:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #111827;
  color: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #e5e7eb;
}

.shell {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: #020817;
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(0,0,0,0.7);
  border: 1px solid rgba(129,140,248,0.28);
  max-width: 980px;
  width: 100%;
}

.left {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-main {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.subtitle-main {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
}

#gameCanvas {
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #9ca3af;
  background: #ffffff;
  display: block;
  width: 480px;
  height: 480px;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  gap: 6px;
}

.status {
  font-size: 12px;
  min-height: 18px;
  color: #e5e7eb;
  flex: 2;
}

.status.win { color: #22c55e; }
.status.lose { color: #f97316; }
.round-label { font-size: 10px; color: #9ca3af; }

.sidebar {
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(75,85,99,0.9);
  background: #020817;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.pill {
  padding: 4px 7px;
  border-radius: 8px;
  background: #020817;
  border: 1px solid rgba(75,85,99,0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #e5e7eb;
  gap: 6px;
}

.btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(129,140,248,0.9);
  background: #111827;
  font-size: 10px;
  color: #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15,23,42,0.9);
  background: #1f2937;
}

.btn:active { transform: translateY(0); box-shadow: none; }
.btn.selected { box-shadow: 0 0 8px rgba(129,140,248,0.9); background: #374151; }
.btn.hidden, .hidden { display: none; }

.overlay {
  margin-top: 4px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(148,163,253,0.4);
  min-height: 48px;
}

.overlay-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #93c5fd;
  margin-bottom: 2px;
}

.overlay-body {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 2px;
}

#storyText {
  font-size: 12px;
  line-height: 1.6;
  color: #e5e7eb;
  flex: 1;
  white-space: pre-line;
}

.story-next {
  font-size: 10px;
  padding: 6px 10px;
  align-self: flex-end;
}

.legend {
  font-size: 9px;
  color: #9ca3af;
  line-height: 1.5;
  margin-top: 4px;
}

.note { font-size: 8px; color: #9ca3af; }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  #gameCanvas { margin: 0 auto; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .overlay-body { flex-direction: column; align-items: flex-start; }
  .story-next { align-self: flex-start; }
}
