/* ============================================
   KIPPIS — GAME UI
   Mobile-first • Premium • Clean
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Core Palette */
    --navy: #151e5e;
    --navy-light: #1e2a7a;
    --navy-dark: #0c1240;
    --cream: #e6d5a7;
    --cream-light: #f5ead0;
    --cream-dark: #c4b285;

    /* Neutrals */
    --black: #0a0a0e;
    --charcoal: #141418;
    --graphite: #1c1c24;
    --graphite-light: #252530;
    --grey: #3a3a4a;
    --grey-light: #8a8a9a;
    --white: #f0f0f5;

    /* Accents */
    --success: #4ade80;
    --danger: #ef4444;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

    /* Timing */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);

    /* Fonts */
    --font-h: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
}

/* ============================================
   SKIP LINK (A11Y)
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--cream);
    color: var(--navy);
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   FOCUS STYLES (A11Y)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 3px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 2px;
}

/* ============================================
   BASE
   ============================================ */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-overflow-scrolling: touch;
}

/* Subtle fixed background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(21, 30, 94, 0.15) 0%, transparent 60%),
        var(--black);
    z-index: -1;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================
   SCREEN LAYOUT
   ============================================ */
/* display is controlled ONLY by JS style.display — never by class */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    position: relative;
    z-index: 1;
}

/* .active only controls opacity — display is set via JS */
.screen.active {
    opacity: 1;
}

.container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    transition: opacity 0.5s var(--ease);
}

.loading-screen:not(.active) {
    opacity: 0;
    pointer-events: none;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-logo-img {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(230, 213, 167, 0.15));
}

.loading-spinner {
    width: 40px;
    height: 40px;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(230, 213, 167, 0.15);
    border-top-color: var(--cream);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: var(--font-h);
    font-size: 0.85rem;
    color: var(--grey-light);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================
   COMMON ELEMENTS
   ============================================ */

/* --- Containers with card styling --- */
.login-container,
.disclaimer-container {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(160deg, var(--graphite-light), var(--charcoal));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s var(--ease) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* Top accent line */
.login-container::before,
.disclaimer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cream-dark), transparent);
}

/* --- Logo --- */
.logo, .main-logo {
    width: 80px;
    height: auto;
    transition: transform 0.3s var(--ease);
}

/* --- Header --- */
.header {
    text-align: center;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.header h1 {
    font-family: var(--font-h);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
}

.subtitle {
    color: var(--grey-light);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cream-light), var(--cream-dark));
    color: var(--black);
    box-shadow: 0 4px 16px rgba(230, 213, 167, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(230, 213, 167, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--grey-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1rem;
}

.btn-spin {
    font-family: var(--font-h);
    font-size: 1.3rem;
    padding: 18px 48px;
    min-width: 200px;
    letter-spacing: 0.1em;
    animation: spinBtnGlow 2s ease-in-out infinite;
}

.btn-spin.hidden {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

@keyframes spinBtnGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(230, 213, 167, 0.2); }
    50% { box-shadow: 0 4px 32px rgba(230, 213, 167, 0.4); }
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

#roulette-screen .button-group {
    flex-direction: column;
    align-items: center;
}

#roulette-screen .button-group .btn-secondary {
    padding: 10px 24px;
    font-size: 0.8rem;
}

/* --- Inputs --- */
input[type="text"],
input[type="email"],
input[type="password"],
.player-input-row input {
    width: 100%;
    padding: 14px 16px;
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s var(--ease);
    -webkit-appearance: none;
    min-height: 48px;
}

input:focus {
    outline: none;
    border-color: var(--cream-dark);
    background: var(--black);
}

input::placeholder {
    color: var(--grey);
}

/* --- Checkbox --- */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s var(--ease);
}

.checkmark.small {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--cream);
    border-color: var(--cream);
}

.checkbox-container input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 6px;
    height: 10px;
    border: solid var(--black);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.88rem;
    color: var(--grey-light);
    line-height: 1.4;
}

.checkbox-text.small {
    font-size: 0.8rem;
}

/* ============================================
   PLAYER SETUP
   ============================================ */
.player-setup {
    width: 100%;
}

.player-setup h2 {
    font-family: var(--font-h);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: var(--cream);
}

#player-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--grey) transparent;
}

#player-inputs::-webkit-scrollbar {
    width: 4px;
}

#player-inputs::-webkit-scrollbar-thumb {
    background: var(--grey);
    border-radius: 2px;
}

.player-input-row {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

.add-player-btn {
    padding: 14px 16px;
    background: var(--cream);
    color: var(--black);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    transition: background 0.2s var(--ease);
}

.add-player-btn:hover {
    background: var(--cream-light);
}

/* Screen controls (rules, pwa, sound) */
.screen-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.control-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.control-btn.sound-on {
    background: var(--cream);
    border-color: var(--cream);
}

/* ============================================
   CATEGORY SCREEN
   ============================================ */
#category-screen .container {
    max-width: 600px;
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

.category-card {
    background: linear-gradient(160deg, var(--graphite-light), var(--graphite));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(21, 30, 94, 0.3);
}

.category-card.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(40%);
}

.category-image {
    height: 140px;
    overflow: hidden;
    position: relative;
}

.category-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, var(--graphite));
    pointer-events: none;
}

.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.category-card:hover .category-img {
    transform: scale(1.08);
}


