@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;

    /* Fun vibrant colors */
    --human-green: #00ff87;
    --human-green-dark: #00cc6a;
    --ai-pink: #ff2d92;
    --ai-pink-dark: #d91a75;
    --accent-purple: #a855f7;
    --accent-blue: #38bdf8;
    --accent-yellow: #fbbf24;

    --glow-green: rgba(0, 255, 135, 0.3);
    --glow-pink: rgba(255, 45, 146, 0.3);
    --glow-purple: rgba(168, 85, 247, 0.3);

    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    overflow: clip; /* Prevents bounce but allows internal scroll */
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
}

#app {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Animated background blobs */
#app::before,
#app::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

#app::before {
    width: 60vmax;
    height: 60vmax;
    background: var(--glow-green);
    top: -20%;
    left: -20%;
    animation: float1 20s ease-in-out infinite;
}

#app::after {
    width: 50vmax;
    height: 50vmax;
    background: var(--glow-pink);
    bottom: -20%;
    right: -20%;
    animation: float2 25s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10%, 10%) scale(1.1); }
    66% { transform: translate(-5%, 15%) scale(0.9); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-10%, -10%) scale(0.9); }
    66% { transform: translate(5%, -5%) scale(1.1); }
}

/* Screens */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ==================== START SCREEN ==================== */
#start-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: calc(70px + var(--safe-area-top));
    padding-bottom: calc(30px + var(--safe-area-bottom));
    text-align: center;
    gap: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#start-screen .top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

#start-screen .bottom-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}

/* LOGO */
.title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    position: relative;
}

.title-human {
    display: block;
    font-size: clamp(2.8rem, 13vw, 5.5rem);
    color: var(--human-green);
    text-shadow:
        0 0 30px var(--glow-green),
        0 0 60px var(--glow-green),
        0 4px 0 rgba(0, 180, 100, 0.8);
    animation: float-human 4s ease-in-out infinite;
    position: relative;
}

.title-human::before {
    content: 'Human';
    position: absolute;
    left: 0;
    top: 0;
    color: transparent;
    -webkit-text-stroke: 2px rgba(0, 255, 135, 0.3);
    transform: translate(4px, 4px);
    z-index: -1;
}

.title-or {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.5rem 0;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.title-or::before,
.title-or::after {
    content: '';
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
    border-radius: 2px;
}

.title-ai {
    display: block;
    font-size: clamp(3.5rem, 16vw, 7rem);
    color: var(--ai-pink);
    text-shadow:
        0 0 30px var(--glow-pink),
        0 0 60px var(--glow-pink),
        0 4px 0 rgba(180, 30, 100, 0.8);
    animation: float-ai 4s ease-in-out infinite;
    animation-delay: 0.5s;
    position: relative;
}

.title-ai::before {
    content: 'AI?';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 45, 146, 0.3);
    transform: translate(4px, 4px);
    z-index: -1;
}

@keyframes float-human {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes float-ai {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Difficulty Selector */
.difficulty-selector {
    width: 100%;
    max-width: 380px;
}

.difficulty-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}

.difficulty-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-difficulty {
    flex: 1;
    max-width: 120px;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-height: 90px;
}

.btn-difficulty:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn-difficulty.selected {
    border-color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 30px var(--glow-purple);
}

.diff-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.diff-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.diff-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Play Button */
.btn-play {
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--human-green) 0%, var(--accent-blue) 100%);
    color: #000;
    border: none;
    padding: 1rem 4rem;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 100px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 30px rgba(0, 255, 135, 0.3),
        0 0 0 0 rgba(0, 255, 135, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}

.btn-play::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-play:hover::before {
    left: 100%;
}

.btn-play:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0, 255, 135, 0.4),
        0 0 0 4px rgba(0, 255, 135, 0.2);
}

.btn-play:active {
    transform: translateY(0) scale(0.98);
}

