/* Dashlet 3.0 - the Dashlet palette: navy, neon cyan (you), lime (the rival), danger red (objects), plus one gold for the star. */

:root {
  --navy: #04101d;
  --panel: #081a2e;
  --panel-edge: #14374f;
  --cyan: #3fd9ff;
  --cyan-dim: #8fb3c7;
  --lime: #b8f235;
  --lime-dim: #a9c96a;
  --danger: #ff5470;
  --star: #ffd84d;
  --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 .side, #timeBlock { background: rgba(8,26,46,.82); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 5px 8px 6px; min-width: 0; }
#hud .side small { display: block; font-size: 8.5px; letter-spacing: .03em; color: var(--cyan-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud .side strong { display: block; font-size: 22px; line-height: 1.15; letter-spacing: .06em; color: var(--cyan); text-shadow: 0 0 12px rgba(63,217,255,.55); white-space: nowrap; }
#hud .side em { display: block; font-style: normal; font-size: 8px; letter-spacing: .03em; color: var(--cyan-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud .side.foe strong { color: var(--lime); text-shadow: 0 0 12px rgba(184,242,53,.5); }
#hud .side.foe small, #hud .side.foe em { color: var(--lime-dim); }
#hud .side.hurt strong { color: var(--danger) !important; text-shadow: 0 0 12px rgba(255,84,112,.6) !important; }
#timeBlock strong { display: block; font-size: 24px; color: var(--cyan); text-shadow: 0 0 12px rgba(63,217,255,.55); }
#timeBlock small { display: block; font-size: 9.5px; color: var(--cyan-dim); }
#timeBlock.low strong { color: var(--danger); text-shadow: 0 0 12px rgba(255,84,112,.6); }
#timeBlock.sudden strong { font-size: 15px; line-height: 24px; color: var(--danger); text-shadow: 0 0 12px rgba(255,84,112,.6); animation: flash .5s steps(2) infinite; }

/* ------------------------------------------------------------- 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); }
h1 em { font-style: normal; font-size: 20px; color: var(--cyan-dim); vertical-align: top; text-shadow: none; }
h2 { font-size: 19px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.55); margin-bottom: 10px; }
.tagline { margin: 8px 0 18px; font-size: 10px; color: var(--cyan-dim); letter-spacing: .22em; }
.lore { font-size: 10px; color: var(--cyan-dim); line-height: 1.6; margin-bottom: 12px; text-transform: none; }

.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; }
.traineeMeta { display: block; font-style: normal; font-size: 8.5px; margin-top: 3px; color: var(--cyan-dim); letter-spacing: .1em; }
.traineeMeta.rare { color: var(--cyan); } .traineeMeta.mythic { color: #d8a7ff; text-shadow: 0 0 8px rgba(216,167,255,.5); } .traineeMeta.uncommon { color: var(--lime-dim); }

/* DEMO button: one line under the how-to list */
.demoBtn { display: block; width: 100%; margin: 2px 0 14px; font: inherit; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); background: rgba(4,16,29,.7); border: 1px solid rgba(184,242,53,.4); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.demoBtn:active { background: rgba(20,55,79,.7); }
.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); }

.pvpRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pvpCard { background: rgba(4,16,29,.7); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 8px 8px 9px; }
.pvpCard span { display: block; font-size: 8.5px; color: var(--cyan-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvpCard strong { display: block; font-size: 20px; color: var(--cyan); text-shadow: 0 0 14px rgba(63,217,255,.5); margin: 2px 0 0; }
.pvpCard small { display: block; font-size: 9px; 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;
}

.build { margin-top: 12px; font-size: 8px; color: var(--cyan-dim); opacity: .7; letter-spacing: .12em; }

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

.compactPanel { padding: 18px 18px 16px; }
.resultsOverlay { background: rgba(2,8,16,.42); }
.resultWrap { text-align: center; text-transform: uppercase; }
.resultWord {
  display: block;
  font-size: clamp(44px, 15vw, 72px);
  line-height: 1;
  letter-spacing: .08em;
  margin-bottom: 8px;
  animation: resultPop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.resultWord.win { color: var(--lime); text-shadow: 0 0 26px rgba(184,242,53,.75), 0 4px 0 #2f5210; }
.resultWord.lose { color: var(--danger); text-shadow: 0 0 26px rgba(255,84,112,.75), 0 4px 0 #6a1426; }
.resultWord.draw { color: var(--cyan); text-shadow: 0 0 26px rgba(63,217,255,.75), 0 4px 0 #0f4a63; }
@keyframes resultPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.resultWhy { font-size: 11px; color: var(--cyan-dim); letter-spacing: .24em; margin-bottom: 10px; }
.resultRating { font-size: 12px; color: var(--lime); text-shadow: 0 0 10px rgba(184,242,53,.5); margin-bottom: 8px; }
.resultRating.down { color: var(--danger); text-shadow: 0 0 10px rgba(255,84,112,.5); }
.resultLine { font-size: 10px; color: var(--cyan-dim); margin-bottom: 18px; }
.resultLine b { color: var(--cyan); } .resultLine i { font-style: normal; color: var(--lime); }
.retryHint { font-size: 10px; color: var(--cyan-dim); letter-spacing: .18em; margin-bottom: 12px; }
@keyframes flash { 50% { filter: brightness(1.6); } }

/* DEMO card: sits over the arena, the duel holds until NEXT / GO */
#coach {
  position: absolute; left: 16px; right: 16px; top: 22%;
  z-index: 7;
  background: var(--panel);
  border: 1px solid rgba(184,242,53,.5); border-radius: 14px;
  padding: 12px 14px 10px; text-align: left;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 30px rgba(184,242,53,.1);
}
#coach.end { top: auto; bottom: 20%; }
#coach.pop { animation: coachPop .28s cubic-bezier(.2,1.4,.4,1); }
@keyframes coachPop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
#coach b { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); text-shadow: 0 0 10px rgba(184,242,53,.5); margin-bottom: 8px; }
#coach p { font-size: 11.5px; line-height: 1.5; color: #dff3ff; margin: 0 0 10px; text-transform: none; letter-spacing: .02em; }
#coach p i { font-style: normal; font-weight: bold; }
#coach p i.g { color: var(--lime); } #coach p i.c { color: var(--cyan); } #coach p i.r { color: var(--danger); } #coach p i.m { color: #d8a7ff; }
.coachRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coachRow small { font-size: 8px; color: var(--cyan-dim); letter-spacing: .14em; text-transform: uppercase; }
#coachNext { font: inherit; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #0c2405; background: linear-gradient(180deg, #96dd3f, #7dc832); border: 0; border-radius: 10px; padding: 10px 16px 9px; box-shadow: 0 4px 0 #47761a; cursor: pointer; }
#coachNext:active { transform: translateY(3px); box-shadow: 0 1px 0 #47761a; }

/* Sound: one small round mute button, tucked in a corner. */
.soundToggle { position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 30; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font-size: 16px; line-height: 1; color: var(--cyan); background: rgba(8,26,46,.7); border: 1px solid var(--panel-edge); border-radius: 50%; cursor: pointer; opacity: .8; }
.soundToggle:active { transform: scale(.94); }
.soundToggle[aria-pressed="true"] { color: var(--cyan-dim); }

/* ------------------------------------------------------ the Stars offer --- */
.offerPanel { padding: 18px 18px 16px; }
.offerRing { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--star); display: grid; place-items: center; box-shadow: 0 0 18px rgba(255,216,77,.45); }
.offerRing b { font-size: 20px; color: var(--star); }
.offerPitch { font-size: 10.5px; line-height: 1.55; color: #dff3ff; text-transform: none; margin: 0 0 12px; }
.starsBtn { display: block; width: 100%; font: inherit; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #2a1d00; background: linear-gradient(180deg, #ffe58a, var(--star)); border: 0; border-radius: 12px; padding: 12px 10px 10px; box-shadow: 0 5px 0 #a8831a, 0 10px 24px rgba(255,216,77,.3); cursor: pointer; margin-bottom: 10px; }
.starsBtn small { display: block; font-size: 8px; letter-spacing: .12em; color: #5a4300; margin-top: 3px; }
.starsBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #a8831a; }
.starsBtn:disabled { filter: grayscale(.2) brightness(.85); box-shadow: none; cursor: default; }
.offerState { font-size: 9px; color: var(--cyan-dim); letter-spacing: .14em; margin-bottom: 12px; }
.offerPanel.bought .offerState { color: var(--lime); }
