@font-face {
  font-family: 'PressStart';
  src: url('fonts/press-start-2p-latin-400-normal.woff2') format('woff2');
}

:root {
  --bg: #0b0710;
  --ink: #fff4dc;
  --dim: #b8a6c9;
  --p1: #ff4d4d;
  --p2: #4da6ff;
  --gold: #ffd23f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'PressStart', ui-monospace, monospace;
  overflow: hidden;
  display: grid;
  place-items: center;
}

#stage {
  position: relative;
  width: min(100vw, 177.78vh);
  aspect-ratio: 16 / 9;
  container-type: size;
}

#screen {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hidden { display: none !important; }

.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.foot {
  position: absolute;
  bottom: 2.2cqh;
  font-size: 1.1cqw;
  color: var(--dim);
  opacity: .75;
}

/* ------------------------------------------------------------- lobby */

#lobby { gap: 2.2cqh; padding-bottom: 4cqh; }
#lobby h1 {
  margin: 0;
  font-size: 3.6cqw;
  font-weight: normal;
  line-height: 1.15;
  text-align: center;
  color: var(--gold);
  text-shadow: .35cqw .35cqw 0 #8c2a1e, .7cqw .7cqw 0 #1a1026;
  letter-spacing: .2cqw;
}
.vs { font-size: 1.3cqw; color: var(--dim); margin-top: -1.5cqh; text-shadow: .2cqw .2cqw 0 #000; }
.vs .gov { color: #ff9933; }
.vs .cjp { color: #c98a4b; }
.cards { display: flex; gap: 7cqw; }
.modes { display: flex; gap: 1.2cqw; }
.mode {
  font: inherit; font-size: 1.15cqw; cursor: pointer;
  padding: 1cqw 1.6cqw .8cqw;
  color: var(--dim); background: #1a1026e8;
  border: .3cqw solid #3d2a55; border-radius: .6cqw;
}
.mode.on { color: #140c1c; background: var(--gold); border-color: #140c1c; box-shadow: 0 .4cqw 0 #0008; }
.guide-btn {
  position: absolute;
  right: 1.6cqw; bottom: 2.4cqh;
  font: inherit; font-size: 1.1cqw; cursor: pointer;
  padding: 1cqw 1.4cqw .8cqw;
  color: #140c1c;
  background: linear-gradient(#d6c4ff, #b48cff);
  border: .3cqw solid #140c1c; border-radius: .6cqw;
  box-shadow: 0 .4cqw 0 #0008;
}
.guide-btn:hover { filter: brightness(1.1); }
.guide-btn:active { transform: translateY(.2cqw); box-shadow: 0 .2cqw 0 #0008; }
.tag.cpu { background: var(--gold); }
.ai-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; min-height: 24cqw; }
.ai-title { font-size: 1.3cqw; color: var(--ink); }
.levels { display: flex; flex-direction: column; gap: .7cqw; width: 100%; }
.level {
  font: inherit; font-size: 1.1cqw; cursor: pointer; padding: .8cqw .6cqw .6cqw;
  color: var(--dim); background: #22162f; border: .25cqw solid #3d2a55; border-radius: .4cqw;
}
.level.on { color: #140c1c; border-color: #140c1c; }
.card {
  position: relative;
  width: 21cqw;
  padding: 2.2cqw 1.6cqw 1.4cqw;
  background: #1a1026e8;
  border: .4cqw solid #3d2a55;
  border-radius: .8cqw;
  box-shadow: 0 .6cqw 0 #0008;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.card .tag {
  position: absolute;
  top: -1.6cqw; left: 50%;
  transform: translateX(-50%);
  padding: .6cqw 1cqw .4cqw;
  font-size: 1.6cqw;
  color: #140c1c;
  border-radius: .4cqw;
}
.tag.p1 { background: var(--p1); }
.tag.p2 { background: var(--p2); }
.qr { width: 100%; image-rendering: pixelated; border-radius: .4cqw; display: block; }
.card .url { margin-top: 1cqw; font-size: .75cqw; color: var(--dim); word-break: break-all; line-height: 1.6; }
.card .state { margin-top: .8cqw; font-size: 1.1cqw; color: var(--dim); }
.card.on { transform: translateY(-.5cqw); }
.card.on[data-slot="1"] { border-color: var(--p1); }
.card.on[data-slot="2"] { border-color: var(--p2); }
.card.on .state { color: #7dff9a; }
.card.on .qr { opacity: .25; }
#room-code { font-size: 1cqw; color: var(--dim); margin-top: -1.5cqh; }
#room-code b { color: var(--gold); letter-spacing: .2cqw; }
#lobby-hint { font-size: 1.25cqw; color: var(--ink); text-shadow: .2cqw .2cqw 0 #000; }

/* ------------------------------------------------------------- rejoin */

#rejoin { background: #0b0710aa; }
.rejoin-box {
  width: 26cqw;
  padding: 2cqw;
  background: #1a1026;
  border: .4cqw solid var(--p1);
  border-radius: .8cqw;
  text-align: center;
}
#rejoin-title { font-size: 1.6cqw; margin-bottom: 1.6cqw; color: var(--gold); }
.rejoin-box .hint { margin-top: 1.4cqw; font-size: .9cqw; color: var(--dim); line-height: 1.6; }

/* ------------------------------------------------------------- pause menu */

#menu { background: #0b0710c8; }
.menu-box {
  min-width: 46cqw;
  padding: 3cqw 3.5cqw 2.5cqw;
  background: #1a1026;
  border: .4cqw solid #3d2a55;
  border-radius: .8cqw;
  box-shadow: 0 .8cqw 0 #0009;
}
.menu-title { font-size: 2.4cqw; text-align: center; color: var(--gold); margin-bottom: 2.4cqw; }
#menu .foot { position: static; text-align: center; margin-top: 2cqw; }
#menu-items { list-style: none; margin: 0; padding: 0; }
#menu-items li {
  display: flex;
  justify-content: space-between;
  gap: 3cqw;
  padding: 1cqw 1.2cqw;
  font-size: 1.4cqw;
  border-radius: .4cqw;
  cursor: pointer;
  color: var(--dim);
}
#menu-items li .val { color: var(--ink); }
#menu-items li.sel, #menu-items li:hover { background: #3d2a55; color: var(--ink); }
#menu-items li.sel::before { content: '▶ '; color: var(--gold); }
#menu-items li.danger { color: #ff8a8a; }

#start-card {
  z-index: 50;
  gap: 2.4cqh;
  cursor: pointer;
  background: radial-gradient(ellipse at center, #2a1838ee 0%, #0b0710f5 70%);
}
.start-title {
  font-size: 5.2cqw;
  color: var(--gold);
  text-shadow: .45cqw .45cqw 0 #8c2a1e, .9cqw .9cqw 0 #1a1026;
  letter-spacing: .25cqw;
}
.start-sub { font-size: 1.4cqw; color: #ff9933; }
.start-sub span { color: var(--dim); }
.start-press { margin-top: 5cqh; font-size: 2.4cqw; color: var(--ink); text-shadow: .25cqw .25cqw 0 #000; }
.start-hint { font-size: 1.1cqw; color: var(--dim); }

/* The Move Guide is drawn on the canvas: hide every HTML layer on top of it while it's open. */
#stage.guide-open .overlay,
#stage.guide-open #start-card,
#stage.guide-open .guide-btn { display: none !important; }