/* Loading Bar */
.loading-bar-container {
    width: 100%;
    max-width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    height: 0;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.loading-bar-container.visible {
    opacity: 1;
    height: 4px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--human-green), var(--accent-blue));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.hint-text {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.hint-text.visible {
    opacity: 1;
    height: auto;
}

/* ==================== GAME SCREEN ==================== */
#game-screen header {
    padding: 0.7rem 1rem;
    padding-top: calc(0.7rem + var(--safe-area-top));
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Logo button (replaces back arrow) */
.btn-logo {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.btn-logo .logo-or {
    color: var(--accent-purple);
    font-size: 0.75em;
    margin: 0 0.1em;
}

.btn-logo:hover {
    opacity: 0.8;
}

/* Home top right container */
.home-top-right {
    position: absolute;
    top: env(safe-area-inset-top, 20px);
    right: 20px;
    padding-top: 15px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Home language selector (top right) */
.home-lang-selector {
    position: relative;
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    min-height: 44px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.lang-arrow {
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.2s;
}

.home-lang-selector.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    min-width: 120px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.home-lang-selector.open .lang-dropdown,
.header-lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.lang-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lang-dropdown-item.active {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

/* Header language selector (smaller) */
.header-lang-selector {
    position: relative;
    z-index: 150;
}

.lang-toggle-sm {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-toggle-sm:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.header-lang-selector .lang-dropdown {
    min-width: 60px;
    background: rgba(20, 20, 35, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
}

.header-lang-selector .lang-dropdown-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    text-align: center;
}

.score-display {
    background: rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    justify-content: center;
}

#score-correct {
    color: var(--human-green);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-menu {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-menu:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Settings Menu */
.settings-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.settings-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.settings-content {
    text-align: center;
    padding: 2rem;
    max-width: 320px;
    width: 100%;
    position: relative;
}

.btn-close-x {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.btn-close-x:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.settings-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.diff-option {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.diff-option:hover {
    background: var(--bg-card-hover);
}

.diff-option.selected {
    border-color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.15);
}

.language-options {
    display: flex;
    gap: 0.5rem;
}

.lang-option {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: var(--bg-card-hover);
}

.lang-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.btn-close-menu {
    font-family: var(--font-display);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 0.9rem 2.5rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-close-menu:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Content Container */
.content-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    min-height: 0; /* Important for flex children to shrink */
}

.content-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Text content needs to scroll for long quotes */
#text-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    padding: 3rem 0 1rem 0; /* Top padding for category badge */
}

.content-panel.hidden {
    display: none;
}

#game-image {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

#game-image.loaded {
    opacity: 1;
}

/* Quote Card */
.quote-card {
    max-width: 90%;
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    margin: 1rem 0;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9) 0%, rgba(20, 20, 35, 0.95) 100%);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0; /* Don't shrink, let container scroll */
    position: relative;
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Decorative accent line at top */
.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), var(--ai-pink), var(--accent-purple), transparent);
    border-radius: 0 0 4px 4px;
}

.quote-card.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.quote-marks {
    font-family: Georgia, 'Palatino Linotype', serif;
    font-size: 3.5rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--ai-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.4;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-weight: 700;
    pointer-events: none;
}

.quote-text {
    font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif;
    font-size: clamp(1.15rem, 4.5vw, 1.6rem);
    line-height: 1.65;
    color: var(--text-primary);
    font-style: italic;
    margin: 0.5rem 0 1.5rem 0;
    padding: 0 0.5rem;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.quote-attribution {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 1.2rem;
    position: relative;
}

/* Decorative divider */
.quote-attribution::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.5), transparent);
    border-radius: 2px;
}

