/* Italian Brainrot Mixing Mod - Meme Aesthetic */

:root {
    --bg-primary: #1a0a2e;
    --bg-secondary: #2d1b4e;
    --accent-gold: #ffd700;
    --accent-pink: #ff6b9d;
    --accent-cyan: #00f5ff;
    --accent-green: #39ff14;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --bowl-gradient: linear-gradient(135deg, #4a2c82, #2d1b4e);
    --card-bg: rgba(45, 27, 78, 0.8);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.5);
}

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

body {
    font-family: 'Comic Neue', cursive, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 157, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 245, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(57, 255, 20, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 60% 30%, rgba(255, 215, 0, 0.08) 0%, transparent 40%);
    animation: bgHueShift 20s ease-in-out infinite;
}

@keyframes bgHueShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

/* Title Styles */
.title-container {
    text-align: center;
    padding: 40px 20px;
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--accent-gold);
    text-shadow:
        3px 3px 0 #ff6b9d,
        6px 6px 0 #00f5ff,
        9px 9px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
    animation: titlePulse 2s ease-in-out infinite;
}

.game-subtitle {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--accent-cyan);
    text-shadow: 2px 2px 0 var(--accent-pink);
    margin-top: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 15px;
    font-style: italic;
}

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

/* Settings Button (Starter Screen) */
.settings-button {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background: rgba(45, 27, 78, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-button:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Starter Screen needs relative positioning for settings button */
#starter-screen {
    position: relative;
}

/* Starter Screen */
.starter-instructions {
    text-align: center;
    margin: 20px 0;
    font-size: 1.5rem;
}

.selected-count {
    color: var(--accent-gold);
    font-weight: bold;
}

/* Character Grid - responsive columns */
.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 601px) {
    .character-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 900px) {
    .character-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .character-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Character Card - Glassmorphism */
.character-card {
    background: rgba(45, 27, 78, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    cursor: grab;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.character-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.character-card.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.character-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Prevent child elements from intercepting drag */
.character-card.dragging * {
    pointer-events: none;
}

/* Tap-to-place selection */
.character-card.selected-for-mix {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.6), 0 0 50px rgba(57, 255, 20, 0.3);
}

.mix-slot.awaiting-tap {
    border-color: var(--accent-green);
    animation: slotPulse 1s ease-in-out infinite;
}

@keyframes slotPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(57, 255, 20, 0.3); }
    50% { box-shadow: 0 0 25px rgba(57, 255, 20, 0.6), 0 0 40px rgba(57, 255, 20, 0.2); }
}

