/* ============ CSS Variables - Roman Theme ============ */
:root {
    /* Backgrounds */
    --bg-marble: #f5f2ed;
    --bg-marble-dark: #ebe6dd;
    --bg-panel: rgba(255, 255, 255, 0.55);
    --bg-panel-hover: rgba(255, 255, 255, 0.7);

    /* Text */
    --text-primary: #1E1A14;
    --text-secondary: #5A4E41;

    /* Accents */
    --gold: #D8B15A;
    --gold-light: #E8C97A;
    --gold-dark: #B8943A;
    --roman-red: #B33A2B;
    --roman-red-light: #C94A3B;
    --roman-red-dark: #8E2C2C;

    /* Status */
    --success: #2E7D4F;
    --error: #8E2C2C;
    --warning: #C9A227;

    /* Borders & Shadows */
    --border-gold: rgba(120, 90, 40, 0.18);
    --border-gold-strong: rgba(120, 90, 40, 0.35);
    --shadow-warm: 0 12px 40px rgba(30, 20, 10, 0.18);
    --shadow-warm-light: 0 4px 16px rgba(30, 20, 10, 0.1);

    /* Fonts */
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============ Reset & Base ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;

    /* Roman cityscape background */
    background-color: var(--bg-marble);
    background-image: url('bg-roman.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

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

/* ============ Glass Panel Base Style ============ */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-warm);
}

/* ============ Header ============ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-warm);
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

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

.network-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.network-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
}

.network-badge.connected .dot {
    background: var(--success);
}

.connect-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--roman-red), var(--roman-red-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(179, 58, 43, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.connect-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--roman-red-light), var(--roman-red));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(179, 58, 43, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.connect-btn:disabled {
    opacity: 0.8;
    cursor: default;
}

.how-it-works-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-gold-strong);
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.how-it-works-btn:hover {
    color: var(--text-primary);
    border-color: var(--gold);
    background: rgba(216, 177, 90, 0.1);
}

/* ============ Stats Bar ============ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-warm);
    margin-bottom: 32px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ Main Content ============ */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 24px;
}

/* ============ Side Panels ============ */
.side-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-warm);
    padding: 20px;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ============ Roman Divider ============ */
.roman-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold-strong) 20%, var(--border-gold-strong) 80%, transparent);
    position: relative;
    margin: 16px 0;
}

.roman-divider::after {
    content: '•';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-marble);
    padding: 0 8px;
    color: var(--gold);
    font-size: 10px;
}

/* ============ Account Panel ============ */
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-gold);
}

.balance-row:last-child {
    border-bottom: none;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.balance-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

/* Deposit button - Wax seal style (Roman Red) */
.btn-primary {
    background: linear-gradient(135deg, var(--roman-red), var(--roman-red-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(179, 58, 43, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(179, 58, 43, 0.5);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--roman-red-light), var(--roman-red));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(179, 58, 43, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Withdraw button - Gold outline */
.btn-secondary {
    background: transparent;
    color: var(--gold-dark);
    border: 2px solid var(--gold);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(216, 177, 90, 0.15);
    border-color: var(--gold-dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-claim {
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--success), #1d5c38);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 125, 79, 0.3);
}

/* ============ Game Panel ============ */
.game-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-warm);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Coin - 3D with thickness */
.coin-container {
    margin: 20px 0 30px;
    perspective: 1000px;
}

.coin {
    width: 180px;
    height: 180px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.coin-face {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    overflow: hidden;
}

.coin-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.coin-face.front {
    transform: translateZ(5px);
    box-shadow: 0 0 20px rgba(216, 177, 90, 0.4);
}

.coin-face.back {
    transform: translateZ(-5px) rotateY(180deg);
    box-shadow: 0 0 20px rgba(216, 177, 90, 0.4);
}

.coin-edge {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(90deg, #d4920f, #ffa814, #d4920f);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
}

/* Stack the edges to create thickness */
.coin-edge:nth-child(2) { transform: translateZ(-4px); }
.coin-edge:nth-child(3) { transform: translateZ(-3px); }
.coin-edge:nth-child(4) { transform: translateZ(-2px); }
.coin-edge:nth-child(5) { transform: translateZ(-1px); }
.coin-edge:nth-child(6) { transform: translateZ(0px); }
.coin-edge:nth-child(7) { transform: translateZ(1px); }
.coin-edge:nth-child(8) { transform: translateZ(2px); }
.coin-edge:nth-child(9) { transform: translateZ(3px); }

.coin.flipping {
    animation: flip3d 1s linear infinite;
}

/* Result states - stop on correct face */
.coin.result-heads {
    transform: rotateY(0deg);
}

.coin.result-tails {
    transform: rotateY(180deg);
}

.coin.result-heads .coin-face,
.coin.result-tails .coin-face {
    color: rgba(0, 0, 0, 0.6);
}

@keyframes flip3d {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Choice Buttons */
.choice-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.choice-btn {
    width: 140px;
    height: 120px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--border-gold-strong);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn:hover:not(:disabled) {
    border-color: var(--gold);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-warm-light);
}

.choice-btn.selected {
    border-color: var(--gold);
    background: rgba(216, 177, 90, 0.2);
    box-shadow: 0 0 0 3px rgba(216, 177, 90, 0.3);
}

.choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.choice-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.choice-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Icon styles for feeds and history */
.feed-icon,
.history-icon,
.confirm-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.confirm-icon {
    width: 28px;
    height: 28px;
    margin-right: 4px;
}

/* Ladder Progress - Centered and larger */
.ladder-section {
    width: 100%;
    margin-top: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border-gold);
    position: relative;
}

.ladder-section::before {
    content: '•';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    padding: 0 8px;
    color: var(--gold);
    font-size: 10px;
}

.ladder-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.ladder-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin: 0 auto;
}

.ladder-step {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--border-gold-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.ladder-step.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold-dark);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(216, 177, 90, 0.4);
}

.ladder-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Pending Bet Display */
.pending-bet {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(216, 177, 90, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.pending-text {
    font-size: 18px;
    color: var(--text-secondary);
}

.refund-btn {
    display: none;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--warning), #a88820);
    color: white;
}

/* Result Display - Simple layout */
.result-display {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.result-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
}

.result-icon {
    font-size: 28px;
}

.result-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}

.result-text.win {
    color: var(--success);
}

.result-text.lose {
    color: var(--error);
}

.result-amount {
    font-size: 20px;
    font-weight: 600;
}

.result-amount.win {
    color: var(--success);
}

.result-amount.lose {
    color: var(--error);
}

.play-again-btn {
    padding: 12px 32px;
    font-size: 15px;
}

/* Bet Info */
.bet-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 24px;
}

.bet-info-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-gold);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.bet-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.bet-info-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ Recent Bets / Leaderboard Panel ============ */
.tab-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: white;
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(216, 177, 90, 0.1);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
}

