:root {
    /* -- PREMIUM THEME (Sophisticated Magenta & Lime) -- */
    --accent: 335, 88%, 44%;
    /* Rich Magenta #d40c6a */
    --brand: 74, 90%, 65%;
    /* Soft Bright Lime #d6f754 */

    /* Light Theme Basics */
    --bg-page: 0, 0%, 98%;
    /* Very soft off-white */
    --bg-card: 0, 0%, 100%;
    /* Pure white */
    --border-color: 0, 0%, 90%;
    /* Subtle grey border */

    --text-main: 232, 20%, 15%;
    /* Deep elegant grey */
    --text-muted: 232, 10%, 45%;

    --header-bg: rgba(255, 255, 255, 0.95);
    --header-text: hsl(var(--text-main));

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.05);

    --success: 142, 60%, 45%;
    --error: 0, 70%, 55%;
}

[data-theme="dark"] {
    /* Dark Theme Basics */
    --bg-page: 240, 5%, 8%;
    /* Very dark grey almost black */
    --bg-card: 240, 5%, 12%;
    /* Slightly lighter dark */
    --border-color: 240, 5%, 18%;

    --text-main: 0, 0%, 95%;
    /* Off-white soft text */
    --text-muted: 0, 0%, 65%;

    --header-bg: rgba(20, 20, 21, 0.95);
    --header-text: hsl(var(--text-main));

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: hsl(var(--bg-page));
    color: hsl(var(--text-main));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Header */
.header {
    width: 100%;
    /* Removed max-width to make it full width */
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    /* Adjusted right column for new button */
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border-color));
    /* Removed position: sticky */
    z-index: 100;
    color: var(--header-text);
    transition: background 0.3s, border-color 0.3s;
}

.header-left,
.header-right {
    display: flex;
    gap: 0.5rem;
}

.header-right {
    justify-content: flex-end;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text);
    letter-spacing: -0.04em;
    text-decoration: none;
}

.logo .highlight {
    background: transparent;
    color: hsl(var(--accent));
    padding: 0 0 2px 0;
    font-weight: 900;
    margin-left: 2px;
    border-bottom: 5px solid hsl(var(--brand));
}

