/* The Fast and the Furrows — Farming-Simulator-flavoured UI over a live 3D field. */
:root {
  --bg: #0f1418;
  --panel: rgba(28, 33, 40, 0.86);
  --panel-solid: #1c2128;
  --panel-2: #242b34;
  --line: #2f3a44;
  --ink: #f2f4f5;
  --ink-2: #9aa4ad;
  --green: #4caf50;
  --green-2: #7ed957;
  --gold: #f2c94c;
  --red: #e0392b;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#app {
  position: fixed;
  inset: 0;
}
#game-root {
  position: relative;
  width: 100%;
  height: 100%;
}
#viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
#viewport > canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hidden {
  display: none !important;
}
.small {
  font-size: 0.85rem;
  color: var(--ink-2);
}
h2,
h3,
h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 900;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.15rem;
}
h4 {
  font-size: 0.95rem;
}

/* ---- generic overlay + panel ---- */
/* auto margins centre a short panel and fall back to top-aligned scrolling for a tall one */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 30;
  padding: 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.overlay > * {
  margin: auto;
  flex: none;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem 1.8rem;
  text-align: center;
  max-width: 92%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.fs-btn {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.12s,
    box-shadow 0.12s;
}
.fs-btn:hover:not(:disabled),
.fs-btn.pad-focus:not(:disabled) {
  transform: translateY(-1px);
  background: #2c3540;
}
.fs-btn.primary {
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}
.fs-btn.primary:hover:not(:disabled),
.fs-btn.primary.pad-focus:not(:disabled) {
  box-shadow: 0 8px 26px rgba(76, 175, 80, 0.5);
}
.fs-btn.danger {
  border-color: rgba(224, 57, 43, 0.5);
  color: #ffb3aa;
}
.fs-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.quip {
  color: #d8dde2;
  font-style: italic;
  margin: 0.4rem 0;
}

/* ---- logo ---- */
.logo-block {
  margin-bottom: 1em;
}
#menu .logo-block {
  margin-bottom: 1em;
}
#menu .logo {
  font-size: min(2.4em, 4.2vw);
}
#menu .logo-rule {
  margin: 0.5em 0 0.35em;
  height: 0.25em;
  width: 4em;
}
#menu .logo-sub {
  font-size: 0.75em;
}
.logo {
  margin: 0;
  font-size: clamp(1.6rem, 4.2vw, 2.6rem);
  line-height: 0.95;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}
.logo-rule {
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  margin: 0.6rem 0 0.4rem;
  border-radius: 2px;
}
.logo-sub {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-2);
  font-weight: 700;
}

/* ---- loading ---- */
#loading {
  background: radial-gradient(ellipse at 50% 30%, #23303a, var(--bg));
  z-index: 50;
}
.load-panel {
  background: none;
  border: 0;
  box-shadow: none;
  text-align: left;
}
.load-track {
  width: 260px;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
#load-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  transition: width 0.15s;
}
.load-note {
  color: var(--ink-2);
  font-size: 0.85rem;
}

/* ---- menu ---- */
#menu {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
#menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 14, 18, 0.72) 0%, rgba(10, 14, 18, 0.45) 38%, rgba(10, 14, 18, 0) 62%);
}
.menu-col {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(440px, 46%);
  font-size: clamp(9px, 2.35vh, 16px);
  padding: 1.5em 1.75em 4em;
  overflow: hidden auto;
  scrollbar-width: none;
  pointer-events: auto;
  animation: slidein 0.35s ease-out;
}
.menu-col::-webkit-scrollbar {
  display: none;
}
@keyframes slidein {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.menu-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  animation: slidein 0.25s ease-out;
}
.menu-panel h3 {
  margin: 0.2em 0 0.3em;
  font-size: 1.15em;
}
.menu-btn {
  display: grid;
  grid-template-columns: 2.1em 1fr 1.2em;
  align-items: center;
  text-align: left;
  gap: 0.5em;
  font-family: inherit;
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.6em;
  padding: 0.7em 1em;
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.12s,
    color 0.12s;
}
.menu-btn .mi {
  font-size: 1.2em;
  text-align: center;
}
.menu-btn .chev {
  color: var(--ink-2);
  font-size: 1.3em;
  text-align: right;
}
.menu-btn:hover,
.menu-btn.pad-focus,
.menu-btn.primary {
  background: linear-gradient(90deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
  transform: translateX(4px);
  box-shadow: 0 8px 26px rgba(76, 175, 80, 0.35);
}
.menu-btn:hover .chev,
.menu-btn.pad-focus .chev,
.menu-btn.primary .chev {
  color: #0f1a10;
}
.menu-btn.danger {
  color: #ffb3aa;
}
.menu-btn.locked {
  opacity: 0.55;
}
.menu-btn.locked:hover,
.menu-btn.locked.pad-focus {
  background: var(--panel);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}
.menu-btn.locked span:nth-child(2) {
  font-size: 0.8em;
  letter-spacing: 0.03em;
}
.menu-btn.danger:hover,
.menu-btn.danger.pad-focus {
  background: linear-gradient(90deg, #ff7a6b, var(--red));
  color: #fff;
}
.menu-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45em 1em 0.45em 0.8em;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.menu-back span:first-child {
  font-size: 1.4em;
  line-height: 0.8;
}
.menu-back:hover,
.menu-back.pad-focus {
  background: linear-gradient(90deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
}
.menu-text {
  margin: 0.2em 0;
  color: #d8dde2;
  font-size: 0.92em;
  line-height: 1.4;
}
.menu-text.small {
  font-size: 0.8em;
  color: var(--ink-2);
}
.menu-text.gold {
  color: var(--gold);
  font-weight: 700;
}
.menu-sub {
  margin: 1rem 0 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-2);
}
.link-btn {
  font: inherit;
  color: var(--green-2);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover,
.link-btn.pad-focus {
  color: var(--gold);
}
/* the CREDITS.txt reader: a panel down the right of the menu screen */
.credits-file {
  position: absolute;
  top: 4%;
  bottom: 8%;
  right: max(16px, env(safe-area-inset-right));
  width: min(560px, 50%);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: slidein 0.25s ease-out;
}
.cf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--green-2);
}
.credits-file pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 14px 18px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #d8dde2;
}
.menu-link {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--gold);
  color: #1f1608;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.menu-link:hover,
