/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1e2743;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(99, 102, 241, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --bg-input: rgba(15, 23, 42, 0.6);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== THEME: NEON CYBERPUNK ===== */
[data-theme="neon"] {
    --bg-main: #09090b;
    --bg-card: rgba(9, 9, 11, 0.85);
    --border-color: rgba(236, 72, 153, 0.3);
    --text-primary: #fdf2f8;
    --text-secondary: #fbcfe8;
    --text-muted: #9d174d;
    --accent-primary: #ec4899;
    --accent-secondary: #06b6d4;
    --accent-gold: #a855f7;
    --accent-glow: rgba(236, 72, 153, 0.3);
    --accent-gold-glow: rgba(168, 85, 247, 0.4);
    --success: #22d3ee;
}

/* ===== THEME: LUXURY GOLD ===== */
[data-theme="gold"] {
    --bg-main: #1c1917;
    --bg-card: rgba(41, 37, 36, 0.9);
    --border-color: rgba(217, 119, 6, 0.3);
    --text-primary: #fefce8;
    --text-secondary: #fde047;
    --text-muted: #a8a29e;
    --accent-primary: #d97706;
    --accent-secondary: #fef08a;
    --accent-gold: #fbbf24;
    --accent-glow: rgba(217, 119, 6, 0.3);
    --accent-gold-glow: rgba(251, 191, 36, 0.4);
    --success: #a3e635;
}

/* ===== THEME: LIGHT CLEAN ===== */
[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: rgba(148, 163, 184, 0.3);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #10b981;
    --accent-gold: #f59e0b;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-gold-glow: rgba(245, 158, 11, 0.4);
    --success: #10b981;
    --bg-input: #ffffff;
}

/* ===== THEME: YOSUKA EVENT ===== */
[data-theme="yosuka"] {
    --bg-main: #f5f7fb;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --accent-primary: #FF6B00;
    --accent-secondary: #0A5A35;
    --accent-gold: #FF6B00;
    --accent-glow: rgba(255, 107, 0, 0.3);
    --accent-gold-glow: rgba(255, 107, 0, 0.4);
    --success: #25D366;
    --bg-input: #ffffff;
}

/* Yosuka Solid Overrides (No Gradients) */
[data-theme="yosuka"] .btn-primary,
[data-theme="yosuka"] .tab-btn.active {
    background: var(--accent-primary) !important;
}

[data-theme="yosuka"] .header h1 {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: var(--accent-primary) !important;
}

[data-theme="yosuka"] .digit-box::before {
    background: var(--accent-primary) !important;
    opacity: 0.6;
}

[data-theme="yosuka"] .digit-slot {
    background: #ffffff !important;
    color: var(--accent-primary) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="yosuka"] .digit-slot::before {
    display: none !important;
}

[data-theme="yosuka"] .digit-slot.spinning::after {
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        var(--accent-primary) 25%,
        transparent 50%,
        var(--accent-primary) 75%,
        transparent 100%
    ) !important;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Animated Background ===== */
.bg-animation {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-main);
}

body.has-custom-bg .bg-animation {
    display: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
    width: 600px; height: 600px;
    background: var(--accent-primary);
    top: -200px; right: -100px;
    animation-duration: 25s;
}

.bg-orb:nth-child(2) {
    width: 500px; height: 500px;
    background: var(--accent-secondary);
    bottom: -150px; left: -100px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.bg-orb:nth-child(3) {
    width: 400px; height: 400px;
    background: var(--accent-gold);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 22s;
    animation-delay: -5s;
    opacity: 0.06;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -60px) scale(1.1); }
    50% { transform: translate(-30px, 40px) scale(0.95); }
    75% { transform: translate(50px, 20px) scale(1.05); }
}

/* ===== Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 50px 0 30px;
}

.header-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    display: inline-block;
    animation: iconBounce 3s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-5deg); }
    75% { transform: translateY(-4px) rotate(5deg); }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.card-glow {
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.08);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-title .icon { font-size: 1.3rem; }

/* ===== Live Badge ===== */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.06em;
    animation: livePulse 2s ease-in-out infinite;
    margin-left: auto;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Latest Info (public page) ===== */
.latest-info {
    text-align: center;
    margin-top: 12px;
}

.latest-ket {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.latest-time {
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* ===== Lottery Machine ===== */
.lottery-machine {
    text-align: center;
    padding: 20px 0;
}

.digit-container {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 30px 0 35px;
}

.digit-slot {
    width: 120px;
    height: 160px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent-secondary);
    position: relative;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: var(--transition-fast);
}

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

.digit-slot.spinning {
    animation: slotSpin 0.12s ease-in-out infinite, slotGlow 0.6s ease-in-out infinite;
    border-color: var(--accent-primary);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px var(--accent-glow),
        0 0 40px rgba(99, 102, 241, 0.2);
}

.digit-slot.spinning::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        var(--accent-primary) 25%,
        transparent 50%,
        var(--accent-secondary) 75%,
        transparent 100%
    );
    z-index: -1;
    animation: borderRotate 1s linear infinite;
    opacity: 0.6;
}

