/* BIOS & Retro 80's Style System */
:root {
    --bios-blue: #0000a8;
    --bios-grey: #a8a8a8;
    --bios-white: #ffffff;
    --bios-yellow: #ffff54;
    
    --term-bg: #05050a;
    --term-text: #39ff14; /* Phosphor Green */
    --neon-cyan: #00ffcc;
    --neon-pink: #ff007f;
    --neon-orange: #ff5e00;
    
    --silver-glow: #e2e2e2;
    --gold-glow: #ffd700;
    --prism-gradient: linear-gradient(90deg, #ff007f, #ffff00, #00ffcc, #bd00ff);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Share Tech Mono', 'VT323', monospace;
    font-smooth: never;
    -webkit-font-smoothing: none;
}

body {
    background-color: #000;
    color: var(--bios-white);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CRT Scanlines and Flicker Filter */
.crt-filter {
    position: relative;
}

.crt-filter::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 3px, 6px 100%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0.85;
}

.crt-filter::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 99998;
    pointer-events: none;
    animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 0.27; }
    50% { opacity: 0.32; }
    100% { opacity: 0.29; }
}

/* BIOS SCREEN STYLES */
.bios-screen {
    width: 96vw;
    height: 94vh;
    max-width: 900px;
    max-height: 550px;
    background-color: var(--bios-blue);
    border: 3px double var(--bios-white);
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 168, 0.8);
    z-index: 10;
}

.bios-screen.hidden {
    display: none !important;
}

.bios-header {
    background-color: var(--bios-white);
    color: var(--bios-blue);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    padding: 8px 12px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.bios-body {
    flex-grow: 1;
    display: flex;
    border: 1px solid var(--bios-white);
    margin-bottom: 10px;
}

.bios-sidebar {
    width: 250px;
    border-right: 1px solid var(--bios-white);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.bios-menu-item {
    padding: 8px;
    color: var(--bios-grey);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.bios-menu-item:hover, .bios-menu-item.active {
    color: var(--bios-yellow);
    background-color: rgba(255, 255, 255, 0.1);
}

.bios-spacer {
    flex-grow: 1;
}

.bios-help {
    border: 1px dashed var(--bios-white);
    padding: 10px;
    font-size: 0.8rem;
    color: var(--bios-white);
    line-height: 1.4;
    height: 160px;
}

.bios-form-box {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bios-form-box.hidden {
    display: none !important;
}

.bios-form-box h2 {
    color: var(--bios-yellow);
    font-size: 1.3rem;
    margin-bottom: 25px;
    text-align: center;
}

.bios-field {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.bios-field label {
    width: 140px;
    font-weight: bold;
    font-size: 1.1rem;
}

.bios-field input {
    flex-grow: 1;
    background-color: transparent;
    border: 1px solid var(--bios-white);
    color: var(--bios-yellow);
    padding: 8px 12px;
    font-size: 1.1rem;
    outline: none;
    caret-color: var(--bios-yellow);
}

.bios-field input:focus {
    background-color: rgba(255, 255, 255, 0.15);
}

.bios-form-box button {
    margin-top: 20px;
    background-color: var(--bios-white);
    color: var(--bios-blue);
    border: none;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bios-form-box button:hover {
    background-color: var(--bios-yellow);
}

.bios-footer {
    border-top: 1px solid var(--bios-white);
    padding-top: 8px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--bios-grey);
}

/* DESKTOP OS WRAPPER STYLES */
.desktop-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

.desktop-wrapper.hidden {
    display: none !important;
}

/* OS Header */
.os-header {
    background-color: #1e1e32;
    border-bottom: 2px solid var(--bios-white);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
}

.os-header .user-status {
    color: var(--bios-white);
}

.os-header #display-balance {
    color: var(--bios-yellow);
    font-weight: bold;
}

/* OS Workspace Layout */
.os-workspace {
    flex-grow: 1;
    display: flex;
    height: calc(100vh - 35px);
}

/* OS Sidebar */
.os-sidebar {
    width: 200px;
    background-color: #10101c;
    border-right: 2px solid var(--bios-white);
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    width: 100%;
    background-color: #1a1a2e;
    border: 1px solid var(--bios-white);
    color: var(--bios-white);
    padding: 12px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover, .nav-btn.active {
    background-color: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

.nav-btn.hidden {
    display: none !important;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-online {
    display: inline-block;
    margin-top: 5px;
    background: rgba(57, 255, 20, 0.15);
    border: 1px solid var(--term-text);
    color: var(--term-text);
    padding: 4px 10px;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
}

/* OS Main contents */
.os-main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--term-bg);
}

.tab-panel.hidden {
    display: none !important;
}

/* Terminal Card (Lobby) */
.terminal-card {
    background-color: #04040a;
    border: 1px solid var(--term-text);
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.15);
    height: 100%;
}

.terminal-card h2 {
    color: var(--term-text);
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--term-text);
    padding-bottom: 10px;
}

.terminal-text p {
    font-size: 1.05rem;
    color: var(--term-text);
    line-height: 1.6;
    margin-bottom: 10px;
}

.blink {
    animation: text-blink 1.2s infinite;
}

@keyframes text-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* PINBALL TAB LAYOUT */
.pinball-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
}

.game-view-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pinball-controls {
    display: flex;
    gap: 10px;
}

.ball-btn {
    flex-grow: 1;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: bold;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #1a1a2e;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.ball-btn.silver {
    border-color: #888;
    color: var(--bios-white);
}

.ball-btn.silver:hover {
    background-color: var(--bios-white);
    color: #000;
    box-shadow: 0 0 15px var(--silver-glow);
}

.ball-btn.gold {
    border-color: #d4af37;
    color: #ffd700;
}

.ball-btn.gold:hover {
    background-color: #ffd700;
    color: #000;
    box-shadow: 0 0 15px var(--gold-glow);
}

.ball-btn.prism {
    border-color: var(--neon-pink);
    color: var(--neon-cyan);
}

.ball-btn.prism:hover {
    background: var(--prism-gradient);
    color: #000;
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.8);
}

.canvas-glow-container {
    width: 800px;
    height: 520px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--bios-white);
    box-shadow: 0 0 20px rgba(255,255,255,0.1), inset 0 0 15px rgba(255,255,255,0.05);
    background-color: #030308;
    position: relative;
}

/* Ball Specs Floating Overlay */
.ball-info-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid var(--bios-white);
    padding: 8px 10px;
    font-size: 0.75rem;
    color: var(--bios-white);
    z-index: 5;
    pointer-events: none; /* Allows clicks to pass through to the canvas */
    font-family: 'Share Tech Mono', monospace;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.ball-info-overlay .title {
    font-weight: bold;
    color: var(--neon-cyan);
    margin-bottom: 4px;
    text-align: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 2px;
}