.character-card.common { border-color: #888; }
.character-card.rare { border-color: #3498db; }
.character-card.epic {
    border-color: #9b59b6;
    animation: epicShimmer 3s ease-in-out infinite;
}
.character-card.legendary {
    border-color: #f39c12;
    animation: legendaryRotate 4s linear infinite;
}
.character-card.mythic {
    border-color: #ff6b9d;
    animation: mythicGlow 2s ease-in-out infinite;
}

@keyframes epicShimmer {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(155, 89, 182, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3); }
}

@keyframes legendaryRotate {
    0% { border-color: #f39c12; box-shadow: 0 0 15px rgba(243, 156, 18, 0.4); }
    33% { border-color: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    66% { border-color: #ff8c00; box-shadow: 0 0 15px rgba(255, 140, 0, 0.4); }
    100% { border-color: #f39c12; box-shadow: 0 0 15px rgba(243, 156, 18, 0.4); }
}

@keyframes mythicGlow {
    0%, 100% { box-shadow: 0 0 20px #ff6b9d, 0 0 40px rgba(255, 107, 157, 0.2); }
    50% { box-shadow: 0 0 30px #ff6b9d, 0 0 60px #00f5ff, 0 0 80px rgba(0, 245, 255, 0.2); }
}

.character-image {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 2rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.character-image:hover {
    transform: scale(1.05);
}

.character-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--text-primary);
    word-break: break-word;
}

.character-fame {
    color: var(--accent-gold);
    font-size: 0.8rem;
}

.tier-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.tier-badge.common { background: #888; }
.tier-badge.rare { background: #3498db; }
.tier-badge.epic { background: #9b59b6; }
.tier-badge.legendary { background: #f39c12; }
.tier-badge.mythic { background: linear-gradient(45deg, #ff6b9d, #00f5ff); }

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

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

.status-value {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.4rem;
}

/* Mixing Area - Fixed at bottom */
.mixing-area {
    text-align: center;
    padding: 15px 20px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    background: var(--bowl-gradient);
    border-top: 4px solid var(--accent-cyan);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.section-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 var(--accent-pink);
}

.mixing-bowl {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: radial-gradient(ellipse at center, #3d2066 0%, #1a0a2e 100%);
    border-radius: 20px;
    border: 3px solid var(--accent-gold);
    position: relative;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin: 0 auto;
}

.mix-slot {
    width: 90px;
    height: 90px;
    border: 3px dashed var(--text-secondary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
}

.mix-slot.drag-over {
    border-color: var(--accent-green);
    background: rgba(57, 255, 20, 0.2);
    transform: scale(1.1);
}

.mix-slot.filled {
    border-style: solid;
    border-color: var(--accent-cyan);
}

.slot-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.mix-operator {
    font-size: 3rem;
    color: var(--accent-gold);
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-gold);
}

.mix-button {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    padding: 15px 60px;
    margin-top: 20px;
    background: linear-gradient(45deg, #ff6b9d, #ffd700);
    border: none;
    border-radius: 50px;
    color: #1a0a2e;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.mix-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.7);
}

.mix-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
}

.mix-button.mixing {
    animation: mixPulse 0.5s ease-in-out infinite;
}

@keyframes mixPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

/* Result Area - Fixed overlay above mixing bowl */
.result-area {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.97), rgba(26, 10, 46, 0.97));
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    position: fixed;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    z-index: 600;
    animation: resultAppear 0.5s ease-out;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 -10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.result-area h3 {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--accent-green);
    margin-bottom: 20px;
    animation: resultTitle 1s ease-out;
}

@keyframes resultTitle {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.result-character {
    padding: 20px;
}

.collect-button {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    padding: 12px 40px;
    background: var(--accent-green);
    border: none;
    border-radius: 30px;
    color: #1a0a2e;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collect-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-green);
}

/* Lightbox collect shortcut button */
.lightbox-collect-btn {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    padding: 10px 36px;
    background: var(--accent-green);
    border: none;
    border-radius: 30px;
    color: #1a0a2e;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s ease;
    animation: resultAppear 0.3s ease-out;
}

.lightbox-collect-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-green);
}

/* Collection Area - scrollable above fixed bowl */
.collection-area {
    padding: 20px;
    padding-bottom: 220px; /* Space for fixed mixing bowl */
}

/* Big Button */
.big-button {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    padding: 20px 60px;
    background: linear-gradient(45deg, #39ff14, #00f5ff);
    border: none;
    border-radius: 50px;
    color: #1a0a2e;
    cursor: pointer;
    display: block;
    margin: 30px auto;
    transition: all 0.3s ease;
}

.big-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.7);
}

.big-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
}

/* Boss Screen */
.boss-container {
    text-align: center;
    padding: 40px;
    animation: bossEntrance 1s ease-out;
}

@keyframes bossEntrance {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.boss-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    background: linear-gradient(45deg, #ff6b9d, #ffd700, #00f5ff, #39ff14);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowText 3s ease infinite;
}

@keyframes rainbowText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.final-boss-display {
    margin: 40px auto;
    max-width: 300px;
}

.infinity-coins {
    margin: 40px 0;
}

.infinity-symbol {
    font-size: 6rem;
    color: var(--accent-gold);
    text-shadow: 0 0 30px var(--accent-gold);
    animation: infinitySpin 4s linear infinite;
    display: inline-block;
}

@keyframes infinitySpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.infinity-label {
    display: block;
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--accent-gold);
    margin-top: 10px;
}

.endgame-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.endgame-button {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    padding: 15px 30px;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-cyan);
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.endgame-button:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 600px) {
    .character-image {
        width: 80px;
        height: 80px;
    }

    .mixing-bowl {
        gap: 10px;
        padding: 10px 15px;
    }

    .mix-slot {
        width: 80px;
        height: 80px;
    }

    .mix-button {
        font-size: 1.5rem;
        padding: 10px 40px;
        margin-top: 8px;
    }

    .mix-operator {
        font-size: 2rem;
    }

    .status-bar {
        gap: 15px;
    }

    .status-item {
        font-size: 1rem;
    }

    .collection-area {
        padding-bottom: 180px; /* Smaller bowl on mobile */
    }

    .result-area {
        bottom: 160px;
        padding: 15px;
    }
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: lightboxIn 0.3s ease-out;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 15px;
    border: 4px solid var(--accent-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--accent-pink);
    background: var(--bg-secondary);
    color: var(--accent-pink);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: var(--accent-pink);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.lightbox-caption {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-top: 15px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Screen Transitions */
.screen-exit {
    animation: screenFadeOut 0.3s ease-in forwards;
}

.screen-enter {
    animation: screenFadeIn 0.3s ease-out;
}

@keyframes screenFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generating Spinner */
.generating-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
    margin: 15px auto;
}

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

/* Particle Burst */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(0);
    }
}

/* Slot unlock animation */
.slot-unlock {
    animation: slotUnlock 0.6s ease-out;
}

/* Slot unlock animation */
@keyframes slotUnlock {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Screen shake for Legendary/Mythic results */
.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-5px, -3px); }
    30% { transform: translate(5px, 2px); }
    45% { transform: translate(-3px, 5px); }
    60% { transform: translate(3px, -2px); }
    75% { transform: translate(-2px, 3px); }
}

/* Mixing vortex on bowl */
.mixing-vortex {
    background: conic-gradient(from 0deg, #ff6b9d, #ffd700, #00f5ff, #39ff14, #ff6b9d) !important;
    background-size: 100% 100% !important;
    animation: vortexSpin 0.8s linear infinite !important;
}

@keyframes vortexSpin {
    to { filter: hue-rotate(360deg); }
}

/* Tier upgrade flash */
.tier-flash {
    animation: tierFlash 0.3s ease-out;
}

@keyframes tierFlash {
    0% { filter: brightness(3); }
    100% { filter: brightness(1); }
}

/* Staggered card entry */
.card-enter {
    animation: cardFadeIn 0.3s ease-out both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Star particle for special effects */
.particle-star {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    animation: particleBurst 1s ease-out forwards;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

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

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

/* ========================================
   PARENTS ZONE - Content Settings
   ======================================== */

.parents-zone-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.parents-zone-header {
    text-align: center;
    margin-bottom: 30px;
}

.parents-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.parents-zone-header h1 {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 0 var(--accent-pink);
    margin-bottom: 5px;
}

.parents-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.parents-zone-info {
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.parents-zone-info p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* Content Rating Options */
.content-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.content-option {
    background: var(--card-bg);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.content-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.content-option[data-rating="kids"]:hover {
    border-color: #39ff14;
}

.content-option[data-rating="pg"]:hover,
.content-option.recommended {
    border-color: var(--accent-gold);
}

.content-option[data-rating="pg13"]:hover {
    border-color: var(--accent-cyan);
}

.content-option.recommended {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 107, 157, 0.1));
}

.option-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 10px;
}

.option-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.option-title {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.option-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* API Key Section */
.api-key-section {
    margin-top: 20px;
}

.api-key-section details {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
}

.api-key-section summary {
    padding: 15px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.api-key-section summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.api-key-content {
    padding: 20px;
    padding-top: 0;
}

.api-key-content p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#api-key-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--text-secondary);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#api-key-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

#api-key-input::placeholder {
    color: #666;
}

.api-key-content small {
    display: block;
    margin-top: 10px;
    color: #888;
    font-size: 0.8rem;
}

.api-key-content small a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.api-key-content small a:hover {
    text-decoration: underline;
}

/* Parents Zone Responsive */
@media (max-width: 600px) {
    .parents-zone-container {
        padding: 20px 15px;
    }

    .parents-zone-header h1 {
        font-size: 2rem;
    }

    .parents-icon {
        font-size: 3rem;
    }

    .content-option {
        padding: 15px;
    }

    .option-title {
        font-size: 1.1rem;
    }
}

/* ========================================
   AUDIO CONTROLS
   ======================================== */

.audio-controls {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.audio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent-cyan);
    background: var(--bg-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
    background: var(--accent-cyan);
}

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

/* Mobile Audio Controls */
@media (max-width: 600px) {
    .audio-controls {
        bottom: 10px;
        right: 10px;
    }

    .audio-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ========================================
   SOCIAL FEATURES - Phase 5
   ======================================== */

/* Share Toast */
.share-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 30px;
    border: 2px solid var(--accent-cyan);
    font-size: 0.95rem;
    z-index: 2000;
    animation: toastIn 0.3s ease-out;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.share-toast.fade-out {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Challenge Banner */
.challenge-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px 20px;
    margin-bottom: 15px;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 2px solid;
    border-image: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan), var(--accent-gold)) 1;
}

.challenge-label {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

.challenge-seed-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Challenge Banner — type icon, objective, progress */
.challenge-type-icon {
    font-size: 1.4rem;
}

.challenge-objective {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-style: italic;
}

.challenge-progress {
    font-family: 'Bangers', cursive;
    font-size: 1rem;
    color: var(--accent-pink);
    letter-spacing: 1px;
}

/* Challenge complete overlay */
.challenge-complete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.challenge-complete-modal {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.challenge-complete-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.challenge-complete-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--accent-gold);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

/* Star rating */
.challenge-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.challenge-star {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.challenge-star.earned {
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
    animation: starPop 0.4s ease backwards;
}

.challenge-star.empty {
    color: #444;
}

.challenge-star.earned:nth-child(1) { animation-delay: 0.1s; }
.challenge-star.earned:nth-child(2) { animation-delay: 0.25s; }
.challenge-star.earned:nth-child(3) { animation-delay: 0.4s; }

@keyframes starPop {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.challenge-score {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.challenge-score strong {
    color: var(--accent-cyan);
    font-size: 1.4rem;
}

.challenge-new-record {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--accent-green);
    letter-spacing: 2px;
    animation: newRecordGlow 1s ease-in-out infinite alternate;
    margin-bottom: 16px;
}

@keyframes newRecordGlow {
    from { text-shadow: 0 0 8px rgba(57, 255, 20, 0.4); }
    to { text-shadow: 0 0 20px rgba(57, 255, 20, 0.9); }
}

.challenge-best {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.challenge-complete-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.challenge-share-btn,
.challenge-again-btn {
    font-family: 'Bangers', cursive;
    font-size: 1.1rem;
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.challenge-share-btn {
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    color: var(--bg-primary);
}

.challenge-again-btn {
    background: linear-gradient(45deg, var(--accent-gold), var(--accent-pink));
    color: var(--bg-primary);
}

.challenge-share-btn:hover,
.challenge-again-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-glow);
}

/* Daily Challenge Button */
.daily-challenge-button {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    padding: 12px 30px;
    background: linear-gradient(45deg, var(--accent-pink), var(--accent-gold));
    border: none;
    border-radius: 30px;
    color: var(--bg-primary);
    cursor: pointer;
    display: block;
    margin: 15px auto;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.daily-challenge-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 107, 157, 0.6);
}

/* Share FAB */
.share-fab {
    position: fixed;
    bottom: max(80px, calc(env(safe-area-inset-bottom) + 60px));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    background: var(--bg-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.share-fab:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* Mobile Social Features */
@media (max-width: 600px) {
    .challenge-banner {
        flex-direction: column;
        gap: 5px;
        padding: 8px 15px;
    }

    .challenge-label {
        font-size: 1rem;
    }

    .daily-challenge-button {
        font-size: 1.1rem;
        padding: 10px 25px;
    }

    .share-fab {
        bottom: 70px;
        right: 10px;
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .share-toast {
        bottom: 130px;
        font-size: 0.85rem;
        padding: 10px 18px;
    }
}

/* ========================================
   ACHIEVEMENTS
   ======================================== */

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2d1b4e, #4a2c82);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: achievementSlideIn 0.5s ease-out;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.achievement-toast.fade-out {
    animation: achievementFadeOut 0.5s ease-in forwards;
}

.achievement-icon { font-size: 2rem; }

.achievement-title {
    font-family: 'Bangers', cursive;
    color: #ffd700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.achievement-name {
    font-family: 'Bangers', cursive;
    color: #fff;
    font-size: 1.2rem;
}

@keyframes achievementSlideIn {
    from { transform: translateX(-50%) translateY(-100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes achievementFadeOut {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(-50px); opacity: 0; }
}

/* Achievement Button (in status bar) */
.achievement-button {
    background: none;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-button:hover {
    background: var(--accent-gold);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Achievement Gallery Modal */
.achievement-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.achievement-gallery-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 0 var(--accent-pink);
    text-align: center;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.achievement-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.achievement-card.earned {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.achievement-card.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-card .icon { font-size: 2rem; margin-bottom: 8px; }
.achievement-card .name { font-family: 'Bangers', cursive; font-size: 0.9rem; color: #ffd700; }
.achievement-card .desc { font-size: 0.7rem; color: #b8b8b8; margin-top: 4px; }

.achievement-close-btn {
    font-family: 'Bangers', cursive;
    font-size: 1.2rem;
    padding: 10px 40px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: 30px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.achievement-close-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    transform: scale(1.05);
}

/* ========================================
   COMBO BOOK
   ======================================== */

.combo-book-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: comboBookFadeIn 0.3s ease;
}

@keyframes comboBookFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.combo-book-content {
    background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
    border: 2px solid #ffd700;
    border-radius: 16px;
    max-width: 650px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.combo-book-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.combo-book-header h2 {
    font-family: 'Bangers', cursive;
    color: #ffd700;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.combo-progress {
    font-family: 'Bangers', cursive;
    color: #00f5ff;
    font-size: 1rem;
}

.combo-book-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.combo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.combo-card {
    background: rgba(45, 27, 78, 0.8);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.combo-card.discovered {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.combo-card.locked {
    opacity: 0.6;
    border-color: #444;
}

.combo-parents {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.combo-result-name {
    font-family: 'Bangers', cursive;
    color: #ffd700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.combo-card.locked .combo-result-name {
    color: #666;
}

.combo-bonus {
    color: #39ff14;
    font-size: 0.8rem;
    font-weight: bold;
}

.combo-hint {
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
}

.game-action-btn {
    background: rgba(45, 27, 78, 0.8);
    border: 2px solid #ffd700;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-action-btn:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
}

/* ========================================
   FAMILY TREE
   ======================================== */

.family-tree-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: comboBookFadeIn 0.3s ease;
}

.family-tree-content {
    background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
    border: 2px solid #39ff14;
    border-radius: 16px;
    max-width: 650px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.family-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.family-tree-header h2 {
    font-family: 'Bangers', cursive;
    color: #39ff14;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.family-tree-stats {
    font-family: 'Bangers', cursive;
    color: #00f5ff;
    font-size: 0.9rem;
}

.family-tree-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.tree-lineage-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tree-lineage-card {
    background: rgba(45, 27, 78, 0.8);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tree-lineage-card.mythic { border-color: #ff6b9d; }
.tree-lineage-card.legendary { border-color: #f39c12; }
.tree-lineage-card.epic { border-color: #9b59b6; }
.tree-lineage-card.rare { border-color: #3498db; }

.tree-parents-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tree-parent {
    font-size: 0.85rem;
    color: #b8b8b8;
}

.tree-plus {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
}

.tree-arrow {
    color: #39ff14;
    font-size: 1.5rem;
    margin: 4px 0;
}

.tree-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tree-result-emoji { font-size: 1.5rem; }

.tree-result-name {
    font-family: 'Bangers', cursive;
    color: #ffd700;
    font-size: 1.1rem;
}

.tree-result-tier {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.tree-gen {
    font-size: 0.7rem;
    color: #00f5ff;
    margin-top: 5px;
}

.tree-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 30px;
}

/* ========================================
   COLLECTION SORT
   ======================================== */

.sort-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px 0;
    margin-bottom: 8px;
}

.sort-btn {
    font-family: 'Comic Neue', cursive;
    font-size: 0.75rem;
    padding: 4px 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    background: rgba(45, 27, 78, 0.6);
    color: #b8b8b8;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: rgba(255, 215, 0, 0.6);
    color: #fff;
}

.sort-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    color: #ffd700;
    font-weight: bold;
}

/* ========================================
   NICKNAMES
   ======================================== */

.original-name {
    font-size: 0.6rem;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}

.character-name[title="Tap to nickname"] {
    text-decoration: underline dotted rgba(255, 215, 0, 0.3);
}

/* ========================================
   MIX PREVIEW
   ======================================== */

.mix-preview {
    text-align: center;
    padding: 6px 12px;
    margin: 8px 0;
    font-family: 'Comic Neue', cursive;
    font-size: 0.8rem;
    display: none;
}

.preview-tier {
    font-family: 'Bangers', cursive;
    font-size: 1rem;
    letter-spacing: 1px;
}

.preview-upgrade {
    color: #ffd700;
    font-size: 0.75rem;
    margin-left: 4px;
}

.preview-special {
    display: block;
    color: #39ff14;
    font-family: 'Bangers', cursive;
    font-size: 0.9rem;
    animation: previewPulse 1s ease infinite;
    margin-top: 2px;
}

@keyframes previewPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.preview-fame {
    display: block;
    color: #888;
    font-size: 0.7rem;
    margin-top: 2px;
}