.quote-author {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.quote-context {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
}

.quote-card.pulse {
    animation: pulse 0.35s ease;
}

.quote-card.shake {
    animation: shake 0.4s ease;
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.6rem 1.4rem;
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-badge.visible {
    opacity: 1;
}

/* Loading */
.loading {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading.visible {
    opacity: 1;
}

.spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(from 0deg, transparent, var(--ai-pink));
    animation: spin 1s linear infinite;
}

.spinner::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--bg-dark);
    border-radius: 50%;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Result Overlay */
.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    padding-bottom: calc(80px + var(--safe-area-bottom)); /* Space for fixed button */
}

.result-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.result-overlay.hidden {
    display: none;
}

.result-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-content > * {
    max-width: 400px;
    width: 100%;
}

#result-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.6rem;
    line-height: 1;
    font-weight: 900;
    font-family: var(--font-display);
}

.result-content.correct #result-icon {
    color: var(--human-green);
    text-shadow: 0 0 50px var(--glow-green);
    animation: bounce 0.5s ease;
}

.result-content.wrong #result-icon {
    color: #ff4757;
    text-shadow: 0 0 50px rgba(255, 71, 87, 0.5);
    animation: shake-icon 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes shake-icon {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

#result-text {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
}

.result-content.correct #result-text {
    color: var(--human-green);
}

.result-content.wrong #result-text {
    color: #ff4757;
}

#result-answer {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Result Info Box */
.result-info {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.5rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#result-subject {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#result-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

#result-description strong {
    color: var(--accent-purple);
}

.source-link {
    display: block;
    margin-top: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
}

.source-link:hover {
    text-decoration: underline;
}

.result-explanation {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}

.prompt-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    word-break: break-word;
    line-height: 1.5;
}

.result-reference {
    display: block;
    font-size: 0.85em;
    color: #8b9dc3;
    background: rgba(59, 89, 152, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #3b5998;
}

.result-hidden-error {
    display: block;
    font-size: 0.85em;
    color: #e8a838;
    background: rgba(232, 168, 56, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #e8a838;
}

.prompt-details {
    margin-top: 1rem;
}

.prompt-details summary {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.prompt-details summary:hover {
    color: var(--text-secondary);
}

/* Result Image Container (inside result-info box) */
.result-image-container {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
}

.result-image-container.hidden {
    display: none;
}

.result-image-container img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

@media (min-width: 768px) {
    .result-image-container img {
        max-height: 280px;
    }
}

.btn-next {
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--accent-purple), var(--ai-pink));
    color: var(--text-primary);
    border: none;
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 50px;
    min-height: 50px;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    /* Fixed at bottom */
    position: absolute;
    bottom: calc(1.5rem + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
}

.btn-next:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
}

.btn-next:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 15px rgba(168, 85, 247, 0.4);
}

/* ==================== CHOICE BUTTONS ==================== */
.buttons-container {
    display: flex;
    gap: clamp(0.5rem, 2vw, 1rem);
    padding: clamp(0.7rem, 2vw, 1.2rem);
    padding-bottom: calc(clamp(0.7rem, 2vw, 1.2rem) + var(--safe-area-bottom));
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 100%;
}

.btn-choice {
    font-family: var(--font-display);
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
    padding: clamp(1rem, 3vw, 1.3rem) clamp(0.8rem, 2vw, 1rem);
    font-size: clamp(1rem, 3.5vw, 1.15rem);
    font-weight: 800;
    border: none;
    border-radius: clamp(14px, 3vw, 18px);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 54px;
}

.btn-choice::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
}

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

.btn-choice:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.btn-human {
    background: linear-gradient(135deg, var(--human-green) 0%, var(--human-green-dark) 100%);
    color: #000;
    box-shadow:
        0 6px 25px rgba(0, 255, 135, 0.35),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1);
}

