@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Press+Start+2P&display=swap');

:root {
    --primary: #0a1628;
    --primary-light: #112240;
    --accent: #1a73e8;
    --accent-hover: #1565c0;
    --accent-glow: rgba(26, 115, 232, 0.2);
    --yellow: #ffc107;
    --yellow-dark: #e0a800;
    --success: #2a9d8f;
    --success-light: rgba(42, 157, 143, 0.12);
    --danger: #e63946;
    --bg: #060d1a;
    --bg-card: #0d1b33;
    --bg-card-hover: #142a4a;
    --bg-surface: #0a1628;
    --text: #e8ecf1;
    --text-secondary: #8fa3bf;
    --text-muted: #506880;
    --border: #1a3050;
    --border-light: #264060;
    --gradient-start: #1a73e8;
    --gradient-end: #4fc3f7;
    --shadow-glow: 0 4px 24px rgba(26, 115, 232, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Press Start 2P', 'Barlow Condensed', Impact, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.game-body {
    overflow: hidden;
    height: 100vh;
    touch-action: none;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
}

/* ─── Top Navigation ─────────────────────────────────── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(6, 13, 26, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.topnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 18px;
    height: 52px;
    gap: 12px;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.topnav-brand svg {
    color: var(--accent);
}
.topnav-brand span {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topnav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    gap: 4px;
}
.topnav-hamburger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
    transform-origin: center;
}
.topnav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topnav-hamburger.open span:nth-child(2) { opacity: 0; }
.topnav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topnav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: rgba(6, 13, 26, 0.98);
    border-bottom: 1px solid var(--border);
    list-style: none;
    padding: 8px 0 12px;
    gap: 0;
}
.topnav-links.open {
    display: flex;
}
.topnav-links li a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}
.topnav-links li a:hover,
.topnav-links li a.active {
    color: var(--text);
    background: var(--bg-card);
}
.topnav-links li a.active {
    color: var(--accent);
}
.topnav-links li a.topnav-login {
    color: var(--accent);
    font-weight: 600;
}
.topnav-links li a.topnav-profile {
    color: var(--yellow);
    font-weight: 600;
}

body.has-topnav .container {
    min-height: calc(100vh - 52px);
}

@media (min-width: 600px) {
    .topnav-hamburger { display: none; }
    .topnav-links {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        border: none;
        padding: 0;
        gap: 0;
    }
    .topnav-links li a {
        padding: 6px 12px;
        border-radius: var(--radius-sm);
    }
    .topnav-links li a:hover { background: var(--bg-card); }
}
/* ─────────────────────────────────────────────────────── */

/* Welcome Page */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    padding: 40px 20px;
}

.welcome-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.welcome-bg::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(26, 115, 232, 0.06) 0%, transparent 70%);
}

.welcome-bg::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.04) 0%, transparent 70%);
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.logo-area {
    margin-bottom: 28px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: var(--accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    position: relative;
    transform: rotate(-3deg);
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    border: 2px solid rgba(230, 57, 70, 0.3);
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 0.95;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: var(--text);
}

.welcome-title span {
    color: var(--accent);
    display: block;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.welcome-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 300px;
    margin: 0 auto 36px;
    line-height: 1.5;
    font-weight: 400;
}

.prize-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 36px;
    width: 100%;
    max-width: 340px;
}

.prize-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    transition: border-color 0.2s;
    position: relative;
}

.prize-card:first-child {
    border-color: rgba(26, 115, 232, 0.3);
}

.prize-card:hover {
    border-color: var(--border-light);
}

.prize-card .prize-icon {
    font-size: 26px;
    margin-bottom: 4px;
}

.prize-card .prize-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prize-card .prize-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 16px 44px;
    font-size: 1.15rem;
    border-radius: var(--radius-lg);
}

.welcome-auth-buttons .btn-lg {
    font-size: 0.65rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.welcome-player-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 115, 232, 0.1);
    border: 1px solid rgba(26, 115, 232, 0.3);
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.welcome-player-banner strong {
    color: var(--text-primary);
}

.welcome-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}

.welcome-auth-buttons .btn {
    width: 100%;
    justify-content: center;
}

.welcome-guest-link {
    margin-top: 50px;
    font-size: 0.7rem;
    font-family: var(--font-display);
    color: var(--accent);
    text-decoration: none;
    text-align: center;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
    text-transform: uppercase;
}

.welcome-guest-link:hover {
    color: var(--accent-hover);
}

.lucky-draw-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 100px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--yellow);
    margin-top: 16px;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 20px;
    margin-top: 24px;
    justify-content: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.nav-links a:hover {
    color: var(--text-secondary);
    border-bottom-color: var(--text-muted);
}

/* Game Canvas */
.game-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--primary);
    border-bottom: 2px solid var(--accent);
    z-index: 10;
    flex-shrink: 0;
}

.hud-item {
    text-align: center;
}

.hud-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0;
    font-family: var(--font-sans);
}

.hud-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.hud-value.time {
    color: var(--yellow);
}

.hud-value.time.warning {
    color: var(--danger);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hud-value.bonus {
    color: var(--success);
}

.game-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    touch-action: none;
}