.category-content {
    padding: 20px;
    text-align: center;
}

.category-content h3 {
    font-family: var(--font-h);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.category-content p {
    font-size: 0.85rem;
    color: var(--grey-light);
    margin-bottom: 14px;
    line-height: 1.5;
}

.category-btn {
    width: 100%;
    padding: 12px;
}

/* Category card glow on hover */
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 0%, rgba(21, 30, 94, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
    z-index: 1;
}

.category-card:hover::before {
    opacity: 1;
}

/* ============================================
   SEASONAL CATEGORY - Golden Exclusive
   ============================================ */
.seasonal-card {
    background: linear-gradient(160deg, #1a1500, #0d0a00) !important;
    border: 2px solid rgba(212, 175, 55, 0.5) !important;
    position: relative;
    overflow: hidden;
}

.seasonal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.2) 0%, transparent 60%);
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.seasonal-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.6), transparent 40%, transparent 60%, rgba(212, 175, 55, 0.6));
    z-index: 0;
    animation: seasonalShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes seasonalShimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.seasonal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.25), 0 0 20px rgba(212, 175, 55, 0.15) !important;
    border-color: rgba(212, 175, 55, 0.8) !important;
}

.seasonal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: #0a0800;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.seasonal-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    animation: seasonalGlow 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes seasonalGlow {
    0%, 100% { transform: translate(-10%, -10%); }
    50% { transform: translate(10%, 10%); }
}

.seasonal-content {
    position: relative;
    z-index: 2;
    padding: 20px !important;
}

.seasonal-content h3 {
    background: linear-gradient(135deg, #d4af37, #f0d060, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem !important;
}

.seasonal-content p {
    color: rgba(212, 175, 55, 0.7) !important;
}

.btn-seasonal {
    background: linear-gradient(135deg, #d4af37, #b8860b) !important;
    color: #0a0800 !important;
    font-weight: 700 !important;
    border: none !important;
    text-shadow: none !important;
    letter-spacing: 0.05em;
}

.btn-seasonal:hover {
    background: linear-gradient(135deg, #f0d060, #d4af37) !important;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4) !important;
}

.seasonal-lock {
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: 18px;
    overflow: hidden;
}

.lock-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.lock-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.5));
}

.lock-overlay p {
    color: rgba(212, 175, 55, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
}

.seasonal-card.locked .btn-seasonal {
    pointer-events: none;
    opacity: 0.3;
}

body.category-kevat::before {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        var(--black);
}

/* Coming soon placeholder */
.coming-soon-card {
    opacity: 0.5;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.08);
}

.coming-soon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px;
    text-align: center;
}

.coming-soon-content h3 {
    font-size: 1.6rem;
    color: var(--grey-light);
}

.coming-soon-content p {
    color: var(--grey);
    margin-bottom: 0;
}

/* Category particles (hover effect) */
.category-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.cat-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--cream);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 3s ease-in-out forwards;
}

@keyframes floatParticle {
    0% { opacity: 0; transform: translateY(0) scale(0); }
    30% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-20px) scale(1.5); }
}

/* ============================================
   ROULETTE SCREEN
   ============================================ */
#roulette-screen {
    padding-left: 8px;
    padding-right: 8px;
}

#roulette-screen .container {
    max-width: none;
    width: 100%;
}

#roulette-screen h1 {
    font-family: var(--font-h);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: var(--grey-light);
    letter-spacing: 0.04em;
}

.stage-indicator {
    display: none;
}

.roulette-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    margin: 0;
    width: 100%;
}

/* Glow behind wheel */
.roulette-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 30, 94, 0.35) 0%, rgba(21, 30, 94, 0.1) 50%, transparent 70%);
    filter: blur(30px);
    z-index: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}

/* Pulsing ring */
.roulette-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(230, 213, 167, 0.08);
    animation: ringPulse 3s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.03); opacity: 0.8; }
}

/* SVG Wheel */
#wheel {
    width: 82vw;
    max-width: 340px;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5));
    z-index: 2;
    position: relative;
    transition: filter 0.4s var(--ease);
}

#wheel-group {
    transform-origin: 150px 150px;
    transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Pointer */
#pointer {
    transition: transform 0.1s ease;
}

.roulette-container.spinning #pointer {
    animation: pointerBounce 0.12s ease-in-out 12;
}

@keyframes pointerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

/* Center decoration with logo */
.roulette-center-decor {
    position: absolute;
    width: 64px;
    height: 64px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle, var(--graphite-light) 0%, var(--charcoal) 80%);
    border-radius: 50%;
    z-index: 3;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 6px rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(230, 213, 167, 0.2);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.roulette-center-decor::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px solid rgba(230, 213, 167, 0.08);
}

.roulette-center-decor::after {
    display: none;
}

.roulette-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    border-radius: 50%;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* Spinning state */
.roulette-container.spinning .roulette-glow {
    opacity: 1.5;
    filter: blur(20px);
}

.roulette-container.spinning::before {
    animation-duration: 0.6s;
    border-color: rgba(230, 213, 167, 0.2);
}

.roulette-container.spinning #wheel {
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 16px rgba(21, 30, 94, 0.25));
}

.roulette-container.spinning .roulette-center-decor {
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(230, 213, 167, 0.1);
}