.btn-human:not(:disabled):active {
    box-shadow:
        0 3px 15px rgba(0, 255, 135, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-ai {
    background: linear-gradient(135deg, var(--ai-pink) 0%, var(--ai-pink-dark) 100%);
    color: #fff;
    box-shadow:
        0 6px 25px rgba(255, 45, 146, 0.35),
        inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.btn-ai:not(:disabled):active {
    box-shadow:
        0 3px 15px rgba(255, 45, 146, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ==================== ANIMATIONS ==================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.shake {
    animation: shake 0.4s ease;
}

.pulse {
    animation: pulse 0.35s ease;
}

/* ==================== RESPONSIVE ==================== */

/* iPad and Desktop */
@media (min-width: 768px) {
    #start-screen {
        padding-top: calc(80px + var(--safe-area-top));
    }

    #start-screen .top-section {
        gap: 1.5rem;
    }

    .title-human {
        font-size: 5rem;
    }

    .title-or {
        font-size: 1.1rem;
        margin: 0.5rem 0;
    }

    .title-or::before,
    .title-or::after {
        width: 60px;
    }

    .title-ai {
        font-size: 6rem;
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .difficulty-selector {
        max-width: 500px;
    }

    .difficulty-buttons {
        gap: 1rem;
    }

    .btn-difficulty {
        max-width: 150px;
        padding: 1.2rem 0.8rem;
        border-radius: 24px;
    }

    .diff-icon {
        font-size: 2.2rem;
    }

    .diff-name {
        font-size: 1rem;
    }

    .diff-desc {
        font-size: 0.75rem;
    }

    .btn-play {
        padding: 1.3rem 5rem;
        font-size: 1.4rem;
    }

    #game-screen header {
        padding: 1rem 1.5rem;
        padding-top: calc(1rem + var(--safe-area-top));
    }

    .btn-logo {
        font-size: 1.1rem;
    }

    .btn-menu {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .score-display {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
    }

    .lang-toggle-sm {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
    }

    .api-key-badge {
        width: 48px;
        height: 48px;
    }

    .image-container {
        padding: 2rem 3rem;
    }

    #game-image {
        max-width: 80%;
        max-height: 80%;
        border-radius: 24px;
    }

    /* Quote card on desktop */
    .quote-card {
        max-width: 700px;
        padding: 3rem 2.5rem 3rem 2.5rem;
    }

    .quote-text {
        font-size: clamp(1.2rem, 2.5vw, 1.5rem);
        margin: 0.5rem 0 1.5rem 0;
    }

    .quote-marks {
        font-size: 3rem;
        opacity: 0.3;
    }

    .quote-author {
        font-size: 1.25rem;
    }

    .quote-context {
        font-size: 1rem;
    }

    .category-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.5rem;
        top: 2.5rem;
    }

    .buttons-container {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 24px 24px 0 0;
        gap: 1rem;
        padding: 1.2rem 1.5rem;
        padding-bottom: calc(1.2rem + var(--safe-area-bottom));
    }

    .btn-choice {
        padding: 1.3rem 1.5rem;
        font-size: 1.2rem;
        border-radius: 18px;
    }

    .settings-content {
        max-width: 400px;
        padding: 3rem;
    }

    .result-content {
        padding: 2rem 2.5rem 1rem 2.5rem;
    }

    .result-content > * {
        max-width: 500px;
    }

    #result-icon {
        font-size: 6rem;
        margin-bottom: 1rem;
    }

    #result-text {
        font-size: 3rem;
    }

    #result-answer {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .result-info {
        padding: 2rem;
        border-radius: 24px;
    }

    #result-subject {
        font-size: 1.35rem;
    }

    #result-description {
        font-size: 1.1rem;
        line-height: 1.7;
    }

    .prompt-text {
        font-size: 1rem;
        padding: 1.2rem;
    }

    .prompt-details summary {
        font-size: 1rem;
    }

    .btn-next {
        padding: 1.1rem 4rem;
        font-size: 1.1rem;
    }

    /* Hover effects */
    .btn-choice:hover:not(:disabled) {
        transform: translateY(-2px);
    }

    .btn-human:hover:not(:disabled) {
        box-shadow: 0 10px 35px rgba(0, 255, 135, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.1);
    }

    .btn-ai:hover:not(:disabled) {
        box-shadow: 0 10px 35px rgba(255, 45, 146, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .title-human {
        font-size: 6rem;
    }

    .title-ai {
        font-size: 7.5rem;
    }

    #game-image {
        max-width: 70%;
        max-height: 75%;
    }

    .buttons-container {
        max-width: 550px;
    }

    .quote-card {
        max-width: 750px;
    }

    .quote-text {
        font-size: 1.5rem;
    }
}

