﻿/* ==================== */
/* Emerald Dice Luxury UI */
/* ==================== */

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(140deg, #0b1622, #142538);
    color: #e0ffe0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}
/* -------------------- */
/* Terminal Wrapper */
.emerald-terminal {
    min-height: 100vh;
    display: grid;
    padding: 20px 20px 30px 20px;
}
/* Header */
.terminal-header {
    text-align: center;
    font-size: 16px;
    padding: 18px 12px 10px;
    margin-bottom: 10px;
    letter-spacing: 1.2px;
    font-weight: 600;
    color: #00ffb3;
    text-shadow: 0 0 8px #00ffb3, 0 0 16px #00ffa0;
    border-bottom: 1px solid rgba(0,255,180,0.2);
}

/* -------------------- */
/* Main Grid Layout */
.terminal-grid {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    min-height: calc(100vh - 70px);
    overflow: visible;
    padding: 20px 10px;
    gap: 15px;
}
.game-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    align-items: start;
}

/* -------------------- */
/* Player Cards */
.players-zone {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 10px;
}

.player-card {
    background: rgba(0, 255, 128, 0.05);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(0, 255, 128, 0.25);
    box-shadow: 0 4px 20px rgba(0, 255, 128, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
}

    .player-card:hover {
        transform: translateY(-3px) scale(1.02);
    }

    .player-card h3 {
        margin: 0;
        color: #00ffb3;
        font-weight: 600;
    }

.tokens span {
    font-size: 18px;
    color: #00ffb3;
    margin: 0 2px;
}

/* -------------------- */
/* Center: Pot & Button */
/* Center zone */
.center-zone {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px; /* increased spacing */
}
.center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}
/* Center pot fixed inside center zone */
.center-pot {
    padding: 20px 30px;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,255,200,0.2);
    position: relative;
    transform: none;
    top: auto;
    z-index: auto;
}

    .center-pot h2 {
        margin: 6px 0;
        font-size: 28px;
        color: #00ffb3;
        text-shadow: 0 0 6px #00ffb3;
    }

    .center-pot .diamond {
        font-size: 40px;
        color: #00ffb3;
        text-shadow: 0 0 8px #00ffb3, 0 0 16px #00ffa0;
        margin: 6px 0;
    }

.center-pot-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px; /* space between pot and buttons */
}
.center-buttons-zone {
    display: flex;
    justify-content: center;
    gap: 20px; /* space between Roll/Pass and Reset */
    width: 100%;
    max-width: 260px;
}

/* Roll Button */
button {
    padding: 12px 28px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #00e5ff, #00ffc6);
    color: #0b1622;
    box-shadow: 0 6px 16px rgba(0, 255, 128, 0.25);
    transition: all 0.2s ease;
}

    button:hover {
        transform: translateY(-2px) scale(1.05);
    }

/* Reset Button */
.reset-button {
    background: linear-gradient(135deg, #ff00d4, #ff8cf3);
    color: #0b1622;
}

/* -------------------- */
/* Activity Log */
/* Shared log + wallet + xp zone */
.log-zone {
    width: 100%;
    max-width: 320px;
    height: 442px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 10px;
    padding: 10px;
    background: #111;
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    box-sizing: border-box;
}

    /* Titles */
    .log-zone h3 {
        color: #00ffb3;
        text-align: center;
        margin: 0 0 6px 0;
    }

/* Cards */
.wallet-card,
.xp-card,
.activity-log {
    background: #181818;
    border: 1px solid #2d2d2d;
    border-radius: 10px;
    padding: 10px;
}

/* Wallet */
.tokens {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

/* XP card */
.xp-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: #2a2a2a;
}

/* XP stats row */
.xp-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
    margin-top: 8px;
}

    .xp-stats div {
        background: #121212;
        border-radius: 6px;
        padding: 6px;
        text-align: center;
    }

    .xp-stats span {
        font-size: 10px;
        opacity: .7;
    }

    .xp-stats strong {
        display: block;
        font-size: 14px;
    }

/* Progress bar */
.xp-bar-wrap {
    width: 100%;
    height: 10px;
    background: #0d0d0d;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,#34d399,#10b981);
    transition: width .35s ease;
}