/* Win flash */
.winning-flash {
    animation: winFlash 0.12s ease-in-out 6;
}

@keyframes winFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; filter: brightness(1.4); }
}

/* ============================================
   WINNER DISPLAY
   ============================================ */
.winner-display {
    text-align: center;
    min-height: 32px;
}

.winner-display:empty {
    display: none;
}

.winner-name {
    font-family: var(--font-h);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.04em;
    animation: winnerIn 0.4s var(--ease-bounce);
}

.winner-label {
    font-size: 0.72rem;
    color: var(--grey-light);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 2px;
}

@keyframes winnerIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

/* ============================================
   GAME CARD SCREEN
   ============================================ */
.card-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    position: relative;
}

/* Card stack behind */
.card-stack {
    position: absolute;
    width: 100%;
    max-width: 440px;
    height: 180px;
    pointer-events: none;
}

.stack-card {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--graphite-light), var(--graphite));
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    transition: all 0.4s var(--ease);
}

.stack-card.stack-3 {
    transform: scale(0.92) translateY(16px);
    opacity: 0.3;
}
.stack-card.stack-2 {
    transform: scale(0.95) translateY(10px);
    opacity: 0.5;
}
.stack-card.stack-1 {
    transform: scale(0.98) translateY(5px);
    opacity: 0.7;
}

.card-stack.low .stack-3 { opacity: 0; }
.card-stack.medium .stack-3,
.card-stack.medium .stack-2 { opacity: 0; }
.card-stack.empty .stack-card { opacity: 0; }

/* Card flip wrapper */
.card-flip-wrapper {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

/* The card */
.card {
    width: 100%;
    min-height: 200px;
    cursor: pointer;
    transform: scale(1);
    opacity: 1;
    transition: transform 0.28s var(--ease), opacity 0.22s var(--ease);
}

.card.flip-out {
    transform: scale(0.88);
    opacity: 0;
}

.card.flip-in {
    transform: scale(1);
    opacity: 1;
}

.card-front,
.card-back {
    width: 100%;
    min-height: 200px;
    background: linear-gradient(160deg, var(--graphite-light), var(--graphite));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cream-dark), transparent);
}

/* Corner accent */
.card-front::after {
    content: '';
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border-right: 1px solid rgba(230, 213, 167, 0.15);
    border-bottom: 1px solid rgba(230, 213, 167, 0.15);
    border-radius: 0 0 8px 0;
}

.card-text {
    font-family: var(--font-h);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--white);
}

.card-back {
    display: none;
}

/* Corner decorations */
.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0.15;
    pointer-events: none;
}

/* ============================================
   PARTICLES
   ============================================ */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: particleFly 1.2s var(--ease-out) forwards;
}

@keyframes particleFly {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3); }
}

.particle.star {
    background: none;
    font-size: 16px;
    animation: particleFlyStar 1.5s var(--ease-out) forwards;
}

@keyframes particleFlyStar {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3) rotate(180deg); }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stage-progress {
    text-align: center;
    font-family: var(--font-h);
    font-size: 0.82rem;
    color: var(--grey-light);
    letter-spacing: 0.06em;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--charcoal);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--navy-light), var(--cream-dark));
    border-radius: 3px;
    transition: width 0.5s var(--ease);
    box-shadow: 0 0 8px rgba(21, 30, 94, 0.5);
}

/* ============================================
   STAGE TRANSITION
   ============================================ */
.stage-transition {
    text-align: center;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.stage-title {
    font-family: var(--font-h);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    animation: titleReveal 0.5s var(--ease-bounce);
}

@keyframes titleReveal {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: none; }
}

.stage-description {
    font-size: 1.05rem;
    color: var(--grey-light);
    line-height: 1.6;
    max-width: 360px;
    animation: fadeUp 0.4s var(--ease) 0.15s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* Decorative lines */
.stage-transition::before,
.stage-transition::after {
    content: '';
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cream-dark), transparent);
    animation: lineReveal 0.6s var(--ease) 0.3s both;
}

@keyframes lineReveal {
    from { width: 0; opacity: 0; }
    to { width: 60px; opacity: 1; }
}

/* ============================================
   VICTORY SCREEN
   ============================================ */
.victory-container {
    text-align: center;
}

.victory-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 400px;
}

.trophy-icon {
    font-family: var(--font-h);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cream);
    background: var(--navy);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: trophyReveal 0.6s var(--ease-bounce);
    box-shadow: 0 4px 24px rgba(21, 30, 94, 0.4);
}

@keyframes trophyReveal {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: none; }
}

.victory-title {
    font-family: var(--font-h);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.victory-subtitle {
    font-size: 1.1rem;
    color: var(--grey-light);
}

.victory-question {
    font-size: 1rem;
    color: var(--grey-light);
    margin-top: 8px;
}

/* Stats */
.victory-stats {
    display: flex;
    gap: 40px;
    margin: 8px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-h);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--grey-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.victory-buttons {
    margin-top: 8px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 12, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    padding: 0;
}

.modal.show,
.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: linear-gradient(160deg, var(--graphite-light), var(--charcoal));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: modalSlideUp 0.35s var(--ease);
}

.modal-large {
    max-width: 600px;
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
    font-family: var(--font-h);
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--grey-light);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 16px 24px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- PWA Modal --- */
.pwa-modal-content {
    max-width: 520px;
}

