/* Sneaky Santa - styles just for this game.
   The game itself is drawn on a canvas; this file styles the menus, radio box and toolbar on top of it. */

[hidden] {
  display: none !important;
}

.ss-stage {
  --stage-bg: #070914;
  min-height: 16rem;
  aspect-ratio: 16 / 9;
  max-height: max(16rem, calc(100vh - 14.5rem));
  padding: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.5px);
  background-size: 18px 18px;
}

/* The game screen. main.js sets its exact size so pixels scale evenly. */
.ss-screen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 180px;
  transform: translate(-50%, -50%);
  container-type: size;
  overflow: hidden;
  background: #0b0d1a;
  font-size: 2cqh;
}

.ss-screen:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 2px;
}

.ss-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- Panels (title, briefing, pause, results) ---------- */

.ss-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2cqh;
  padding: 4cqh 5cqw;
  text-align: center;
  color: #f5f1e8;
  background: rgba(8, 10, 24, 0.86);
  font-size: 3.6cqh;
  line-height: 1.35;
}

.ss-kicker {
  font-family: var(--font-display);
  font-size: 3cqh;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7ee08a;
}

.ss-logo {
  font-size: 15cqh;
  line-height: 0.95;
  color: var(--sun);
  text-shadow: 0.6cqh 0.6cqh 0 var(--red);
}

.ss-logo span {
  color: #f5f1e8;
}

.ss-tagline {
  font-family: var(--font-display);
  font-size: 4cqh;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6cqh 2cqh;
  border: 0.4cqh solid currentColor;
  color: #ff8a7a;
  transform: rotate(-2deg);
}

.ss-heading {
  font-size: 7cqh;
  color: var(--sun);
  text-shadow: 0.4cqh 0.4cqh 0 var(--red);
}

/* ---------- Menu buttons ---------- */

.ss-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.4cqh;
  min-width: 40cqw;
}

.ss-menu--row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}

.ss-menu:empty {
  display: none;
}

.ss-btn {
  font: inherit;
  font-family: var(--font-display);
  font-size: 3.8cqh;
  padding: 1.2cqh 3cqh;
  color: var(--ink);
  background: var(--sun);
  border: 0.5cqh solid #10131f;
  border-radius: 1.2cqh;
  box-shadow: 0.6cqh 0.6cqh 0 var(--red);
  cursor: pointer;
}

.ss-btn--ghost {
  color: #f5f1e8;
  background: #26304d;
}

.ss-btn:hover {
  background: #fff0a8;
  color: var(--ink);
}

.ss-btn:disabled {
  cursor: not-allowed;
  color: #8a90a8;
  background: #1a2036;
  box-shadow: none;
}

/* Big, obvious keyboard focus: a white ring plus an arrow marker. */
.ss-btn:focus-visible {
  outline: 0.6cqh solid #ffffff;
  outline-offset: 0.6cqh;
  border-radius: 1.2cqh;
}

.ss-btn:focus-visible::before {
  content: "\25B6\00a0";
}

#ss-level-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1cqh 1.6cqh;
}

.ss-level {
  font-size: 3.2cqh;
  text-align: left;
}

.ss-level small {
  display: block;
  font-family: var(--font-body);
  font-size: 2.8cqh;
  font-weight: 700;
}

/* ---------- Controls list ---------- */

.ss-controls {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0.8cqh 3cqh;
  margin: 0;
  padding: 1.6cqh 2.4cqh;
  list-style: none;
  font-size: 2.8cqh;
  text-align: left;
  border: 0.3cqh dashed rgba(255, 255, 255, 0.35);
  border-radius: 1cqh;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9em;
  text-align: center;
  color: var(--ink);
  background: #f5f1e8;
  border-radius: 0.3em;
  box-shadow: 0 0.15em 0 #8a90a8;
}

.ss-touch-note {
  display: none;
  font-weight: 700;
  color: #ff8a7a;
}

@media (pointer: coarse) {
  .ss-touch-note {
    display: block;
  }
}

/* ---------- Briefing ---------- */

.ss-brief {
  display: flex;
  gap: 3cqh;
  align-items: flex-start;
  max-width: 80cqw;
  text-align: left;
}

.ss-brief__text {
  display: grid;
  gap: 1.2cqh;
}