.history-choice {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-step {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-result {
    font-weight: 600;
    font-size: 14px;
}

.history-result.win {
    color: var(--success);
}

.history-result.lose {
    color: var(--error);
}

.empty-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
}

/* Live Feed specific */
.live-feed-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.feed-player {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 12px;
}

.feed-choice {
    font-size: 14px;
}

/* ============ Recovery Mode Indicator ============ */
.recovery-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid var(--warning);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--gold-dark);
}

/* ============ Modals ============ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 26, 20, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-marble);
    border: 1px solid var(--border-gold-strong);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-warm);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.modal-input-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-input-wrapper {
    display: flex;
    gap: 8px;
}

.modal-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-gold-strong);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(216, 177, 90, 0.2);
}

.max-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-gold-strong);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.max-btn:hover {
    background: rgba(216, 177, 90, 0.2);
    border-color: var(--gold);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Approval status */
.approval-status {
    display: none;
    padding: 12px;
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid var(--warning);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--gold-dark);
}

/* Confirm bet modal */
.confirm-bet-details {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.confirm-row:not(:last-child) {
    border-bottom: 1px solid var(--border-gold);
}

.confirm-label {
    color: var(--text-secondary);
}

.confirm-value {
    font-weight: 600;
    color: var(--text-primary);
}

.wallet-pull-warning {
    display: none;
    padding: 12px;
    background: rgba(216, 177, 90, 0.15);
    border: 1px solid var(--gold);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

/* Transaction Modal */
.tx-modal-content {
    text-align: center;
    padding: 32px;
}

.tx-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(216, 177, 90, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.tx-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tx-message {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.tx-link {
    display: none;
    color: var(--gold-dark);
    text-decoration: none;
}

.tx-link:hover {
    text-decoration: underline;
    color: var(--gold);
}

/* How It Works Modal */
.how-it-works-content {
    max-width: 480px;
}

.how-it-works-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-gold);
    position: relative;
}

.how-it-works-section:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
}

.how-it-works-section h4 {
    font-family: var(--font-display);
    color: var(--gold-dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.how-it-works-section p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--bg-marble);
    border: 1px solid var(--border-gold-strong);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
    box-shadow: var(--shadow-warm);
    color: var(--text-primary);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.toast.success .toast-icon {
    background: var(--success);
}

.toast.error .toast-icon {
    background: var(--error);
}

.toast.info {
    border-left: 4px solid var(--gold);
}

.toast.info .toast-icon {
    background: var(--gold);
}

/* ============ Footer ============ */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer a {
    color: var(--gold-dark);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: var(--gold);
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .side-panel {
        order: 2;
    }

    .game-panel {
        order: 1;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        margin-bottom: 16px;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 16px;
    }

    /* Make game panel and side panels match stats bar width */
    .game-panel,
    .side-panel {
        margin: 0;
    }

    /* Keep choice buttons horizontal */
    .choice-buttons {
        flex-direction: row;
        gap: 12px;
    }

    .choice-btn {
        width: 120px;
        height: 100px;
    }

    .choice-icon {
        width: 40px;
        height: 40px;
    }

    .choice-label {
        font-size: 14px;
    }

    .bet-info {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .bet-info-item {
        padding: 12px;
    }

    .bet-info-value {
        font-size: 16px;
    }

    .coin {
        width: 140px;
        height: 140px;
    }

    .coin-face {
        width: 140px;
        height: 140px;
        font-size: 56px;
    }

    .coin-edge {
        width: 140px;
        height: 140px;
    }

    /* Ladder: 2 rows on mobile */
    .ladder-steps {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        max-width: 280px;
    }

    .ladder-step {
        width: 100%;
        height: 36px;
        font-size: 13px;
    }

    .game-panel {
        padding: 20px 16px;
    }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-gold-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}
