/* Tata Surya 3D: kanvas WebGL, panel info, kuis, navigasi tujuan */
.ts-wrap { position: relative; flex: 1; min-height: 0; background: #02040d; overflow: hidden; color: #e8eefc; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#gl:active { cursor: grabbing; }
.ts-nogl { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); width: min(560px, 90%); background: rgba(8,14,36,.92); border: 2px solid #475569; border-radius: 16px; padding: 14px 18px; font-weight: 700; text-align: center; }
.ts-nogl[hidden] { display: none; }

.ts-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ts-lbl { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(8,14,36,.72); color: #fff; font: 800 clamp(11px, 1.3vw, 15px)/1.35 var(--font); white-space: nowrap; will-change: transform; }
.ts-lbl i { width: 9px; height: 9px; border-radius: 50%; background: var(--d, #fff); flex: none; }
.ts-lbl.sub { font-weight: 700; font-size: clamp(10px, 1.1vw, 13px); background: rgba(8,14,36,.6); }
.ts-lbl.on { border-color: #fde047; background: rgba(30,41,90,.88); }
.ts-lbl.done::after { content: "\2713"; color: #86efac; font-weight: 900; }
.ts-lbl[hidden] { display: none; }

.ts-hud { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; max-width: min(46vw, 330px); pointer-events: none; }
.ts-hud .row { display: flex; flex-wrap: wrap; gap: 5px; }
.ts-chip { pointer-events: auto; background: rgba(8,14,36,.78); border: 2px solid var(--c, #475569); border-radius: 12px; padding: 2px 10px; font-weight: 800; font-size: clamp(11px, 1.35vw, 16px); line-height: 1.4; display: inline-flex; gap: 8px; align-items: baseline; }
.ts-chip b { font-size: 1.3em; font-variant-numeric: tabular-nums; }
.ts-chip.on { background: var(--c); color: #fff; }
.ts-fuel { background: rgba(8,14,36,.78); border: 2px solid #475569; border-radius: 12px; padding: 2px 10px; font-weight: 800; font-size: clamp(11px, 1.35vw, 16px); display: inline-flex; align-items: center; gap: 6px; }
.ts-fuel .bar { display: inline-flex; gap: 2px; }
.ts-fuel .bar i { width: 7px; height: 14px; border-radius: 2px; background: #334155; }
.ts-fuel .bar i.f { background: #fbbf24; }
.ts-badges { display: flex; flex-wrap: wrap; gap: 3px; background: rgba(8,14,36,.7); border-radius: 12px; padding: 4px 6px; pointer-events: auto; }
.ts-badges i { width: clamp(14px, 1.7vw, 20px); height: clamp(14px, 1.7vw, 20px); border-radius: 50%; background: #1e293b; border: 2px solid #475569; display: block; }
.ts-badges i.g { background: var(--d); border-color: #fff; box-shadow: 0 0 8px var(--d); }
.ts-time { pointer-events: auto; align-self: flex-start; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 2px solid #475569; background: rgba(8,14,36,.78); color: #e8eefc; font: 800 clamp(11px, 1.3vw, 14px) var(--font); cursor: pointer; }

.ts-banner { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: rgba(8,14,36,.88); border: 2px solid #fbbf24; border-radius: 999px; padding: 4px 6px 4px 18px; font-weight: 800; font-size: clamp(12px, 1.6vw, 18px); max-width: calc(100% - 16px); white-space: nowrap; }
.ts-banner[hidden] { display: none; }
.ts-banner button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: #fbbf24; color: #1f2937; font: 900 clamp(12px, 1.4vw, 16px) var(--font); cursor: pointer; }

.ts-toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: min(620px, calc(100% - 16px)); background: rgba(8,14,36,.92); border: 2px solid #38bdf8; border-radius: 14px; padding: 8px 14px; font-weight: 700; font-size: clamp(12px, 1.5vw, 17px); line-height: 1.4; text-align: center; pointer-events: none; z-index: 5; }
.ts-toast[hidden] { display: none; }
.ts-toast.good { border-color: #4ade80; } .ts-toast.warn { border-color: #fbbf24; }

.ts-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; background: linear-gradient(180deg, rgba(2,4,13,0), rgba(2,4,13,.92) 40%); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ts-nav::-webkit-scrollbar { display: none; }
.ts-nav button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: clamp(34px, 5.2vh, 46px); padding: 0 12px 0 9px; border-radius: 999px; border: 2px solid #334155; background: rgba(15,23,42,.9); color: #e8eefc; font: 800 clamp(12px, 1.4vw, 16px) var(--font); cursor: pointer; }
.ts-nav button i { width: 13px; height: 13px; border-radius: 50%; background: var(--d, #fff); box-shadow: 0 0 6px var(--d, #fff); }
.ts-nav button.on { border-color: #fde047; background: #1e2a5a; }
.ts-nav button.done::after { content: "\2713"; color: #86efac; }
.ts-nav button.lock { opacity: .55; }
.ts-nav button.lock::after { content: "\1F512"; font-size: .85em; }
.ts-nav button:disabled { cursor: default; }

.ts-panel { position: absolute; right: 8px; top: 8px; bottom: calc(clamp(34px, 5.2vh, 46px) + 18px); width: min(410px, 46vw); display: flex; flex-direction: column; background: rgba(8,14,36,.93); border: 2px solid #38bdf8; border-radius: 16px; overflow: hidden; z-index: 4; }
.ts-panel[hidden] { display: none; }
.tp-head { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px 4px; }
.tp-head > div { flex: 1; min-width: 0; }
.tp-head h2 { margin: 0; color: #fff; font-size: clamp(18px, 2.4vw, 28px); }
.tp-head p { margin: 0; color: #93c5fd; font-weight: 700; font-size: clamp(12px, 1.4vw, 16px); }
.tp-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #475569; background: transparent; color: #e8eefc; cursor: pointer; padding: 0; display: grid; place-items: center; }
.tp-x svg { width: 18px; height: 18px; }
.tp-tabs { display: flex; gap: 4px; padding: 4px 10px; overflow-x: auto; scrollbar-width: none; }
.tp-tabs::-webkit-scrollbar { display: none; }
.tp-tabs button { flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 2px solid #334155; background: transparent; color: #cbd5e1; font: 800 clamp(12px, 1.35vw, 15px) var(--font); cursor: pointer; }
.tp-tabs button[aria-selected="true"] { background: #38bdf8; border-color: #38bdf8; color: #082f49; }
.tp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 10px; font-size: clamp(13px, 1.5vw, 17px); line-height: 1.55; -webkit-overflow-scrolling: touch; }
.tp-body p { margin: 0 0 9px; color: #e2e8f0; }
.tp-body .lead { color: #fff; font-weight: 800; }
.tp-body h3 { margin: 12px 0 5px; color: #fde68a; font-size: 1.02em; }
.tp-body ul { margin: 0 0 8px; padding-left: 18px; color: #e2e8f0; }
.tp-body li { margin-bottom: 5px; }
.tp-body table { width: 100%; border-collapse: collapse; }
.tp-body th, .tp-body td { text-align: left; vertical-align: top; padding: 5px 6px; border-bottom: 1px solid #1e293b; font-size: .95em; }
.tp-body th { color: #93c5fd; font-weight: 700; width: 40%; }
.tp-body td { color: #fff; font-weight: 700; }
.tp-moons { display: grid; gap: 6px; }
.tp-moons button { text-align: left; border: 2px solid #334155; border-radius: 12px; background: rgba(30,41,90,.55); color: #fff; padding: 7px 11px; font: 700 inherit var(--font); cursor: pointer; }
.tp-moons button b { display: block; font-size: 1.05em; }
.tp-moons button span { color: #bae6fd; font-size: .9em; }
.tp-foot { padding: 8px 12px 10px; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid #1e293b; }
.tp-foot:empty { display: none; }
.ts-btn { min-height: clamp(38px, 6vh, 50px); padding: 0 18px; border: 0; border-radius: 999px; background: #22c55e; color: #052e16; font: 900 clamp(13px, 1.6vw, 18px) var(--font); cursor: pointer; flex: 1; }
.ts-btn.alt { background: transparent; border: 2px solid #475569; color: #e2e8f0; font-weight: 800; flex: none; }
.ts-btn.go { background: #38bdf8; color: #082f49; }
.ts-btn:disabled { opacity: .45; cursor: default; }
.tp-status { color: #86efac; font-weight: 800; align-self: center; }

.ts-quiz { position: absolute; left: 50%; bottom: calc(clamp(34px, 5.2vh, 46px) + 18px); transform: translateX(-50%); width: min(800px, calc(100% - 16px)); max-height: calc(100% - 100px); overflow-y: auto; background: rgba(8,14,36,.95); border: 3px solid var(--c, #fbbf24); border-radius: 18px; padding: 10px 14px 12px; z-index: 6; }
.ts-quiz[hidden] { display: none; }
.tq-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; font-weight: 800; font-size: clamp(12px, 1.4vw, 16px); color: #bae6fd; }
.tq-top .turn { color: #fff; background: var(--c, #475569); border-radius: 999px; padding: 1px 12px; }
.tq-q { margin: 6px 0 8px; color: #fff; font-weight: 800; font-size: clamp(15px, 2.1vw, 26px); line-height: 1.3; }
.tq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tq-opts button { min-height: clamp(42px, 8vh, 64px); padding: 6px 12px; border-radius: 12px; border: 3px solid #334155; background: #172554; color: #fff; font: 800 clamp(13px, 1.7vw, 21px)/1.25 var(--font); cursor: pointer; text-align: left; display: flex; align-items: center; gap: 8px; }
.tq-opts button b { flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; background: #1e3a8a; display: grid; place-items: center; font-size: .85em; }
.tq-opts button:hover:not(:disabled) { border-color: #38bdf8; }
.tq-opts button.ok { background: #14532d; border-color: #4ade80; }
.tq-opts button.bad { background: #7f1d1d; border-color: #f87171; }
.tq-opts button:disabled { cursor: default; }
.tq-fb { margin: 8px 0 0; font-weight: 700; font-size: clamp(12px, 1.5vw, 17px); line-height: 1.45; color: #e2e8f0; }
.tq-fb strong { color: #fde68a; }
.tq-row { display: flex; gap: 8px; margin-top: 8px; }
.tq-clues { margin: 6px 0 8px; padding: 0; list-style: none; display: grid; gap: 5px; }
.tq-clues li { background: #172554; border-radius: 10px; padding: 5px 11px; font-weight: 700; font-size: clamp(13px, 1.7vw, 20px); color: #fff; }
.tq-clues li.new { background: #1d4ed8; }
.tq-guess { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tq-guess button { min-height: clamp(36px, 6.5vh, 52px); border-radius: 10px; border: 3px solid #334155; background: #172554; color: #fff; font: 800 clamp(12px, 1.5vw, 18px) var(--font); cursor: pointer; }
.tq-guess button:disabled { opacity: .35; cursor: default; }

.ts-names { display: grid; gap: 6px; }
.ts-names input { min-height: 40px; border: 3px solid var(--line); border-radius: 12px; padding: 0 12px; font: 800 17px var(--font); width: 100%; }
.ts-names input[hidden] { display: none; }
.ts-recap { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 8px 0 4px; color: var(--ink); font-weight: 700; }
.ts-recap b { color: var(--ink); }
.op-desc { min-height: 2.6em; }

@media (max-height: 520px) {
  .ts-toast { top: 52px; padding: 5px 10px; font-size: 12px; }
  .ts-panel { width: min(360px, 50vw); }
  .tp-head { padding: 6px 10px 2px; }
  .ts-quiz { padding: 6px 10px 8px; }
  .tq-q { margin: 3px 0 5px; }
}
@media (max-width: 700px) {
  .ts-panel { width: min(340px, 62vw); }
  .ts-hud { max-width: 40vw; }
}
@media (prefers-reduced-motion: reduce) { #gl { cursor: default; } }
.ts-wrap.mystery #gl { filter: blur(26px) brightness(.85); transition: filter .6s; }
.ts-wrap #gl { transition: filter .6s; }
.mode-kuis .ts-time { display: none; }
.ts-nav[hidden] { display: none; }