.ball-info-overlay p {
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.ball-info-overlay .dot {
    font-size: 0.8rem;
    margin-right: 2px;
}

.ball-info-overlay .black-dot {
    color: #555;
    text-shadow: 0 0 2px #000;
}

.ball-info-overlay .silver-dot {
    color: #e2e2e2;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
}

.ball-info-overlay .gold-dot {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

.ball-info-overlay .prism-dot {
    background: var(--prism-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    display: inline-block;
}

#pinball-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Sidebar Dashboard (Leaderboard & Chat) */
.game-dashboard {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 585px;
}

.dash-panel {
    background: rgba(10, 10, 20, 0.8);
    border: 1px solid var(--bios-white);
    padding: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.dash-panel h3 {
    font-size: 0.95rem;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
}

/* Scoreboard */
.scoreboard {
    height: 160px;
}

.scoreboard ul {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}

.scoreboard li {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 4px 0;
    color: var(--bios-grey);
}

.scoreboard li.me {
    color: var(--bios-yellow);
    font-weight: bold;
}

.scoreboard li .rank {
    font-weight: bold;
    color: var(--bios-white);
    margin-right: 6px;
}

/* Personal Log */
.personal-log {
    height: 160px;
}

/* Chat container */
.chat {
    flex-grow: 1;
    height: 220px;
}

.chat-logs {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--bios-grey);
    padding-right: 2px;
}

.chat-logs::-webkit-scrollbar {
    width: 3px;
}
.chat-logs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.chat-log-line {
    word-break: break-all;
    line-height: 1.3;
}

.chat-log-line .user {
    font-weight: bold;
    color: var(--neon-cyan);
    margin-right: 4px;
}

.chat-log-line .sys-text {
    color: var(--neon-pink);
    font-style: italic;
}

.chat-input-row {
    display: flex;
    gap: 6px;
}

.chat-input-row input {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.5);
    border: 1px solid var(--bios-white);
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 10px;
    outline: none;
}

.chat-input-row input:focus {
    border-color: var(--neon-cyan);
}

.chat-input-row button {
    background-color: var(--bios-white);
    border: none;
    color: #000;
    font-weight: bold;
    padding: 0 12px;
    cursor: pointer;
}

.chat-input-row button:hover {
    background-color: var(--neon-cyan);
}

/* ADMIN PANEL CARD */
.admin-panel-card {
    background-color: #060614;
    border: 2px solid var(--neon-pink);
    padding: 20px;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.2);
    height: 100%;
}

.admin-panel-card h2 {
    color: var(--neon-pink);
    font-size: 1.4rem;
    border-bottom: 2px solid var(--neon-pink);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.4);
}

.admin-workspace {
    display: flex;
    gap: 20px;
    height: calc(100% - 60px);
}