/* Small phones (short screens) */
@media (max-height: 700px) {
    #start-screen {
        padding-top: calc(60px + var(--safe-area-top));
        padding-bottom: calc(20px + var(--safe-area-bottom));
        gap: 1.5rem;
    }

    #start-screen .top-section {
        gap: 0.5rem;
    }

    #start-screen .bottom-section {
        gap: 1rem;
    }

    .title-human {
        font-size: 2.5rem;
    }

    .title-or {
        margin: 0.2rem 0;
        font-size: 0.75rem;
    }

    .title-ai {
        font-size: 3.2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .btn-difficulty {
        padding: 0.8rem 0.4rem;
        max-width: 100px;
        min-height: 80px;
    }

    .diff-icon {
        font-size: 1.5rem;
    }

    .diff-name {
        font-size: 0.8rem;
    }

    .diff-desc {
        font-size: 0.65rem;
    }

    .btn-play {
        padding: 0.9rem 3rem;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Very small phones */
@media (max-height: 600px) {
    #start-screen {
        gap: 1rem;
    }

    .title-human {
        font-size: 2rem;
    }

    .title-ai {
        font-size: 2.6rem;
    }

    .btn-difficulty {
        min-height: 70px;
        padding: 0.6rem 0.3rem;
    }
}

/* ============================================
   CREDITS SYSTEM STYLES
   ============================================ */

.credits-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.8rem;
    border-radius: 22px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.credits-badge:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Hide credits during gameplay to not reveal AI content */
.credits-badge.hidden-during-game {
    display: none;
}

.credits-icon {
    font-size: 1rem;
}

#credits-display {
    font-weight: 600;
    min-width: 1.2em;
    text-align: center;
}

/* Credits Modal */
.credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.credits-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.credits-modal.hidden {
    display: none;
}

.credits-modal-content {
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.99) 0%, rgba(15, 15, 30, 1) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 90%;
    position: relative;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(168, 85, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.credits-modal-content h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    text-align: center;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.credits-modal-content > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* API Key Form */
.api-key-form {
    text-align: center;
}

.api-key-form.hidden {
    display: none;
}

.api-key-form label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-key-form input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-body);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.api-key-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.api-key-form input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.btn-validate {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--ai-pink) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-validate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-purple);
}

.btn-validate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.option-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent-blue);
    text-decoration: none;
    margin-top: 1rem;
    transition: opacity 0.2s;
}

.option-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
}

.error-message.hidden {
    display: none;
}

/* Mobile responsiveness for modal */
@media (max-width: 500px) {
    .credits-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .credits-modal-content h2 {
        font-size: 1.5rem;
    }
}

/* API Key Badge */
.api-key-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.api-key-badge:hover {
    background: rgba(255, 255, 255, 0.15);
}

.key-icon {
    font-size: 1.1rem;
}

/* API Key Management Popup */
.api-key-popup {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.api-key-popup.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.api-key-popup.hidden {
    display: none;
}

.api-key-popup-content {
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.98) 0%, rgba(15, 15, 30, 1) 100%);
    border: 1px solid rgba(0, 255, 135, 0.2);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 180px;
}

.api-key-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.api-key-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--human-green);
    margin-bottom: 0.8rem;
    word-break: break-all;
}

.btn-remove-key {
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff4757;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-key:hover {
    background: rgba(255, 71, 87, 0.3);
}
