@font-face { font-family: 'Luckiest Guy'; src: url('assets/luckiest-guy-v25-latin-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('assets/nunito-v32-latin-regular.woff2') format('woff2'); font-display: swap; }

:root {
    --bg: #0a1f0a; --card: #143314; --text: #fff; --gold: #ffd700;
    --red: #d9381e; --green: #2ecc71; --chip: #f1c40f;
    --font-header: 'Luckiest Guy', cursive; --font-body: 'Nunito', sans-serif;
}

html, body { margin: 0; padding: 0; width: 100vw; height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--font-body); overflow: hidden; text-align: center; overscroll-behavior: none;}
h1, h2, h3, .btn-action, .btn-host, .status-label, .round-label, .odds-display { font-family: var(--font-header); letter-spacing: 1px; }

.text-gold { color: var(--gold); } .text-muted { color: #aaa; }
.w-full { width: 100%; } .flex-col-center { display: flex; flex-direction: column; align-items: center; justify-content:center; }

.container { height: 100dvh; width: 100vw; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2dvh 4vw; box-sizing: border-box; position: relative; z-index: 500; background: var(--bg); min-width: 0; min-height: 0;}

.btn-action, .btn-host { padding: clamp(10px, 2vh, 15px) 30px; font-size: clamp(1rem, 2.5vh, 1.2rem); background: var(--gold); color: black; border: none; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); margin-top: 10px; transition: transform 0.1s; z-index: 600; position: relative; font-family: var(--font-header); letter-spacing: 1px; touch-action: manipulation; flex-shrink: 0;}
.btn-action:active { transform: scale(0.95); }

.input-box { font-size: clamp(1.2rem, 3vh, 1.5rem); padding: clamp(10px, 2vh, 15px); border-radius: 12px; border: 2px solid #444; background: #222; color: white; width: 85%; max-width: 300px; margin-bottom: 2vh; font-family: var(--font-body); font-weight: bold; text-transform: uppercase; flex-shrink: 0;}

.bet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; height: 40vh; margin-top: 10px; flex: 1 1 auto; min-height: 0;}
.bet-btn { border: 4px solid #333; border-radius: 15px; font-size: clamp(1.2rem, 3vh, 1.5rem); font-weight: bold; color: white; background: #222; transition: all 0.2s; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; font-family: 'Nunito', sans-serif !important; text-transform: uppercase; touch-action: manipulation; }
.bet-btn.a { border-color: var(--red); } .bet-btn.b { border-color: var(--green); }
.bet-btn:active { transform: scale(0.95); }

.chip-slider { width: 85%; margin: 2vh 0; flex-shrink: 0;}
.chip-display { font-size: clamp(2rem, 5vh, 2.5rem); color: var(--gold); font-weight: 900; font-family: var(--font-header); letter-spacing:2px;}

/* IRONCLAD SPLIT LAYOUT FIX FOR TV */
.host-grid-container { display: flex; width: 100vw; height: 100dvh; overflow: hidden; flex-direction: row; }
#panel-left { flex: 0 0 clamp(200px, 25vw, 250px); height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: rgba(0,0,0,0.6); border-right: 2px solid #333; z-index: 20; padding: 2vh 1vw; box-sizing: border-box; gap: 2vh;}
#panel-right { flex: 1; min-width: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 10; }

#box-status { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 15px; background: #143314; border-radius: 15px; border: 2px solid #2a552a; }
#box-leaderboard { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: #143314; border-radius: 15px; border: 2px solid #2a552a; padding: 15px; min-height: 0; }
#p-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding-right: 5px; color: white; }

#box-header { flex: 0 0 auto; height: clamp(60px, 12vh, 100px); display: flex; align-items: center; justify-content: center; border-bottom: 2px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.4); overflow: hidden; padding: 0 15px; background: #143314; border-radius: 15px; border: 2px solid #2a552a; margin: 10px; margin-bottom: 0;}
#box-stage { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 2vh 2vw; min-height: 0; background: #0f260f; border-radius: 15px; border: 4px solid var(--gold); margin: 10px;}

#game-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; min-height: 0; width: 100%;}

.timer-circle { width: clamp(60px, 12vh, 80px); height: clamp(60px, 12vh, 80px); border: clamp(2px, 0.5vh, 4px) solid var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(2rem, 5vh, 3rem); font-weight: 900; margin: 10px 0; color: var(--gold); flex-shrink: 0; font-family: var(--font-header); }
.lb-header { color: var(--gold); font-size: clamp(1rem, 2.5vh, 1.2rem); margin-bottom: 1vh; border-bottom: 1px solid #444; padding-bottom: 5px; font-family: var(--font-header); text-align: center; flex-shrink: 0;}
.p-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #2a552a; font-size: clamp(0.9rem, 2vh, 1rem); font-weight: bold; flex-shrink:0; }
.subject-badge { background: var(--red); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; margin-left: 5px; }

.question-text { font-size: clamp(1.2rem, 4vh, 2.5rem); color: white; text-align: center; line-height: 1.2; flex-shrink: 0; margin-bottom: 2vh; font-family: 'Nunito', Arial, sans-serif !important; font-weight: 800 !important; letter-spacing: 1px !important; word-break: break-word;}
.odds-display { font-size: clamp(1.5rem, 4vh, 2rem); color: var(--gold); margin-top: 5px; font-family: var(--font-header); letter-spacing:2px;}

.option-box { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 10px; border-radius: 10px; font-size: clamp(1.2rem, 3vh, 2rem); font-weight: bold; color: black; transition: opacity 0.5s; min-height: 0; font-family: var(--font-body); text-transform: uppercase; width:100%; word-break: break-word;}
.opt-a { background: var(--red); } .opt-b { background: var(--green); }

.winner-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;}
.winner-title { font-size: clamp(3rem, 10vmin, 8rem); color: var(--gold); margin: 0; text-align:center;}
.winner-name { font-size: clamp(2rem, 8vmin, 6rem); color: white; margin-top: 20px; word-break: break-word; text-align:center;}
.btn-icon { position: absolute; top: 10px; left: 10px; background: none; border: 1px solid #555; color: #aaa; width: 40px; height: 40px; border-radius: 8px; font-size: 1.5rem; cursor: pointer; z-index:999;}

.orientation-warning { position: fixed; inset: 0; background: var(--bg); z-index: 99999; display: none; flex-direction: column; align-items: center; justify-content: center; text-align:center;}
.orientation-warning h1 { font-size: 5rem; margin: 0 0 20px 0; } .orientation-warning h2 { font-size: 2rem; color: var(--gold); font-family: var(--font-header); }
@media (orientation: portrait) { body.host-client #landscape-warning { display: flex !important; } body.host-client .host-ui-wrap { display: none !important; } }
.hidden { display: none !important; } .hidden-ui { display: none; } .show-flex { display: flex !important; }
