@font-face {
  font-family: "Bodoni";
  src: url("/assets/fonts/bodoni-moda-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni";
  src: url("/assets/fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #14110f;
  --paper: #f4ecd8;
  --red: #c8102e;
  --gold: #f2b631;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
canvas#c { position: fixed; inset: 0; display: block; touch-action: none; }

.hidden { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(20, 17, 15, 0.72), rgba(20, 17, 15, 0.94));
  z-index: 5;
}

h1 {
  font-family: "Bodoni", Georgia, serif;
  font-weight: 900;
  font-size: clamp(44px, 12vw, 104px);
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 0.9;
  color: var(--paper);
  text-shadow: 0 4px 0 var(--red), 0 10px 30px rgba(0, 0, 0, 0.6);
}
h2 {
  font-family: "Bodoni", Georgia, serif;
  font-weight: 900;
  font-size: clamp(30px, 7vw, 56px);
  margin: 0 0 6px;
  color: var(--gold);
  text-shadow: 0 3px 0 #000;
}
.sub {
  margin: 0;
  font-size: clamp(15px, 3.6vw, 20px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
#lineup { width: min(720px, 100%); height: auto; aspect-ratio: 720 / 210; }

button { font: inherit; cursor: pointer; border: 0; }
.big {
  min-width: 220px;
  padding: 16px 36px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--red);
  border-radius: 14px;
  box-shadow: 0 6px 0 #7a0a1c, 0 12px 26px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s;
}
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a0a1c; }
.big { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.ghost {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--paper);
  background: transparent;
  border: 2px solid rgba(244, 236, 216, 0.35);
  border-radius: 12px;
}
.best { margin: 0; font-size: 16px; opacity: 0.85; }
.best b { color: var(--gold); font-size: 20px; }
.hint { margin: 0; font-size: 13px; opacity: 0.55; }
.score { margin: 0; font-size: clamp(48px, 12vw, 84px); font-weight: 900; color: #fff; }
.meta { margin: 0 0 8px; font-size: 16px; opacity: 0.8; }

#hudBtns {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 4;
}
#hudBtns button {
  width: 42px;
  height: 42px;
  font-size: 19px;
  border-radius: 12px;
  background: rgba(20, 17, 15, 0.55);
  color: #fff;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 760px;
}
.card {
  width: 210px;
  padding: 18px 14px 16px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  box-shadow: 0 8px 0 #b9ab86, 0 16px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: pop 0.25s ease-out backwards;
}
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
@keyframes pop { from { transform: scale(0.6) translateY(30px); opacity: 0; } }
.card:hover { transform: translateY(-4px); }
.card > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.card .ic { font-size: 44px; line-height: 1; }
.card .t { font-size: 20px; font-weight: 900; }
.card .d { font-size: 14px; opacity: 0.75; }
.card .lv { font-size: 12px; letter-spacing: 3px; color: var(--red); }
.card .k { font-size: 11px; opacity: 0.4; }

@media (max-width: 560px) {
  .card { width: 100%; max-width: 340px; flex-direction: row; text-align: left; padding: 12px 16px; gap: 14px; }
  .card .ic { font-size: 36px; }
  .card .k { display: none; }
  .card > div { align-items: flex-start; gap: 2px; }
}

#maps { overflow-y: auto; justify-content: flex-start; padding-top: max(24px, 6vh); }
#maps .card { cursor: pointer; }
.rank { color: var(--gold); font-weight: 800; }
.quote { margin: 0 0 6px; font-size: 14px; font-style: italic; opacity: 0.7; max-width: 420px; }

#actBtns {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  gap: 12px;
  z-index: 4;
}
#actBtns button {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  background: rgba(20, 17, 15, 0.6);
  border: 3px solid rgba(244, 236, 216, 0.35);
  touch-action: manipulation;
}
#actBtns small { font-size: 10px; font-weight: 900; letter-spacing: 0.08em; }
#actBtns button.off { opacity: 0.4; }
#actBtns button.ready { border-color: var(--gold); box-shadow: 0 0 18px rgba(242, 182, 49, 0.7); animation: pulse 1s ease-in-out infinite; }
