/* Dashlet — same TOKEHUNT palette as Sticker Slice / Clashlet: navy, neon cyan, lime. */

:root {
  --navy: #04101d;
  --panel: #081a2e;
  --panel-edge: #14374f;
  --cyan: #3fd9ff;
  --cyan-dim: #8fb3c7;
  --lime: #b8f235;
  --danger: #ff5470;
  --font: "Courier New", ui-monospace, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: #dff3ff;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: .06em;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#gameShell { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ HUD --- */

#hud {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  pointer-events: none;
  text-transform: uppercase;
  text-align: center;
}
#hud strong { display: block; font-size: 24px; color: var(--cyan); text-shadow: 0 0 12px rgba(63,217,255,.55); }
#hud small { display: block; font-size: 9.5px; color: var(--cyan-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hudSide, #timeBlock { background: rgba(8,26,46,.82); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 5px 8px; }
.hudSide.chain strong { color: var(--lime); text-shadow: 0 0 12px rgba(184,242,53,.5); }

/* ------------------------------------------------------------- overlays --- */

.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(2,8,16,.72);
  z-index: 5;
}

.panel {
  width: min(360px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 0 40px rgba(63,217,255,.04);
  text-transform: uppercase;
}

h1 { font-size: 38px; line-height: 1; color: var(--cyan); text-shadow: 0 0 18px rgba(63,217,255,.6); }
h1 span { color: var(--lime); text-shadow: 0 0 18px rgba(184,242,53,.55); }
h2 { font-size: 19px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.55); margin-bottom: 10px; }
.tagline { margin: 8px 0 10px; font-size: 11px; color: var(--cyan-dim); letter-spacing: .28em; }
.lore { font-size: 10px; color: var(--cyan-dim); line-height: 1.6; margin-bottom: 12px; text-transform: none; }

.howList { list-style: none; text-align: left; margin-bottom: 14px; }
.howList li { font-size: 10.5px; color: var(--cyan-dim); padding: 4px 0; }
.howList b { color: var(--cyan); margin-right: 6px; }
.howList b.good { color: var(--lime); }
.howList b.bad { color: var(--danger); }

.traineeRow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.traineeCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 7px 10px 9px; }
.traineeCard span { display: block; font-size: 9px; color: var(--cyan-dim); }
.traineeCard strong { display: block; font-size: 14px; color: var(--cyan); margin-top: 2px; }
.arrowBtn {
  font: inherit; font-size: 15px;
  color: var(--lime);
  background: rgba(4,16,29,.7);
  border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
}
.arrowBtn:active { background: rgba(20,55,79,.7); }

.rankRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.rankCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 8px 10px 10px; text-align: left; }
.rankCard span { display: block; font-size: 9px; color: var(--cyan-dim); }
.rankCard strong { display: block; font-size: 13px; color: var(--lime); margin: 2px 0 6px; }

.xpBar { height: 8px; border-radius: 4px; background: #0a2036; border: 1px solid var(--panel-edge); overflow: hidden; }
.xpBar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #6fb52a, var(--lime)); box-shadow: 0 0 10px rgba(184,242,53,.6); transition: width .9s cubic-bezier(.2,.7,.2,1); }

.bestCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 9px 12px 11px; margin-bottom: 16px; }
.bestCard span { font-size: 10px; color: var(--cyan-dim); }
.bestCard strong { display: block; font-size: 27px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.5); }
.bestCard small { font-size: 10px; color: var(--lime); }

.primaryBtn {
  width: 100%;
  font: inherit; letter-spacing: .14em; text-transform: uppercase;
  font-size: 17px;
  color: #0c2405;
  background: linear-gradient(180deg, #96dd3f, #7dc832);
  border: 0; border-radius: 12px;
  padding: 14px 0;
  box-shadow: 0 5px 0 #47761a, 0 10px 24px rgba(125,200,50,.35);
  cursor: pointer;
}
.primaryBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #47761a; }
.primaryBtn:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; cursor: default; }

.secondaryBtn {
  font: inherit; letter-spacing: .12em; text-transform: uppercase;
  font-size: 12px;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
}

/* -------------------------------------------------------------- results --- */

.compactPanel { padding: 18px 18px 16px; }
.scoreLine { font-size: 40px; color: var(--cyan); text-shadow: 0 0 16px rgba(63,217,255,.55); margin-bottom: 6px; }

.gradeBadge {
  width: 58px; height: 58px; line-height: 56px;
  margin: 0 auto 10px;
  font-size: 30px;
  color: #0c2405;
  background: linear-gradient(180deg, #96dd3f, #7dc832);
  border-radius: 14px;
  box-shadow: 0 0 22px rgba(184,242,53,.45);
}

.resultGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.resultGrid div { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 7px 4px; }
.resultGrid small { display: block; font-size: 9px; color: var(--cyan-dim); }
.resultGrid strong { font-size: 17px; color: var(--cyan); }

.xpRow { display: flex; justify-content: center; gap: 12px; font-size: 11px; color: var(--lime); margin-bottom: 8px; }
.rankUp { font-size: 11px; color: var(--lime); margin-bottom: 6px; animation: flash .5s steps(2) infinite; }
.newBest { color: var(--lime); font-size: 13px; margin-bottom: 6px; animation: flash .6s steps(2) infinite; }
.retryHint { font-size: 10px; color: var(--cyan-dim); letter-spacing: .18em; margin-bottom: 12px; }
@keyframes flash { 50% { filter: brightness(1.6); } }