.menu-link.pad-focus {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.menu-strip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(440px, 46%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1em;
  padding: 0.6em 1.75em;
  font-size: clamp(8px, 1.8vh, 12px);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green-2);
  white-space: nowrap;
  background: linear-gradient(0deg, rgba(10, 14, 18, 0.95), rgba(10, 14, 18, 0.7) 70%, transparent);
  pointer-events: none;
}
.menu-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.menu-strip span:last-child {
  color: var(--ink-2);
  text-align: right;
}
.menu-hint {
  position: absolute;
  right: 60px;
  bottom: 14px;
  font-size: 0.75rem;
  color: var(--ink-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.diff-row {
  display: flex;
  gap: 0.4em;
}
.diff-row label {
  flex: 1;
}
.diff-row input {
  display: none;
}
.diff-row span {
  display: block;
  text-align: center;
  padding: 0.45em;
  border: 1px solid var(--line);
  border-radius: 0.5em;
  background: var(--panel);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.diff-row input:checked + span {
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
}
.loadout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35em 0.6em;
  margin: 0.2em 0;
}
.loadout label {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
}
.loadout select {
  font-family: inherit;
  font-size: 1.15em;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 0.4em;
  padding: 0.35em 0.5em;
}
.loadout .chks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
}
.loadout label.chk {
  flex-direction: row;
  align-items: center;
  gap: 0.5em;
  padding-top: 0.3em;
}
.loadout label.locked {
  opacity: 0.45;
}
.loadout input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.loadout label.vol input {
  width: 100%;
  accent-color: var(--green);
  margin: 0.2em 0;
}
.loadout.stack {
  grid-template-columns: 1fr;
  gap: 0.55em;
} /* Settings: one control per line */
.loadout.stack label.chk {
  padding-top: 0;
}
.controls {
  list-style: none;
  margin: 0.3em 0;
  padding: 0;
  font-size: 0.8em;
  color: var(--ink-2);
  line-height: 1.5;
}
/* the controls section on Settings: one card per way of playing */
.ctl-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  margin: 0.2em 0 0.6em;
}
.ctl {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6em 0.8em;
}
.ctl h5 {
  margin: 0 0 0.35em;
  font-size: 0.78em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-2);
}
.ctl dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15em 0.9em;
  margin: 0;
  font-size: 0.78em;
  line-height: 1.4;
}
.ctl dt {
  color: var(--ink-2);
}
.ctl dd {
  margin: 0;
  color: #d8dde2;
}
html.touch .kb-only {
  display: none;
}
html:not(.touch) .touch-only {
  display: none;
}
/* a gamepad in use: its own hints, and the touch controls out of the way */
html:not(.pad) .pad-only {
  display: none !important;
}
html.pad .kb-only,
html.pad .touch-only,
html.pad #touch-ui {
  display: none !important;
}
/* anything without a hover look of its own (selects, sliders, checkboxes) gets a soft ring instead */
select.pad-focus,
input.pad-focus,
label.pad-focus {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.55rem 1rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, rgba(10, 14, 18, 0.65), transparent);
  pointer-events: none;
  flex-wrap: wrap;
}
.hud-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-2);
}
.hud-item.plough #hud-plough {
  color: var(--ink-2);
}
.hud-item.plough #hud-plough.down {
  color: var(--green-2);
}
#hud-meter {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#hud-meter.dim {
  opacity: 0.4;
}
/* a compass card that turns with the tractor: the lubber line at the top is where you're pointing */
.compass {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #f3ead6, #cdbf9f 70%, #8b7b5a);
  border: 3px solid #3a3129;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 0 10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.compass .dial {
  position: absolute;
  inset: 0;
  transition: transform 0.08s linear;
}
.compass .dial.no-anim {
  transition: none;
}
.compass .dial img {
  position: absolute;
  left: 14%;
  top: 14%;
  width: 72%;
  height: 72%;
  object-fit: contain;
}
.compass .dial b {
  position: absolute;
  font-size: 11px;
  font-weight: 900;
  color: #2a2118;
  line-height: 1;
  transform: translate(-50%, -50%);
  font-family: Georgia, serif;
}
.compass .dial b.n {
  left: 50%;
  top: 9%;
  color: #b3231a;
}
.compass .dial b.s {
  left: 50%;
  top: 91%;
}
.compass .dial b.e {
  left: 91%;
  top: 50%;
}
.compass .dial b.w {
  left: 9%;
  top: 50%;
}
.compass .lubber {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 12px solid var(--red);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
.compass.aligned .lubber {
  border-top-color: var(--green-2);
}
#hud-compass-label.aligned {
  color: var(--green-2);
}
#commentary {
  position: absolute;
  left: 14px;
  bottom: 16px;
  z-index: 15;
  max-width: min(420px, 60%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-2);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  pointer-events: none;
  animation: popin 0.2s ease-out;
}
#commentary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
#comm-face {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  border: 2px solid var(--green-2);
}
.comm-body {
  min-width: 0;
}
html.touch #comm-face {
  width: 32px;
  height: 32px;
}
.comm-name {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-2);
  font-weight: 800;
}
#commentary-text {
  font-size: 0.95rem;
  font-style: italic;
  color: #e6eaee;
}
@keyframes popin {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
html.touch #commentary {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(44%, 420px);
  text-align: center;
}
#toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 16;
  background: rgba(120, 20, 20, 0.85);
  border: 1px solid rgba(255, 120, 100, 0.6);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffd9c0;
  pointer-events: none;
  text-align: center;
  max-width: 80%;
}
#pickprompt {
  position: absolute;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  z-index: 15;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  text-align: center;
  pointer-events: none;
}
.pp-text {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.pp-track {
  width: 180px;
  height: 6px;
  margin: 6px auto 0;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
#pick-bar {
  height: 100%;
  width: 0%;
  background: var(--green-2);
}
#cash-layer {
  position: absolute;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  overflow: hidden;
}
.cash-fly {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%) scale(1.2);
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--green-2);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  transition:
    transform 1.1s cubic-bezier(0.3, 0.8, 0.4, 1),
    opacity 1.1s;
}
.count {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 18;
  font-size: clamp(4rem, 18vh, 8rem);
  font-weight: 900;
  color: var(--ink);
  -webkit-text-stroke: 3px #1c2128;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  text-transform: uppercase;
}
.count.go {
  color: var(--green-2);
  font-size: clamp(3rem, 14vh, 6rem);
}
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  box-shadow: inset 0 0 140px rgba(5, 8, 10, 0.45);
}
.frame-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 26;
  font-size: 1.1rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
