* {
    box-sizing: border-box;
    font-family: 'DungGeunMo', sans-serif;
    user-select: none;
}

body {
    background-color: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: white;
}

/* ==========================================
   TOP BAR
   ========================================== */
.top-bar {
    width: 100%;
    background: #0f0f23;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    font-size: 14px;
}

.top-bar-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-bar-links a {
    color: #ffeb3b;
    text-decoration: none;
    font-size: 13px;
}
.top-bar-links a:hover { text-decoration: underline; }

.btn-small {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}
.btn-small:hover { background: #c0392b; }

/* ==========================================
   AUTH PAGES
   ========================================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.auth-card {
    background: #16213e;
    padding: 40px;
    border-radius: 16px;
    width: 380px;
    border: 3px solid #e94560;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

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

.auth-header h1 {
    color: #ffeb3b;
    font-size: 40px;
    margin: 0;
    text-shadow: 3px 3px 0 #e94560;
}

.auth-header p {
    color: #aaa;
    font-size: 14px;
    margin-top: 5px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #ccc;
}

.input-group input {
    width: 100%;
    padding: 10px 14px;
    background: #0f3460;
    border: 2px solid #444;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #e94560;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.btn-primary:hover { background: #c0392b; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}
.auth-footer a { color: #ffeb3b; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.error-msg {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
}

.success-msg {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
}

/* ==========================================
   ARCADE MACHINE
   ========================================== */
.arcade-machine {
    width: 450px;
    background: linear-gradient(180deg, #d32f2f, #9a0007);
    border: 8px solid #333;
    border-radius: 20px 20px 10px 10px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), inset 0 5px 15px rgba(255,255,255,0.2);
    position: relative;
    border-top-width: 25px;
    margin: 20px auto;
}

.marquee {
    text-align: center;
    background: #ffeb3b;
    color: #d32f2f;
    padding: 10px;
    border-radius: 10px;
    border: 4px solid #f57f17;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.marquee h1 { margin: 0; font-size: 32px; text-shadow: 2px 2px 0px #fff; }
.marquee .subtitle { font-size: 12px; font-weight: bold; letter-spacing: 2px; }

.screen {
    background: #222;
    border: 15px solid #bdc3c7;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    box-shadow: inset 0 0 20px black;
    border-bottom: 30px solid #95a5a6;
}

.roulette-container {
    width: 300px;
    height: 300px;
    position: relative;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #333 40%, #111 60%);
    border: 5px solid #444;
}

.roulette-item {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #fff;
    color: #000;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 3px solid #ccc;
    box-shadow: 0 4px 0 #999, inset 0 -2px 5px rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.roulette-item.active {
    background-color: #ffeb3b;
    border-color: #ffd600;
    box-shadow: 0 0 15px #ffd600, 0 4px 0 #f57f17;
    color: #d32f2f;
    transform: scale(1.1);
}

.target-20 { top: 10px; left: 125px; }
.target-10 { top: 60px; left: 230px; }
.target-7 { top: 170px; left: 250px; }
.target-4 { top: 250px; left: 125px; }
.target-2 { top: 170px; left: 0px; }
.target-1 { top: 60px; left: 20px; }

.center-graphic {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    border: 4px dashed #ffeb3b;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.4);
}

.led-panel {
    display: flex;
    justify-content: space-around;
    background: #000;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #444;
}

.led-display { text-align: center; }

.led-label {
    font-size: 14px;
    color: #ffeb3b;
    margin-bottom: 5px;
}

.led-value {
    font-family: 'VT323', monospace;
    font-size: 32px;
    color: #ff0000;
    background: #1a0000;
    padding: 0 10px;
    border-radius: 4px;
    text-shadow: 0 0 10px #ff0000;
    min-width: 100px;
    line-height: 1.2;
}

.game-message {
    text-align: center;
    padding: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: #ffeb3b;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    min-height: 32px;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    background: #444;
    padding: 20px;
    border-radius: 10px;
    border: 4px solid #222;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.5);
}

.action-buttons { display: flex; gap: 15px; }

.rps-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 0 #555, 0 15px 20px rgba(0,0,0,0.4);
    transition: all 0.1s;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: inherit;
}

.rps-btn:active, .rps-btn.pressed {
    transform: translateY(8px);
    box-shadow: 0 0 0 #555, 0 5px 10px rgba(0,0,0,0.4);
}

.btn-scissors { background: #e74c3c; color: white; box-shadow: 0 8px 0 #c0392b; }
.btn-rock { background: #2ecc71; color: white; box-shadow: 0 8px 0 #27ae60; }
.btn-paper { background: #3498db; color: white; box-shadow: 0 8px 0 #2980b9; }

.btn-scissors:active { box-shadow: 0 0 0 #c0392b; }
.btn-rock:active { box-shadow: 0 0 0 #27ae60; }
.btn-paper:active { box-shadow: 0 0 0 #2980b9; }

.side-controls { display: flex; align-items: center; }

.insert-coin-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.btn-coin {
    width: 20px;
    height: 40px;
    background: #000;
    border: 2px solid #e67e22;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: inset 0 0 10px #e67e22;
    transition: background 0.1s;
}
.btn-coin:active { background: #e67e22; }

.insert-coin-slot span {
    font-size: 10px;
    color: #ffeb3b;
    font-weight: bold;
    text-align: center;
}

#double-up-banner {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0000;
    color: white;
    padding: 10px 20px;
    border: 3px solid #ffeb3b;
    border-radius: 8px;
    font-size: 13px;
    animation: flash 0.5s infinite alternate;
    white-space: nowrap;
    z-index: 10;
}

.hidden { display: none !important; }

@keyframes flash {
    0% { opacity: 1; box-shadow: 0 0 20px #ffeb3b; }
    100% { opacity: 0.5; box-shadow: 0 0 5px #ffeb3b; }
}

/* ==========================================
   PAGE CONTAINER (Leaderboard, Admin)
   ========================================== */
.page-container {
    width: 100%;
    max-width: 900px;
    padding: 30px 20px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 28px;
    color: #ffeb3b;
    margin-bottom: 20px;
}

/* ==========================================
   TABLES
   ========================================== */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.leaderboard-table th {
    background: #0f3460;
    padding: 12px 8px;
    text-align: center;
    color: #ffeb3b;
    border-bottom: 2px solid #e94560;
}

.leaderboard-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.leaderboard-table tr:hover { background: rgba(233, 69, 96, 0.1); }
.row-online { background: rgba(46, 204, 113, 0.1) !important; }

.rank-cell { font-size: 20px; }
.coins-cell { color: #ffeb3b; font-weight: bold; }

/* Admin extras */
.admin-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 16px;
}

.online-count { color: #2ecc71; }

.adjust-controls {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.btn-adjust {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
}
.btn-adjust.plus { background: #2ecc71; color: white; }
.btn-adjust.minus { background: #e74c3c; color: white; }
.btn-adjust:hover { opacity: 0.8; }