/* D-pad Controls */
.game-dpad {
    flex-shrink: 0;
    background: var(--primary);
    border-top: 1px solid var(--border);
    padding: 10px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
}

.dpad-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dpad-btn {
    width: 58px;
    height: 58px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.08s, border-color 0.08s, color 0.08s;
    touch-action: manipulation;
}

.dpad-btn:active,
.dpad-btn.pressed {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.dpad-cell {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-center {
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}

.overlay-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Tutorial controls panel in game overlay */
.tutorial-controls {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
    max-width: 300px;
}

.tutorial-control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.tutorial-control-item span {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.tutorial-control-icon {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    align-items: center;
}

.tutorial-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 0;
    font-style: italic;
}

.tutorial-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--yellow);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.game-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 22, 30, 0.92);
    backdrop-filter: blur(6px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 380px;
}

.overlay-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.overlay-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.92rem;
}

.time-bonus-popup {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 6px 18px;
    border-radius: 100px;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.75rem;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 0.5px;
}

.time-bonus-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Tutorial */
.tutorial-page {
    padding: 40px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 36px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.tutorial-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    border-left: 3px solid var(--accent);
}

.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-display);
}

.step-content h3 {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 0.92rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

/* Result Page */
.result-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 0;
    text-align: center;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 14px;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.result-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-prize {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.result-stats {
    display: flex;
    gap: 28px;
    justify-content: center;
    margin-bottom: 28px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--yellow);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Form */
.form-page {
    padding: 40px 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c6b7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.player-session-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 115, 232, 0.12);
    border: 1px solid rgba(26, 115, 232, 0.35);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.player-session-banner strong {
    color: var(--text-primary);
}

.form-input[readonly] {
    opacity: 0.7;
    cursor: default;
    background: rgba(255,255,255,0.03);
}

/* Claim Page */
.claim-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 0;
    text-align: center;
}

.qr-container {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.qr-container svg {
    width: 200px;
    height: 200px;
}

.claim-instructions {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 24px;
    max-width: 360px;
    text-align: left;
    border-left: 3px solid var(--yellow);
}

.claim-instructions h3 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.claim-instructions ol {
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.claim-instructions li {
    margin-bottom: 5px;
}

.claim-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.claim-info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.88rem;
}

.claim-info-label {
    color: var(--text-muted);
}

.claim-info-value {
    font-weight: 600;
    color: var(--text);
}

/* Dealer */
.dealer-login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 0;
}

.dealer-login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 400px;
}

.dealer-login-card h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dealer-login-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 22px;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: var(--bg);
}

.dashboard-header {
    background: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-content {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
}

.stat-card .stat-label {
    margin-top: 4px;
}

.player-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.table-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

tbody td {
    padding: 10px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(46, 46, 68, 0.5);
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--yellow);
}

.badge-muted {
    background: rgba(108, 107, 126, 0.1);
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.88rem;
}

/* 404 */
.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.page-404 h1 {
    font-family: var(--font-display);
    font-size: 7rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 0.88rem;
    z-index: 1000;
    transition: transform 0.25s ease-out;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

/* Mobile controls hint */
.controls-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 18px;
    font-size: 0.78rem;
    color: var(--text-muted);
    z-index: 20;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Brand Footer */
.brand-footer {
    margin-top: 32px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    width: 100%;
    text-align: center;
}

.brand-logo {
    max-width: 90px;
    height: auto;
    opacity: 0.85;
}

.developed-by {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
    font-weight: 500;
}

.lucky-draw-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.smartwatch-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(26, 115, 232, 0.35));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* Privacy Page */
.privacy-page {
    padding: 40px 0 60px;
}

.privacy-content {
    max-width: 600px;
    margin: 0 auto;
}

.privacy-section {
    margin-bottom: 24px;
}

.privacy-section h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    color: var(--text);
}

.privacy-section p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.privacy-section ul {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    padding-left: 20px;
    margin-top: 4px;
}

.privacy-section ul li {
    margin-bottom: 3px;
}

.privacy-updated {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .welcome-title { font-size: 2.2rem; }
    .welcome-title span { font-size: 1.9rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .result-stats { flex-direction: column; gap: 16px; }
    
    table {
        font-size: 0.78rem;
    }
    thead th, tbody td {
        padding: 8px 12px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Date input */
input[type="date"] {
    color-scheme: dark;
}

/* Play Now CTA */
.play-now-cta {
    animation: playGlow 2s ease-in-out infinite;
}
@keyframes playGlow {
    0%, 100% { box-shadow: 0 0 18px rgba(26,115,232,0.4); }
    50%       { box-shadow: 0 0 36px rgba(26,115,232,0.75), 0 0 60px rgba(26,115,232,0.25); }
}

/* WhatsApp button */
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.btn-whatsapp:hover {
    background: #1ebe5a;
    transform: translateY(-1px);
}
.btn-whatsapp.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

/* Terms checkbox */
.terms-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
    cursor: pointer;
}
.terms-check-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}
.terms-check-label a {
    color: var(--accent);
    text-decoration: none;
}
.terms-check-label a:hover {
    text-decoration: underline;
}
