:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.gate-body {
  display: grid;
  place-items: center;
  background: #05070a;
  color: #f3f6fb;
}

.gate-shell {
  width: min(320px, calc(100vw - 48px));
}

.gate-form,
.admin-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.gate-form input,
.admin-add input {
  min-width: 0;
  border: 1px solid #28313d;
  border-radius: 6px;
  background: #0d1117;
  color: #f3f6fb;
  padding: 11px 12px;
  outline: none;
}

.gate-form input:focus,
.admin-add input:focus {
  border-color: #5fa8ff;
}

button {
  border: 0;
  border-radius: 6px;
  background: #f3f6fb;
  color: #0d1117;
  padding: 11px 14px;
  cursor: pointer;
}

a {
  color: inherit;
}

.games-body {
  background: #0a0d12;
  color: #eef3f8;
  padding: 32px 22px;
}

.games-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.games-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
}

.games-header h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.game-card {
  display: grid;
  align-content: end;
  min-height: 230px;
  border: 1px solid #253241;
  border-radius: 8px;
  padding: 18px;
  color: #eef3f8;
  text-decoration: none;
  background: #111820;
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

.game-card:hover {
  border-color: #77b9ff;
  transform: translateY(-2px);
}

.game-card strong {
  display: block;
  margin-top: 22px;
  font-size: 24px;
}

.game-card span:last-child {
  margin-top: 8px;
  color: #aeb9c7;
  line-height: 1.45;
}

.game-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #eef3f8;
  color: #111820;
  font-weight: 900;
}

.reaction-card {
  background:
    linear-gradient(145deg, rgba(19, 168, 91, 0.16), transparent 44%),
    #111820;
}

.pin-card {
  background:
    radial-gradient(circle at 70% 26%, rgba(238, 243, 248, 0.2), transparent 28%),
    #111820;
}

.reaction-body {
  color: #fff;
  user-select: none;
  touch-action: manipulation;
  transition: background 120ms ease;
}

.reaction-body.waiting,
.reaction-body.too-soon,
.reaction-body.done {
  background: #c51f2b;
}

.reaction-body.ready {
  background: #13a85b;
}

.reaction-arena {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.reaction-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(48px, 12vw, 132px);
  line-height: 0.95;
}

.reaction-copy p {
  margin: 8px 0 0;
  font-size: clamp(18px, 3vw, 28px);
}

.game-nav {
  position: fixed;
  z-index: 2;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.game-nav a,
.game-nav button {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(9, 13, 18, 0.62);
  color: #f7fafc;
  padding: 9px 12px;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.reaction-nav {
  right: auto;
}

.pin-body {
  overflow: hidden;
  background: #111820;
  color: #f7fafc;
  user-select: none;
  touch-action: manipulation;
}

.pin-shell {
  min-height: 100vh;
}

.pin-hud {
  position: fixed;
  z-index: 1;
  top: 64px;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  gap: 4px;
  pointer-events: none;
}

.pin-hud p {
  margin: 0;
}

.pin-hud p:first-child {
  font-size: 22px;
  font-weight: 800;
}

.pin-hud p:nth-child(2),
.pin-hud p:nth-child(3) {
  color: #aeb9c7;
}

#pinCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.admin-body {
  display: grid;
  place-items: center;
  background: #0a0d12;
  color: #eef3f8;
  padding: 24px;
}

.admin-panel {
  width: min(640px, 100%);
}

.admin-panel h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

.invite-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 18px 0;
  list-style: none;
}

.invite-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #28313d;
  border-radius: 6px;
  padding: 10px 12px;
  background: #111722;
}

.invite-list code {
  overflow-wrap: anywhere;
}

.invite-list button,
.ghost {
  background: #263241;
  color: #eef3f8;
}

@media (max-width: 520px) {
  .gate-form,
  .admin-add {
    grid-template-columns: 1fr;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 190px;
  }
}
