* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070b14; color: #e6edf3;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
canvas#globe { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas#globe.dragging { cursor: grabbing; }
canvas#globe.pointer { cursor: pointer; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: #8b949e; font-weight: normal; }

#topbar { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between;
  pointer-events: none; z-index: 2; }
#topbar > * { pointer-events: auto; }
.tabs, .zoom { display: flex; background: rgba(13,17,23,.85); border: 1px solid #30363d; border-radius: 10px;
  overflow: hidden; backdrop-filter: blur(6px); }
.tabs button, .zoom button { background: none; border: 0; padding: 8px 16px; }
.zoom button { font-size: 20px; padding: 4px 14px; }
.tabs button.active { background: #1f6feb; }

#panel { position: fixed; top: 64px; left: 12px; width: 340px; max-height: calc(100% - 76px); overflow: auto;
  background: rgba(13,17,23,.88); border: 1px solid #30363d; border-radius: 12px; padding: 14px;
  backdrop-filter: blur(6px); z-index: 2; }
#panel h2 { margin: 0 0 8px; font-size: 18px; }
.label { margin: 12px 0 6px; font-size: 13px; color: #8b949e; text-transform: uppercase; letter-spacing: .04em; }
.hint { color: #8b949e; font-size: 13px; margin: 8px 0; }

#search { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #30363d; background: #0d1117;
  color: inherit; font: inherit; }

.card { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.card img { width: 96px; border-radius: 4px; box-shadow: 0 0 0 1px #30363d; flex: none; }
.card .nm { font-size: 18px; font-weight: 600; }
.card .cap { color: #c9d1d9; }
.card .ct { color: #8b949e; font-size: 13px; }

.seg { display: flex; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; background: none; border: 0; padding: 8px 4px; font-size: 14px; }
.seg button + button { border-left: 1px solid #30363d; }
.seg button.active { background: #1f6feb; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: #161b22; border: 1px solid #30363d; border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.chips button.active { background: #238636; border-color: #2ea043; }

.rounds { display: flex; gap: 6px; }
.rounds input { width: 72px; padding: 6px 8px; border-radius: 8px; border: 1px solid #30363d; background: #0d1117;
  color: inherit; font: inherit; }
.rounds button { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 6px 10px; }

button.primary { margin-top: 16px; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: #238636;
  font-weight: 600; font-size: 16px; }
button.primary:disabled { opacity: .5; cursor: default; }
button.secondary { margin-top: 8px; width: 100%; padding: 9px; border: 1px solid #30363d; border-radius: 8px;
  background: #161b22; }
button.link { background: none; border: 0; color: #58a6ff; padding: 0; }

.playhead { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #8b949e; }
.bar { height: 4px; background: #21262d; border-radius: 2px; margin: 8px 0 12px; }
.bar > div { height: 100%; background: #1f6feb; border-radius: 2px; transition: width .3s; }
#question { text-align: center; }
#question .ask { color: #8b949e; font-size: 13px; }
#question .big { font-size: 26px; font-weight: 700; margin: 4px 0; }
#question img { max-width: 200px; width: 70%; border-radius: 4px; box-shadow: 0 0 0 1px #30363d; margin: 6px 0; }
#feedback .ok { color: #3fb950; font-weight: 600; }
#feedback .bad { color: #f85149; font-weight: 600; }
#feedback .card { margin-top: 6px; }

#result .big { font-size: 34px; font-weight: 700; }
#result ul { list-style: none; padding: 0; margin: 8px 0; }
#result li { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #21262d; cursor: pointer; }
#result li img { width: 36px; border-radius: 2px; }
#result li .cap { color: #8b949e; font-size: 13px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #161b22;
  border: 1px solid #30363d; padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s;
  pointer-events: none; z-index: 3; }
#toast.show { opacity: 1; }

@media (max-width: 640px) {
  #panel { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 45%; padding: 10px; }
  #question .big { font-size: 22px; }
  #question img { max-width: 120px; }
  .card img { width: 72px; }
}