.admin-sub-card {
    background-color: rgba(0,0,0,0.4);
    border: 1px solid var(--bios-white);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.users-list-view {
    flex-grow: 2;
    width: 60%;
}

.charge-card {
    flex-grow: 1;
    width: 40%;
    justify-content: flex-start;
}

.admin-sub-card h3 {
    font-size: 1.05rem;
    color: var(--bios-yellow);
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    padding-bottom: 6px;
}

/* Table styling for users list */
.table-container {
    overflow-y: auto;
    flex-grow: 1;
}

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

th, td {
    border: 1px solid var(--bios-grey);
    padding: 8px 10px;
    text-align: left;
}

th {
    background-color: rgba(255,255,255,0.1);
    color: var(--neon-cyan);
}

td {
    color: var(--bios-white);
}

/* Charge Form styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: bold;
}

.form-group input {
    background-color: rgba(0,0,0,0.5);
    border: 1px solid var(--bios-white);
    color: var(--bios-yellow);
    padding: 8px 12px;
    font-size: 1rem;
    outline: none;
}

.form-group input:focus {
    border-color: var(--neon-pink);
}

#charge-submit-btn {
    background-color: var(--neon-pink);
    color: #fff;
    border: none;
    padding: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255,0,127,0.3);
    transition: all 0.2s;
}

#charge-submit-btn:hover {
    background-color: #ff3399;
    box-shadow: 0 0 15px rgba(255,0,127,0.5);
}

.admin-log {
    margin-top: 15px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-all;
}

/* RESPONSIVE SCALING */
@media (max-width: 1080px) {
    .pinball-layout {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .game-dashboard {
        width: 800px;
        height: auto;
        flex-direction: row;
        gap: 10px;
    }
    
    .scoreboard, .personal-log, .chat {
        width: 33.33%;
        height: 220px;
    }
}

@media (max-width: 840px) {
    .os-workspace {
        flex-direction: column;
    }
    
    .os-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
    }
    
    .nav-btn {
        width: auto;
        white-space: nowrap;
        padding: 8px 12px;
    }
    
    .canvas-glow-container {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 2.6;
    }
    
    .game-dashboard {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .scoreboard, .personal-log, .chat {
        width: 100%;
        height: 160px;
    }
    
    .admin-workspace {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .users-list-view, .charge-card {
        width: 100%;
        height: auto;
    }
    
    /* Responsive Limbo layout */
    .limbo-layout {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }
    
    .limbo-sidebar-panel {
        width: 100%;
        height: auto;
    }
    
    .limbo-monitor-wrapper {
        width: 100%;
        height: auto;
    }
    
    .limbo-monitor {
        width: 100%;
        height: 280px;
    }
}

@media (max-width: 600px) {
    .ball-info-overlay {
        font-size: 0.6rem;
        padding: 4px 6px;
        top: 5px;
        left: 5px;
    }
    
    .ball-info-overlay .title {
        margin-bottom: 2px;
        padding-bottom: 1px;
    }
    
    .ball-info-overlay p {
        margin: 1px 0;
        gap: 4px;
    }
}

/* BIOS Screen Mobile Responsiveness & Extra Adjustments */
@media (max-width: 768px) {
    .bios-screen {
        width: 98vw;
        height: auto;
        max-height: 98vh;
        max-width: 100%;
        padding: 5px;
        box-shadow: 0 0 15px rgba(0, 0, 168, 0.6);
        overflow-y: auto;
    }
    
    .bios-header {
        font-size: 0.55rem;
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    
    .bios-body {
        flex-direction: column;
        margin-bottom: 6px;
    }
    
    .bios-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bios-white);
        padding: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .bios-menu-item {
        flex: 1;
        text-align: center;
        margin-bottom: 0;
        font-size: 0.8rem;
        padding: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .bios-menu-item.active {
        border-color: var(--bios-yellow);
    }
    
    .bios-spacer {
        display: none;
    }
    
    .bios-help {
        display: none;
    }
    
    .bios-form-box {
        padding: 15px 10px;
    }
    
    .bios-form-box h2 {
        font-size: 1.05rem;
        margin-bottom: 15px;
    }
    
    .bios-field {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        margin-bottom: 12px;
    }
    
    .bios-field label {
        width: 100%;
        font-size: 0.9rem;
    }
    
    .bios-field input {
        font-size: 0.95rem;
        padding: 6px 10px;
    }
    
    .bios-form-box button {
        margin-top: 10px;
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .bios-footer {
        font-size: 0.7rem;
        padding-top: 6px;
    }
}

@media (max-width: 600px) {
    .pinball-controls {
        flex-direction: column;
        gap: 5px;
    }
    .ball-btn {
        width: 100%;
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Retro DOS-Style Toast Notifications */
.toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 320px;
    width: 90%;
}

.toast {
    background-color: var(--bios-blue);
    color: var(--bios-yellow);
    border: 3px double var(--bios-white);
    padding: 14px 20px;
    font-family: 'Press Start 2P', 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 0 20px rgba(0, 0, 168, 0.8);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0);
    pointer-events: auto;
    word-break: keep-all;
}

.toast.error {
    background-color: #a80000;
    color: var(--bios-white);
    border-color: #ff5555;
    box-shadow: 0 0 20px rgba(168, 0, 0, 0.8);
}

.toast.success {
    background-color: #00a800;
    color: var(--bios-white);
    border-color: #55ff55;
    box-shadow: 0 0 20px rgba(0, 168, 0, 0.8);
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

/* Flashing Jackpot Overlay styling */
.jackpot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.jackpot-overlay.hidden {
    display: none !important;
}

.jackpot-banner {
    background-color: #000;
    border: 6px double #ffd700;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 50px #ffd700, inset 0 0 30px rgba(255, 215, 0, 0.4);
    animation: border-flash 0.5s infinite alternate;
}

.jackpot-banner h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.5rem;
    color: #ffd700;
    margin: 20px 0;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ff007f;
    animation: text-rainbow 1.5s infinite linear;
}

.jackpot-banner p {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.jackpot-banner #jackpot-user {
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
}

.jackpot-banner #jackpot-prize {
    color: #ffff54;
    font-size: 1.6rem;
    text-shadow: 0 0 15px #ffff54;
}

.jackpot-stars {
    font-size: 1.5rem;
    color: #ffd700;
    letter-spacing: 10px;
    animation: stars-blink 0.4s infinite alternate;
}

@keyframes border-flash {
    0% {
        border-color: #ffd700;
        box-shadow: 0 0 30px #ffd700;
    }
    100% {
        border-color: #ff007f;
        box-shadow: 0 0 50px #ff007f;
    }
}

@keyframes text-rainbow {
    0% { color: #ffd700; }
    25% { color: #00ffcc; }
    50% { color: #ff007f; }
    75% { color: #ffff54; }
    100% { color: #ffd700; }
}

@keyframes stars-blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ----------------------------------------------------
   LIMBO BETTING GAME LAYOUT & COMPONENTS
   ---------------------------------------------------- */
.limbo-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    align-items: stretch;
}

.limbo-sidebar-panel {
    width: 300px;
    background-color: #060614;
    border: 1px solid var(--bios-white);
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.limbo-sidebar-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--neon-cyan);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.limbo-form-group {
    margin-bottom: 16px;
}

.limbo-form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--bios-white);
    opacity: 0.8;
    margin-bottom: 6px;
    font-family: 'Share Tech Mono', monospace;
}

.limbo-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.limbo-input-wrapper input {
    width: 100%;
    background-color: #000;
    border: 1px solid var(--bios-white);
    color: #fff;
    padding: 8px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    outline: none;
    box-sizing: border-box;
}

.limbo-input-wrapper input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.2);
}

.limbo-input-wrapper .input-suffix {
    position: absolute;
    right: 12px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--bios-white);
    opacity: 0.6;
    font-weight: bold;
}

.limbo-quick-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 5px;
}

.limbo-quick-row.five-cols {
    grid-template-columns: repeat(5, 1fr);
}

.limbo-btn-sm {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    padding: 4px 0;
    cursor: pointer;
    text-align: center;
}

.limbo-btn-sm:hover {
    background-color: var(--neon-cyan);
    color: #000;
    border-color: var(--neon-cyan);
}

.limbo-info-group {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.limbo-info-group .info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.6;
}

.limbo-launch-btn {
    background-color: var(--neon-green);
    border: none;
    color: #000;
    font-family: 'Noto Sans KR', monospace;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 12px 0;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    transition: filter 0.1s, transform 0.05s;
}

.limbo-launch-btn:hover {
    filter: brightness(1.2);
}

.limbo-launch-btn:active {
    transform: scale(0.97);
}

.limbo-launch-btn:disabled {
    background-color: #222;
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
}

/* Limbo Monitor Screen styling */
.limbo-monitor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.limbo-monitor {
    flex: 1;
    background-color: #000;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.1);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.limbo-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    z-index: 5;
    pointer-events: none;
}

.limbo-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.limbo-title {
    position: absolute;
    top: 15px;
    font-family: 'Share Tech Mono', monospace;
    color: rgba(0, 255, 204, 0.4);
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.limbo-multiplier {
    font-family: 'Press Start 2P', monospace;
    font-size: 4.5rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin: 15px 0;
    transition: transform 0.08s;
}

.limbo-multiplier.success {
    color: var(--neon-green) !important;
    text-shadow: 0 0 25px var(--neon-green) !important;
    animation: limbo-win-bounce 0.35s ease-out;
}

.limbo-multiplier.fail {
    color: var(--neon-pink) !important;
    text-shadow: 0 0 25px var(--neon-pink) !important;
    animation: limbo-shake 0.3s;
}

.limbo-rocket-art-container {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.limbo-rocket-art {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    line-height: 1.05;
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.2);
}

.limbo-rocket-art.launching {
    animation: rocket-thrust 0.08s infinite alternate;
    color: #ffa500;
    text-shadow: 0 0 10px #ff4500;
}

.limbo-status-msg {
    position: absolute;
    bottom: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    color: var(--bios-white);
    letter-spacing: 1px;
}

/* Recent Strip */
.limbo-recent-strip-container {
    background-color: #060614;
    border: 1px solid var(--bios-white);
    padding: 10px 15px;
}

.limbo-recent-strip-container h4 {
    margin: 0 0 8px 0;
    font-size: 0.75rem;
    color: var(--bios-white);
    opacity: 0.7;
    font-family: 'Press Start 2P', monospace;
}

.limbo-recent-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.limbo-recent-list::-webkit-scrollbar {
    height: 3px;
}

.limbo-recent-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.limbo-recent-badge {
    padding: 4px 10px;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
}

.limbo-recent-badge.success {
    background-color: rgba(57, 255, 20, 0.15);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

.limbo-recent-badge.fail {
    background-color: rgba(255, 0, 127, 0.15);
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
}

/* Animations */
@keyframes limbo-win-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes limbo-shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

@keyframes rocket-thrust {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-4px) scale(0.98); }
}

/* ----------------------------------------------------
   PERSONAL LOG PANEL & PRISM ALERT OVERLAY
   ---------------------------------------------------- */
.personal-logs {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--bios-grey);
    padding-right: 2px;
    font-family: 'Share Tech Mono', monospace;
}

.personal-logs::-webkit-scrollbar {
    width: 3px;
}

.personal-logs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.personal-log-line {
    word-break: break-all;
    line-height: 1.35;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

/* Prism alert banner overlay */
.prism-alert-overlay {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none; /* Let clicks pass through */
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
}

.prism-alert-overlay.hidden {
    display: none !important;
}

.prism-alert-banner {
    background-color: rgba(6, 6, 20, 0.95);
    border: 4px double #bd00ff;
    padding: 15px 35px;
    text-align: center;
    box-shadow: 0 0 25px #bd00ff, inset 0 0 15px rgba(189, 0, 255, 0.5);
    animation: prism-border-flash 0.5s infinite alternate;
}

.prism-alert-banner h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    margin: 5px 0;
    text-shadow: 0 0 10px #bd00ff, 0 0 20px #ff007f;
    animation: prism-text-rainbow 1.5s infinite linear;
}

.prism-alert-banner p {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: #ffffff;
    margin: 6px 0 0 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.prism-stars {
    font-size: 1.1rem;
    color: #bd00ff;
    letter-spacing: 6px;
    animation: stars-blink 0.4s infinite alternate;
}

.drop-btn {
    background-color: #ff0055 !important;
    border: 1px solid #ff5588 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4) !important;
}

.drop-btn:hover {
    background-color: #ff3377 !important;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.6) !important;
}

@keyframes prism-border-flash {
    0% {
        border-color: #bd00ff;
        box-shadow: 0 0 15px #bd00ff;
    }
    100% {
        border-color: #00ffcc;
        box-shadow: 0 0 25px #00ffcc;
    }
}

@keyframes prism-text-rainbow {
    0% { color: #ff007f; }
    33% { color: #00ffcc; }
    66% { color: #ffff54; }
    100% { color: #ff007f; }
}

/* Origin Alert Overlay (태초 구슬) */
.origin-alert-overlay {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
}

.origin-alert-overlay.hidden {
    display: none !important;
}

.origin-alert-banner {
    background-color: rgba(6, 6, 20, 0.95);
    border: 4px double #00ffff;
    padding: 15px 35px;
    text-align: center;
    box-shadow: 0 0 35px #00ffff, inset 0 0 20px rgba(0, 255, 255, 0.5);
    animation: origin-border-flash 0.4s infinite alternate;
}

.origin-alert-banner h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    margin: 5px 0;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #ff00ff;
    animation: origin-text-flash 0.8s infinite alternate;
}

.origin-alert-banner p {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: #ffffff;
    margin: 6px 0 0 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.origin-stars {
    font-size: 1.1rem;
    color: #00ffff;
    letter-spacing: 6px;
    animation: stars-blink 0.3s infinite alternate;
}

/* Origin Dot (Specs Info overlay) */
.ball-info-overlay .origin-dot {
    color: #00ffff;
    text-shadow: 0 0 6px #00ffff;
    font-weight: bold;
}

@keyframes origin-border-flash {
    0% {
        border-color: #00ffff;
        box-shadow: 0 0 15px #00ffff;
    }
    100% {
        border-color: #ff00ff;
        box-shadow: 0 0 30px #ff00ff;
    }
}

@keyframes origin-text-flash {
    0% {
        color: #00ffff;
        text-shadow: 0 0 10px #00ffff, 0 0 20px #00ff00;
    }
    100% {
        color: #ff00ff;
        text-shadow: 0 0 15px #ff00ff, 0 0 25px #ffff00;
    }
}



/* ============================================
   MINES GAME STYLES
   ============================================ */

.mines-layout {
    display: flex;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    align-items: flex-start;
}

.mines-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 0 20px rgba(255, 60, 0, 0.1);
}

.mines-sidebar h3 {
    color: #ff5e00;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 94, 0, 0.4);
    padding-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 94, 0, 0.5);
}

.mines-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mines-form-group label {
    font-size: 0.78rem;
    color: var(--bios-grey);
    font-weight: bold;
}

.mines-input-wrapper input {
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--bios-yellow);
    padding: 8px 10px;
    font-size: 1rem;
    font-family: 'Share Tech Mono', monospace;
    outline: none;
    transition: border-color 0.2s;
}
.mines-input-wrapper input:focus {
    border-color: #ff5e00;
}

.mines-quick-row {
    display: flex;
    gap: 4px;
}

.mines-btn-sm {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--bios-white);
    padding: 5px 0;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.15s;
}
.mines-btn-sm:hover {
    background: rgba(255, 94, 0, 0.3);
    border-color: #ff5e00;
    color: #ff5e00;
}

/* Mine Count Slider */
.mines-mine-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mines-mine-selector input[type="range"] {
    flex: 1;
    accent-color: #ff5e00;
    height: 4px;
    cursor: pointer;
}
.mines-count-num {
    color: #ff5e00;
    font-size: 1rem;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.mines-mine-presets {
    display: flex;
    gap: 4px;
}
.mines-preset-btn {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--bios-grey);
    padding: 5px 0;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.15s;
}
.mines-preset-btn:hover,
.mines-preset-btn.active {
    background: rgba(255, 94, 0, 0.25);
    border-color: #ff5e00;
    color: #ff5e00;
}

/* Info Box */
.mines-info-box {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mines-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--bios-grey);
}
.mines-mult-val {
    color: #39ff14;
    font-weight: bold;
    font-size: 0.95rem;
}
.mines-mult-next {
    color: var(--neon-cyan);
    font-size: 0.85rem;
}
.mines-payout-val {
    color: var(--bios-yellow);
    font-size: 0.85rem;
}

/* Action Buttons */
.mines-start-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff5e00, #ff2200);
    border: none;
    color: #fff;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 94, 0, 0.35);
    letter-spacing: 1px;
}
.mines-start-btn:hover {
    box-shadow: 0 0 20px rgba(255, 94, 0, 0.6);
    transform: translateY(-1px);
}
.mines-start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.mines-cashout-btn {
    width: 100%;
    background: linear-gradient(135deg, #39ff14, #00cc44);
    border: none;
    color: #000;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(57, 255, 20, 0.4);
    animation: cashout-pulse 1.2s ease-in-out infinite;
    letter-spacing: 1px;
}
.mines-cashout-btn:hover {
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.7);
    transform: translateY(-1px);
}
.mines-cashout-btn.hidden {
    display: none !important;
}

