/* Estilo Profesional - BurlaBurlando */

:root {
    /* Paleta de Colores Profesional */
    --primary-color: #2c3e50;
    /* Azul oscuro corporativo */
    --secondary-color: #ecf0f1;
    /* Gris claro fondo */
    --accent-color: #0D9488;
    --color-red: #e74c3c;
    /* Corporate Red */
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
    --text-inverse: #ffffff;
    --border-color: #bdc3c7;

    /* Tema Metálico (Steel) */
    --custom-card-bg: #cfd8dc;
    /* Gris acero */
    --custom-card-border: #b0bec5;
    /* Gris pizarra suave */

    /* Progress Bar */
    --progress-bg: #ffffff;
    --progress-fill: #0D9488;

    /* Tipografía */
    --font-main: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Oswald', sans-serif;

    /* Spacing */
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 8px;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--secondary-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Layout General --- */

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* --- Cabecera --- */

.site-header {
    background-color: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    margin-left: var(--spacing-md);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* --- Footer --- */

.site-footer {
    background-color: var(--primary-color);
    color: var(--text-inverse);
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--text-inverse);
    text-decoration: none;
    margin-left: var(--spacing-md);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* --- Home: Hero Section --- */

.hero-section {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: var(--spacing-lg);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Oscurecer imagen de fondo */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    /* text-transform: uppercase; Removed */
    letter-spacing: 2px;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Home: Activities Grid --- */

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.activity-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.activity-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.activity-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.activity-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.activity-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Lex Game Integration (Game Specifics) --- */

/* Adapt existing game elements to new cleaner style */
.game-container {
    max-width: 600px;
    width: 100%;
    margin: 40px auto;
    position: relative;
    aspect-ratio: 2/3;
    /* Max height = 1.5 * width */
    max-height: 75vh;
    /* Cap at 75% viewport height */
    display: flex;
    flex-direction: column;
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    color: var(--text-light);
}

/* Overriding previous .card-stack logic if needed, or keeping it but styling simpler */
.card-stack {
    position: relative;
    width: 100%;
    flex-grow: 1;
    perspective: 1000px;
}


.game-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--custom-card-bg);
    /* Steel Gray */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--custom-card-border);
    /* Darker Steel */
    text-align: center;
    user-select: none;
    cursor: grab;
    transition: transform 0.1s;
}

.game-card.top-card {
    z-index: 10;
}

.card-word {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--primary-color);
    margin: 20px 0;
}

.card-type-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.card-challenge {
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.6);
    /* Slightly transparent white for better contrast on gray */
    padding: 20px;
    border-radius: var(--border-radius);
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}


/* Card Header with Icon */
.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 15px;
}

.card-type-icon {
    width: 60px;
    /* Adjust size as needed */
    height: 60px;
    margin-right: 15px;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Makes white background transparent */
}

.card-type-title {
    font-size: 2rem;
    /* Increased size as requested */
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 700;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.control-btn {
    width: 100px;
    height: 100px;
    background: transparent;
    border: none;
    cursor: pointer;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.control-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.2s ease;
}

.control-btn:hover img {
    transform: scale(1.1);
}

.control-btn:hover {
    background: transparent;
}



/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--custom-card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--custom-card-border);
    box-shadow: var(--shadow-soft);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 20px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #34495e;
}

/* Form Styles for Highscore */
.input-group {
    margin: 15px 0;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
}

/* Animations */
.swipe-indicator {
    position: absolute;
    top: 50px;
    padding: 10px 20px;
    border: 4px solid;
    border-radius: 8px;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    opacity: 0;
}

.swipe-like {
    left: 40px;
    color: #27ae60;
    border-color: #27ae60;
    transform: rotate(-15deg);
}

.swipe-nope {
    right: 40px;
    color: var(--color-red);
    border-color: var(--color-red);
    transform: rotate(15deg);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 10px;
    background-color: var(--progress-bg);
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background-color: var(--progress-fill);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

/* --- Dropdown Menu (User Auth) --- */
.dropdown {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-radius: 8px;
    overflow: visible;
    border: 1px solid #eee;
    margin-top: 10px;
}

/* Bridge to prevent closing on hover gap */
.dropdown-content::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: left;
    margin-left: 0;
    /* Override nav-links margin */
}

.dropdown-content a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.dropdown-content.show {
    display: block;
}

/* --- Refactored JS Styles (Logos) --- */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.text-center {
    text-align: center;
}

.loader-container {
    text-align: center;
    padding: 40px;
}

.loader-title {
    font-family: 'Oswald';
    font-size: 2rem;
    margin-bottom: 20px;
}

.ranking-box {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #444;
    background: #f0f9ff;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.5;
}

.save-prompt {
    background: #E6FFFA;
    color: var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--accent-color);
}

.save-prompt-title {
    margin-bottom: 10px;
    font-weight: 600;
}

.save-prompt-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.save-prompt-login-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
    text-decoration: none;
    margin-top: 0;
}

.save-prompt-register-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
    text-decoration: none;
    background: var(--secondary-color);
    color: var(--text-main);
}

.error-msg {
    color: var(--color-red);
    font-size: 0.9rem;
    margin-top: 10px;
}

.results-container {
    text-align: center;
    padding: 40px;
}

