@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}

:root {
  --night: #072536;
  --night2: #0d3a52;
  --orange: #ec7004;
  --orange2: #a84f00;
  --teal: #05506b;
  --snow: #f4f7ff;
  --snow2: #c9d6ee;
  --red: #d62839;
  --red2: #8f1726;
  --green: #2a9d4b;
  --green2: #1a6331;
  --gold: #f2c14e;
  --gold2: #b5862a;
  --px: "Press Start 2P", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--snow);
  font-family: var(--px);
  font-size: 12px;
  line-height: 1.6;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.screen {
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.screen[hidden] { display: none; }

h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.3; font-weight: normal; }
h1 span { display: block; }
h1 .t1 { color: var(--orange); text-shadow: 3px 3px 0 var(--orange2); }
h1 .t2 { color: var(--snow); text-shadow: 3px 3px 0 var(--teal); }
h2 { margin: 0; font-size: 16px; font-weight: normal; color: var(--orange); }
.school { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 10px; color: var(--snow2); }
.school img { width: 40px; height: 40px; }

.btn {
  font: inherit;
  font-size: 13px;
  color: var(--snow);
  background: var(--night2);
  border: 0;
  padding: 14px 18px;
  min-height: 48px;
  width: 100%;
  cursor: pointer;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.35), 0 0 0 3px var(--snow);
  transition: transform .08s;
}
.btn:active { transform: translateY(2px); box-shadow: inset 4px 4px 0 rgba(0,0,0,.35), 0 0 0 3px var(--snow); }
.btn.go { background: var(--orange); }
.btn.small { width: auto; font-size: 11px; padding: 10px 14px; min-height: 40px; }

.link {
  font: inherit;
  font-size: 11px;
  color: var(--snow2);
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  text-decoration: underline;
}

.corner {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 8px;
  z-index: 2;
  font-size: 20px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

/* Menu */
.games { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.game-row { display: flex; gap: 12px; }
.game-row .btn:first-child { flex: 1; text-align: left; display: flex; align-items: center; gap: 10px; }
.game-row .btn:first-child .e { font-size: 22px; }
.game-row .trophy { width: 56px; flex: none; font-size: 20px; padding: 0; }
.me { font-size: 10px; color: var(--snow2); margin: 6px 0 0; }
.me strong { color: var(--orange); font-weight: normal; }

/* Nickname */
.preview { margin: 0; font-size: 11px; color: var(--snow2); }
.preview strong { display: block; margin-top: 6px; font-size: 14px; color: var(--orange); font-weight: normal; }
.wheels { display: flex; gap: 10px; width: 100%; }
.wheel {
  position: relative;
  flex: 1;
  height: min(38vh, 260px);
  overflow-y: auto;
  touch-action: pan-y;
  background: var(--night2);
  box-shadow: 0 0 0 3px var(--teal);
  scrollbar-width: none;
}
.wheel::-webkit-scrollbar { display: none; }
.wheel button {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 10px;
  color: var(--snow);
  background: none;
  border: 0;
  padding: 12px 4px;
  cursor: pointer;
}
.wheel button[aria-selected="true"] { background: var(--orange); color: var(--snow); }

/* Intro */
.big { font-size: 64px; line-height: 1; }
.uitleg { margin: 0; font-size: 12px; line-height: 1.9; }

/* Game */
#play { position: fixed; inset: 0; max-width: none; justify-content: center; }
#game { image-rendering: pixelated; touch-action: none; display: block; box-shadow: 0 0 0 3px var(--snow2); }

/* Game over */
.score { margin: 0; font-size: 14px; }
.score strong { color: var(--orange); font-weight: normal; font-size: 22px; display: block; margin-top: 8px; }
.rank { margin: 0; font-size: 11px; min-height: 2em; color: var(--snow2); }

/* Board */
.top { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; font-size: 10px; }
.top li { display: flex; gap: 8px; padding: 8px 6px; border-bottom: 2px dashed var(--night2); }
.top li .p { width: 2.4em; flex: none; }
.top li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top li .s { color: var(--orange); }
.top li.me { background: var(--night2); }
.top li.empty { justify-content: center; color: var(--snow2); }
.mine { margin: 0; font-size: 10px; color: var(--orange); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Nickname availability */
.status { margin: 0; min-height: 1.6em; font-size: 10px; }
.status.free { color: var(--snow2); }
.status.taken { color: var(--orange); }
.btn:disabled { opacity: .45; }

.privacy { margin: 0; font-size: 8px; line-height: 1.8; color: var(--snow2); opacity: .8; max-width: 300px; }