/* XP footer */
.xp-meta {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

/* Activity log */
.activity-log {
    overflow-y: auto;
    min-height: 0;
}

/* Keep newest entries on bottom */
.log {
    display: flex;
    flex-direction: column-reverse;
}

    /* log entries */
    .log p {
        margin: 2px 0;
        font-size: 13px;
    }

/* wager zone unchanged */
.wager-zone {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

/* NAV BA */

.emerald-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #021b14;
    border-bottom: 1px solid #00ff9c;
}

.emerald-brand {
    font-size: 20px;
    color: #00ff9c;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 2px;
}

.emerald-toggle {
    background: none;
    border: 1px solid #00ff9c;
    color: #00ff9c;
    padding: 5px 10px;
    cursor: pointer;
}

.emerald-nav-menu {
    display: flex;
    flex-direction: column;
    background: #031f18;
    padding: 10px;
}

.emerald-link {
    color: #00ff9c;
    padding: 10px;
    text-decoration: none;
    font-size: 16px;
}

    .emerald-link:hover {
        background: #06382b;
    }

.nav-collapsed {
    display: none;
}

.nav-open {
    display: flex;
}
.emerald-link:hover {
    background: #06382b;
    box-shadow: 0 0 8px #00ff9c;
}
//-------wallet--------------
.wallet-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    background: linear-gradient(180deg, #08110d 0%, #0f1b15 100%);
    box-sizing: border-box;
    overflow-x: hidden;
}

.wallet-card {
    width: 100%;
    max-width: 820px;
    background: rgba(16, 28, 22, 0.96);
    border: 1px solid rgba(90, 255, 170, 0.18);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    color: #e7fff2;
    box-sizing: border-box;
    overflow: hidden;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

    .wallet-header h2 {
        margin: 0;
        font-size: 1.7rem;
        line-height: 1.1;
    }

.wallet-subtitle {
    margin: 6px 0 0;
    color: #93b8a4;
    font-size: 0.95rem;
}

.wallet-mode-label,
.wallet-badge {
    background: rgba(80, 255, 170, 0.12);
    color: #72ffbc;
    border: 1px solid rgba(80, 255, 170, 0.25);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.wallet-balance-panel {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(34, 76, 55, 0.95), rgba(16, 35, 26, 0.95));
    border: 1px solid rgba(102, 255, 178, 0.14);
    box-sizing: border-box;
}

.wallet-label {
    font-size: 0.95rem;
    color: #9fd7b5;
    margin-bottom: 6px;
}

.wallet-balance {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #7dffbf;
}

.wallet-balance-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 18px;
    flex-wrap: wrap;
}

    .wallet-balance-line strong {
        font-size: 28px;
        font-weight: 800;
        word-break: break-word;
    }

.wallet-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.wallet-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(122, 255, 191, 0.08);
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
    box-sizing: border-box;
}

    .wallet-info-box span {
        display: block;
        font-size: 0.82rem;
        color: #89ab98;
        margin-bottom: 6px;
    }

    .wallet-info-box strong {
        display: block;
        font-size: 1rem;
        color: #f0fff7;
        word-break: break-word;
    }

.wallet-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wallet-btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    min-height: 44px;
}

    .wallet-btn:hover {
        transform: translateY(-1px);
    }

    .wallet-btn.primary {
        background: #63ffb2;
        color: #062513;
    }

    .wallet-btn.secondary {
        background: #173427;
        color: #d8ffea;
        border: 1px solid rgba(99, 255, 178, 0.18);
    }

    .wallet-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none;
    }

