:root {
    --bg-dark: #090d14;
    --card-bg: #101622;
    --border: #1e293b;
    --accent-cyan: #00f0ff;
    --accent-gold: #ffd700;
    --accent-red: #ff2a5f;
    --accent-green: #00ff88;
    --text-muted: #8b9bb4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: var(--bg-dark);
    color: #fff;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    gap: 16px;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-gold);
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 1px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.menu-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #cad5e2;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.menu-btn:hover {
    background: #192333;
    color: #fff;
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #141b27;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}

.avatar-view {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1c2738;
    border: 2px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-snippet .info {
    overflow: hidden;
}
.user-snippet .u-name {
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-snippet .u-coins {
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 700;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    height: 64px;
    border-bottom: 1px solid var(--border);
    background: #0d121c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.balance-card {
    background: #141c2a;
    border: 1px solid #25334c;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.btn {
    border: none;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.btn:hover { opacity: 0.95; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent-cyan);
    color: #000;
    padding: 10px 20px;
}
.btn-bonus {
    background: linear-gradient(135deg, #ffd700, #ff8800);
    color: #000;
    padding: 8px 16px;
}
.btn-cashout {
    background: var(--accent-green);
    color: #000;
    padding: 10px 20px;
}
.btn-danger {
    background: var(--accent-red);
    color: #fff;
    padding: 10px 20px;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 24px;
}

.controls-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-top: 20px;
}

.input-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.input-box label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}
.input-box input, .input-box select, .input-box textarea {
    background: #141c2b;
    border: 1px solid #233147;
    color: #fff;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.canvas-wrapper {
    background: #0b0f17;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
#crashCanvas {
    width: 100%;
    height: 380px;
    display: block;
}

.mines-arena {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
}
.mine-tile {
    aspect-ratio: 1;
    background: #151d2a;
    border: 1px solid #233147;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.dice-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}
.dice-cube {
    width: 100px;
    height: 100px;
    background: #141b27;
    border: 3px solid var(--accent-cyan);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    font-weight: 900;
    color: #fff;
}
.dice-options {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}
.dice-btn {
    flex: 1;
    background: #141c2b;
    border: 1px solid #233147;
    color: #cad5e2;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}
.dice-btn.active {
    background: #1d2b3e;
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.roulette-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}
.roulette-slot {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    font-weight: 900;
    border: 4px solid #fff;
}
.roulette-slot.red { background: #e6194b; }
.roulette-slot.black { background: #191e24; }
.roulette-slot.green { background: #3cb44b; }
.roulette-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}
.r-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 800;
    color: #fff;
}
.r-btn.red { background: #e6194b; }
.r-btn.black { background: #191e24; }
.r-btn.green { background: #3cb44b; }
.r-btn.active { border-color: #fff; transform: scale(1.05); }

.cards-arena {
    background: #0d141e;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 320px;
}
.hand-container {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}
.playing-card {
    width: 64px;
    height: 94px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    user-select: none;
    cursor: pointer;
}
.playing-card.red { color: #d00; }
.playing-card.black { color: #111; }
.playing-card.back {
    background: repeating-linear-gradient(45deg, #182333, #182333 8px, #0e1520 8px, #0e1520 16px);
    border: 2px solid #2c3c54;
}

.chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 24px;
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-bubble {
    display: flex;
    gap: 12px;
    background: #141c2a;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #1f2a3a;
}
.chat-input-row {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #0d121c;
    border-top: 1px solid var(--border);
}

.leaderboard-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.leaderboard-table th, .leaderboard-table td, .admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.rank-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 800;
    background: #1e293b;
}
.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #000; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-content, .admin-modal-content {
    background: #121824;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    width: 420px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.admin-modal-content {
    width: 780px;
    max-width: 95vw;
}

.secret-corner-trigger {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 25px;
    height: 25px;
    z-index: 9999;
    cursor: default;
}

.btn-admin-action {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.btn-admin-give { background: var(--accent-gold); color: #000; }
.btn-admin-ban { background: var(--accent-red); color: #fff; }
.btn-admin-unban { background: var(--accent-green); color: #000; }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.shop-card {
    background: #141b27;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.shop-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
}
.shop-card-icon {
    font-size: 38px;
    width: 64px;
    height: 64px;
    background: #0e141f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #233147;
}
.shop-card-title {
    font-weight: 800;
    font-size: 15px;
}
.shop-card-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-gold);
}

.avatar-view.frame-neon {
    border-color: #00f0ff !important;
    box-shadow: 0 0 16px #00f0ff, inset 0 0 10px #00f0ff !important;
}
.avatar-view.frame-purple {
    border-color: #d946ef !important;
    box-shadow: 0 0 16px #d946ef, inset 0 0 10px #d946ef !important;
}
.avatar-view.frame-fire {
    border-color: #ff5500 !important;
    box-shadow: 0 0 18px #ff3300, 0 0 30px rgba(255, 68, 0, 0.5) !important;
    animation: firePulse 1.8s infinite alternate ease-in-out;
}
@keyframes firePulse {
    0% { border-color: #ff3300; box-shadow: 0 0 14px #ff3300; }
    100% { border-color: #ffaa00; box-shadow: 0 0 24px #ff7700; }
}
.avatar-view.frame-gold {
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px #ffd700, 0 0 35px rgba(255, 215, 0, 0.6) !important;
}
.text-gold-gradient {
    background: linear-gradient(90deg, #ffd700, #ff8800, #fff275);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900 !important;
}
.user-title-badge {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    margin-right: 6px;
    text-transform: uppercase;
}

.mine-tile {
    perspective: 600px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    user-select: none;
}
.mine-tile:hover:not(.revealed) {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    border-color: var(--accent-cyan);
}
.mine-tile.gem {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.35) 0%, #111a28 85%) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6) !important;
    animation: gemPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mine-tile.bomb {
    background: radial-gradient(circle, rgba(255, 42, 95, 0.4) 0%, #1a1017 85%) !important;
    border-color: #ff2a5f !important;
    box-shadow: 0 0 25px rgba(255, 42, 95, 0.8) !important;
    animation: bombShake 0.4s ease-in-out;
}
@keyframes gemPop {
    0% { transform: scale(0.6) rotateY(90deg); }
    100% { transform: scale(1) rotateY(0deg); }
}
@keyframes bombShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px) rotate(-3deg); }
    40%, 80% { transform: translateX(6px) rotate(3deg); }
}

.dice-cube {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.2), border-color 0.3s;
}
.dice-rolling {
    animation: diceRollAnim 0.5s infinite linear;
}
@keyframes diceRollAnim {
    0% { transform: rotate(0deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(0.9); }
}

.playing-card {
    animation: cardAppear 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.playing-card:hover {
    transform: translateY(-6px);
}
@keyframes cardAppear {
    0% { opacity: 0; transform: translateY(-20px) scale(0.85); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.roulette-slot.spinning {
    animation: rouletteSpin 0.6s infinite ease-in-out;
}
@keyframes rouletteSpin {
    0% { transform: scale(0.95); opacity: 0.6; }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 15px gold); }
    100% { transform: scale(0.95); opacity: 0.6; }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-x: hidden;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 8px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background: rgba(14, 18, 26, 0.95);
        backdrop-filter: blur(10px);
    }
    .logo { display: none; }
    .menu {
        flex-direction: row;
        gap: 6px;
        flex: 1;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .menu::-webkit-scrollbar { display: none; }
    .menu-btn {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 8px;
    }
    .user-snippet { padding: 6px; }
    .user-snippet .info { display: none; }
    .main-content {
        padding-bottom: 80px;
        height: auto;
        overflow-y: visible;
    }
    .game-card { margin: 12px; padding: 16px; }
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .btn { width: 100%; }
    .exchange-grid { grid-template-columns: 1fr; }
}:root {
    --bg-main: #0a0d14;
    --bg-card: #121722;
    --bg-sidebar: #0e121a;
    --accent-cyan: #00f0ff;
    --accent-gold: #ffd700;
    --accent-green: #00ff88;
    --accent-red: #ff2a5f;
    --border: #1f2738;
    --text-muted: #7888a2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    color: #fff;
    min-height: 100vh;
    display: flex;
}

/* Сайдбар */
.sidebar {
    width: 270px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 20px;
}

.logo {
    font-size: 21px;
    font-weight: 900;
    color: var(--accent-cyan);
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    padding-left: 8px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.menu-btn {
    background: #141b27;
    border: 1px solid #222d42;
    color: var(--text-muted);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 0 #0c111a;
    transition: all 0.1s ease;
}

.menu-btn:hover {
    background: #1c2638;
    color: #fff;
    border-color: #334466;
}

.menu-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #0c111a;
}

.menu-btn.active {
    background: linear-gradient(90deg, #182336, #121927);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25), 0 4px 0 #0a111a;
}

/* Аватар */
.avatar-view {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1c2536;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.avatar-view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-snippet {
    background: #131924;
    padding: 12px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    box-shadow: 0 4px 0 #090d14;
    transition: 0.1s ease;
}

.user-snippet:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #090d14;
}

.user-snippet .info {
    flex: 1;
    overflow: hidden;
}

.user-snippet .u-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-snippet .u-coins {
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 700;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 36px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
}

.balance-card {
    background: #151c29;
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-weight: 800;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.tab-pane {
    display: none;
    padding: 32px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

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

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.controls-row {
    display: flex;
    gap: 16px;
    padding: 22px 26px;
    background: #0f131c;
    align-items: flex-end;
}

.input-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

input, select {
    background: #18202d;
    border: 1px solid #273347;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Кнопки */
.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.1s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn:active {
    transform: translateY(3px) !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #00f0ff, #0072ff);
    color: #040914;
    box-shadow: 0 5px 0 #004fb3, 0 8px 20px rgba(0, 240, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 5px 0 #004fb3, 0 10px 25px rgba(0, 240, 255, 0.6);
}
.btn-primary:active:not(:disabled) {
    box-shadow: 0 2px 0 #004fb3;
}

.btn-cashout {
    background: linear-gradient(135deg, #00ff88, #00b359);
    color: #040914;
    box-shadow: 0 5px 0 #008040, 0 8px 20px rgba(0, 255, 136, 0.35);
}
.btn-cashout:hover:not(:disabled) {
    box-shadow: 0 5px 0 #008040, 0 10px 25px rgba(0, 255, 136, 0.6);
}
.btn-cashout:active:not(:disabled) {
    box-shadow: 0 2px 0 #008040;
}

.btn-bonus {
    background: linear-gradient(135deg, var(--accent-gold), #ff8800);
    color: #050811;
    font-weight: 800;
    padding: 10px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    border: none;
    box-shadow: 0 4px 0 #b35900, 0 5px 15px rgba(255, 215, 0, 0.3);
    transition: 0.1s ease;
}
.btn-bonus:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b35900;
}
.btn-bonus.disabled {
    background: #252e3d !important;
    color: #6d7b92 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ff2a5f, #b3002d);
    color: #fff;
    box-shadow: 0 5px 0 #800020;
}
.btn-danger:active {
    box-shadow: 0 2px 0 #800020;
}

/* Crash */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
    background: radial-gradient(circle at bottom left, #162032 0%, #0b0e14 70%);
}

/* Mines */
.mines-arena {
    display: grid;
    grid-template-columns: repeat(5, 75px);
    grid-gap: 12px;
    justify-content: center;
    padding: 30px;
    background: radial-gradient(circle, #182233 0%, #0d121a 100%);
}

.mine-tile {
    width: 75px;
    height: 75px;
    background: #1c2536;
    border-radius: 14px;
    border: 1px solid #2d3b52;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 0 #101622;
    transition: all 0.1s ease;
}

.mine-tile:hover:not(.revealed) {
    background: #27344c;
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 0 #101622, 0 0 12px rgba(0, 240, 255, 0.3);
}

.mine-tile:active:not(.revealed) {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #101622;
}

.mine-tile.gem {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
    cursor: default;
}

.mine-tile.bomb {
    background: rgba(255, 42, 95, 0.3);
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 42, 95, 0.6);
    cursor: default;
}

/* Dice */
.dice-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 24px;
}

.dice-cube {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #1f293d, #141b27);
    border: 2px solid var(--accent-cyan);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 54px;
    font-weight: 900;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.35);
}

.dice-options {
    display: flex;
    gap: 12px;
}

.dice-btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #171f2d;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 0 #0c111a;
    transition: 0.1s ease;
}

.dice-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0c111a;
}

.dice-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), 0 4px 0 #0c111a;
}

/* Roulette */
.roulette-display {
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: #0d111a;
}

.roulette-slot {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 42px;
    font-weight: 900;
    border: 4px solid #fff;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.roulette-slot.red { background: var(--accent-red); box-shadow: 0 0 30px rgba(255, 42, 95, 0.5); }
.roulette-slot.black { background: #1a1e28; border-color: #55627a; }
.roulette-slot.green { background: var(--accent-green); box-shadow: 0 0 30px rgba(0, 255, 136, 0.5); }

.roulette-buttons {
    display: flex;
    gap: 16px;
}

.r-btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 800;
    border: 2px solid transparent;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 5px 0 rgba(0,0,0,0.5);
    transition: 0.1s ease;
}

.r-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

.r-btn.red { background: #d31e4b; }
.r-btn.green { background: #00aa55; }
.r-btn.black { background: #262c3b; }
.r-btn.active { border-color: #fff; box-shadow: 0 0 20px rgba(255,255,255,0.4), 0 5px 0 rgba(0,0,0,0.5); }

/* Лидерборд */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    padding: 14px 20px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #161e2b;
    font-size: 15px;
    font-weight: 600;
}

.leader-row:hover {
    background: #172030;
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 13px;
}
.rank-1 { background: #ffd700; color: #000; box-shadow: 0 0 10px #ffd700; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #000; }

/* Модалки */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 440px;
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7);
}

/* СЕКРЕТНАЯ ЗОНА В ПРАВОМ НИЖНЕМ УГЛУ */
.secret-corner-trigger {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 70px;
    height: 70px;
    z-index: 9999;
    cursor: pointer;
    background: transparent;
}

/* Админка */
.admin-modal-content {
    background: #0d121c;
    width: 860px;
    max-width: 95vw;
    border-radius: 18px;
    border: 1px solid var(--accent-red);
    box-shadow: 0 0 40px rgba(255, 42, 95, 0.4);
    padding: 26px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th {
    padding: 10px;
    background: #141b26;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #192130;
    font-size: 13px;
}

.btn-admin-action {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.btn-admin-ban { background: #ff2a5f; color: #fff; }
.btn-admin-unban { background: #00ff88; color: #000; }
.btn-admin-give { background: #ffd700; color: #000; }

/* КАРТОЧНЫЙ СТИЛЬ (21 И ДУРАК) */
.cards-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: radial-gradient(circle, #0e2a1b 0%, #06110a 100%);
    border-radius: 16px;
    border: 2px solid #1a4d2e;
}

.hand-container {
    display: flex;
    gap: 12px;
    min-height: 100px;
    align-items: center;
}

.playing-card {
    width: 65px;
    height: 95px;
    background: #ffffff;
    border-radius: 8px;
    color: #111;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: 0.15s;
    user-select: none;
}

.playing-card:hover {
    transform: translateY(-8px);
}

.playing-card.red { color: #d32f2f; }
.playing-card.black { color: #111111; }

.playing-card.back {
    background: repeating-linear-gradient(45deg, #1f293d, #1f293d 5px, #161e2d 5px, #161e2d 10px);
    border: 2px solid #fff;
}

/* ОБЩИЙ ЧАТ */
.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-bubble {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #141b27;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #1f2a3d;
}

.chat-input-row {
    padding: 16px;
    background: #0d121c;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

/* БИРЖА */
.exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.coin-card {
    background: #141b27;
    border: 1px solid #25334c;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.coin-ticker {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent-cyan);
}

.coin-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
}

/* ===================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (СМАРТФОНЫ И ПЛАНШЕТЫ)
   =================================================== */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-x: hidden;
    }

    /* Сайдбар превращается в нижний навбар */
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 8px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background: rgba(14, 18, 26, 0.95);
        backdrop-filter: blur(10px);
    }

    .logo {
        display: none; /* Прячем логотип в мобильном меню для экономии места */
    }

    .menu {
        flex-direction: row;
        gap: 6px;
        flex: 1;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }

    .menu::-webkit-scrollbar {
        display: none; /* скрываем скроллбар меню на тач-экранах */
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 8px;
        box-shadow: none;
    }

    .user-snippet {
        padding: 6px;
        border-radius: 10px;
    }

    .user-snippet .info {
        display: none; /* Оставляем только круглый аватар */
    }

    /* Главный блок с контентом */
    .main-content {
        padding-bottom: 80px; /* Отступ снизу, чтобы нижнее меню не перекрывало контент */
        height: auto;
        overflow-y: visible;
    }

    .top-bar {
        padding: 12px 16px;
        font-size: 14px;
    }

    .tab-pane {
        padding: 16px 12px;
    }

    /* Растягиваем элементы игр на 100% ширины */
    .game-card {
        border-radius: 14px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .btn {
        width: 100%;
        padding: 12px;
    }

    /* Мобильная адаптация биржи */
    .exchange-grid {
        grid-template-columns: 1fr; /* Одна колонка на узком экране */
    }

    .coin-chart-wrapper {
        height: 80px;
    }

    /* Карточный стол 21 и Дурака */
    .cards-arena {
        padding: 16px 8px;
    }

    .hand-container {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .playing-card {
        width: 52px;
        height: 76px;
        font-size: 16px;
    }

    /* Модальные окна во весь экран */
    .modal-content, .admin-modal-content {
        width: 95vw;
        padding: 20px;
        max-height: 90vh;
    }
}

/* --- СТИЛИ МАГАЗИНА БАТИ --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.shop-card {
    background: #141b27;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.shop-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
}

.shop-card-icon {
    font-size: 38px;
    width: 64px;
    height: 64px;
    background: #0e141f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #233147;
}

.shop-card-title {
    font-weight: 800;
    font-size: 15px;
}

.shop-card-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-gold);
}

/* --- РАМКИ АВАТАРОВ --- */
.avatar-view.frame-neon {
    border-color: #00f0ff !important;
    box-shadow: 0 0 16px #00f0ff, inset 0 0 10px #00f0ff !important;
}

.avatar-view.frame-purple {
    border-color: #d946ef !important;
    box-shadow: 0 0 16px #d946ef, inset 0 0 10px #d946ef !important;
}

.avatar-view.frame-fire {
    border-color: #ff5500 !important;
    box-shadow: 0 0 18px #ff3300, 0 0 30px rgba(255, 68, 0, 0.5) !important;
    animation: firePulse 1.8s infinite alternate ease-in-out;
}

@keyframes firePulse {
    0% { border-color: #ff3300; box-shadow: 0 0 14px #ff3300; }
    100% { border-color: #ffaa00; box-shadow: 0 0 24px #ff7700; }
}

.avatar-view.frame-gold {
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px #ffd700, 0 0 35px rgba(255, 215, 0, 0.6) !important;
}

/* Золотой градиент никнейма */
.text-gold-gradient {
    background: linear-gradient(90deg, #ffd700, #ff8800, #fff275);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900 !important;
}

/* Титулы бейджики */
.user-title-badge {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    margin-right: 6px;
    text-transform: uppercase;
}

/* --- КРАСИВЫЕ ВИЗУАЛЫ И 3D АНИМАЦИИ --- */

/* Анимация переворота мин */
.mine-tile {
    perspective: 600px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    user-select: none;
}
.mine-tile:hover:not(.revealed) {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    border-color: var(--accent-cyan);
}
.mine-tile.gem {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.35) 0%, #111a28 85%) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6) !important;
    animation: gemPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mine-tile.bomb {
    background: radial-gradient(circle, rgba(255, 42, 95, 0.4) 0%, #1a1017 85%) !important;
    border-color: #ff2a5f !important;
    box-shadow: 0 0 25px rgba(255, 42, 95, 0.8) !important;
    animation: bombShake 0.4s ease-in-out;
}

@keyframes gemPop {
    0% { transform: scale(0.6) rotateY(90deg); }
    100% { transform: scale(1) rotateY(0deg); }
}
@keyframes bombShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px) rotate(-3deg); }
    40%, 80% { transform: translateX(6px) rotate(3deg); }
}

/* 3D кубик Dice */
.dice-cube {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.2), border-color 0.3s;
}
.dice-rolling {
    animation: diceRollAnim 0.5s infinite linear;
}
@keyframes diceRollAnim {
    0% { transform: rotate(0deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(0.9); }
}

/* Анимация раздачи карт */
.playing-card {
    animation: cardAppear 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.playing-card:hover {
    transform: translateY(-6px);
}
@keyframes cardAppear {
    0% { opacity: 0; transform: translateY(-20px) scale(0.85); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Вращение рулетки */
.roulette-slot.spinning {
    animation: rouletteSpin 0.6s infinite ease-in-out;
}
@keyframes rouletteSpin {
    0% { transform: scale(0.95); opacity: 0.6; }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 15px gold); }
    100% { transform: scale(0.95); opacity: 0.6; }
}