html.touch .frame-btn {
  display: none;
}
.pause-btn {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: max(8px, env(safe-area-inset-top));
  z-index: 26;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 0.9rem;
  letter-spacing: -0.15em;
  color: var(--ink);
  background: rgba(28, 33, 40, 0.7);
  border: 2px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.pause-btn:hover {
  border-color: var(--green-2);
}
#hud-meter {
  margin-right: 52px;
}

/* ---- argument ---- */
#argument {
  background: rgba(10, 14, 18, 0.55);
}
.arg-panel {
  width: min(720px, 96%);
  height: min(600px, 92vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
#arg-bubble {
  min-height: 3.4em;
  flex: none;
}
.arg-you-row {
  min-height: 62px;
  flex: none;
}
.arg-you-row.blank {
  visibility: hidden;
}
.arg-star {
  color: var(--gold);
  margin-right: 0.45em;
  font-style: normal;
}
.pg-star {
  color: #b8860b;
  margin-right: 0.35em;
  font-style: normal;
}
.arg-rival {
  display: flex;
  gap: 1rem;
  align-items: center;
}
#arg-face {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--green);
  flex: none;
}
.arg-rival-text h3 {
  color: var(--green-2);
}
.bubble {
  position: relative;
  margin: 0.8rem 0 0;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 1.05rem;
  line-height: 1.35;
}
.bubble.rival {
  background: #2c3540;
  border: 1px solid var(--line);
  color: var(--ink);
}
.bubble.rival::before {
  content: "";
  position: absolute;
  left: 30px;
  top: -8px;
  border: 8px solid transparent;
  border-top: 0;
  border-bottom-color: #2c3540;
}
.bubble.you {
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #0f1a10;
  margin-left: 20%;
  font-weight: 600;
}
.arg-you-row {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
}
.arg-you-row .bubble.you {
  flex: 1;
  margin-left: 0;
}
#arg-you-face {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  border: 3px solid var(--green);
  margin-left: 20%;
}
.bubble.pop {
  animation: popin 0.2s ease-out;
}
.arg-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0.8rem 0 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 800;
}
.arg-score i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  margin: 0 2px;
}
.arg-score i.on {
  background: var(--green-2);
  border-color: transparent;
}
.arg-score .vs {
  margin: 0 6px;
}
.arg-prompt {
  margin: 0.4rem 0 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-2);
  font-weight: 800;
  min-height: 1em;
}
.arg-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: flex-start;
}
.arg-choices .arg-choice,
.arg-choices .fs-btn {
  flex: none;
}
.arg-choice {
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.arg-choice:hover,
.arg-choice.pad-focus {
  background: var(--green);
  color: #0f1a10;
  border-color: transparent;
}
.arg-footer {
  margin: auto 0 0;
  padding-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-2);
  flex: none;
}
.arg-cancel {
  margin-top: 0.7rem;
  font-size: 0.72rem;
  flex: none;
}
#plot-cancel {
  margin-top: 0.4rem;
  font-size: 0.72rem;
}