.ss-from {
  font-family: var(--font-display);
  font-size: 2.6cqh;
  color: #7ee08a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ss-goals {
  margin: 0;
  padding-left: 1.2em;
  font-weight: 700;
  color: var(--sun);
}

.ss-portrait {
  flex: none;
  width: 22cqh;
  height: 22cqh;
  image-rendering: pixelated;
  border: 0.6cqh solid #f5f1e8;
  border-radius: 1cqh;
  background: #173a36;
}

/* ---------- Radio box ---------- */

.ss-radio {
  position: absolute;
  left: 3cqw;
  right: 3cqw;
  bottom: 3cqh;
  display: flex;
  gap: 2.5cqh;
  align-items: center;
  padding: 2cqh 2.5cqh;
  color: #f5f1e8;
  background: rgba(10, 30, 28, 0.94);
  border: 0.6cqh solid #7ee08a;
  border-radius: 1.6cqh;
  box-shadow: 0 0 0 0.5cqh #10131f;
}

.ss-radio[data-who="santa"] {
  background: rgba(40, 12, 18, 0.94);
  border-color: #ff8a7a;
}

.ss-radio[data-who="santa"] .ss-portrait {
  background: #2a1630;
}

.ss-radio__body {
  flex: 1;
  display: grid;
  gap: 0.8cqh;
}

.ss-radio__who {
  font-family: var(--font-display);
  font-size: 3cqh;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7ee08a;
}

.ss-radio[data-who="santa"] .ss-radio__who {
  color: #ff8a7a;
}

.ss-radio__text {
  min-height: 2.7em;
  font-size: 4cqh;
  font-weight: 700;
  line-height: 1.35;
}

.ss-radio__next {
  justify-self: end;
  font-size: 2.4cqh;
  opacity: 0.8;
}

/* ---------- Results ---------- */

.ss-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 1cqh 4cqh;
  margin: 0;
}

.ss-stats dt {
  font-size: 2.6cqh;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9fb0d0;
}

.ss-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 5cqh;
  color: #ffffff;
}

.ss-rank-label {
  font-size: 2.8cqh;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9fb0d0;
}

.ss-rank {
  margin-top: -1.6cqh;
  font-family: var(--font-display);
  font-size: 7cqh;
  line-height: 1.05;
  color: var(--sun);
  text-shadow: 0.4cqh 0.4cqh 0 var(--red);
}

.ss-best {
  font-weight: 700;
  color: #7ee08a;
}

.ss-best:empty {
  display: none;
}

/* ---------- Medals, progress, outfits ---------- */

.ss-medals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1cqh 1.6cqh;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ss-medal {
  padding: 0.6cqh 1.6cqh;
  font-size: 2.8cqh;
  font-weight: 800;
  color: #6b7590;
  border: 0.3cqh dashed #4a5370;
  border-radius: 99em;
}

.ss-medal--won {
  color: var(--ink);
  background: var(--sun);
  border: 0.3cqh solid #10131f;
}

.ss-medal--new::after {
  content: " NEW!";
  color: var(--red);
}

.ss-progress {
  margin-top: -1cqh;
  font-weight: 800;
  color: var(--sun);
}

.ss-progress:empty {
  display: none;
}

.ss-wardrobe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1cqh 1.6cqh;
}

.ss-wardrobe__preview {
  width: 10.4cqh;
  height: 5.6cqh;
  image-rendering: pixelated;
}

.ss-btn--small {
  font-size: 2.8cqh;
  padding: 0.8cqh 2cqh;
}

.ss-wardrobe__note {
  flex-basis: 100%;
  margin: 0;
  font-size: 2.6cqh;
  color: #9fb0d0;
}

.ss-wardrobe__note:empty {
  display: none;
}

.ss-noscript {
  position: relative;
  color: #fff;
  font-weight: 700;
}

/* ---------- Toolbar under the game ---------- */

.ss-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
}

.ss-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  color: var(--ink-soft);
}

.ss-keys kbd {
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

@media (max-width: 40rem) {
  .ss-controls {
    grid-template-columns: repeat(2, auto);
  }
}

@container (max-width: 28rem) {
  #ss-level-list {
    grid-template-columns: 1fr;
  }
}
