/* Zodiac Wheel. LHT official palette (black #08090d, gold #e8c047) blended with a dark sky look. */
@font-face { font-family: "Bangers"; font-weight: 400; font-display: swap; src: url("../assets/fonts/bangers-400.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 400 700; font-display: swap; src: url("../assets/fonts/fredoka.woff2") format("woff2"); }

:root {
  --bg: #08090d;
  --bg2: #0f1116;
  --card: #12141b;
  --card2: #181b24;
  --gold: #e8c047;
  --gold-hi: #ffd04d;
  --gold-soft: #f6e3a1;
  --gold-dim: #8a6e12;
  --text: #e0e0e0;
  --mute: #a0a0a0;
  --line: rgba(232, 192, 71, 0.22);
  --indigo: #2a1b52;
  --win: #7fe0a0;
  --lose: #ff8a80;
  --display: "Bangers", Impact, "Arial Black", sans-serif;
  --ui: "Fredoka", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--ui); font-size: 16px; line-height: 1.45;
  background:
    radial-gradient(900px 500px at 15% -5%, rgba(80, 45, 150, 0.35), transparent 60%),
    radial-gradient(800px 500px at 100% 10%, rgba(232, 192, 71, 0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(40, 30, 90, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.top, .app, .foot { position: relative; z-index: 1; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; color: var(--gold-soft); word-break: break-all; }
a { color: var(--gold); }
.cur { color: var(--gold); }

/* header */
.top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 14px clamp(14px, 4vw, 36px); border-bottom: 1px solid var(--line); background: rgba(8, 9, 13, 0.82); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 52px; height: 52px; flex: none; }
h1 { font-family: var(--display); font-weight: 400; letter-spacing: 0.04em; font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.05; margin: 0; color: var(--gold); text-shadow: 0 2px 0 #000; }
.tag { margin: 2px 0 0; color: var(--mute); font-size: 0.92rem; }
.badge { display: inline-block; vertical-align: middle; font-family: var(--ui); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); background: rgba(232, 192, 71, 0.1); text-shadow: none; }
.top-right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-left: auto; }
.bal { display: flex; flex-direction: column; align-items: flex-end; }
.bal-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.bal-amt { font-family: var(--display); font-size: 1.9rem; color: var(--gold-hi); letter-spacing: 0.03em; line-height: 1; }
.wallet-on { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; background: var(--card); }
.wallet-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute); }
.addr { font-size: 0.8rem; }
.mini-tag { font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold-soft); margin-left: 6px; vertical-align: middle; font-weight: 500; }

