* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #0a0a0a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 100px;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
}

/* Header */
.header {
    text-align: center;
    padding: 8px 0 12px;
}

.text-logo {
    margin-bottom: 10px;
    line-height: 1.1;
}

.logo-top {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffd700 0%, #c9a84c 40%, #8b6914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.logo-bottom {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #c0392b;
    text-shadow: 0 0 10px rgba(192, 57, 43, 0.4), 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.balance-bar {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #c9a84c;
    border-radius: 12px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.balance-icon {
    font-size: 24px;
}

.balance-amount {
    color: #ffd700;
    font-variant-numeric: tabular-nums;
}

.balance-label {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

/* Roulette */
.roulette-section {
    text-align: center;
    margin: 16px 0;
}

.wheel-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
}

.wheel {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 5px solid #c9a84c;
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.3), 0 0 60px rgba(201, 168, 76, 0.1);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid #ffd700;
    z-index: 10;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

.wheel.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.result-display {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    margin: 0 8px;
    border: 2px solid #c9a84c;
}

.result-number.red { background: #c0392b; }
.result-number.black { background: #1a1a1a; }
.result-number.green { background: #0d6b32; }

.result-win {
    color: #2ecc71;
    font-size: 16px;
}

.result-lose {
    color: #e74c3c;
    font-size: 16px;
}

/* Bet Section */
.bet-section {
    margin: 12px 0;
}

.bet-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bet-input-label {
    color: #999;
    font-size: 15px;
    white-space: nowrap;
}

.bet-input {
    flex: 1;
    background: #1a1a2e;
    border: 1px solid #555;
    color: #ffd700;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
}

.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bet-input:focus {
    border-color: #c9a84c;
}

.bet-input::placeholder {
    color: #555;
    font-weight: 400;
}

.bet-max-btn {
    background: linear-gradient(135deg, #c9a84c, #8b6914);
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 1px;
}

.current-bet {
    text-align: center;
    font-size: 16px;
    color: #ccc;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.current-bet span {
    color: #ffd700;
    font-weight: 700;
}

.clear-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 6px;
    opacity: 0.7;
}

/* Board */
.board-section {
    margin: 12px 0;
}

.bet-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.bet-btn {
    flex: 1;
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
}

.bet-btn:active {
    transform: scale(0.95);
}

.bet-btn.selected {
    border-color: #ffd700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.red-btn {
    background: linear-gradient(135deg, #c0392b, #922b21);
    color: #fff;
    border-color: #e74c3c;
}

.black-btn {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    color: #fff;
    border-color: #444;
}

.green-btn {
    background: linear-gradient(135deg, #0d6b32, #0a5028);
    color: #fff;
    border-color: #27ae60;
    max-width: 70px;
}

.outline-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    border: 1px solid #444;
}

.outline-btn:active {
    background: rgba(201, 168, 76, 0.15);
}

.dozen-btn {
    background: rgba(201, 168, 76, 0.1);
    color: #c9a84c;
    border: 1px solid #c9a84c44;
}

/* Number Grid */
.number-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.num-btn {
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    color: #fff;
    transition: all 0.15s;
    text-align: center;
}

.num-btn:active {
    transform: scale(0.9);
}

.num-btn.selected {
    border-color: #ffd700 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.num-btn.red { background: #c0392b; }
.num-btn.black { background: #222; border-color: #444; }
.num-btn.green { background: #0d6b32; grid-column: span 6; max-width: 100%; }

/* Active Bets */
.active-bets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    min-height: 20px;
}

.active-bet-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid #c9a84c;
    color: #ffd700;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.active-bet-chip .remove-bet {
    cursor: pointer;
    color: #e74c3c;
    margin-left: 4px;
    font-size: 16px;
}

/* Spin Button */
.spin-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #c9a84c, #8b6914);
    color: #000;
    border: none;
    border-radius: 14px;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
    margin: 12px 0;
}

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

.spin-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.spin-btn.win-pulse {
    animation: winPulse 0.5s ease 3;
}

@keyframes winPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3); }
    50% { box-shadow: 0 4px 40px rgba(46, 204, 113, 0.7); }
}

/* History */
.history-section {
    margin-top: 16px;
}

.history-title {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.history-num {
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.history-num.red { background: #c0392b; }
.history-num.black { background: #222; }
.history-num.green { background: #0d6b32; }

/* Admin */
.admin-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid #c9a84c44;
    color: #c9a84c;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
}

.admin-panel {
    margin-top: 12px;
}

.admin-section {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.admin-title {
    color: #c9a84c;
    font-size: 16px;
    margin-bottom: 10px;
}

.admin-input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    margin-bottom: 8px;
}

.admin-input:focus { border-color: #c9a84c; }
.admin-input::placeholder { color: #555; }

.admin-btns {
    display: flex;
    gap: 8px;
}

.btn-admin {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-admin.green { background: #27ae60; color: #fff; }
.btn-admin.red { background: #c0392b; color: #fff; }
.btn-admin.gold { background: linear-gradient(135deg, #c9a84c, #8b6914); color: #000; }

.admin-msg {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

.admin-msg.ok { color: #2ecc71; }
.admin-msg.err { color: #e74c3c; }

.user-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.user-card:active { background: #222; }

.user-card .name {
    font-weight: 700;
    font-size: 14px;
}

.user-card .uid {
    color: #666;
    font-size: 12px;
}

.user-card .ubal {
    color: #ffd700;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 10px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #c9a84c;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    z-index: 1000;
    font-size: 15px;
    font-weight: 600;
    animation: toastIn 0.3s ease;
    text-align: center;
    max-width: 90%;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

/* Win overlay */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.win-overlay .win-amount {
    font-size: 48px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.win-overlay .win-label {
    font-size: 20px;
    color: #2ecc71;
    margin-bottom: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-screen img {
    width: 200px;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.loading-text {
    color: #c9a84c;
    margin-top: 16px;
    font-size: 16px;
    letter-spacing: 2px;
}
