/* ============================================================
   Tester Central - Styles
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Colors */
    --bg:           #0a0e1a;
    --bg-card:      rgba(15, 20, 40, 0.92);
    --bg-card-alt:  rgba(25, 32, 60, 0.85);
    --bg-glass:     rgba(255,255,255,0.04);
    --surface:      #131a2e;
    --border:       rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.15);

    --text:         #e8eaf0;
    --text-muted:   #8b92a8;
    --text-dim:     #5a6178;

    --primary:      #6c5ce7;
    --primary-glow: rgba(108, 92, 231, 0.3);
    --accent:       #00cec9;
    --accent-glow:  rgba(0, 206, 201, 0.25);
    --gold:         #fdcb6e;
    --gold-glow:    rgba(253, 203, 110, 0.3);
    --danger:       #ff6b6b;
    --success:      #00b894;

    /* Typography */
    --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono:    'Cascadia Code', 'Fira Code', monospace;

    /* Spacing */
    --nav-h:        56px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    20px;

    /* Transitions */
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --duration:     200ms;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* --- Top Navigation --- */
.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.topnav.hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }

.topnav-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1.5rem;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}
.topnav-logo { width: 32px; height: 32px; border-radius: 6px; }

.topnav-links {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--bg-glass);
    text-decoration: none;
}
.nav-link.active { color: var(--accent); }

.topnav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-badge {
    background: linear-gradient(135deg, var(--gold), #f0932b);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.nav-user-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-user-btn:hover { background: var(--bg-card-alt); border-color: var(--border-light); }

/* --- Page Container --- */
#app {
    min-height: 100vh;
}
.page {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 2rem) 1rem 3rem;
}
.page-landing { max-width: 1000px; padding-top: 0; }
.page-wide { max-width: 1100px; }

/* --- Page Transitions --- */
.page-enter {
    animation: pageIn var(--duration) var(--ease) forwards;
}
.page-exit {
    animation: pageOut var(--duration) var(--ease) forwards;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--duration) var(--ease);
}
.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.card-glow:hover {
    box-shadow: 0 4px 30px var(--primary-glow);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 4px 20px var(--primary-glow); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #00b894);
    color: #0a0e1a;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #f0932b);
    color: #1a1a2e;
    box-shadow: 0 2px 12px var(--gold-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg-glass); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-glass); }

.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color var(--duration) var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; }

/* --- Star Rating --- */
.star-rating {
    display: flex;
    gap: 0.25rem;
    font-size: 1.75rem;
    cursor: pointer;
}
.star-rating .star {
    color: var(--text-dim);
    transition: color 150ms var(--ease), transform 150ms var(--ease);
    user-select: none;
}
.star-rating .star.active { color: var(--gold); }
.star-rating .star:hover { transform: scale(1.15); }

/* --- Game Cards --- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}
.game-card-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.game-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.game-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; flex: 1; }
.game-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

.daily-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}
.daily-status.done { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.daily-status.pending { background: rgba(253, 203, 110, 0.15); color: var(--gold); }

/* --- Draw Cards --- */
.draw-card {
    position: relative;
    overflow: hidden;
}
.draw-card .draw-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.draw-status.open     { background: rgba(0,206,201,0.2); color: var(--accent); }
.draw-status.upcoming { background: rgba(108,92,231,0.2); color: var(--primary); }
.draw-status.drawn    { background: rgba(253,203,110,0.2); color: var(--gold); }
.draw-prize {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), #f0932b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
}

/* --- Token History --- */
.token-list { list-style: none; }
.token-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.token-item:last-child { border-bottom: none; }
.token-earned { color: var(--success); font-weight: 600; }
.token-spent  { color: var(--danger); font-weight: 600; }
.token-source { color: var(--text-muted); font-size: 0.85rem; }

/* --- Onboarding --- */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.onboarding-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
}
.onboarding-mascot {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    animation: mascotFloat 3s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.3);
}
@keyframes mascotFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.onboarding-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.onboarding-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}
.onboarding-progress {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all 300ms var(--ease);
}
.onboarding-dot.active { background: var(--accent); transform: scale(1.4); }
.onboarding-dot.done   { background: var(--success); }

.step-enter {
    animation: stepIn 400ms var(--ease) forwards;
}
@keyframes stepIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* --- How It Works (3-column) --- */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}
.how-step {
    text-align: center;
    padding: 1.5rem 1rem;
}
.how-step-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}
.how-step h4 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}
.how-step p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Landing Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, var(--primary-glow), transparent 50%),
                radial-gradient(ellipse at 70% 80%, var(--accent-glow), transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes heroGlow {
    from { opacity: 0.4; transform: rotate(0deg); }
    to   { opacity: 0.7; transform: rotate(3deg); }
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}
.hero-mascot {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    box-shadow: 0 12px 48px rgba(108, 92, 231, 0.4);
    animation: mascotFloat 3s ease-in-out infinite;
}
.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* --- QR Code Section --- */
.qr-section {
    text-align: center;
    padding: 3rem 1rem;
}
.qr-code {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    display: inline-block;
    margin: 1rem 0;
}
.qr-code canvas { display: block; }

/* --- Countdown --- */
.countdown {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}
.countdown-unit {
    text-align: center;
}
.countdown-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}
.countdown-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Stats Row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    text-align: center;
    padding: 1.25rem 1rem;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- Disclaimer --- */
.disclaimer {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 2rem;
}

/* --- Auth Buttons --- */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: var(--bg-card);
    color: var(--text);
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: var(--accent);
}
.auth-btn img { width: 24px; height: 24px; border-radius: 4px; }

/* --- Modal / Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 200ms var(--ease);
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    animation: slideUp 300ms var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } }

/* --- Loading --- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--bg-card-alt) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Utilities --- */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-accent  { color: var(--accent); }
.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .hero-mascot { width: 100px; height: 100px; }
    .how-it-works { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .topnav-links { display: none; }
    .page { padding-left: 0.75rem; padding-right: 0.75rem; }
    .countdown-value { font-size: 1.5rem; }
}

/* --- Confetti Canvas --- */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* --- Mobile nav drawer --- */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: none;
    z-index: 1000;
    padding: 0.5rem 0 max(0.5rem, env(safe-area-inset-bottom));
}
.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
}
.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.75rem;
    color: var(--text-dim);
    font-size: 0.65rem;
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}
.mobile-nav-link .icon { font-size: 1.25rem; }
.mobile-nav-link.active { color: var(--accent); }

@media (max-width: 640px) {
    .mobile-nav { display: block; }
    #app { padding-bottom: 70px; }
}

/* --- User dropdown --- */
.user-dropdown {
    position: absolute;
    top: calc(var(--nav-h) - 4px);
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideUp 200ms var(--ease);
    z-index: 1001;
}
.user-dropdown a, .user-dropdown button {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border: none;
    background: none;
    color: var(--text);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font);
}
.user-dropdown a:hover, .user-dropdown button:hover {
    background: var(--bg-glass);
    text-decoration: none;
}
.user-dropdown .logout-btn { color: var(--danger); }

/* --- Skill Testing Question --- */
.skill-question {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin: 1rem 0;
    text-align: center;
}
.skill-question .question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