@keyframes cashout-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(57, 255, 20, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(57, 255, 20, 0.8); }
}

/* Game Area */
.mines-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mines-grid-header {
    text-align: center;
    min-height: 28px;
}
.mines-state-label {
    font-size: 0.9rem;
    color: var(--bios-grey);
    letter-spacing: 1px;
}

/* 5x5 grid */
.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    aspect-ratio: 1;
    max-width: 550px;
    margin: 0 auto;
    width: 100%;
}

.mines-cell {
    aspect-ratio: 1;
    background: rgba(20, 20, 40, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.mines-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), transparent 70%);
    pointer-events: none;
}

.mines-cell:hover:not(.revealed):not(.disabled) {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(40, 40, 70, 0.95);
    transform: scale(1.04);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.mines-cell.gem {
    background: rgba(10, 40, 20, 0.9);
    border-color: #39ff14;
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
    cursor: default;
    animation: gem-reveal 0.3s ease-out;
}

.mines-cell.mine-hit {
    background: rgba(80, 0, 0, 0.95);
    border-color: #ff2200;
    box-shadow: 0 0 25px rgba(255, 34, 0, 0.6);
    cursor: default;
    animation: mine-explode 0.4s ease-out;
}

.mines-cell.mine-reveal {
    background: rgba(40, 0, 0, 0.8);
    border-color: rgba(255, 94, 0, 0.5);
    cursor: default;
}

.mines-cell.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes gem-reveal {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes mine-explode {
    0% { transform: scale(1); }
    25% { transform: scale(1.3) rotate(-5deg); }
    50% { transform: scale(0.9) rotate(5deg); }
    100% { transform: scale(1); }
}

/* Recent Results */
.mines-recent-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--bios-grey);
    flex-wrap: wrap;
    max-width: 550px;
    margin: 0 auto;
    width: 100%;
}
.mines-recent-results {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mines-result-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}
.mines-result-badge.win {
    background: rgba(57, 255, 20, 0.15);
    border: 1px solid #39ff14;
    color: #39ff14;
}
.mines-result-badge.loss {
    background: rgba(255, 34, 0, 0.15);
    border: 1px solid #ff2200;
    color: #ff2200;
}

