/* Link Runner — everything outside the canvas.
 *
 * The canvas handles the game; this file only has to keep it centred, keep the
 * page from scrolling under a thumb, and dress the death card. The death card
 * is deliberately small: a domain, one line, two numbers, one button.
 */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The backlit pools from tokens.css sit behind the canvas and read as glow
   spilling past its edges on a wide screen. */
#stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage canvas {
  display: block;
  touch-action: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- death card ---------- */

.over {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 9, 31, 0.82);
  backdrop-filter: blur(10px);
  animation: over-in 0.18s var(--ease-out) both;
}

.over[hidden] { display: none; }

@keyframes over-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.over-card {
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 20px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: card-in 0.26s var(--ease-snap) both;
}

@keyframes card-in {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.over-kick {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* The domain that killed you, with the deceptive part picked out in hot. The
   mark is the whole teaching moment for most players. */
.over-dom {
  margin: 0;
  font-size: clamp(20px, 6.4vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-all;
  color: var(--paper);
}

.over-dom mark {
  background: rgba(255, 45, 120, 0.18);
  color: var(--hot);
  border-radius: 5px;
  padding: 0 2px;
  box-shadow: 0 2px 0 rgba(255, 45, 120, 0.55);
}

.over-line {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--dim);
}

/* The answer she needed. Green, so it reads as "this was the safe one" against
   the hot pink of the name that killed her. */
.over-real {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  word-break: break-all;
}

.over-real[hidden] { display: none; }

.over-real b {
  font-weight: 700;
  color: var(--volt);
}

.over-nums {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 20px 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.over-nums > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.over-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--volt);
}

.over-nums > div:last-child .over-num { color: var(--gold); }

.over-lab {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.retry {
  width: 100%;
  min-height: var(--thumb);
  border-radius: 16px;
  background: var(--volt);
  color: var(--void);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease-snap);
}

.retry:active { transform: scale(0.97); }

/* Collapsed by default, and it stays collapsed for anyone who just wants to
   run again. Nothing behind it is required to play. */
.why {
  margin-top: 14px;
  text-align: left;
}

/* 44px minimum: this was 33px tall, under the size a thumb reliably hits. */
.why summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  text-align: center;
}

.why summary::-webkit-details-marker { display: none; }
.why summary::after { content: " \203A"; }
.why[open] summary::after { content: " \2039"; }
.why summary:hover { color: var(--paper); }

.why p {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--dim);
}