/* ---- plot pick ---- */
#plotpick {
  background: rgba(10, 14, 18, 0.55);
}
.pick-panel {
  width: min(900px, 96%);
}
.pick-panel h2 {
  color: var(--ink);
}
.plot-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 0.8rem;
}
.plot-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.plot-card.forced {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green) inset;
}
.plot-card.locked {
  opacity: 0.8;
}
.plot-card h4 {
  color: var(--green-2);
}
.plot-card .tag {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.plot-card .blurb {
  margin: 0;
  font-size: 0.82rem;
  color: #d8dde2;
  flex: 1;
}
.plot-card .stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  font-size: 0.75rem;
  align-items: center;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plot-card .stats b {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}
.pips i {
  display: inline-block;
  width: 12px;
  height: 8px;
  margin-right: 2px;
  background: var(--line);
  border-radius: 2px;
}
.pips i.on {
  background: var(--gold);
}

/* ---- scorecard ---- */
#scorecard {
  background: rgba(10, 14, 18, 0.5);
}
.sc-panel {
  width: min(560px, 96%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.sc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.sc-gradebox {
  text-align: center;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-radius: 12px;
  padding: 0.4rem 0.9rem;
  min-width: 72px;
}
.sc-gradebox span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.sc-gradebox small {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}
.sc-bars {
  margin: 0.9rem 0 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  font-weight: 700;
}
.sc-row b {
  color: var(--ink);
  text-align: right;
  font-size: 0.95rem;
}
.bar {
  height: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.bar > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  transition: width 0.8s ease-out;
}
.sc-line {
  display: flex;
  justify-content: space-between;
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.sc-line b {
  color: var(--ink);
}
.sc-line b.big {
  font-size: 1.4rem;
  color: var(--green-2);
}
.sc-cash {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: 0.5rem 0;
  padding: 0.5rem 0.8rem;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.35);
  border-radius: 8px;
  font-size: 0.85rem;
}
.sc-cash b {
  text-align: right;
}
.sc-cash .total {
  color: var(--green-2);
  font-weight: 900;
}
.sc-board {
  margin: 0.5rem 0;
  border-top: 1px solid var(--line);
}
.sc-board .row {
  display: grid;
  grid-template-columns: 28px 1fr 40px 44px;
  gap: 8px;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.sc-board .row.you {
  color: var(--green-2);
  font-weight: 800;
}
.sc-board .pos {
  color: var(--ink-2);
}
.sc-board .grade,
.sc-board .mark {
  text-align: right;
}
.sc-place {
  margin: 0.3rem 0 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}
#sc-btn {
  width: 100%;
}

/* ---- the shed: two shelves of stacked carousels down the left of the yard, the tractor on the right wearing what you browse ---- */
#shed {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  font-family: var(--font);
}
#shed::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 14, 18, 0.93) 0%,
    rgba(10, 14, 18, 0.86) 42%,
    rgba(10, 14, 18, 0.35) 58%,
    rgba(10, 14, 18, 0) 72%
  );
}
.shed-col {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(1000px, 62vw);
  box-sizing: border-box;
  padding: 30px 40px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  pointer-events: auto;
  animation: slidein 0.35s ease-out;
}
.shed-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.shed-head h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}
.shed-money {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--green-2);
}
.shed-actions {
  display: flex;
  gap: 10px;
  flex: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.12s;
}
.pill:hover,
.pill.pad-focus {
  background: #2c3540;
}
.pill.go {
  background: linear-gradient(90deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
}
.pill.go:hover,
.pill.go.pad-focus {
  background: linear-gradient(90deg, #8fe66a, #55bb59);
}
.shed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shed-spacer {
  flex: 1;
}
.shelf-tab {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 22px;
  cursor: pointer;
}
.shelf-tab.active {
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
}
.shed-chips {
  display: flex;
  gap: 6px;
}
.chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.chip.active {
  color: var(--gold);
  border-color: var(--gold);
}
.shed-rows {
  position: relative;
  flex: 1;
  min-height: 118px;
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.shed-rows::-webkit-scrollbar {
  display: none;
}
.shed-row {
  flex: none;
  display: flex;
  gap: 14px;
}
.sr-tick {
  flex: none;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}
.shed-row.active .sr-tick {
  background: var(--green-2);
}
.sr-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sr-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.sr-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.shed-row.active .sr-label {
  color: var(--green-2);
}
.sr-count {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sr-window {
  overflow: hidden;
  touch-action: pan-y;
}
.sr-track {
  display: flex;
  gap: 12px;
  column-gap: 12px;
  transition: transform 0.22s ease-out;
  will-change: transform;
}
.sr-track.still {
  transition: none;
}
.sr-card {
  flex: none;
  width: 148px;
  height: 90px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.shed-row.active .sr-card.focus {
  border-color: var(--green-2);
  box-shadow:
    0 0 0 1px var(--green-2) inset,
    0 10px 26px rgba(0, 0, 0, 0.45);
}
.cd-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.cd-flag {
  width: 48px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-clip: padding-box;
} /* 3:2, the same shape as the cloth */
.cd-dots {
  display: flex;
  gap: 5px;
}
.cd-dots b {
  width: 20px;
  height: 7px;
  border-radius: 4px;
  background: var(--line);
}
.cd-dots b.on {
  background: var(--green-2);
}
.cd-icon {
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  color: var(--green-2);
}
.cd-name {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}
.cd-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.sr-card.owned .cd-sub {
  color: var(--ink-2);
}
.sr-card.current .cd-sub {
  color: var(--green-2);
}
.shed-detail {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px 24px;
}
.sd-text {
  min-width: 0;
}
.sd-text h3 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
.sd-tag {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.sd-tag.on {
  color: var(--green-2);
}
.sd-blurb {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.4;
  font-style: italic;
  color: #d8dde2;
  max-width: 640px;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sd-stats {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-2);
}
.sd-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.sd-btn {
  display: grid;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  padding: 16px 20px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  color: #0f1a10;
  transition: filter 0.12s;
}
.sd-btn:hover:not(:disabled),
.sd-btn.pad-focus:not(:disabled) {
  filter: brightness(1.06);
}
.sd-btn .sd-ico {
  font-size: 18px;
  text-align: center;
}
.sd-btn .sd-chev {
  opacity: 0.6;
  font-size: 20px;
  text-align: right;
}
.sd-btn.poor {
  background: var(--panel-2);
  border-color: var(--line);
  color: #ffb3aa;
  cursor: default;
}
.sd-btn.done {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--ink-2);
  cursor: default;
}
.sd-btn.secondary {
  min-width: 0;
  grid-template-columns: 24px 1fr;
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--ink);
}
.shed-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
#shed .shed-toast {
  left: 40px;
  right: 40px;
  bottom: 22px;
  transform: none;
  max-width: none;
  font-size: 14px;
}
/* the right-hand side: what the tractor is wearing right now (preview), and the pad hints */
.shed-worn {
  position: absolute;
  right: 56px;
  top: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.sw-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.sw-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
}
.sw-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.sw-slot {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sw-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.shed-pad {
  position: absolute;
  right: 56px;
  bottom: 30px;
  display: flex;
  gap: 10px;
  pointer-events: none;
}
.shed-pad span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 20, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.shed-pad b {
  font-size: 13px;
  color: var(--green-2);
}
.shed-touchhint {
  position: absolute;
  right: 56px;
  bottom: 12px;
  margin: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(242, 244, 245, 0.55);
  pointer-events: none;
}
/* ---- the almanac: a book ---- */
#almanac {
  z-index: 40;
  background: rgba(10, 14, 18, 0.5);
  align-items: center;
}
.book-wrap {
  width: min(940px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
}
.book-tabs {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--font);
}
.book-tab {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.book-tab.active {
  background: var(--gold);
  color: #1a1408;
  border-color: transparent;
}
.book-tab.close {
  margin-left: auto;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  color: #0f1a10;
  border-color: transparent;
  border-radius: 0.5rem;
}
.book {
  position: relative;
  display: flex;
  height: min(68vh, 560px);
  background: linear-gradient(180deg, #7d5f3e, #5b442c);
  border-radius: 12px;
  padding: 12px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px #4a3522;
  perspective: 2000px;
}
.page {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fcf7ea;
  color: #2a2118;
  padding: 1.1rem 1.4rem 1.6rem;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
}
.pg-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cdbc93 transparent;
}
.pg-scroll::-webkit-scrollbar {
  width: 6px;
}
.pg-scroll::-webkit-scrollbar-thumb {
  background: #cdbc93;
  border-radius: 3px;
}
.page.left {
  border-radius: 6px 0 0 6px;
  box-shadow: inset -14px 0 18px -14px rgba(0, 0, 0, 0.35);
}
.page.right {
  border-radius: 0 6px 6px 0;
  box-shadow: inset 14px 0 18px -14px rgba(0, 0, 0, 0.35);
}
.page.empty {
  background: #f5eedc;
  cursor: default;
}
.page::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-bottom: 30px solid #e9dfc3;
}
.page.left::after {
  left: 0;
  border-right: 30px solid transparent;
}
.page.right::after {
  right: 0;
  border-left: 30px solid transparent;
}
.page.empty::after {
  display: none;
}
.spine {
  width: 14px;
  background: linear-gradient(90deg, #f0e7d0, #cdbc93, #f0e7d0);
}
.book.single .page.left,
.book.single .spine {
  display: none;
}
.book.single .page.right {
  border-radius: 6px;
  box-shadow: none;
}
.leaf {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: calc(50% + 7px);
  width: calc(50% - 19px);
  transform-style: preserve-3d;
  transition: transform 0.55s ease-in-out;
  display: none;
  pointer-events: none;
}
.leaf.show {
  display: block;
}
/* the leaf is page-sized but turns about the middle of the 14px spine, 7px outside its own edge, so it lands exactly on the facing page */
.leaf.fwd {
  transform-origin: -7px center;
}
.leaf.fwd.go {
  transform: rotateY(-180deg);
}
.leaf.bwd {
  left: 12px;
  transform-origin: calc(100% + 7px) center;
}
.leaf.bwd.go {
  transform: rotateY(180deg);
}
.book.single .leaf {
  left: 12px;
  width: calc(100% - 24px);
}
.book.single .leaf.fwd {
  transform-origin: left center;
}
.book.single .leaf.bwd {
  transform-origin: right center;
}
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fcf7ea;
  color: #2a2118;
  padding: 1.1rem 1.4rem 1.6rem;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
}
.face.back {
  transform: rotateY(180deg);
}
.pg-title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #cfc09c;
  padding-bottom: 0.3rem;
}
.pg-head {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a6a4a;
  border-bottom: 1px solid #cfc09c;
  padding-bottom: 0.25rem;
  font-family: var(--font);
}
.pg-lead {
  margin: 0 0 0.6rem;
  font-style: italic;
  color: #4a3d2a;
}
.pg-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #5a4d3a;
}
.page p,
.face p {
  margin: 0 0 0.35rem;
}
.pg-lab {
  display: block;
  font-family: var(--font);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a6a4a;
  font-weight: 700;
  margin-top: 0.3rem;
}
.pg-pair {
  margin-bottom: 0.7rem;
}
.pg-pair + .pg-pair {
  border-top: 1px dashed #dccda9;
  padding-top: 0.5rem;
}
.pg-they {
  color: #2a2118;
}
.pg-stew {
  font-style: italic;
  color: #5a4d3a;
}
.pg-you {
  color: #2f6a2f;
  font-weight: 700;
}
.pg-you.dim {
  color: #8a7a5a;
  font-weight: 400;
  font-style: italic;
}
.pg-blank {
  margin-top: 1rem;
  color: #7a6a4a;
  font-style: italic;
  border: 1px dashed #dccda9;
  padding: 0.8rem;
  border-radius: 4px;
}
.pg-rival {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.pg-rival h4 {
  margin: 0 0 0.15rem;
  font-size: 1.15rem;
  font-weight: 400;
}
.pg-face {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.pg-meta {
  font-family: var(--font);
  font-size: 0.72rem;
  color: #7a6a4a;
}
.pg-meta b {
  color: #a5760f;
  letter-spacing: 0.06em;
}
.pg-bio {
  margin-bottom: 0.4rem;
}
.pg-lines {
  font-size: 0.86rem;
  color: #3a2e1e;
}
.pg-lines i {
  color: #8a7a5a;
}
.pg-quotes {
  margin: 0.15rem 0 0;
  padding-left: 0.95rem;
  list-style: none;
  font-size: 0.86rem;
  color: #3a2e1e;
}
.pg-quotes li {
  position: relative;
  margin-bottom: 0.32rem;
  font-style: italic;
  line-height: 1.3;
}
.pg-quotes li::before {
  content: "\201C";
  position: absolute;
  left: -0.8rem;
  font-size: 1.15em;
  font-style: normal;
  color: #b09c6d;
}
.pg-quotes li::after {
  content: "\201D";
}
.pg-quotes li.unheard {
  font-style: normal;
  color: #8a7a5a;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}
.pg-quotes li.unheard::before,
.pg-quotes li.unheard::after {
  content: "";
}
.pg-end {
  margin-top: 30%;
  text-align: center;
  font-style: italic;
  color: #7a6a4a;
}
.pg-no {
  position: absolute;
  bottom: 0.45rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font);
  font-size: 0.65rem;
  color: #8a7a5a;
  pointer-events: none;
}
.book-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.book-nav button {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.book-nav button:disabled {
  opacity: 0.4;
  cursor: default;
}
.menu-toast {
  z-index: 20;
  bottom: 28px;
  font-size: 16px;
  padding: 0.6rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.shed-toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: var(--green);
  color: #0f1a10;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  max-width: 90%;
  text-align: center;
}

.pause-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.8rem;
  min-width: 240px;
}
.pause-btns .fs-btn {
  width: 100%;
}

/* ---- touch controls ---- */
#touch-ui {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}
html:not(.touch) #touch-ui {
  display: none !important;
}
#tc-pad {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(28, 33, 40, 0.5);
  border: 2px solid var(--line);
  pointer-events: auto;
  touch-action: none;
}
#tc-pad .wheel {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: url("./assets/ui/wheel.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.08s linear;
  will-change: transform;
}
.tc-cluster {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.tc-right {
  right: max(14px, env(safe-area-inset-right));
  width: 210px;
  height: 210px;
}
.tc-right .tc-gas {
  position: absolute;
  right: 0;
  bottom: 0;
}
.tc-right .tc-n {
  position: absolute;
  right: 16px;
  bottom: 118px;
}
.tc-right .tc-nw {
  position: absolute;
  right: 96px;
  bottom: 96px;
}
.tc-right .tc-w {
  position: absolute;
  right: 118px;
  bottom: 16px;
}
.tc-btn {
  pointer-events: auto;
  touch-action: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
  font-family: inherit;
  color: var(--ink);
  background: rgba(28, 33, 40, 0.6);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}
.tc-btn.held {
  filter: brightness(1.35);
  transform: scale(0.96);
  border-color: rgba(255, 255, 255, 0.6);
}
.tc-gas {
  width: 96px;
  height: 96px;
  font-size: 1.2rem;
  background: radial-gradient(circle at 35% 30%, rgba(126, 217, 87, 0.85), rgba(46, 125, 50, 0.85));
  color: #0f1a10;
  border-color: rgba(200, 255, 190, 0.5);
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.45);
}
#tc-brake {
  background: radial-gradient(circle at 35% 30%, rgba(255, 196, 72, 0.9), rgba(214, 120, 20, 0.9));
  color: #2a1a05;
  border-color: rgba(255, 230, 170, 0.5);
}
#tc-plough {
  background: radial-gradient(circle at 35% 30%, rgba(160, 110, 62, 0.92), rgba(84, 52, 24, 0.92));
  color: #ffe9cf;
  border-color: rgba(220, 180, 130, 0.5);
}
#tc-pick {
  background: radial-gradient(circle at 35% 30%, rgba(170, 172, 168, 0.9), rgba(88, 90, 86, 0.9));
  color: #f4f4f0;
  border-color: rgba(230, 230, 225, 0.5);
}
.tc-small {
  width: 64px;
  height: 64px;
  font-size: 0.72rem;
}
/* the shed on anything narrower than a desktop (a tablet, a small window): three cards to a row, and the action button
   only as wide as its label so the description keeps its width */