.digit-slot.revealed {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 30px var(--accent-gold-glow),
        0 0 60px rgba(245, 158, 11, 0.15);
    animation: revealPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.digit-slot.revealed::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-md);
    border: 2px solid var(--accent-gold);
    animation: ringBurst 0.8s ease-out forwards;
    pointer-events: none;
}

/* Digit container shakes during spin */
.digit-container.shaking {
    animation: containerShake 0.08s ease-in-out infinite;
}

@keyframes slotSpin {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px); }
    75% { transform: translateY(3px); }
}

@keyframes slotGlow {
    0%, 100% { 
        box-shadow: inset 0 2px 8px rgba(0,0,0,0.4), 0 0 20px var(--accent-glow), 0 0 40px rgba(99,102,241,0.15);
    }
    50% { 
        box-shadow: inset 0 2px 8px rgba(0,0,0,0.4), 0 0 30px var(--accent-glow), 0 0 60px rgba(99,102,241,0.3);
    }
}

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

@keyframes revealPop {
    0% { transform: scale(0.7) rotateX(90deg); opacity: 0; }
    40% { transform: scale(1.2) rotateX(-15deg); opacity: 1; }
    60% { transform: scale(0.95) rotateX(5deg); }
    100% { transform: scale(1) rotateX(0deg); opacity: 1; }
}

@keyframes ringBurst {
    0% { inset: -4px; opacity: 1; border-width: 2px; }
    100% { inset: -20px; opacity: 0; border-width: 1px; }
}

@keyframes containerShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-0.5deg); }
    75% { transform: translateX(2px) rotate(0.5deg); }
}

/* Sound toggle button */
.sound-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-soft);
}

.sound-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

/* ===== Inputs ===== */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-field::placeholder { color: var(--text-muted); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
    min-width: 220px;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 16px var(--danger-glow);
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--danger-glow); }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    min-width: auto;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Result Display ===== */
.result-display {
    display: none;
    text-align: center;
    padding: 20px 0 10px;
    animation: fadeSlideUp 0.5s ease;
}

.result-display.show { display: block; }

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.result-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px var(--accent-gold-glow);
}

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

/* ===== Table ===== */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead { background: rgba(99, 102, 241, 0.08); }

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr { transition: var(--transition-fast); }
.table tbody tr:hover { background: rgba(99, 102, 241, 0.05); }
.table tbody tr:last-child td { border-bottom: none; }

.number-cell {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
}

.date-cell { color: var(--text-muted); font-size: 0.83rem; }

.ket-cell {
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-cell { text-align: center; }

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition-fast);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-edit {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-btn:hover { background: rgba(99, 102, 241, 0.2); color: var(--text-primary); }

.page-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info { font-size: 0.83rem; color: var(--text-muted); padding: 0 8px; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; }

/* ===== Stats ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.1);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

/* ===== Confetti Canvas ===== */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 24px; right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
    animation: toastSlideIn 0.4s ease, toastFadeOut 0.4s ease 2.6s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    backdrop-filter: blur(12px);
}

.toast.success { border-color: rgba(34, 197, 94, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal h3 { font-size: 1.2rem; margin-bottom: 10px; }

.modal p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions { display: flex; gap: 12px; justify-content: center; }

.btn-ghost {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }

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

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

/* ===== Start Overlay ===== */
.start-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.start-content {
    text-align: center;
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-content .icon {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 24px;
    animation: iconBounce 3s ease-in-out infinite;
}

.start-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 0 30px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.footer a { color: var(--accent-secondary); text-decoration: none; }

/* ==========================================
   ADMIN - Login Page
   ========================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 44px 38px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(16px);
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.06);
    animation: modalPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.login-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: inline-block;
    animation: iconBounce 3s ease-in-out infinite;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.login-footer a:hover { color: var(--accent-secondary); }

/* ===== Alert ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ==========================================
   ADMIN - Navbar
   ========================================== */
.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-user {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-link {
    font-size: 0.83rem;
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.15);
}

.nav-link-danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.nav-link-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ==========================================
   ADMIN - Tabs
   ========================================== */
.admin-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 5px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.tab-content {
    display: none;
    animation: fadeSlideUp 0.4s ease;
}

.tab-content.active { display: block; }

/* ==========================================
   ADMIN - Settings Info Grid
   ========================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.info-item {
    padding: 16px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
}

.info-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .container { padding: 14px; }
    .header { padding: 30px 0 20px; }
    .header h1 { font-size: 1.8rem; }
    .card { padding: 20px; border-radius: var(--radius-md); }
    .digit-container { gap: 8px; }
    .digit-slot { width: 75px; height: 100px; font-size: 3.2rem; }
    .btn-primary { width: 100%; min-width: unset; }
    .btn-group { flex-direction: column; align-items: stretch; }
    .table th, .table td { padding: 10px 12px; }
    .history-header { flex-direction: column; align-items: flex-start; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }

    .toast-container { top: 12px; right: 12px; left: 12px; }
    .toast { max-width: unset; }

    .admin-nav { flex-direction: column; align-items: flex-start; }
    .nav-right { width: 100%; justify-content: flex-start; }

    .admin-tabs { flex-direction: column; }
    .tab-btn { text-align: center; }

    .login-card { padding: 30px 24px; }

    .info-grid { grid-template-columns: 1fr 1fr; }
}