.results-icon {
    height: 160px;
    margin-bottom: 20px;
}

.results-title {
    font-family: 'Oswald';
    font-size: 3rem;
    margin-bottom: 10px;
}

.results-label {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 5px;
}

.results-score-value {
    font-size: 5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.results-actions {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.results-btn-secondary {
    text-decoration: none;
    background: var(--secondary-color);
    color: var(--text-main);
    margin-top: 0;
    display: inline-block;
}

.results-btn-secondary:hover {
    color: #fff;
    background: var(--primary-color);
}

.mode-question-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-weight: normal;
}

.btn-option-container {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.info-icon-img {
    height: 24px;
    vertical-align: middle;
}

.info-icon-wrapper {
    cursor: help;
    padding: 0 10px;
    opacity: 0.9;
}

.scale-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.scale-btn {
    flex: 1;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.token-container {
    line-height: 1.8;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-family: "Georgia", serif;
    font-size: 1.2rem;
}

.word-token {
    cursor: pointer;
    padding: 2px 1px;
    border-radius: 4px;
    transition: background 0.2s;
}

.word-token-selected {
    background: #f1c40f;
    color: #000;
}

.word-token-default {
    background: transparent;
    color: inherit;
}

.btn-confirm-highlight {
    margin-top: 20px;
    width: 100%;
}

.mode-unsupported {
    color: #999;
}

.modal-icon-img {
    height: 120px;
    vertical-align: middle;
}

.modal-body-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #333;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- LEX Game Specific Styles (Refactored) --- */

/* Header Elements */
.lex-game-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.lex-nav-container {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lex-stats-box {
    display: none;
    /* Toggled via JS */
    align-items: center;
    gap: 5px;
}

.lex-score-span {
    color: var(--accent-color);
    font-weight: bold;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.lex-btn-login {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.lex-btn-login:hover {
    background-color: var(--accent-color);
    color: white;
}

.lex-user-dropdown-toggle {
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

/* Welcome Section */
.lex-welcome-section {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    margin-top: 40px;
    padding: 20px;
    min-height: 60vh;
    justify-content: center;
}

.lex-welcome-img {
    max-width: 40%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.lex-welcome-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-color);
    max-width: 800px;
    line-height: 1.4;
    margin-bottom: 40px;
    text-transform: uppercase;
    font-weight: 500;
}

.lex-start-btn {
    font-size: 1.2rem;
    padding: 15px 40px;
}

/* Modal Specifics */
.lex-modal-score {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.lex-modal-score strong {
    color: var(--primary-color);
}

.lex-modal-form-area {
    text-align: left;
}

.lex-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.lex-input-status {
    font-size: 0.8rem;
    height: 20px;
    color: var(--accent-color);
}

.lex-modal-btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.lex-btn-exit {
    background-color: var(--text-light);
}

.lex-save-success {
    display: none;
    color: var(--secondary-color);
    background: #27ae60;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    font-weight: bold;
}

/* Feedback Modal */
.lex-feedback-container {
    max-width: 400px;
    text-align: center;
}

.lex-feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.lex-feedback-title {
    color: var(--color-red);
    font-size: 2rem;
}

.lex-feedback-text {
    font-size: 1.1rem;
    color: var(--text-main);
    margin: 20px 0;
    line-height: 1.5;
}

/* Footer Social Icons */
.social-icon-link {
    display: flex;
    align-items: center;
}

.social-icon-svg {
    color: #fff;
    opacity: 0.7;
    transition: all 0.3s;
}


/* --- Home Page Specifics --- */
.header-relative {
    position: relative !important;
}

.hero-section {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: var(--spacing-lg);
}

.activity-card-disabled {
    cursor: default;
}

.activity-image-dimmed {
    opacity: 0.7;
}

.activity-title-dimmed {
    color: #7f8c8d;
}

/* --- About & Info Pages --- */
.info-section {
    background: #fff;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    max-width: 800px;
    margin: var(--spacing-lg) auto;
}

.info-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
}

.info-text {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: var(--spacing-md);
}

.signature {
    font-style: italic;
    font-weight: 600;
    margin-top: var(--spacing-lg);
    color: var(--primary-color);
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-sm);
}

.signature a {
    color: inherit;
    text-decoration: none;
}

/* --- Auth Pages (Login, Register, Profile) --- */
.auth-page-body {
    background-color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-container {
    max-width: 500px;
    width: 100%;
    background: var(--custom-card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--custom-card-border);
    text-align: center;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-transform: uppercase;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.form-group {
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--custom-card-border);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-color);
}

.btn-auth {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    font-family: var(--font-heading);
    width: 100%;
    margin-top: 10px;
}

.btn-auth:hover {
    background-color: var(--accent-color);
    transform: scale(1.02);
}

.btn-danger {
    background-color: var(--color-red);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.btn-danger:hover {
    background-color: #c0392b;
    /* Darker red */
}

.auth-register-link {
    margin-top: 30px;
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

.auth-register-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.auth-error-msg {
    color: var(--color-red);
    margin-bottom: 15px;
    font-weight: bold;
    display: none;
}

.auth-success-msg {
    color: #27ae60;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Utilities */
.w-full {
    width: 100%;
}

.mt-20 {
    margin-top: 20px;
}