@media (max-width: 1100px) {
  .sr-card {
    width: calc((100% - 24px) / 3);
  }
  .sd-blurb {
    max-width: none;
  }
  .sd-btn {
    min-width: 200px;
  }
  .shed-hint {
    display: none;
  }
}
/* the shed at landscape on a phone or a small tablet: thumbs-first, two rows visible, tractor in the right third */
@media (max-height: 560px) {
  /* the shed at phone-landscape: thumbs-first, two rows visible, the menu in the left half */
  #shed::before {
    background: linear-gradient(
      90deg,
      rgba(10, 14, 18, 0.94) 0%,
      rgba(10, 14, 18, 0.88) 40%,
      rgba(10, 14, 18, 0.3) 54%,
      transparent 68%
    );
  }
  .shed-col {
    width: min(592px, 50vw);
    padding: 12px 14px 12px 18px;
    gap: 9px;
  }
  .shed-head {
    align-items: center;
  }
  .shed-head > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .shed-head h2 {
    font-size: 19px;
  }
  .shed-money {
    margin: 0;
    font-size: 11px;
  }
  .pill {
    height: 44px;
    padding: 0 16px;
    font-size: 12px;
    border-radius: 11px;
  }
  #shed-next {
    width: 46px;
    padding: 0;
    justify-content: center;
  }
  #shed-next span:last-child {
    display: none;
  }
  #shed-next span:first-child {
    font-size: 22px;
    line-height: 1;
  }
  .shelf-tab {
    font-size: 11px;
    padding: 9px 14px;
    border-radius: 9px;
  }
  .chip {
    font-size: 10px;
    padding: 6px 10px;
  }
  .shed-rows {
    gap: 8px;
  }
  .shed-row {
    gap: 9px;
  }
  .sr-body {
    gap: 4px;
  }
  .sr-tick {
    width: 2px;
  }
  .sr-label {
    font-size: 10px;
  }
  .sr-count {
    font-size: 9px;
  }
  .sr-track {
    gap: 8px;
    column-gap: 8px;
  }
  .sr-card {
    width: 116px;
    height: 62px;
    border-radius: 9px;
    padding: 5px;
    gap: 3px;
  }
  .cd-swatch {
    width: 15px;
    height: 15px;
  }
  .cd-flag {
    width: 27px;
    height: 18px;
  }
  .cd-dots {
    gap: 3px;
  }
  .cd-dots b {
    width: 13px;
    height: 5px;
  }
  .cd-icon {
    font-size: 14px;
  }
  .cd-name {
    font-size: 10px;
  }
  .cd-sub {
    font-size: 9px;
  }
  .shed-detail {
    padding-top: 9px;
    gap: 8px 12px;
  }
  .sd-text h3 {
    font-size: 13px;
    gap: 8px;
  }
  .sd-tag {
    font-size: 10px;
  }
  .sd-stats {
    margin-top: 2px;
    font-size: 10px;
  }
  .sd-blurb {
    margin-top: 3px;
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .sd-btn {
    height: 46px;
    min-width: 160px;
    padding: 0 12px;
    font-size: 12px;
    grid-template-columns: 22px 1fr;
    text-align: center;
  }
  .sd-btn .sd-chev {
    display: none;
  }
  .sd-btn.secondary {
    min-width: 46px;
    grid-template-columns: 1fr;
  }
  .sd-btn.secondary .sd-label {
    display: none;
  }
  .shed-hint {
    display: none;
  }
  #shed .shed-toast {
    left: 18px;
    right: 14px;
    bottom: 10px;
    font-size: 11px;
  }
  .shed-worn {
    right: 14px;
    top: 12px;
    gap: 5px;
  }
  .sw-label {
    font-size: 9px;
  }
  .sw-pill {
    padding: 4px 9px 4px 6px;
    gap: 6px;
  }
  .sw-dot {
    width: 9px;
    height: 9px;
  }
  .sw-slot {
    font-size: 9px;
  }
  .sw-name {
    font-size: 10px;
  }
  .sw-chassis,
  .sw-seat {
    display: none;
  }
  .shed-pad {
    display: none;
  }
  .sr-card {
    width: calc((100% - 16px) / 3);
  }
  .shed-rows {
    min-height: 80px;
  }
  .sd-blurb {
    max-width: none;
  }
}
@media (max-height: 420px) {
  .tc-btn {
    width: 58px;
    height: 58px;
  }
  .tc-gas {
    width: 76px;
    height: 76px;
  }
  .tc-small {
    width: 52px;
    height: 52px;
    font-size: 0.65rem;
  }
  .tc-right {
    width: 170px;
    height: 170px;
  }
  .tc-right .tc-n {
    right: 12px;
    bottom: 96px;
  }
  .tc-right .tc-nw {
    right: 78px;
    bottom: 78px;
  }
  .tc-right .tc-w {
    right: 96px;
    bottom: 12px;
  }
  #tc-pad {
    width: 120px;
    height: 120px;
  }
  .menu-col {
    padding: 1em 1.3em 3.6em;
  }
  .menu-strip {
    padding: 0.4em 1.3em;
  }
  .plot-cards {
    gap: 6px;
  }
  .plot-card {
    padding: 0.6rem;
  }
  .arg-panel,
  .sc-panel {
    padding: 0.8rem 1rem;
  }
  .arg-panel {
    height: 96vh;
  }
  #arg-face {
    width: 52px;
    height: 52px;
  }
  .arg-rival {
    gap: 0.6rem;
  }
  .arg-rival-text h3 {
    font-size: 1rem;
  }
  .arg-rival-text .small {
    display: none;
  }
  #arg-bubble {
    min-height: 2.2em;
    margin-top: 0.4rem;
  }
  .arg-you-row {
    min-height: 40px;
  }
  #arg-you-face {
    width: 36px;
    height: 36px;
  }
  .arg-score {
    margin: 0.3rem 0 0.1rem;
  }
  .arg-prompt {
    margin: 0.2rem 0;
  }
  .arg-choice {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }
  .arg-footer {
    padding-top: 0.3rem;
    font-size: 0.7rem;
  }
  .arg-cancel {
    margin-top: 0.3rem;
  }
  .bubble {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }
  #hud {
    padding: 0.3rem 0.8rem;
    gap: 0.8rem;
  }
  .hud-item {
    font-size: 0.95rem;
  }
  /* scorecard: tighter on a phone so more of it fits before scrolling */
  .overlay {
    padding: 0.5rem;
  }
  .book {
    height: calc(100vh - 5.4rem);
    padding: 8px;
  }
  .page,
  .face {
    padding: 0.7rem 0.9rem;
    font-size: 0.78rem;
  }
  .pg-title {
    font-size: 1.15rem;
  }
  .pg-face {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
  .book-tab {
    font-size: 0.68rem;
    padding: 0.3rem 0.6rem;
  }
  /* a long rival page can outrun a phone: let it scroll and let the folio flow with the text */
  .page {
    overflow: hidden auto;
    scrollbar-width: none;
  }
  .page::-webkit-scrollbar {
    display: none;
  }
  .pg-no {
    position: static;
    display: block;
    margin-top: 0.5rem;
  }
  .page::after {
    display: none;
  }
  .pg-quotes {
    font-size: 0.76rem;
  }
  .pg-quotes li {
    margin-bottom: 0.22rem;
    line-height: 1.25;
  }
  .pg-bio {
    margin-bottom: 0.25rem;
  }
  .pg-rival {
    margin-bottom: 0.35rem;
  }
  .sc-panel {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }
  .sc-panel h2 {
    font-size: 1.15rem;
  }
  .sc-gradebox span {
    font-size: 1.5rem;
  }
  .sc-gradebox {
    padding: 0.25rem 0.6rem;
    min-width: 56px;
  }
  .sc-bars {
    margin: 0.5rem 0 0.3rem;
    gap: 4px;
  }
  .sc-row {
    grid-template-columns: 90px 1fr 32px;
    font-size: 0.7rem;
  }
  .sc-line {
    margin: 0.15rem 0;
    font-size: 0.75rem;
  }
  .sc-line b.big {
    font-size: 1.15rem;
  }
  .sc-cash {
    margin: 0.3rem 0;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
  }
  .sc-board .row {
    padding: 0.2rem 0;
    font-size: 0.8rem;
  }
  .sc-place {
    margin: 0.2rem 0 0.5rem;
  }
  .quip {
    font-size: 0.85rem;
    margin: 0.25rem 0;
  }
}
@media (max-width: 640px) {
  .plot-cards {
    grid-template-columns: 1fr;
  }
}

/* Force landscape on phones: cover the screen with a rotate prompt in portrait. */
#rotate {
  display: none;
}
html.touch #rotate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
  color: var(--ink);
}
.rotate-inner {
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.5;
}
.rotate-icon {
  font-size: 3rem;
  color: var(--green-2);
  animation: rot 1.6s ease-in-out infinite;
}
.rotate-icon.still {
  animation: none;
}
#fs-gate {
  display: none;
}
html.touch #fs-gate {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
  color: var(--ink);
}
html.touch #fs-gate.hidden {
  display: none;
}
#fs-gate .fs-btn {
  margin-top: 1rem;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
}
@keyframes rot {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(90deg);
  }
}
@media (orientation: portrait) {
  html.touch #rotate {
    display: flex;
  }
  html.touch #app {
    visibility: hidden;
  }
}