/* Mobile */
@media (max-width: 840px) {
    .mines-layout {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .mines-sidebar {
        width: 100%;
        max-width: 500px;
    }
    .mines-grid {
        gap: 7px;
    }
    .mines-cell {
        font-size: 1.4rem;
    }
}

/* ============================================
   알까기 GAME STYLES (simple click version)
   ============================================ */
.text-yellow { color: var(--bios-yellow); }
.text-green  { color: #39ff14; }

.alkkagi-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.alkkagi-header {
    text-align: center;
    width: 100%;
}
.alkkagi-header h2 {
    color: #00aaff;
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(0,170,255,0.5);
}
.alkkagi-desc {
    font-size: 0.85rem;
    color: var(--bios-grey);
    line-height: 1.5;
}

/* Center area */
.alkkagi-click-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    width: 100%;
}

/* Marble wrapper */
.alkkagi-marble-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* The big clickable marble */
.alkkagi-marble-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #88ddff 0%, #00aaff 40%, #003388 100%);
    box-shadow: 0 0 40px rgba(0,170,255,0.5), 0 0 80px rgba(0,170,255,0.2), inset 0 -8px 20px rgba(0,0,100,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    transition: transform 0.08s, box-shadow 0.08s;
}
.alkkagi-marble-btn:hover {
    box-shadow: 0 0 55px rgba(0,170,255,0.7), 0 0 100px rgba(0,170,255,0.3);
    transform: scale(1.03);
}
.alkkagi-marble-btn:active {
    transform: scale(0.93);
    box-shadow: 0 0 25px rgba(0,170,255,0.4);
}
.alkkagi-marble-inner {
    font-size: 3rem;
    pointer-events: none;
}

/* Ripple effect */
@keyframes ripple-out {
    0%   { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}
.alkkagi-marble-btn.clicked .alkkagi-marble-ripple {
    animation: ripple-out 0.4s ease-out forwards;
}
.alkkagi-marble-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(0,200,255,0.6);
    pointer-events: none;
    opacity: 0;
}

/* Counter */
.alkkagi-click-counter {
    font-size: 2rem;
    font-weight: bold;
    color: #00aaff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0,170,255,0.5);
}

/* Progress bar */
.alkkagi-progress-wrap {
    width: 240px;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(0,170,255,0.25);
    border-radius: 5px;
    overflow: hidden;
}
.alkkagi-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #00aaff, #00ffcc);
    border-radius: 5px;
    transition: width 0.12s ease;
    box-shadow: 0 0 8px rgba(0,200,255,0.5);
}

/* Result box */
.alkkagi-result-box {
    text-align: center;
    animation: result-pop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.alkkagi-result-box.hidden { display: none; }
@keyframes result-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
#alkkagi-result-icon { font-size: 3rem; margin-bottom: 4px; }
.alkkagi-result-text {
    font-size: 2rem;
    font-weight: bold;
    color: #39ff14;
    text-shadow: 0 0 15px rgba(57,255,20,0.6);
}
.alkkagi-result-sub {
    font-size: 0.8rem;
    color: var(--bios-grey);
    margin-top: 4px;
    animation: text-blink 1s infinite;
}

/* Session total */
.alkkagi-total-box {
    font-size: 0.85rem;
    color: var(--bios-grey);
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 18px;
    border-radius: 3px;
}
.alkkagi-session-total {
    color: var(--bios-yellow);
    font-size: 1rem;
    font-weight: bold;
}


.alkkagi-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}

.alkkagi-header h2 {
    color: #00aaff;
    font-size: 1.1rem;
    margin-bottom: 6px;
    text-shadow: 0 0 8px rgba(0,170,255,0.5);
}

.alkkagi-desc {
    font-size: 0.85rem;
    color: var(--bios-grey);
    margin-bottom: 8px;
    line-height: 1.5;
}

.alkkagi-cooldown-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--bios-grey);
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 3px;
}

.alkkagi-cooldown-val {
    color: #39ff14;
    font-weight: bold;
}
.alkkagi-cooldown-val.waiting {
    color: #ff5e00;
}

.alkkagi-game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.alkkagi-canvas-wrap {
    position: relative;
    width: 480px;
    height: 480px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 170, 255, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0,170,255,0.15), inset 0 0 30px rgba(0,0,0,0.5);
    background: radial-gradient(circle at 40% 35%, #0a0a1a, #000510);
    overflow: hidden;
    cursor: crosshair;
}

