/* Quick game: one word per screen, big crop, few buttons. */
:root {
  --ink: #1b1b1b;
  --paper: #fbfaf7;
  --accent: #0b5cad;
  --hl: #d40000;
  --muted: #5a5a5a;
  --good: #1d7a2e;
  --bad: #a3261b;
  --focus: #ffbf47;
  font-family: "Frank Ruehl CLM", "David", "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
}

body {
  margin: 0 auto;
  max-width: 900px;
  padding: 0.75rem 1rem 2rem;
  line-height: 1.5;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* headings and the verdict get focus only so screen readers announce them */
[tabindex="-1"]:focus {
  outline: none;
}

h1,
h2 {
  font-size: 1.8rem;
  margin: 1.5rem 0 0.5rem;
  text-align: center;
}

.lead {
  font-size: 1.15rem;
  text-align: center;
  margin: 0.4rem 0;
}

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

button {
  font: inherit;
  font-size: 1rem;
  padding: 0.45rem 1rem;
  border: 1px solid #b9b9b9;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}

button.big {
  font-size: 1.25rem;
  padding: 0.6rem 1.6rem;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.sizes {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

#card {
  text-align: center;
}

.points {
  font-size: 3rem;
  font-weight: bold;
  margin: 0.2rem 0;
  color: var(--accent);
}

/* thin progress row: hearts, n/size, score */
.status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
  color: var(--muted);
}

.hearts {
  color: var(--bad);
  letter-spacing: 0.15em;
  font-size: 1.2rem;
}

.hearts .lost {
  opacity: 0.2;
}

.bar {
  height: 4px;
  background: #e6e3dc;
  border-radius: 2px;
  margin: 0.3rem 0 0.6rem;
  overflow: hidden;
}

#bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* the crop never shrinks below a readable size; on narrow screens it scrolls and centres on the word */
.viewport {
  overflow-x: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.stage {
  position: relative;
  width: 100%;
  min-width: 720px;
}

.stage img {
  display: block;
  width: 100%;
  height: auto;
}

.highlight {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid var(--hl);
  border-radius: 3px;
  pointer-events: none;
}

.context {
  font-size: 1.2rem;
  color: var(--muted);
  text-align: center;
  margin: 0.5rem 0 0.8rem;
  unicode-bidi: isolate;
}

.context mark {
  background: #ffe7a3;
  color: var(--ink);
  padding: 0 0.4rem;
  margin: 0 0.25rem;
  border-radius: 3px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.choices button {
  font-size: 2rem;
  min-width: 7rem;
  padding: 0.4rem 1.2rem;
  border: 2px solid var(--accent);
  unicode-bidi: isolate;
}

.minor {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.minor button:not(.big) {
  color: var(--muted);
}

.verdict {
  font-size: 1.4rem;
  text-align: center;
  margin: 0.5rem 0;
}

.verdict.good {
  color: var(--good);
}

.verdict.bad {
  color: var(--bad);
}

/* ---- players: name, device code, leaderboard, award toast */
[hidden] {
  display: none !important;
}

button.link {
  border: none;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 0 0.3rem;
}

.name-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 0.8rem 0 0;
}

.name-form input {
  font: inherit;
  font-size: 1.1rem;
  padding: 0.4rem 0.6rem;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #b9b9b9;
  border-radius: 10px;
  width: 11rem;
}

.err {
  flex-basis: 100%;
  text-align: center;
  color: var(--bad);
  margin: 0;
  min-height: 1.2em;
}

.device {
  text-align: center;
  border-top: 1px solid #e6e3dc;
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 2rem;
  letter-spacing: 0.3em;
  margin: 0.4rem 0;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.tabs button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

table.lb {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 1.1rem;
}

.lb th,
.lb td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e6e3dc;
  text-align: start;
}

.lb th {
  color: var(--muted);
  font-weight: normal;
  font-size: 0.95rem;
}

.lb td:first-child,
.lb td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}

.lb .tag {
  color: var(--muted);
  font-size: 0.85em;
}

.lb tr.you td {
  background: #fff6d6;
  font-weight: bold;
}

.lb tr.gap td {
  text-align: center;
  color: var(--muted);
  border-bottom: none;
}

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 1.2rem;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}

.privacy {
  max-width: 900px;
  margin: 2.5rem auto 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Gate 11 */
.ok {
  color: var(--good, #1a7f37);
  font-weight: 600;
}

.hint {
  text-align: center;
  margin: 0.5rem 0 0;
}

#typed {
  margin-top: 0.75rem;
}

.share-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 4.5rem;
  width: fit-content;
  max-width: 94vw;
  margin: 0 auto;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border: 1px solid #b9b9b9;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 18%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.share-panel p {
  flex-basis: 100%;
  text-align: center;
  margin: 0;
}

.share-panel a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.6rem;
}

.toast button {
  margin-inline-start: 0.6rem;
}