/* Mobile */
@media (max-width: 768px) {
    .wallet-shell {
        padding: 8px;
    }

    .wallet-card {
        padding: 12px;
        border-radius: 16px;
    }

    .wallet-header {
        margin-bottom: 14px;
    }

        .wallet-header h2 {
            font-size: 1.4rem;
        }

    .wallet-subtitle {
        font-size: 0.88rem;
    }

    .wallet-balance-panel {
        padding: 14px;
    }

    .wallet-balance {
        font-size: 1.7rem;
    }

    .wallet-balance-line {
        font-size: 16px;
    }

        .wallet-balance-line strong {
            font-size: 24px;
        }

    .wallet-user-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wallet-info-box {
        padding: 12px;
    }

    .wallet-actions {
        flex-direction: column;
    }

    .wallet-btn {
        width: 100%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .wallet-shell {
        padding: 6px;
    }

    .wallet-card {
        padding: 10px;
    }

    .wallet-header h2 {
        font-size: 1.25rem;
    }

    .wallet-balance {
        font-size: 1.5rem;
    }

    .wallet-balance-line {
        flex-direction: column;
        align-items: flex-start;
    }

        .wallet-balance-line strong {
            font-size: 22px;
        }
}

.buy-tokens-container {
    display: flex;
    justify-content: center; /* horizontal center */
    align-items: center; /* vertical center if height allows */
    flex-wrap: wrap; /* allow wrapping on small screens */
    gap: 30px;
    margin-top: 60px;
}
.center-card {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.page-center {
    width: 100%;
    max-width: 900px;
    text-align: center;
}
.page-shifted {
    width: 100%;
    text-align: center;
    padding-top: 60px;
    transform: translateX(360px);
    padding-top: 240px;
}
.buy-page-shifted {
    width: 100%;
    text-align: center;
    padding-top: 60px;
    transform: translateX(240px);
    padding-top: 240px;
}
/* Admin Page */
.admin-shell {
    width: 100%;
    min-height: 100vh;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(180deg, #08110d 0%, #0f1b15 100%);
    overflow-x: hidden;
}

.admin-card {
    width: 100%;
    max-width: 1280px;
    background: rgba(16, 28, 22, 0.96);
    border: 1px solid rgba(90, 255, 170, 0.18);
    border-radius: 20px;
    padding: 14px;
    box-sizing: border-box;
    color: #e7fff2;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.admin-header {
    margin-bottom: 14px;
}

    .admin-header h2 {
        margin: 0;
        font-size: 1.7rem;
        line-height: 1.1;
    }

.admin-subtitle {
    margin: 6px 0 0;
    color: #93b8a4;
    font-size: 0.95rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.admin-left,
.admin-right {
    min-width: 0;
}

.admin-master-box {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(34, 76, 55, 0.95), rgba(16, 35, 26, 0.95));
    border: 1px solid rgba(102, 255, 178, 0.14);
}

    .admin-master-box h4 {
        margin: 0 0 12px 0;
    }

.admin-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.admin-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(122, 255, 191, 0.08);
    border-radius: 16px;
    padding: 12px;
    min-width: 0;
}

    .admin-info-box span {
        display: block;
        font-size: 0.82rem;
        color: #89ab98;
        margin-bottom: 6px;
    }

    .admin-info-box strong {
        display: block;
        font-size: 1rem;
        color: #f0fff7;
        word-break: break-word;
    }

.admin-users-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-users-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

    .admin-users-topbar h4 {
        margin: 0;
    }

.admin-user-count {
    color: #93b8a4;
    font-size: 0.9rem;
}

.admin-search-wrap {
    margin-bottom: 12px;
}

.admin-search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(122, 255, 191, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f0fff7;
    box-sizing: border-box;
    outline: none;
    font-size: 0.95rem;
}

    .admin-search-input::placeholder {
        color: #89ab98;
    }

    .admin-search-input:focus {
        border-color: rgba(99, 255, 178, 0.35);
        box-shadow: 0 0 0 2px rgba(99, 255, 178, 0.08);
    }

.admin-users-scroll {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.admin-user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(122, 255, 191, 0.08);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
}

.admin-user-main {
    margin-bottom: 10px;
    min-width: 0;
}

.admin-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f0fff7;
    word-break: break-word;
}

.admin-user-email {
    margin-top: 4px;
    font-size: 0.9rem;
    color: #93b8a4;
    word-break: break-word;
}

.admin-user-stats {
    margin-bottom: 10px;
}

.admin-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(80, 255, 170, 0.08);
    border: 1px solid rgba(80, 255, 170, 0.18);
    color: #dfffee;
    font-size: 0.9rem;
}

.admin-user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-btn {
    border: 0;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    min-height: 44px;
}

    .admin-btn:hover {
        transform: translateY(-1px);
    }

    .admin-btn.bonus {
        background: #63ffb2;
        color: #062513;
    }

    .admin-btn.danger {
        background: #3a1717;
        color: #ffd9d9;
        border: 1px solid rgba(255, 120, 120, 0.22);
    }

.admin-loading,
.admin-empty-state {
    color: #93b8a4;
    padding: 12px 0;
}

@media (max-width: 980px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-users-scroll {
        max-height: 56vh;
    }
}

@media (max-width: 768px) {
    .admin-shell {
        padding: 8px;
    }

    .admin-card {
        padding: 12px;
        border-radius: 16px;
    }

    .admin-header h2 {
        font-size: 1.4rem;
    }

    .admin-subtitle {
        font-size: 0.88rem;
    }

    .admin-user-actions {
        flex-direction: column;
    }

    .admin-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .admin-shell {
        padding: 8px;
    }

    .admin-card {
        padding: 12px;
        border-radius: 16px;
    }

    .admin-header h2 {
        font-size: 1.4rem;
    }

    .admin-subtitle {
        font-size: 0.88rem;
    }

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

    .admin-users-scroll {
        max-height: 56vh;
    }

    .admin-user-actions {
        flex-direction: column;
    }

    .admin-btn {
        width: 100%;
    }
}
/* Mobile */
@media (max-width: 768px) {
    .admin-shell {
        padding: 10px;
    }

    .admin-card {
        padding: 12px;
        border-radius: 14px;
    }

    .admin-header h2 {
        font-size: 20px;
    }

    .admin-subtitle {
        font-size: 13px;
    }

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

    .admin-users-scroll {
        max-height: 58vh;
    }

    .admin-user-card {
        padding: 10px;
    }

    .admin-btn {
        width: 100%;
    }
}
/* ==================== */
/* Responsive tweaks */
@media screen and (max-width: 900px) {
    .terminal-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .players-zone,
    .center-zone,
    .log-zone {
        width: 100%;
        max-width: 100%;
    }

    .log-zone {
        height: auto;
        min-height: 360px;
    }

    .activity-log {
        max-height: 260px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .center-pot {
        margin: 20px 0;
    }

    .page-shifted,
    .buy-page-shifted {
        transform: none;
        padding-top: 40px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .center-card,
    .page-center {
        max-width: 100%;
    }
}