@font-face {
  font-family: "General Sans";
  src: url("/fonts/GeneralSans-Variable.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  --night: #0a1230;
  --sky: #142456;
  --gold: #ffd970;
  --berry: #b3261e;
  --cream: #f5f3ee;
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #d89e00;
  --green: #26890c;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: "General Sans", ui-sans-serif, system-ui, sans-serif;
  color: #fff;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 41% 26%, #fffbe0 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 69% 31%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 83% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 48%, #fff 50%, transparent 51%),
    linear-gradient(180deg, var(--night) 0%, var(--sky) 50%, #27407a 100%);
  background-size: 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 100% 100%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7em 1.6em;
  background: var(--gold);
  color: #2a1d0e;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.25em 0 #b8962f;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 0.1em 0 #b8962f;
}
.btn:disabled {
  opacity: 0.5;
}
.field {
  width: 100%;
  border: 2px solid rgb(255 255 255 / 0.25);
  border-radius: 12px;
  padding: 0.75em 0.9em;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 1.15rem;
}
.field:focus {
  outline: none;
  border-color: var(--gold);
}
.error {
  color: #ffb4b4;
  font-weight: 600;
}
.muted {
  opacity: 0.75;
}
.eyebrow {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85em;
}
.c0 {
  --c: var(--red);
}
.c1 {
  --c: var(--blue);
}
.c2 {
  --c: var(--yellow);
}
.c3 {
  --c: var(--green);
}
.gif {
  position: relative;
  container-type: inline-size;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  border: 0.25em solid #fff;
  box-shadow: 0 1.5em 3em rgb(0 0 0 / 0.5);
}
.gif img {
  display: block;
  width: 100%;
  object-fit: contain;
}
.gif figcaption {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 4%;
  color: #fff;
  font-family: Impact, "Anton", "Arial Black", sans-serif;
  font-size: clamp(1rem, 6cqi, 3.6rem);
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
  text-shadow: 0 3px 4px rgb(0 0 0 / 0.6);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-6deg);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5em);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

/* ---------- Mobilen ---------- */
.play {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}
.play-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.play-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.play-center h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}
.play-big {
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 700;
  animation: pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.join {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 12px;
  text-align: left;
}
.join label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.pin-field {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.8rem;
  font-weight: 700;
}
.answers {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 12px;
}
.answer {
  border: 0;
  border-radius: 14px;
  background: var(--c);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: 0 6px 0 rgb(0 0 0 / 0.3);
  cursor: pointer;
}
.answer:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.3);
}
.answer .shape {
  font-size: 2rem;
  line-height: 1;
}
.answer.dim {
  opacity: 0.25;
}
.timebar {
  height: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.15);
  overflow: hidden;
}
.timebar i {
  display: block;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
}
.result-right {
  background: var(--green);
}
.result-wrong {
  background: var(--red);
}
.chip {
  display: inline-block;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.3);
  font-weight: 600;
}

/* ---------- Storskjermen ---------- */
.host {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 3vh 4vw;
  font-size: clamp(16px, 1.5vw, 34px);
  overflow: hidden;
}
.host-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5vh;
}
.host-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  gap: 1em;
}
.host-title {
  margin: 0;
  font-size: 4em;
  line-height: 1;
  font-weight: 700;
  text-align: center;
}
.host-h2 {
  margin: 0;
  font-size: 2.4em;
  font-weight: 700;
  text-align: center;
}
.lobby {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4vw;
  align-items: center;
  width: 100%;
  max-width: 90vw;
}
.qr {
  width: min(42vh, 34vw);
  border-radius: 16px;
  background: #fff;
  padding: 0.6em;
}
.qr img {
  display: block;
  width: 100%;
}
.pin {
  font-size: 5em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1;
}
.players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 34vh;
  overflow: hidden;
}
.players li {
  padding: 0.3em 0.9em;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  font-weight: 600;
  animation: pop 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3vw;
  min-height: 0;
  flex: 1;
  width: 100%;
}
.stage .gif {
  width: min(62vw, 92vh);
}
.stage .gif img {
  max-height: 50vh;
}
.timer {
  width: 4.2em;
  height: 4.2em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6a1b9a;
  font-size: 1.6em;
  font-weight: 700;
  flex-shrink: 0;
}
.answered {
  text-align: center;
  flex-shrink: 0;
}
.answered b {
  display: block;
  font-size: 2.6em;
  line-height: 1;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1vh 1vw;
  width: 100%;
}
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.6em 1em;
  border-radius: 10px;
  background: var(--c);
  font-size: 1.4em;
  font-weight: 700;
  box-shadow: 0 0.2em 0 rgb(0 0 0 / 0.3);
  transition: opacity 300ms;
}
.tile .shape {
  font-size: 1.2em;
}
.tile .count {
  margin-left: auto;
  font-size: 1.1em;
}
.tile.dim {
  opacity: 0.3;
}
.tile.right::after {
  content: "✔";
  margin-left: 0.5em;
}
.reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  animation: pop 650ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms both;
  flex-shrink: 0;
}
.face {
  width: 26vh;
  height: 26vh;
  border-radius: 50%;
  object-fit: cover;
  border: 0.18em solid var(--gold);
  box-shadow: 0 0 2em rgb(255 217 112 / 0.4);
  display: grid;
  place-items: center;
  background: #161c2d;
  font-size: 9vh;
  font-weight: 700;
}
.reveal-name {
  font-size: 1.8em;
  font-weight: 700;
  text-align: center;
  max-width: 24vw;
}
.board {
  width: min(70vw, 1100px);
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6em;
}
.board li {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.55em 1em;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.1);
  font-size: 1.3em;
  font-weight: 600;
  animation: rise 500ms both;
}
.board li:first-child {
  background: var(--gold);
  color: #2a1d0e;
}
.board .pts {
  margin-left: auto;
}
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2vw;
}
.podium > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  width: 22vw;
  animation: rise 800ms both;
}
.podium .step {
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: grid;
  place-items: center;
  font-size: 3em;
  font-weight: 700;
}
.podium .p1 .step {
  height: 34vh;
  background: var(--gold);
  color: #2a1d0e;
}
.podium .p2 .step {
  height: 24vh;
  background: #c9d2e3;
  color: #1b2540;
}
.podium .p3 .step {
  height: 16vh;
  background: #d39a66;
  color: #2a1d0e;
}
.podium .p1 {
  animation-delay: 1.6s;
}
.podium .p2 {
  animation-delay: 0.8s;
}
.podium .who {
  font-size: 1.5em;
  font-weight: 700;
  text-align: center;
}
.setup {
  display: grid;
  gap: 1em;
  width: min(560px, 90vw);
  font-size: 1.1rem;
}
.setup label {
  display: grid;
  gap: 0.4em;
  font-weight: 600;
}
.hint {
  font-size: 0.6em;
  opacity: 0.55;
}
.host.cursorless {
  cursor: none;
}
/* Uten bilde (eller uten samtykke til skjerm): bare et stort spørsmålstegn. */
.face-unknown {
  font-size: 16vh;
  color: var(--gold);
}