.pwa-intro {
    text-align: center;
    color: var(--grey-light);
    font-size: 0.92rem;
    margin-bottom: 20px;
}

.pwa-benefits-modal {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.benefit-icon {
    font-size: 1.5rem;
}

.benefit-item span:last-child {
    font-size: 0.8rem;
    color: var(--grey-light);
}

.instruction-block {
    margin-bottom: 20px;
}

.instruction-block h3 {
    font-family: var(--font-h);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--charcoal);
    border-radius: 12px;
}

.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--navy);
    color: var(--cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-content p {
    font-size: 0.88rem;
    color: var(--grey-light);
}

.pwa-modal-footer {
    flex-direction: column;
}

/* Platform-specific instructions */
#ios-instructions,
#android-instructions {
    display: none;
}

#ios-instructions.visible,
#android-instructions.visible {
    display: block;
}

/* --- Player Modal --- */
.current-players {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--charcoal);
    border-radius: 12px;
}

.player-name {
    font-weight: 600;
    color: var(--white);
}

.remove-player-btn,
.remove-player {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}

.remove-player-btn:hover,
.remove-player:hover {
    background: rgba(239, 68, 68, 0.2);
}

.add-player-section {
    display: flex;
    gap: 10px;
}

.add-player-section input {
    flex: 1;
}

/* --- Rules Modal --- */
.rules-body {
    padding: 20px 24px;
}

.rules-section {
    margin-bottom: 24px;
}

.rules-section:last-child {
    margin-bottom: 0;
}

.rules-section h3 {
    font-family: var(--font-h);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--white);
}

.rules-section p {
    font-size: 0.9rem;
    color: var(--grey-light);
    line-height: 1.6;
}

.rules-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rules-section ul li {
    font-size: 0.9rem;
    color: var(--grey-light);
    padding-left: 16px;
    position: relative;
}

.rules-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    background: var(--navy-light);
    border-radius: 50%;
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stage-item {
    padding: 12px 16px;
    background: var(--charcoal);
    border-radius: 10px;
    border-left: 3px solid;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stage-item strong {
    font-size: 0.88rem;
    color: var(--white);
}

.stage-item span {
    font-size: 0.82rem;
    color: var(--grey-light);
}

.stage-item.stage-1 { border-color: var(--success); }
.stage-item.stage-2 { border-color: var(--navy-light); }
.stage-item.stage-3 { border-color: #f59e0b; }
.stage-item.stage-4 { border-color: var(--danger); }

.rules-warning {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    padding: 16px;
}

/* ============================================
   DISCLAIMER SCREEN
   ============================================ */
.disclaimer-container {
    max-width: 560px;
    text-align: center;
}

.disclaimer-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--cream);
    font-family: var(--font-h);
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 2px solid rgba(230, 213, 167, 0.2);
}

.disclaimer-container h1 {
    font-family: var(--font-h);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.disclaimer-content {
    text-align: left;
    margin-bottom: 20px;
}

.disclaimer-section {
    padding: 16px;
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 12px;
}

.disclaimer-section h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--white);
}

.disclaimer-section p {
    font-size: 0.85rem;
    color: var(--grey-light);
    line-height: 1.6;
}

.disclaimer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.disclaimer-section ul li {
    font-size: 0.85rem;
    color: var(--grey-light);
    padding-left: 16px;
    position: relative;
}

.disclaimer-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    background: var(--navy-light);
    border-radius: 50%;
}

.disclaimer-help {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.15);
}

.help-link {
    display: inline-block;
    color: var(--success);
    font-weight: 600;
    margin-top: 6px;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 0.8;
}

.disclaimer-checkbox {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* ============================================
   LOGIN / ERROR
   ============================================ */
.login-container {
    max-width: 440px;
}

.login-form {
    margin-bottom: 24px;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
}

.age-warning {
    padding: 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    text-align: center;
}

.age-warning p {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
}

.legal-footer {
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--grey);
    text-align: center;
}

.legal-footer a {
    color: var(--cream-dark);
}

/* Remember me */
.remember-me-group {
    margin-bottom: 20px;
}

/* ============================================
   DESKTOP ENHANCEMENTS
   ============================================ */
@media (min-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        border-radius: 24px;
        max-height: 85vh;
    }

    .modal {
        align-items: center;
    }

    @keyframes modalSlideUp {
        from { opacity: 0; transform: translateY(24px) scale(0.96); }
        to { opacity: 1; transform: none; }
    }

    .card-text {
        font-size: 1.4rem;
    }

    /* Bigger wheel on tablet+ */
    #wheel {
        width: 60vw;
        max-width: 460px;
    }

    .roulette-center-decor {
        width: 76px;
        height: 76px;
    }

    .roulette-logo {
        padding: 12px;
    }

    .login-container,
    .disclaimer-container {
        padding: 40px 36px;
    }

    .stage-title {
        font-size: 2.8rem;
    }

    .victory-title {
        font-size: 3rem;
    }
}

@media (min-width: 900px) {
    .container {
        max-width: 600px;
    }

    #category-screen .container {
        max-width: 700px;
    }

    /* Even bigger wheel on desktop */
    #roulette-screen .container {
        max-width: 800px;
    }

    #wheel {
        width: 50vw;
        max-width: 560px;
    }

    .roulette-center-decor {
        width: 90px;
        height: 90px;
    }

    .logo, .main-logo {
        width: 100px;
    }

    .header h1 {
        font-size: 2.4rem;
    }

    .card-front,
    .card-back {
        min-height: 240px;
        padding: 40px 32px;
    }
}