/* Icons */
.icon-btn {
    background: transparent;
    border: none;
    color: hsl(var(--text-main));
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn svg {
    stroke: currentColor;
}

.icon-btn:hover {
    background: hsla(var(--text-main), 0.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

/* List View */
.list-container {
    width: 100%;
    max-width: 900px;
    padding: 2.5rem 1rem;
    animation: fadeIn 0.4s ease;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.list-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    color: hsl(var(--text-main));
}

.small-btn {
    width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.zulos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.zulo-card {
    background: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.zulo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: hsla(var(--accent), 0.3);
}

.zulo-card-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background: #e0e0e0;
}

.zulo-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.zulo-card:hover .zulo-card-thumb img {
    transform: scale(1.03);
}

.zulo-card-content {
    padding: 1.2rem;
    position: relative;
}

.zulo-card-title {
    font-family: 'Outfit', sans-serif;
    color: hsl(var(--accent));
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.zulo-card-info {
    font-size: 0.95rem;
    color: hsl(var(--text-muted));
    line-height: 1.5;
}

.zulo-status {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 1.1rem;
    /* Slightly larger emoji */
    z-index: 2;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
}

.link-btn {
    background: transparent;
    border: none;
    color: hsl(var(--accent));
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0;
}

.input-group {
    width: 100%;
    margin: 1.5rem 0;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid hsl(var(--border-color));
    background: hsla(var(--text-main), 0.03);
    color: hsl(var(--text-main));
    font-family: inherit;
    font-size: 1rem;
}

.feedback-msg {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.feedback-msg.success {
    background: hsla(var(--success), 0.1);
    color: #0c7a3d;
}

.feedback-msg.error {
    background: hsla(var(--error), 0.1);
    color: hsl(var(--error));
}

/* Premium Panels */
.glass-panel {
    background: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s, border-color 0.3s;
}

/* Game View Styling */
.game-container {
    width: 100%;
    max-width: 600px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.4s ease;
}

/* Modificar la interfaz de escritorio para tener las fotos a la izquierda y el hueco de acertar a la derecha (Issue #2) */
@media (min-width: 800px) {
    .game-container {
        max-width: 1000px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto 1fr;
        grid-template-areas:
            "progress hint"
            "photo input"
            "photo badge"
            "photo .";
        gap: 1.5rem;
        align-items: start;
    }

    .progress-bar {
        grid-area: progress;
    }

    .try-counter {
        display: none; /* hidden normally but adjust if needed */
    }

    #hintBox {
        grid-area: hint;
    }

    .image-wrapper {
        grid-area: photo;
    }

    .input-area {
        grid-area: input;
    }

    #lastGuessBadge {
        grid-area: badge;
        margin-top: 0;
    }
}

.progress-bar {
    display: flex;
    gap: 8px;
    height: 8px;
    width: 100%;
}

.progress-dot {
    flex: 1;
    background: hsla(var(--text-muted), 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: hsl(var(--accent));
}

.progress-dot.used {
    background: hsla(var(--accent), 0.2);
}

.try-counter {
    display: none;
}

/* Main Photo */
.image-wrapper {
    position: relative;
    border-radius: 20px;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #e0e0e0;
}

/* REMOVED TACKY GLARE ANIMATION */
.glass-glare {
    display: none;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.info-tag {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #eee;
    z-index: 5;
}

.jokers-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.joker-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid hsl(var(--accent));
    background: hsl(var(--bg-card));
    color: hsl(var(--accent));
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.joker-btn:hover:not(:disabled) {
    background: hsl(var(--accent));
    color: white;
    transform: translateY(-2px);
}

.joker-btn:disabled {
    opacity: 0.3;
    cursor: default;
    filter: grayscale(1);
}

/* Nav Buttons inside Photo */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* Input Area */
.input-area {
    padding: 1.2rem;
    gap: 0.8rem;
    display: flex;
    flex-direction: column;
}

.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input-wrapper input {
    background: hsla(var(--text-main), 0.03);
    border: 2px solid hsl(var(--border-color));
    border-radius: 10px;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: hsl(var(--text-main));
    width: 100%;
    transition: all 0.2s;
    font-family: inherit;
    outline: none;
}

.price-input-wrapper input:focus {
    border-color: hsl(var(--accent));
    background: hsla(var(--accent), 0.02);
}

.price-input-wrapper .currency {
    position: absolute;
    right: 1.2rem;
    font-size: 1.2rem;
    color: hsl(var(--text-muted));
    font-weight: 500;
}

.primary-btn {
    background: hsl(var(--accent));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.primary-btn:hover {
    background: hsl(335, 88%, 38%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px hsla(var(--accent), 0.3);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    background: hsl(var(--brand));
    color: #111;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}

.secondary-btn:hover {
    background: hsl(74, 90%, 55%);
    transform: translateY(-2px);
}

/* New Standalone Hint Box above Photo */
.hint-box-standalone {
    background: hsla(var(--brand), 0.15);
    border: 1px solid hsla(var(--brand), 0.5);
    padding: 0.6rem 1rem;
    margin-bottom: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: hsl(var(--text-main));
    font-weight: 500;
    line-height: 1.3;
    animation: fadeIn 0.3s ease;
}

[data-theme="dark"] .hint-box-standalone {
    background: hsla(var(--brand), 0.05);
}

.hint-label {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.75rem;
    color: hsl(var(--accent));
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.hint-box-standalone::before {
    content: '💡';
    font-size: 1.1rem;
}

/* Modal Overlay fixed */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: hsl(var(--bg-card));
    color: hsl(var(--text-main));
    border: 1px solid hsl(var(--border-color));
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Specific structure for Result Modal */
.result-modal-content {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden !important;
}

.modal-scroll-area {
    padding: 3rem 2rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-fixed-footer {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid hsl(var(--border-color));
    background: hsl(var(--bg-card));
}

.modal-fixed-footer .secondary-btn {
    margin-top: 1rem;
}

.sugerencias-text {
    margin: 1.5rem 0 1rem;
    font-size: 0.85rem;
    color: hsl(var(--text-muted));
    text-align: center;
    line-height: 1.5;
}

.sugerencias-text a {
    color: hsl(var(--accent));
    font-weight: 600;
    text-decoration: none;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: hsl(var(--text-muted));
    cursor: pointer;
    line-height: 1;
    z-index: 2000;
    /* Above everything inside */
}

.close-btn:hover {
    color: hsl(var(--text-main));
}

.modal h2 {
    color: hsl(var(--text-main));
    margin-bottom: 1rem;
    font-size: 1.6rem;
    text-align: center;
}

.modal p,
.modal li {
    color: hsl(var(--text-muted));
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.modal ul {
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
}

.modal-content .primary-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.center-content {
    text-align: center;
}

/* Badges & Results */
.last-guess-badge {
    background: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.last-guess-badge .guess-val {
    font-size: 1.2rem;
    font-weight: 700;
}

.last-guess-badge.correct {
    border-left: 6px solid hsl(var(--success));
}

.last-guess-badge.too-high {
    border-left: 6px solid hsl(var(--error));
}

.last-guess-badge.too-low {
    border-left: 6px solid hsl(var(--warning));
}

/* Share Grid */
.share-grid {
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

.real-price-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--text-muted));
    margin-bottom: 4px;
}

.real-price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: hsl(var(--accent));
    margin-bottom: 0.5rem;
}

.next-zulo-timer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    color: hsl(var(--text-muted));
}

/* Disabling AdSense (User Request) */
.ad-slot {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.4s ease-in-out;
}

.highlight-btn {
    border: 2px solid hsl(var(--brand)) !important;
    background: hsla(var(--brand), 0.1) !important;
    font-size: 0.9rem !important;
    width: auto !important;
    height: 36px !important;
    border-radius: 18px !important;
    padding: 0 12px !important;
    gap: 6px;
    font-weight: 700;
}

.help-legend {
    background: hsla(var(--text-main), 0.05);
    border: 1px solid hsl(var(--border-color));
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.help-legend h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.help-legend ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.help-legend li {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: hsl(var(--text-main)) !important;
}

/* Stats Modal UI */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 1.5rem 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: hsl(var(--text-main));
    line-height: 1.1;
}

.stat-label {
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    text-align: center;
    line-height: 1.2;
    margin-top: 5px;
}

.guess-distribution {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 1rem;
}

.guess-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.guess-number {
    width: 15px;
    text-align: right;
    font-weight: 600;
    color: hsl(var(--text-main));
}

.guess-bar-container {
    flex: 1;
    position: relative;
    background: transparent;
    height: 24px;
}

.guess-bar {
    height: 100%;
    background: hsl(var(--border-color));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transition: width 0.5s ease;
}

.guess-bar.highlight {
    background: hsla(var(--success), 0.9);
}

.guess-count {
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    padding-right: 6px;
}

.guess-count.outside {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--text-main));
    padding-right: 0;
}