:root {
  --bg: #0d0e14;
  --fg: #f4f1ea;
  --muted: #8b8fa3;
  --accent: #ffd23f;
  --accent-dark: #b8901a;
  --p1: #2fe0d6;   /* Kurai's teal */
  --p2: #ff8a1f;   /* the robot's orange */
  --display: "Arial Black", Impact, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* 16:9 box as large as the window allows, leaving room for the help footer. */
#stage {
  position: relative;
  width: min(100%, calc((100vh - 130px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(5, 6, 10, 0.65);
  backdrop-filter: blur(2px);
}

.overlay.hidden { display: none; }

.ko-card { text-align: center; }

#ko-title {
  margin: 0;
  font: italic 900 clamp(44px, 9vw, 110px)/1 var(--display);
  letter-spacing: 0.04em;
  color: var(--accent);
  -webkit-text-stroke: 3px #000;
  text-shadow: 0 6px 0 #000;
}

#ko-winner {
  margin: 0.4em 0 0.2em;
  font: 900 clamp(20px, 3vw, 34px) var(--display);
}

#ko-score {
  margin: 0 0 1.4em;
  color: var(--muted);
  font-weight: 700;
}

.btn {
  min-width: 220px;
  padding: 14px 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #111;
  font: 900 20px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-dark);
}

.btn:hover { filter: brightness(1.08); }

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--accent-dark);
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.btn.secondary {
  background: #2a2d3d;
  color: var(--fg);
  box-shadow: 0 4px 0 #14161f;
}

.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.menu.row { flex-direction: row; justify-content: center; }

/* Title screen: the arena stays visible behind the logo. */
.overlay.title {
  background: linear-gradient(rgba(8, 6, 18, 0.15), rgba(8, 6, 18, 0.55));
  backdrop-filter: none;
}

.title-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

#logo {
  width: 62%;
  height: auto;
  margin-bottom: 4%;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
}

.logo-text {
  margin: 0 0 4%;
  font: italic 900 clamp(40px, 8vw, 96px)/1 var(--display);
  color: var(--accent);
  -webkit-text-stroke: 3px #000;
}

/* In the menu, the highlighted choice is yellow and the other one dark, so
   it's obvious what Enter will pick. */
.title .btn {
  min-width: 280px;
  font-size: clamp(18px, 2.4vw, 26px);
  background: rgba(20, 22, 34, 0.85);
  color: var(--fg);
  box-shadow: 0 4px 0 #0a0b12;
}

.title .btn:focus {
  background: var(--accent);
  color: #111;
  box-shadow: 0 4px 0 var(--accent-dark);
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.title .hint {
  color: var(--fg);
  text-shadow: 0 1px 3px #000;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  color: var(--muted);
  font-size: 14px;
}

.help strong { margin-right: 4px; }
.help .p1 { color: var(--p1); }
.help .p2 { color: var(--p2); }
.help .or { margin-left: 6px; }

/* Only the controls for the current mode. */
.mode-1 .only-2,
.mode-2 .only-1 { display: none; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 1px;
  padding: 1px 5px;
  border: 1px solid #3a3d4d;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1a1c26;
  color: var(--fg);
  font: 600 12px/1.4 ui-monospace, monospace;
  text-align: center;
}
