:root {
  --bg: #05070d;
  --panel: rgba(12, 16, 28, 0.86);
  --panel-border: rgba(255,255,255,0.08);
  --text: #e8ecf4;
  --muted: #9aa4b8;
  --accent: #f3c969;
  --accent-ink: #1a1304;
  --win: #6ed38a;
  --lose: #f07a7a;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
#globe { position: fixed; inset: 0; }
#globe canvas { outline: none; }

#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.brand h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.stats { display: flex; gap: 14px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; background: var(--panel); border: 1px solid var(--panel-border); padding: 6px 12px; border-radius: 999px; pointer-events: auto; }

.hud { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: none; }
.hud-hint { font-size: 12px; color: var(--muted); background: rgba(5,7,13,.55); padding: 6px 12px; border-radius: 999px; }

.panel {
  position: fixed; z-index: 6; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 36px);
  background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  max-height: calc(100vh - 100px); overflow: auto;
}
.panel h2 { margin: 0 0 6px; font-size: 20px; }
.panel p { margin: 8px 0; line-height: 1.45; font-size: 14.5px; }
.lead { font-size: 16px; }
.muted { color: var(--muted); }
.fine { font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.hidden { display: none !important; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 10px 16px; transition: transform .08s ease, background .15s ease; }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: #ffd97a; }
button.primary.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 8px; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--panel-border); }
button.ghost:hover { color: var(--text); border-color: rgba(255,255,255,.25); }

.years { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0; }
.years label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; }
.years input { width: 100%; font: inherit; font-size: 20px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: var(--text); font-variant-numeric: tabular-nums; }
.years input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.years .dash { padding-bottom: 12px; color: var(--muted); }
.err { color: var(--lose); font-size: 13px; }
#guess-form button { width: 100%; margin-top: 4px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row .ghost { margin-left: auto; }
.toggle { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.toggle input { accent-color: var(--accent); }

.verdict { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.verdict.win { color: var(--win); }
.verdict.lose { color: var(--lose); }
.verdict small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.truth { font-size: 15px; }
.truth b { color: var(--accent); }
#hints h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 6px; }
#hints ul { margin: 0; padding-left: 18px; }
#hints li { margin: 6px 0; line-height: 1.4; font-size: 14px; }
#hints li b { color: var(--text); }
#hints .ctx { color: var(--muted); font-size: 13px; }

.loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); color: var(--muted); transition: opacity .4s ease; }
.loading.fade { opacity: 0; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tip { background: rgba(5,7,13,.9); color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: 13px; border: 1px solid var(--panel-border); white-space: nowrap; }
.tip small { color: var(--muted); }

@media (max-width: 640px) {
  .panel { right: 10px; left: 10px; bottom: 10px; width: auto; max-width: none; padding: 16px; max-height: 55vh; }
  .brand h1 { font-size: 15px; }
  .hud { top: 52px; width: 100%; text-align: center; }
  .hud-hint { font-size: 11px; }
  .verdict { font-size: 22px; }
}

.hint-ui { position: fixed; top: 58px; left: 18px; z-index: 6; width: 320px; max-width: calc(100vw - 36px); }
.hint-btn { background: rgba(243,201,105,.14); color: var(--accent); border: 1px solid rgba(243,201,105,.45); font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.hint-btn:hover { background: rgba(243,201,105,.25); }
.hint-box { margin-top: 10px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.hint-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hint-box p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.hint-box b { color: var(--accent); }
button.x { background: none; border: none; color: var(--muted); font-size: 18px; padding: 0 4px; line-height: 1; }
button.x:hover { color: var(--text); }
@media (max-width: 640px) { .hint-ui { top: 52px; left: 10px; width: calc(100vw - 20px); } .hud { display: none; } }
