/* Look C (the user's UI decisions, 2026-11-16): squared shapes, the system's own fonts,
   plain HTML/CSS. Every colour is a custom property here, in :root only, so a colour
   change is one line. You are always blue and on the left (rule 32); the opponent amber. */

:root {
  --you: #3563E9;
  --them: #C9822F;
  --page: #eef2f7;
  --card: #ffffff;
  --ink: #1b2330;
  --muted: #5b6574;
  --line: #d3dae4;
  --system: #a9b2bf;
  --correct: #2e8b57;
  --correct-bg: #e3f4e9;
  --error: #b02020;
  --notice-bg: #fff4d6;
  --notice-line: #e8c766;
  --radius: 4px;
}

/* `hidden` must win over any display rule below. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  color: var(--ink);
  background: var(--page);
}

/* Phone: 20 px side margins; laptop: a 720 px column in the middle. */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  box-sizing: border-box;
}

h1 {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

p {
  margin: 4px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
}

.form {
  display: grid;
  gap: 6px;
}

.form label {
  font-size: 0.9rem;
  color: var(--muted);
}

.form label.check {
  color: var(--ink);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.center {
  justify-content: center;
}

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

.inline {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Long sentences wrap inside the page (Phase 2 hand check 16). */
.text,
.choice,
.answers li,
.list li {
  overflow-wrap: anywhere;
}

.text {
  font-size: 1.15rem;
}

.small {
  font-size: 0.85rem;
  color: var(--muted);
}

.big {
  font-size: 1.25rem;
  font-weight: bold;
}

.record {
  font-size: 0.85rem;
  color: var(--muted);
}

.error {
  color: var(--error);
}

.notice {
  padding: 8px 12px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: var(--radius);
}

.notice:empty,
.error:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.code {
  font-size: 2.5rem;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.3rem;
}

#code {
  text-transform: uppercase;
  width: 7em;
}

button,
input {
  font: inherit;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

input {
  background: var(--card);
}

button {
  background: var(--you);
  border-color: var(--you);
  color: var(--card);
  cursor: pointer;
}

button.plain {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--you);
  outline-offset: 1px;
}

/* The players row: you on the left, the opponent right-aligned, "vs" between. */
.players {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.player {
  flex: 1;
  min-width: 0;
}

.player p {
  margin: 0;
  overflow-wrap: anywhere;
}

.them {
  text-align: right;
}

.vs {
  color: var(--muted);
  padding-top: 2px;
}

.name {
  font-weight: bold;
}

.you .name,
.you .points {
  color: var(--you);
}

.them .name,
.them .points {
  color: var(--them);
}

.points {
  font-size: 1.4rem;
  font-weight: bold;
}

.bar {
  display: flex;
  height: 20px;
  margin: 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.part {
  height: 100%;
}

.part.system {
  background: var(--system);
}

.part.mine {
  background: var(--you);
}

.part.theirs {
  background: var(--them);
}

.roundline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.choices {
  display: grid;
  gap: 8px;
}

/* A choice: the letter in a square, then the text, one per row. */
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  white-space: normal;
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  padding: 8px 10px;
}

.letter {
  flex: none;
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: bold;
}

.chosen {
  border-color: var(--you);
  outline: 2px solid var(--you);
}

.chosen .letter {
  background: var(--you);
  border-color: var(--you);
  color: var(--card);
}

.answers {
  padding-left: 0;
  list-style: none;
}

.answers li {
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.answers .correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  font-weight: bold;
}

.list {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.list li:last-child {
  border-bottom: none;
}

.rounds li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 8px 0;
}