/* ============================================
   TIMER
   ============================================ */
.timer-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 16px auto;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease-bounce);
}

.timer-container.timer-visible {
    opacity: 1;
    transform: scale(1);
}

.timer-ring {
    position: relative;
    width: 90px;
    height: 90px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--graphite-light);
    stroke-width: 4;
}

.timer-progress {
    fill: none;
    stroke: var(--cream);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear;
}

.timer-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-h);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--cream);
}

.timer-container.timer-done .timer-display {
    color: var(--danger);
    animation: timerPulse 0.5s ease 2;
}

.timer-container.timer-done .timer-progress {
    stroke: var(--danger);
}

.btn-timer {
    font-size: 0.85rem;
    padding: 8px 24px;
    background: var(--navy);
    border: 1px solid var(--cream-dark);
    color: var(--cream);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.2s var(--ease);
}

.btn-timer:hover:not(:disabled) {
    background: var(--navy-light);
    transform: translateY(-1px);
}

.btn-timer:disabled {
    opacity: 0.5;
    cursor: default;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================
   STAGE TRANSITION CONFETTI
   ============================================ */
.confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall var(--fall-duration, 3s) var(--fall-delay, 0s) linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(var(--rotation, 720deg));
        opacity: 0;
    }
}

/* ============================================
   CARD ENTRANCE ANIMATION
   ============================================ */
.card-entrance {
    animation: cardEntrance 0.5s var(--ease-bounce) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Screen shake */
.screen-shake {
    animation: screenShake 0.4s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-4px) rotate(-0.5deg); }
    30% { transform: translateX(4px) rotate(0.5deg); }
    50% { transform: translateX(-3px); }
    70% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
}

/* Winner name entrance */
.winner-display .winner-name {
    animation: winnerPop 0.4s var(--ease-bounce) forwards;
}

@keyframes winnerPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stage transition title entrance */
.stage-transition .stage-title {
    animation: stageTitleSlide 0.6s var(--ease-bounce) forwards;
}

@keyframes stageTitleSlide {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stage-transition .stage-description {
    animation: stageTitleSlide 0.6s var(--ease-bounce) 0.15s both;
}

.stage-transition .btn {
    animation: stageTitleSlide 0.6s var(--ease-bounce) 0.3s both;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .roulette-glow {
        animation: none;
    }
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary, rgba(255,255,255,0.5));
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab.active {
    background: var(--cream);
    color: #0a0a0e;
}

.auth-tab:hover:not(.active) {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.08);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 15px;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--cream);
}

.auth-form input::placeholder {
    color: rgba(255,255,255,0.3);
}

.auth-message {
    text-align: center;
    font-size: 13px;
    min-height: 20px;
    margin: 4px 0;
}

.auth-message.error {
    color: #f87171;
}

.auth-message.success {
    color: #4ade80;
}