#alkkagi-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Overlay */
.alkkagi-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: opacity 0.3s;
}
.alkkagi-overlay.hidden {
    display: none;
}
.alkkagi-overlay-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#alkkagi-overlay-icon {
    font-size: 3rem;
}
#alkkagi-overlay-title {
    font-size: 1.4rem;
    color: #00aaff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0,170,255,0.6);
}
#alkkagi-overlay-desc {
    font-size: 0.85rem;
    color: var(--bios-grey);
    max-width: 220px;
    line-height: 1.5;
}
.alkkagi-action-btn {
    margin-top: 8px;
    background: linear-gradient(135deg, #0066cc, #00aaff);
    border: none;
    color: #fff;
    padding: 12px 30px;
    font-size: 0.95rem;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,170,255,0.4);
    transition: all 0.2s;
    letter-spacing: 1px;
}
.alkkagi-action-btn:hover {
    box-shadow: 0 0 25px rgba(0,170,255,0.7);
    transform: translateY(-2px);
}
.alkkagi-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Side Info */
.alkkagi-side-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alkkagi-stat-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(0,170,255,0.25);
    padding: 12px 16px;
    text-align: center;
    border-radius: 4px;
}
.alkkagi-stat-label {
    font-size: 0.72rem;
    color: var(--bios-grey);
    margin-bottom: 4px;
}
.alkkagi-stat-val {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.alkkagi-how-to {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px;
    font-size: 0.78rem;
    color: var(--bios-grey);
    line-height: 1.8;
    border-radius: 4px;
}
.alkkagi-how-to h4 {
    color: #00aaff;
    margin-bottom: 6px;
    font-size: 0.82rem;
}
.alkkagi-how-to hr {
    border-color: rgba(255,255,255,0.1);
    margin: 6px 0;
}

/* Aim line canvas indicator */
.alkkagi-canvas-wrap.aiming {
    cursor: none;
}

@media (max-width: 840px) {
    .alkkagi-game-container {
        flex-direction: column;
        align-items: center;
    }
    .alkkagi-canvas-wrap {
        width: min(90vw, 400px);
        height: min(90vw, 400px);
    }
    .alkkagi-side-info {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .alkkagi-stat-box {
        flex: 1;
        min-width: 80px;
    }
    .alkkagi-how-to {
        width: 100%;
    }
}

/* Shop & Upgrade & My Layout */
.shop-layout, .my-layout {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
    color: #00ff00;
}
.shop-header {
    margin-bottom: 20px;
}
.shop-header h2 {
    color: #ff00ff;
    text-shadow: 2px 2px 0px #000;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-bottom: 30px;
}
.shop-item-card {
    background: #000;
    border: 2px solid #00ff00;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 4px 0 rgba(0, 255, 0, 0.2);
    position: relative;
}
.shop-item-card.disabled {
    border-color: #555;
    color: #888;
}
.shop-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.shop-item-icon {
    font-size: 2em;
    margin-right: 15px;
}
.shop-item-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
}
.shop-item-level {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #00ff00;
    color: #000;
    padding: 2px 6px;
    font-size: 0.8em;
    font-weight: bold;
}
.shop-item-desc {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
    flex-grow: 1;
}
.shop-item-stats {
    font-size: 0.9em;
    margin-bottom: 10px;
}
.shop-item-stats span {
    color: #00ffcc;
}
.shop-buy-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 10px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: 0.1s;
}
.shop-buy-btn:hover {
    background: #fff;
}
.shop-buy-btn:disabled {
    background: #555;
    color: #222;
    cursor: not-allowed;
}
.my-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.collect-card {
    background: #000;
    border: 2px solid #00ffcc;
    padding: 20px;
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0, 255, 204, 0.2);
}
.pending-income {
    font-size: 3em;
    color: #ffd700;
    margin: 15px 0;
    text-shadow: 2px 2px 0 #ff5e00;
}
.income-rate {
    font-size: 1.2em;
    margin-bottom: 20px;
}
.collect-btn {
    background: #ffd700;
    color: #000;
    border: 2px solid #ff5e00;
    padding: 15px 30px;
    font-size: 1.5em;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0 #ff5e00;
}
.collect-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #ff5e00;
}
.collect-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}
.inventory-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.inventory-list li {
    background: #111;
    border: 1px dashed #555;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}
.inventory-list .empty-msg {
    justify-content: center;
    color: #666;
}

/* Dungeon UI */
.dungeon-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #fff;
    padding: 20px;
    gap: 20px;
}
.dungeon-header h2 {
    color: #ff3333;
    text-shadow: 2px 2px 0px #000;
}
.dps-display {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 10px;
}
.dungeon-monster-area {
    background: #111;
    border: 3px solid #ff3333;
    border-radius: 10px;
    position: relative;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.monster-container {
    text-align: center;
    position: relative;
    z-index: 10;
}
.monster-sprite {
    font-size: 8em;
    animation: idle-bounce 2s infinite ease-in-out;
    filter: drop-shadow(0 0 10px #ff0000);
}
.monster-sprite.hit {
    animation: hit-shake 0.2s;
    filter: drop-shadow(0 0 20px #ffffff);
}
.monster-hp-bar {
    width: 200px;
    height: 20px;
    background: #333;
    border: 2px solid #555;
    margin-top: 10px;
    position: relative;
}
.monster-hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff5555);
}
.monster-hp-text {
    position: absolute;
    top: 0; left: 0; right: 0;
    text-align: center;
    font-size: 0.8em;
    line-height: 20px;
    font-weight: bold;
}
@keyframes idle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes hit-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

/* Damage Numbers */
#damage-numbers-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 20;
}
.damage-number {
    position: absolute;
    color: #ffcc00;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    animation: float-up 1s ease-out forwards;
}
@keyframes float-up {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    20% { transform: translateY(-20px) scale(1.5); opacity: 1; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

.dungeon-bottom-area {
    display: flex;
    gap: 20px;
    flex: 1;
}
.merc-panel, .forge-panel {
    background: #1a1a1a;
    border: 2px solid #444;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.merc-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.merc-item {
    background: #222;
    padding: 10px;
    border: 1px solid #555;
    display: flex;
    justify-content: space-between;
}
.equip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    overflow-y: auto;
    max-height: 200px;
    margin-bottom: 15px;
}
.equip-item {
    background: #222;
    border: 2px solid #555;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.1s;
    user-select: none;
}
.equip-item:hover, .equip-item.selected {
    border-color: #00ffcc;
    background: #333;
}
.equip-stars {
    color: #ffd700;
    font-size: 0.9em;
}

.enhance-area {
    border-top: 2px dashed #555;
    padding-top: 15px;
}
.stars-display {
    color: #ffd700;
    font-size: 1.2em;
    letter-spacing: 2px;
    margin: 10px 0;
}
.enhance-stats {
    color: #00ffcc;
    margin-bottom: 5px;
}
.enhance-probs {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 10px;
}
.btn-enhance {
    background: linear-gradient(180deg, #ff9900, #cc5500);
    color: #fff;
    border: none;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}
.btn-enhance:hover {
    background: linear-gradient(180deg, #ffaa33, #e66600);
}

.potential-area {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #555;
}
.potential-area h5 {
    color: #99ff99;
    margin-bottom: 5px;
}
.potential-lines {
    background: #000;
    border: 1px solid #333;
    padding: 5px;
    margin-bottom: 10px;
}
.pot-line {
    font-size: 0.85em;
    padding: 2px 5px;
}
.pot-line.attack {
    color: #ff3333;
    font-weight: bold;
}
.pot-line.charm {
    color: #888;
}
.btn-reroll {
    background: #333;
    color: #99ff99;
    border: 1px solid #99ff99;
    padding: 5px 10px;
    width: 100%;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-reroll:hover {
    background: #99ff99;
    color: #000;
}

/* ============================================= */
/* NAV GROUP LABELS */
/* ============================================= */
.nav-group-label {
    font-size: 0.65em;
    color: #666;
    padding: 10px 8px 2px 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Share Tech Mono', monospace;
    border-top: 1px solid #2a2a2a;
    margin-top: 4px;
}
.nav-group-label:first-child { border-top: none; margin-top: 0; }

/* ============================================= */
/* LOBBY GRID LAYOUT */
/* ============================================= */
.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    height: 100%;
    box-sizing: border-box;
}
.lobby-left, .lobby-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.lobby-panel {
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
}
.lobby-panel h3 {
    color: #00ff88;
    margin: 0 0 8px 0;
    font-size: 0.85em;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
}
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 3px 2px;
    font-size: 0.82em;
    border-bottom: 1px solid #1a1a1a;
}
.leaderboard-list li.me { color: #00ffcc; font-weight: bold; }
.leaderboard-list .rank { color: #666; margin-right: 4px; }

/* ============================================= */
/* MEMO BOARD */
/* ============================================= */
.memo-desc {
    font-size: 0.72em;
    color: #777;
    margin: 0 0 8px 0;
}
.memo-board-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.memo-post-card {
    background: #0d0d0d;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px;
    position: relative;
}
.memo-post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.memo-poster { color: #00aaff; font-weight: bold; font-size: 0.82em; }
.memo-fee { color: #ffd700; font-size: 0.78em; }
.memo-post-text { color: #eee; font-size: 0.85em; margin: 4px 0; word-break: break-all; }
.memo-post-time { color: #555; font-size: 0.7em; }
.memo-post-img { max-width: 100%; max-height: 120px; border-radius: 4px; display: block; margin: 4px 0; }
.memo-empty { color: #555; font-size: 0.8em; text-align: center; padding: 12px 0; }
.memo-post-form { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #333; padding-top: 8px; }
.memo-post-form input[type="text"],
.memo-post-form input[type="number"] {
    background: #0a0a0a;
    border: 1px solid #444;
    color: #eee;
    padding: 5px 8px;
    font-size: 0.82em;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}
.memo-form-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.memo-form-btns input[type="number"] { flex: 1; min-width: 100px; }
.memo-img-preview { margin-top: 4px; }
.btn-secondary {
    background: #222;
    color: #aaa;
    border: 1px solid #555;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8em;
    border-radius: 3px;
    white-space: nowrap;
}
.btn-secondary:hover { background: #333; color: #fff; }

/* ============================================= */
/* CHAT PANEL in LOBBY */
/* ============================================= */
.chat-panel .chat-logs {
    height: 160px;
    overflow-y: auto;
}

/* ============================================= */
/* PINBALL without sidebar */
/* ============================================= */
.pinball-layout-full {
    display: flex;
    gap: 10px;
    padding: 10px;
}
.pinball-layout-full .game-view-wrapper {
    flex: 1;
}
.pinball-log-only {
    width: 200px;
    flex-shrink: 0;
}

/* ============================================= */
/* SHOP SECTION TITLE */
/* ============================================= */
.shop-section-title {
    color: #00ff88;
    font-size: 0.9em;
    font-weight: bold;
    padding: 6px 4px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .lobby-grid { grid-template-columns: 1fr; }
}

/* ============================================= */
/* CRASH (GRAPH) GAME LAYOUT */
/* ============================================= */
.crash-layout {
    display: flex;
    gap: 15px;
    padding: 15px;
    height: 100%;
    box-sizing: border-box;
}
.crash-sidebar-panel {
    width: 260px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}
.crash-sidebar-panel h3 {
    margin: 0;
    font-size: 1.0em;
    color: #ff007f;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}
.crash-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.crash-form-group label {
    font-size: 0.75em;
    color: #888;
}
.crash-input-wrapper input {
    background: #000;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    font-size: 1.0em;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Share Tech Mono', monospace;
}
.bet-korean-guide {
    font-size: 0.72em;
    color: #00ffcc;
    margin-top: 2px;
    font-family: 'Share Tech Mono', monospace;
}
.crash-quick-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 4px;
}
.crash-quick-presets button {
    background: #222;
    border: 1px solid #444;
    color: #aaa;
    font-size: 0.72em;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 2px;
}
.crash-quick-presets button:hover {
    background: #333;
    color: #fff;
}
.crash-action-btn {
    background: linear-gradient(180deg, #ff007f, #b30059);
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 12px;
    cursor: pointer;
    font-size: 1.0em;
    border-radius: 4px;
    transition: background 0.2s;
}
.crash-action-btn:hover {
    background: linear-gradient(180deg, #ff3399, #e60073);
}
.crash-action-btn.cashout {
    background: linear-gradient(180deg, #39ff14, #1b8a07);
    color: #000;
}
.crash-action-btn.cashout:hover {
    background: linear-gradient(180deg, #66ff4d, #25c00b);
}
.crash-info-box {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crash-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
}
.crash-info-val {
    font-weight: bold;
}
.crash-recent-bar {
    font-size: 0.75em;
    color: #888;
}
.crash-recent-results {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    max-height: 50px;
    overflow-y: auto;
}
.crash-badge {
    padding: 2px 5px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 2px;
    color: #000;
}
.crash-badge.win {
    background: #39ff14;
}
.crash-badge.fail {
    background: #ff007f;
}

.crash-visual-area {
    flex: 1;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.crash-status-msg {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.8em;
    color: #888;
    font-family: 'Press Start 2P', cursive;
}
.crash-display-container {
    margin-top: 20px;
    margin-bottom: 10px;
}
.crash-multiplier {
    font-size: 3.5em;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.crash-multiplier.success {
    color: #39ff14;
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.8);
}
.crash-multiplier.fail {
    color: #ff007f;
    text-shadow: 0 0 15px rgba(255, 0, 127, 0.8);
}
.crash-canvas-container {
    width: 100%;
    background: #000;
    border: 1px solid #222;
    border-radius: 4px;
    overflow: hidden;
}
#crash-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Pinball bet presets */
.pinball-bet-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.pinball-bet-preset {
    background: #222;
    border: 1px solid #444;
    color: #aaa;
    font-size: 0.8em;
    padding: 5px 0;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}
.pinball-bet-preset:hover {
    background: #333;
    color: #fff;
}
.pinball-bet-preset.active {
    background: #ff007f;
    color: #fff;
    border-color: #ff007f;
}

/* ============================================= */
/* THREE-SECOND GAME LAYOUT */
/* ============================================= */
.three-sec-layout {
    display: flex;
    gap: 15px;
    padding: 15px;
    height: 100%;
    box-sizing: border-box;
}
.three-sec-sidebar {
    width: 260px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}
.three-sec-sidebar h3 {
    margin: 0;
    font-size: 1.0em;
    color: #ffd700;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}
.three-sec-desc {
    font-size: 0.75em;
    color: #aaa;
    line-height: 1.4;
}
.three-sec-info-box {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.three-sec-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
}
.three-sec-val {
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
}
.three-sec-action-btn {
    background: linear-gradient(180deg, #ffd700, #b39200);
    border: none;
    color: #000;
    font-weight: bold;
    padding: 12px;
    cursor: pointer;
    font-size: 1.0em;
    border-radius: 4px;
    transition: background 0.2s;
}
.three-sec-action-btn:hover {
    background: linear-gradient(180deg, #ffe54d, #cc9e00);
}
.three-sec-action-btn.active {
    background: linear-gradient(180deg, #ff3333, #cc0000);
    color: #fff;
}
.three-sec-feedback {
    background: #1e1e1e;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85em;
    font-family: 'Share Tech Mono', monospace;
}
.three-sec-feedback.success {
    border-color: #39ff14;
    color: #39ff14;
}
.three-sec-feedback.fail {
    border-color: #ff3333;
    color: #ff3333;
}

.three-sec-visual-area {
    flex: 1;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 250px;
}
.three-sec-status-msg {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.8em;
    color: #888;
    font-family: 'Press Start 2P', cursive;
}
.three-sec-timer-container {
    background: #000;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 30px 60px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}
.three-sec-timer {
    font-size: 4.5em;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* ============================================= */
/* GLOBAL CASINO STATS BANNER */
/* ============================================= */
.casino-stats-banner {
    background: #0a0a0a;
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}
.casino-stats-title {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}
.casino-stats-content {
    font-size: 0.85em;
    display: flex;
    gap: 15px;
    align-items: center;
}
.casino-stats-content span {
    color: #aaa;
}
.casino-stats-content .divider {
    color: #444;
}
.casino-stats-content strong {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.05em;
}
.stat-won {
    color: #39ff14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
}
.stat-lost {
    color: #ff007f;
    text-shadow: 0 0 6px rgba(255, 0, 127, 0.3);
}

/* ============================================= */
/* FORGE AUTO CONTROLS */
/* ============================================= */
.auto-enhance-controls, .auto-reroll-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
    align-items: center;
}
.auto-enhance-controls input, .auto-reroll-controls input {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    font-size: 0.85em;
    padding: 6px;
    width: 100px;
    border-radius: 3px;
    text-align: center;
}
.btn-auto-action {
    flex: 1;
    background: linear-gradient(180deg, #00ffcc, #00a385);
    border: none;
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}
.btn-auto-action:hover {
    background: linear-gradient(180deg, #33ffdd, #00c49f);
}
.btn-auto-action.active {
    background: linear-gradient(180deg, #ff3333, #b30000);
    color: #fff;
}

/* ============================================= */
/* PINBALL ACTION ROW & AUTODROP */
/* ============================================= */
.pinball-action-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 5px;
}
.pinball-action-row .ball-btn {
    flex: 1;
    margin-top: 0 !important; /* override default margin */
}
.autodrop-btn {
    background: #222;
    border: 1px solid #444;
    color: #aaa;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}
.autodrop-btn:hover {
    background: #333;
    color: #fff;
}
.autodrop-btn.active {
    background: linear-gradient(180deg, #ff007f, #b30059) !important;
    border-color: #ff007f !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

/* ============================================= */
/* BET DISPLAY BOX (replaces number input) */
/* ============================================= */
.bet-display-box {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px 14px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
    transition: color 0.2s, text-shadow 0.2s;
}

/* ============================================= */
/* TOWER SYSTEM LAYOUT & COMPONENTS */
/* ============================================= */
.tower-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    height: calc(100vh - 140px);
    min-height: 600px;
    box-sizing: border-box;
    padding-bottom: 10px;
}

.tower-combat-panel,
.tower-forge-panel {
    background: rgba(18, 18, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tower-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.tower-stats-row {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tower-stat-item {
    font-size: 1rem;
    font-weight: 600;
}

.tower-monster-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 200px;
}

.monster-floor-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.4);
    color: #ff8888;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    font-weight: bold;
}

.tower-monster-sprite {
    font-size: 5rem;
    margin-bottom: 20px;
    user-select: none;
    transition: transform 0.1s ease-in-out;
}

.tower-monster-sprite.hit {
    transform: scale(0.85) rotate(-5deg);
}

.tower-monster-hp-bar {
    width: 80%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.tower-monster-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    transition: width 0.15s ease-out;
}

.tower-monster-hp-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    line-height: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    font-family: 'Share Tech Mono', monospace;
}

#tower-damage-layer {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-damage {
    position: absolute;
    color: #ff3333;
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.2rem;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9), 0 0 4px rgba(255, 0, 0, 0.8);
    animation: damage-float-fade 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes damage-float-fade {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    30% {
        transform: translate(-50%, -80%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -130%) scale(0.9);
        opacity: 0;
    }
}

.tower-combat-log-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.tower-combat-log {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    height: 180px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: #aaa;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry {
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 3px solid transparent;
}

.log-entry.system {
    border-left-color: #00ffcc;
    color: #00ffcc;
}

.log-entry.damage {
    border-left-color: #ff5555;
    color: #ff8888;
}

.log-entry.reward {
    border-left-color: #ffff55;
    color: #ffff99;
}

/* Forge & Potential Panels */
.forge-card,
.potential-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weapon-info-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.weapon-preview-img {
    font-size: 2.5rem;
}

.weapon-details h4 {
    margin: 0 0 4px 0;
}

.enhance-action-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 204, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.rate-badge {
    font-size: 0.85rem;
    color: #aaa;
}

.btn-enhance-new,
.btn-reroll-new {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    transition: transform 0.1s, opacity 0.2s;
}

.btn-enhance-new:hover,
.btn-reroll-new:hover {
    opacity: 0.9;
}

.btn-enhance-new:active,
.btn-reroll-new:active {
    transform: scale(0.96);
}

.auto-enhance-new-box,
.auto-reroll-new-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auto-enhance-new-box label,
.auto-reroll-new-box label {
    font-size: 0.85rem;
    color: #bbb;
}

.auto-input-row {
    display: flex;
    gap: 10px;
}

.auto-input-row input {
    flex-grow: 1;
    background: #000;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
}

.btn-auto-new {
    background: #222;
    border: 1px solid #555;
    color: #fff;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-auto-new.active {
    background: #ff5555;
    border-color: #ff3333;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 85, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0); }
}

.potential-lines-new {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    min-height: 150px;
    justify-content: center;
}

.pot-line-new {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #00ffcc;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.3);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
}

.pot-line-new.charm {
    color: #ff85ff;
    text-shadow: 0 0 5px rgba(255, 133, 255, 0.3);
}

.potential-summary-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-radius: 6px;
}

.potential-action-row {
    display: flex;
}

.potential-action-row button {
    width: 100%;
}

/* ============================================= */
/* 3D MULTIPLAYER LOBBY SYSTEM */
/* ============================================= */
.lobby-3d-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    gap: 12px;
    box-sizing: border-box;
    padding-bottom: 10px;
}

.lobby-3d-header {
    background: rgba(18, 18, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lobby-3d-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.canvas-3d-wrapper {
    position: relative;
    flex-grow: 1;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 255, 204, 0.05);
}

.canvas-3d-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.nametag-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.nametag {
    position: absolute;
    transform: translate(-50%, -100%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #00ffcc;
    border-radius: 4px;
    color: #00ffcc;
    padding: 4px 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
    white-space: nowrap;
    transition: transform 0.1s ease-out;
}

.nametag.other-player {
    border-color: #ff9900;
    color: #ff9900;
    text-shadow: 0 0 5px rgba(255, 153, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.2);
}