/* buttons */
.btn, .tab, .chip, .pick { font-family: var(--ui); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn { border: 1px solid var(--gold); background: var(--card2); color: var(--gold); border-radius: 12px; padding: 10px 16px; font-size: 0.95rem; font-weight: 600; }
.btn:hover { background: #20242f; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible, .pick:focus-visible, .link:focus-visible, input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.btn-xaman { border-color: #3b82f6; color: #cfe0ff; background: #0f1a33; }
.btn-xaman:hover { background: #14224a; }
.btn-xaman .mini-tag { border-color: #3b82f6; color: #cfe0ff; }
.btn-spin { width: 100%; margin-top: 10px; padding: 14px; font-family: var(--display); font-size: 1.7rem; font-weight: 400; letter-spacing: 0.08em; color: #1a1300; background: linear-gradient(180deg, #ffe27a, #e8c047 55%, #b8941f); border: 0; box-shadow: 0 4px 0 #7a5f0c, 0 10px 24px rgba(232, 192, 71, 0.25); }
.btn-spin:hover { background: linear-gradient(180deg, #fff0a8, #f3cf55 55%, #c9a228); }
.btn-spin:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a5f0c; }
.btn-spin:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--mute); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.82rem; padding: 6px 0; }
.link:hover { color: var(--gold); }

/* layout */
.app { max-width: 1180px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 28px) 30px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 20px; align-items: start; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.panel { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 0; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); min-width: 0; }
.app > .panel { margin-top: 20px; }
.panel h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; font-size: 1.55rem; margin: 0 0 8px; color: var(--gold); }
.panel h3 { font-size: 0.95rem; color: var(--gold-soft); margin: 18px 0 8px; }

/* stage */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wheel-wrap { position: relative; width: min(100%, 520px); aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }
.pointer { position: absolute; left: 50%; top: -4px; width: 0; height: 0; transform: translateX(-50%); z-index: 2; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 30px solid var(--gold-hi); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7)); }
.dealer { display: flex; align-items: flex-end; gap: 10px; width: 100%; max-width: 560px; }
.dealer-img { width: 92px; height: auto; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.bubble { position: relative; flex: 1; background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 0.95rem; margin-bottom: 18px; }
.bubble::before { content: ""; position: absolute; left: -9px; bottom: 18px; border: 9px solid transparent; border-right-color: var(--line); border-left: 0; }
.bubble strong { color: var(--gold); }
.status { text-align: center; color: var(--gold-soft); min-height: 1.5em; font-size: 0.95rem; max-width: 560px; }
.status.warn { color: var(--lose); }
.result { display: flex; align-items: center; gap: 14px; background: var(--card2); border: 1px solid var(--gold); border-radius: 16px; padding: 12px 18px; width: 100%; max-width: 560px; animation: pop 0.4s ease; }
.result img { flex: none; }
.result-sign { font-family: var(--display); font-size: 1.9rem; letter-spacing: 0.05em; color: var(--gold-hi); line-height: 1.1; }
.result-line { font-size: 0.98rem; }
.result.win .result-line { color: var(--win); }
.result.lose .result-line { color: var(--lose); }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* bet slip */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.tab { background: var(--bg); color: var(--mute); border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; font-weight: 600; }
.tab.active { background: rgba(232, 192, 71, 0.14); color: var(--gold); border-color: var(--gold); }
.picks { display: grid; gap: 6px; margin-bottom: 14px; grid-template-columns: repeat(4, 1fr); }
.picks.cols3 { grid-template-columns: repeat(3, 1fr); }
.picks.cols2 { grid-template-columns: repeat(2, 1fr); }
.pick { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; text-align: center; min-height: 58px; font-size: 0.78rem; line-height: 1.2; }
.pick .g { display: block; font-size: 1.35rem; color: var(--gold-soft); line-height: 1.15; font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Noto Sans Symbols 2", "DejaVu Sans", system-ui, sans-serif; }
.pick small { display: block; color: var(--mute); font-size: 0.66rem; }
.pick.sel { border-color: var(--gold-hi); background: rgba(232, 192, 71, 0.16); box-shadow: 0 0 0 1px var(--gold-hi) inset; }
.field-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 0.88rem; }
.chip.sel { border-color: var(--gold-hi); color: var(--gold-hi); background: rgba(232, 192, 71, 0.14); }
input[type="number"], input:not([type]), input[type="text"] { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 1rem; }
.odds { color: var(--gold-soft); font-size: 0.92rem; margin: 10px 0 0; }
.fine { color: var(--mute); font-size: 0.78rem; margin: 10px 0 0; }

/* tables */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid rgba(232, 192, 71, 0.12); white-space: nowrap; }
th { color: var(--mute); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
td.win { color: var(--win); } td.lose { color: var(--lose); }
.empty { color: var(--mute); }

/* verify */
.verify label { display: block; font-size: 0.72rem; color: var(--mute); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 10px; }
.verify label input { margin-top: 4px; text-transform: none; letter-spacing: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; }
.verify .btn { margin-top: 12px; }
.vlast, .vout { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 0.85rem; margin-top: 10px; }
.vstep { margin: 0 0 9px; }
.vstep b { display: block; color: var(--gold-soft); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.vstep.ok { color: var(--win); }
.vstep.bad, .tagflag { color: var(--lose); }
.tagflag { font-weight: 600; }

.rg p { margin: 6px 0; color: var(--text); font-size: 0.92rem; }
.foot { text-align: center; padding: 10px 16px 40px; color: var(--mute); font-size: 0.9rem; }
.foot p { margin: 6px 0; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 7, 0.88); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--gold); border-radius: 20px; padding: 22px; max-width: 460px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); }
.modal h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; color: var(--gold); font-size: 1.8rem; margin: 8px 0; }
.modal p { font-size: 0.95rem; }
.check { display: flex; gap: 10px; text-align: left; align-items: flex-start; margin: 10px 0; font-size: 0.9rem; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.preview-flag { border: 1px dashed #3b82f6; color: #cfe0ff; border-radius: 10px; padding: 8px 10px; font-size: 0.82rem; }
.modal-actions { margin-top: 12px; }
#signin-qr img { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 10px; }

/* desktop: dealer beside the wheel so Astro Bear is above the fold */
@media (min-width: 861px) {
  .stage { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 14px; row-gap: 8px; align-items: end; justify-items: center; }
  .wheel-wrap { grid-column: 2; grid-row: 1; }
  .dealer { grid-column: 1; grid-row: 1; flex-direction: column-reverse; align-items: center; max-width: none; align-self: end; gap: 6px; }
  .dealer-img { width: 120px; }
  .bubble { margin-bottom: 0; font-size: 0.85rem; width: 100%; }
  .bubble::before { left: 50%; bottom: -9px; transform: translateX(-50%); border: 9px solid transparent; border-bottom: 0; border-top-color: var(--line); border-right-color: transparent; }
  .status, .result { grid-column: 2; max-width: 520px; }
}
/* mobile */
@media (max-width: 860px) {
  .layout, .grid2 { grid-template-columns: 1fr; }
  .top { padding: 10px 14px; }
  .brand-logo { width: 44px; height: 44px; }
  .top-right { width: 100%; justify-content: space-between; }
  .bal { align-items: flex-end; }
  .dealer-img { width: 72px; }
  .bubble { font-size: 0.88rem; padding: 10px 12px; }
}
@media (max-width: 480px) {
  .picks { grid-template-columns: repeat(3, 1fr); }
  .btn-xaman { font-size: 0.85rem; padding: 9px 12px; }
  .panel { padding: 14px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { .result { animation: none; } }