.auth-link {
    background: none;
    border: none;
    color: var(--cream);
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    padding: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-checkbox {
    font-size: 12px;
    margin: 4px 0;
}

.auth-checkbox a {
    color: var(--cream);
}

.guest-info {
    text-align: center;
    margin-bottom: 20px;
}

.guest-info p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.auth-small {
    font-size: 12px;
    color: rgba(255,255,255,0.4) !important;
}

/* Account Features Intro */
.account-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(230,213,167,0.06);
    border: 1px solid rgba(230,213,167,0.12);
    border-radius: 12px;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

.feature-icon {
    color: var(--cream);
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Guest Skip Link */
.guest-skip {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-guest {
    display: inline-block;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--cream);
    color: var(--cream);
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.btn-guest:hover {
    background: rgba(230, 213, 167, 0.1);
    transform: translateY(-1px);
}

.guest-note {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

/* User Status Bar on Setup Screen */
.user-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    padding: 6px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.user-status-bar .user-name {
    color: var(--cream);
    font-weight: 600;
}

.auth-link-small {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    padding: 2px 6px;
}

.auth-link-small:hover {
    color: #f87171;
}

/* ============================================
   SUGGESTION FORM
   ============================================ */
.suggest-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggest-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.suggest-input:focus {
    outline: none;
    border-color: var(--cream);
}

textarea.suggest-input {
    resize: vertical;
    min-height: 80px;
}

.suggest-input option {
    background: var(--charcoal);
    color: #fff;
}

/* ============================================
   CHALLENGE REACTIONS (Like/Dislike)
   ============================================ */
.reaction-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}
.reaction-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reaction-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: scale(1.1);
}
.reaction-btn.active-like {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--success);
}
.reaction-btn.active-dislike {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

/* ============================================
   ACCOUNT BUTTON (Setup Screen)
   ============================================ */
.control-btn-inline {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--cream);
    font-size: 16px;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.control-btn-inline:hover {
    background: rgba(230, 213, 167, 0.1);
    border-color: var(--cream);
}

/* ============================================
   ACCOUNT HUB MODAL
   ============================================ */
/* ============================================ */
/* USER NAV BAR (top-right on setup/category)   */
/* ============================================ */
.user-nav {
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
    background: rgba(20,20,24,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    padding: 4px 6px;
}
.user-nav-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-nav-btn:hover { color: var(--cream); background: rgba(255,255,255,0.08); }
.user-nav-icon { font-size: 16px; }
.user-nav-profile {
    border-radius: 20px;
    padding: 3px 10px 3px 3px;
}
.user-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--graphite-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.user-nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-nav-avatar .acc-avatar-initials { font-size: 11px; }
.user-nav-name {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================ */
/* ACCOUNT MODAL                                */
/* ============================================ */
.acc-modal {
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.acc-tabs {
    display: flex;
    gap: 2px;
    padding: 0 20px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.acc-tabs::-webkit-scrollbar { display: none; }

.acc-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 12px 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.acc-tab:hover { color: rgba(255,255,255,0.7); }
.acc-tab.active { color: var(--cream); border-bottom-color: var(--cream); }

.acc-body { flex: 1; overflow-y: auto; padding: 20px; }
.acc-panel { display: none; }
.acc-panel.active { display: block; }

.acc-loading { text-align: center; padding: 40px; color: rgba(255,255,255,0.4); }
.acc-empty { color: rgba(255,255,255,0.3); font-size: 13px; font-style: italic; }

.acc-msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.acc-msg.success { color: var(--success); }
.acc-msg.error { color: var(--danger); }

.acc-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}
.acc-input:focus { outline: none; border-color: var(--cream); }

.acc-section { margin-top: 20px; }
.acc-section h4 { font-family: var(--font-h); font-size: 15px; font-weight: 600; color: var(--cream); margin: 0 0 12px; }
.acc-section-header { display: flex; align-items: center; gap: 8px; }
.acc-count-badge {
    background: rgba(102,126,234,0.2);
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-body);
}
.acc-hint { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 10px; }
.acc-back-btn {
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    margin-bottom: 16px;
    transition: all 0.2s;
}
.acc-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ============================================ */
/* PROFILE                                      */
/* ============================================ */
.acc-profile-card {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.06);
}
.acc-profile-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.acc-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--graphite-light);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.acc-avatar-lg { width: 72px; height: 72px; border: 2px solid rgba(230,213,167,0.3); }
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acc-avatar-clickable { cursor: pointer; position: relative; }
.acc-avatar-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; opacity: 0; transition: opacity 0.2s; font-size: 20px;
}
.acc-avatar-clickable:hover .acc-avatar-overlay { opacity: 1; }
.acc-avatar-initials { font-family: var(--font-h); font-size: 18px; font-weight: 700; color: var(--cream); }
.acc-avatar-lg .acc-avatar-initials { font-size: 26px; }

.acc-profile-info { flex: 1; }
.acc-profile-info h3 { font-size: 20px; font-weight: 700; margin: 0 0 2px; color: #fff; }
.acc-username { font-size: 13px; color: rgba(255,255,255,0.4); }
.acc-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 6px; }
.acc-badge-admin { background: rgba(102,126,234,0.2); color: #667eea; }
.acc-fav-cat { display: block; font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 4px; }
.acc-profile-bio { font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 8px; }
.acc-profile-since { font-size: 12px; color: rgba(255,255,255,0.25); }

.acc-profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
}
.acc-ps {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid rgba(255,255,255,0.04);
}
.acc-ps:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); }
.acc-ps-num { display: block; font-size: 24px; font-weight: 700; color: var(--cream); font-family: var(--font-h); }
.acc-ps-label { display: block; font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; }

.acc-profile-edit {
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}
.acc-profile-edit h4 { font-family: var(--font-h); font-size: 15px; color: var(--cream); margin: 0 0 14px; }
.acc-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.acc-edit-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.acc-edit-field label { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }
.acc-save-btn { align-self: flex-start; margin-top: 4px; }

