/* ==========================================================================
   FORTUNE GEMS 2 - Pixel-Perfect Temple Edition Styles
   ========================================================================== */

:root {
    --bg-dark: #070709;
    --bg-surface: #111116;
    --bg-card: rgba(20, 20, 26, 0.85);
    
    --primary-gold: #d4af37;
    --primary-gold-bright: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    
    --glass-border: rgba(212, 175, 55, 0.25);
    
    --font-heading: 'Teko', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-primary);
}

.game-body.fortune-gems-theme {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at center, #3a2510 0%, #100803 100%);
}

.hidden {
    display: none !important;
}

.text-gold {
    color: var(--primary-gold-bright);
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: radial-gradient(circle at center, #181822 0%, var(--bg-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-logo-text {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-gold-bright);
    letter-spacing: 2px;
}

.progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-wrap {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
    padding: 2px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--primary-gold-bright));
    border-radius: 4px;
    transition: width 0.2s ease-out;
}

.progress-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary-gold-bright);
}

.loading-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Main UI Wrapper --- */
.game-ui {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* --- Header --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-small {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--primary-gold-bright);
    text-decoration: none;
}

.mode-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary-gold-bright);
    border: 1px solid var(--glass-border);
}

.balance-box {
    text-align: right;
}

.balance-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.balance-value {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--primary-gold-bright);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

/* --- Viewport & Layout --- */
.game-viewport {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a120b 0%, #070402 90%);
}

.game-title-banner {
    text-align: center;
    margin-bottom: 2px;
}

.title-main {
    font-family: var(--font-heading);
    font-size: 24px;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Fortune Wheel Top Arc */
.fortune-wheel-container {
    position: relative;
    width: 260px;
    height: 90px;
    margin: 0 auto 4px auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.wheel-arc-board {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, #d4af37 0deg 90deg, #b8860b 90deg 180deg, #daa520 180deg 270deg, #ffd700 270deg 360deg);
    border: 3px solid #fff3b0;
    position: absolute;
    top: 8px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.wheel-pointer-top {
    position: absolute;
    top: 0;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.wheel-sector {
    position: absolute;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: #000;
}
.s-16 { top: 32px; left: 50px; }
.s-40 { top: 32px; right: 50px; }
.s-ex { top: 12px; left: 98px; }
.s-20 { top: 68px; left: 75px; }

.wheel-center-hub {
    width: 26px;
    height: 26px;
    background: #ffcc00;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    top: 0;
}

.multiplier-effect-bar {
    font-size: 11px;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 10px;
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto 6px auto;
}

/* Temple Slot Matrix (3 columns + Special Wheel) */
.temple-slots-matrix {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1c130b, #2c1a0e);
    border: 3px solid var(--primary-gold);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), inset 0 0 15px rgba(0,0,0,0.9);
    max-width: 380px;
    width: 100%;
    margin: 0 auto 6px auto;
}

.slot-reel-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slot-symbol {
    width: 70px;
    height: 65px;
    background: linear-gradient(145deg, #181818, #2a2a2a);
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.9);
}

.slot-symbol.gem-blue-glow {
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), inset 0 0 8px rgba(0,0,0,0.8);
}

.slot-symbol.selected-win {
    border-color: var(--primary-gold-bright);
    box-shadow: 0 0 14px var(--primary-gold-bright), inset 0 0 10px rgba(255,215,0,0.5);
}

.gem-inner {
    width: 40px;
    height: 40px;
    transform: rotate(45deg);
    border-radius: 5px;
}

.diamond-blue {
    background: linear-gradient(135deg, #60a5fa, #1d4ed8);
    box-shadow: 0 0 8px #3b82f6;
    border: 1px solid #bfdbfe;
}

.gem-green-bg {
    background: linear-gradient(135deg, #34d399, #065f46);
    box-shadow: 0 0 8px #10b981;
    border: 1px solid #a7f3d0;
}

.gem-dark-bg {
    background: linear-gradient(135deg, #4b5563, #1f2937);
    border: 1px solid #6b7280;
}

.card-letter {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: #94a3b8;
}

/* Special Wheel Column (Right) */
.special-wheel-col {
    background: #0f0a07;
    border: 2px solid var(--primary-gold);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.special-wheel-header {
    font-size: 7.5px;
    font-family: var(--font-heading);
    color: var(--primary-gold);
    letter-spacing: 0.5px;
    text-align: center;
}

.special-wheel-item {
    width: 55px;
    height: 44px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 15px;
    color: #ccc;
}

.special-wheel-item.active-ex-item {
    background: radial-gradient(circle, #ff4444, #880000);
    border: 2px solid var(--primary-gold-bright);
    box-shadow: 0 0 10px #ff0000;
    color: #fff;
}

.ex-badge {
    font-size: 8px;
    background: var(--primary-gold-bright);
    color: #000;
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 700;
    line-height: 1;
}

.ex-val {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

/* Win Display Bar */
.win-display-bar {
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    padding: 3px;
    text-align: center;
    width: 100%;
}

.win-label {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--primary-gold-bright);
    margin-right: 6px;
    letter-spacing: 1px;
}

.win-amount {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--primary-gold-bright);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* --- Bottom Control Deck --- */
.game-controls {
    background: var(--bg-surface);
    border-top: 1px solid var(--glass-border);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.bottom-bet-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ctrl-icon-btn {
    width: 30px;
    height: 30px;
    background: #1c140c;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold-bright);
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.bet-display-box {
    background: #161009;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    padding: 3px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--primary-gold-bright);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.8);
}

.bottom-action-deck {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.action-sub-btn {
    width: 38px;
    height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--primary-gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.action-sub-btn:hover {
    border-color: var(--primary-gold);
}

/* Main Spin Button */
.btn-main-spin {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--primary-gold-bright), #b8860b);
    border: 3px solid #fff3b0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transition: transform 0.1s ease;
}

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

.spin-btn-inner {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, #2c1a0e, #100803);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-gold-bright);
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-top: 2px solid var(--primary-gold);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-gold-bright);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .game-ui {
        border-left: 1px solid var(--glass-border);
        border-right: 1px solid var(--glass-border);
    }
}