/* ============================================ */
/* STATS                                        */
/* ============================================ */
.acc-stats-hero {
    background: linear-gradient(160deg, var(--graphite-light), var(--charcoal));
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.acc-stat-big { margin-bottom: 16px; }
.acc-stat-num-big { font-size: 48px; font-weight: 800; color: var(--cream); font-family: var(--font-h); display: block; }
.acc-stat-label { font-size: 13px; color: rgba(255,255,255,0.45); }
.acc-stats-row { display: flex; justify-content: center; gap: 24px; }
.acc-stat-sm { text-align: center; }
.acc-stat-num-sm { display: block; font-size: 22px; font-weight: 700; color: #fff; font-family: var(--font-h); }
.acc-stat-label-sm { font-size: 11px; color: rgba(255,255,255,0.35); }

.acc-cat-bars { display: flex; flex-direction: column; gap: 10px; }
.acc-cat-row { display: flex; align-items: center; gap: 10px; }
.acc-cat-name { font-size: 13px; font-weight: 500; min-width: 85px; }
.acc-cat-bar-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.acc-cat-bar { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.acc-cat-num { font-size: 13px; font-weight: 600; color: var(--cream); min-width: 24px; text-align: right; }

.acc-recent-games { display: flex; flex-direction: column; gap: 6px; }
.acc-game-row {
    display: flex; gap: 10px; align-items: center;
    padding: 10px 14px; background: rgba(255,255,255,0.04); border-radius: 10px; font-size: 13px;
}
.acc-game-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.acc-game-cat { font-weight: 600; color: var(--cream); min-width: 75px; }
.acc-game-players { color: rgba(255,255,255,0.4); }
.acc-game-status { font-size: 12px; }
.acc-game-status.finished { color: var(--success); }
.acc-game-status.active { color: var(--cream); }
.acc-game-date { color: rgba(255,255,255,0.25); margin-left: auto; font-size: 12px; }

/* ============================================ */
/* LEADERBOARD                                  */
/* ============================================ */
.acc-lb-header { margin-bottom: 16px; }
.acc-lb-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.acc-lb-tab {
    padding: 7px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    color: rgba(255,255,255,0.5);
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: var(--font-body); transition: all 0.2s;
}
.acc-lb-tab.active { background: var(--graphite-light); border-color: var(--cream); color: var(--cream); }
.acc-lb-filter { display: flex; gap: 6px; }
.acc-lb-filter-btn {
    padding: 5px 12px;
    background: none; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; color: rgba(255,255,255,0.35);
    font-size: 12px; cursor: pointer; font-family: var(--font-body); transition: all 0.2s;
}
.acc-lb-filter-btn.active { border-color: #667eea; color: #667eea; background: rgba(102,126,234,0.1); }

.acc-lb-myrank {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px; background: rgba(230,213,167,0.06);
    border: 1px solid rgba(230,213,167,0.12);
    border-radius: 12px; font-size: 14px; margin-bottom: 14px; color: rgba(255,255,255,0.6);
}
.acc-lb-myrank strong { font-size: 20px; color: var(--cream); font-family: var(--font-h); }
.acc-lb-myscore { color: rgba(255,255,255,0.35); font-size: 12px; }

.acc-lb-list { display: flex; flex-direction: column; gap: 4px; }
.acc-lb-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(255,255,255,0.03);
    border-radius: 10px; font-size: 14px; transition: background 0.15s;
}
.acc-lb-row:hover { background: rgba(255,255,255,0.06); }
.acc-lb-row.acc-lb-me { background: rgba(230,213,167,0.08); border: 1px solid rgba(230,213,167,0.15); }
.acc-lb-row.acc-lb-top { background: rgba(255,255,255,0.05); }
.acc-lb-rank { min-width: 32px; display: flex; align-items: center; justify-content: center; }
.acc-lb-pos { font-weight: 500; color: rgba(255,255,255,0.35); font-size: 14px; }
.acc-lb-medal { font-size: 20px; }
.acc-lb-avatar-sm {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--graphite-light); overflow: hidden;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.acc-lb-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.acc-lb-avatar-sm .acc-avatar-initials { font-size: 11px; }
.acc-lb-info { flex: 1; min-width: 0; }
.acc-lb-name { display: block; font-weight: 500; font-size: 14px; }
.acc-lb-sub { display: block; font-size: 11px; color: rgba(255,255,255,0.3); }
.acc-lb-score { font-weight: 700; color: var(--cream); font-family: var(--font-h); font-size: 18px; min-width: 40px; text-align: right; }

/* ============================================ */
/* ACHIEVEMENTS                                 */
/* ============================================ */
.acc-ach-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 20px; background: rgba(255,255,255,0.03);
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.06);
}
.acc-ach-ring { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.acc-ach-ring svg { width: 100%; height: 100%; }
.acc-ach-pct {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: var(--cream); font-family: var(--font-h);
}
.acc-ach-summary { }
.acc-ach-count { display: block; font-size: 22px; font-weight: 700; color: #fff; font-family: var(--font-h); }
.acc-ach-summary span { font-size: 13px; color: rgba(255,255,255,0.4); }

.acc-ach-list { display: flex; flex-direction: column; gap: 6px; }
.acc-ach-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: rgba(255,255,255,0.04);
    border-radius: 10px; transition: all 0.2s;
}
.acc-ach-card.locked { opacity: 0.3; }
.acc-ach-card.unlocked { border-left: 3px solid var(--cream); }
.acc-ach-icon { font-size: 26px; min-width: 36px; text-align: center; }
.acc-ach-info { flex: 1; }
.acc-ach-info strong { display: block; font-size: 14px; margin-bottom: 2px; }
.acc-ach-desc { font-size: 12px; color: rgba(255,255,255,0.4); display: block; }
.acc-ach-date { font-size: 11px; color: rgba(255,255,255,0.3); display: block; margin-top: 2px; }
.acc-ach-check { color: var(--success); font-size: 16px; font-weight: 700; }
.acc-ach-lock { font-size: 14px; opacity: 0.3; }

/* ============================================ */
/* FRIENDS                                      */
/* ============================================ */
.acc-friend-search { margin-bottom: 16px; }
.acc-search-wrap { display: flex; gap: 8px; }
.acc-search-input { flex: 1; }
.acc-search-btn {
    background: #667eea; color: #fff; border: none;
    padding: 10px 18px; border-radius: 10px; font-weight: 600;
    font-size: 13px; cursor: pointer; font-family: var(--font-body);
    white-space: nowrap; transition: background 0.2s;
}
.acc-search-btn:hover { background: #5a6fd6; }

.acc-friend-list { display: flex; flex-direction: column; gap: 6px; }
.acc-friend-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: rgba(255,255,255,0.04);
    border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.acc-friend-card:hover { background: rgba(255,255,255,0.07); }
.acc-friend-card.acc-pending { border-left: 3px solid var(--cream); cursor: default; }
.acc-friend-card.acc-sent { cursor: default; opacity: 0.6; }
.acc-friend-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--graphite-light); overflow: hidden;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.acc-friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acc-friend-avatar .acc-avatar-initials { font-size: 14px; }
.acc-friend-details { flex: 1; min-width: 0; }
.acc-friend-name { display: block; font-weight: 500; font-size: 14px; }
.acc-friend-sub { display: block; font-size: 12px; color: rgba(255,255,255,0.3); }
.acc-friend-actions { display: flex; gap: 6px; }
.acc-friend-pending-badge {
    font-size: 11px; color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05); padding: 4px 10px;
    border-radius: 8px;
}

.acc-btn-accept, .acc-btn-reject, .acc-btn-remove {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.acc-btn-accept { background: rgba(46,204,113,0.15); color: var(--success); }
.acc-btn-accept:hover { background: rgba(46,204,113,0.3); }
.acc-btn-reject { background: rgba(239,68,68,0.12); color: var(--danger); }
.acc-btn-reject:hover { background: rgba(239,68,68,0.25); }
.acc-btn-remove { background: none; color: rgba(255,255,255,0.2); width: 28px; height: 28px; font-size: 12px; }
.acc-btn-remove:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* Friend profile view */
.acc-friend-profile { }
.acc-fp-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.acc-fp-info { flex: 1; }
.acc-fp-info h3 { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.acc-fp-bio { font-size: 13px; color: rgba(255,255,255,0.45); margin-top: 6px; line-height: 1.4; }
.acc-mini-achs { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-mini-ach { font-size: 24px; cursor: default; }

/* ============================================ */
/* HISTORY                                      */
/* ============================================ */
.acc-history-list { display: flex; flex-direction: column; gap: 6px; }
.acc-history-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: rgba(255,255,255,0.04);
    border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.acc-history-row:hover { background: rgba(255,255,255,0.08); }
.acc-history-main { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.acc-history-cat { font-weight: 600; color: var(--cream); }
.acc-history-players { color: rgba(255,255,255,0.4); font-size: 13px; }
.acc-history-names { font-size: 12px; color: rgba(255,255,255,0.3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-history-meta { display: flex; gap: 10px; font-size: 12px; color: rgba(255,255,255,0.3); align-items: center; flex-shrink: 0; }
.acc-history-status.finished { color: var(--success); }
.acc-history-status.active { color: var(--cream); }

.acc-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.acc-page-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent; color: rgba(255,255,255,0.5);
    font-size: 13px; cursor: pointer; font-family: var(--font-body);
}
.acc-page-btn.active { background: var(--graphite-light); border-color: var(--cream); color: var(--cream); }

/* History detail */
.acc-detail-header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.acc-detail-header h4 { margin: 0; }
.acc-detail-code { font-size: 12px; color: rgba(255,255,255,0.25); font-family: monospace; }
.acc-detail-players { display: flex; flex-direction: column; gap: 6px; }
.acc-detail-player {
    display: flex; justify-content: space-between;
    padding: 8px 14px; background: rgba(255,255,255,0.04); border-radius: 8px; font-size: 14px;
}
.acc-detail-rounds { display: flex; flex-direction: column; gap: 4px; }
.acc-detail-round {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 14px; background: rgba(255,255,255,0.03); border-radius: 8px; font-size: 13px;
}
.acc-round-num { color: var(--cream); font-weight: 600; min-width: 30px; }
.acc-round-text { flex: 1; line-height: 1.4; }
.acc-round-target { color: rgba(255,255,255,0.4); font-size: 12px; }

/* ============================================ */
/* GROUPS                                       */
/* ============================================ */
.acc-group-save {
    background: rgba(255,255,255,0.03); border-radius: 14px;
    padding: 16px; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.05);
}
.acc-group-save-row { display: flex; gap: 8px; }
.acc-group-list { display: flex; flex-direction: column; gap: 8px; }
.acc-group-card { padding: 14px; background: rgba(255,255,255,0.04); border-radius: 12px; }
.acc-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.acc-group-count { color: rgba(255,255,255,0.35); font-size: 12px; }
.acc-group-players { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.acc-group-tag {
    background: rgba(255,255,255,0.06); padding: 4px 10px;
    border-radius: 8px; font-size: 12px; color: rgba(255,255,255,0.6);
}
.acc-group-actions { display: flex; gap: 6px; }

/* ============================================ */
/* SHARED BUTTONS                               */
/* ============================================ */
.btn-sm { padding: 6px 14px !important; font-size: 12px !important; border-radius: 8px !important; }
.btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25) !important; }

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 600px) {
    .acc-modal { max-height: 92vh; margin: 4vh auto; }
    .acc-profile-stats-row { grid-template-columns: repeat(2, 1fr); }
    .acc-edit-grid { grid-template-columns: 1fr; }
    .acc-tab { font-size: 12px; padding: 10px 10px; }
    .acc-stats-row { gap: 16px; }
    .acc-stat-num-big { font-size: 36px; }
    .user-nav { top: 8px; right: 8px; }
    .user-nav-name { display: none; }
    .acc-lb-row { padding: 8px 10px; gap: 8px; }
    .acc-friend-card { padding: 10px 12px; }
    .acc-history-row { flex-wrap: wrap; }
}
