body.godot-owner-page {
  margin: 0;
  min-height: 100vh;
  background: var(--card-night);
  color: var(--card-rail);
  font-family: var(--font-ui);
  font-size: 15px;
}

.godot-owner-page [hidden] { display: none !important; }
.godot-owner-shell { min-height: 100vh; }

/* ---- the rail across the top ---- */

.godot-owner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--card-rule-strong);
  background-color: var(--card-night);
}

.godot-owner-brand {
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  color: var(--card-rail);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-decoration: none;
}

.godot-owner-topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

/* Navigation is a rail of plain words. The scene you are in carries a solid
   underline in your own colours; nothing else is drawn. */
.godot-owner-topbar button {
  padding: 15px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--card-chalk);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.godot-owner-topbar button:hover { color: var(--card-rail); }
.godot-owner-topbar button[aria-current="page"],
.godot-owner-sound[aria-pressed="true"] {
  border-bottom-color: var(--identity-gold);
  color: var(--card-rail);
}

.godot-owner-sound { margin-left: auto; }
.godot-owner-shell:has(#firstFoalBook:not([hidden])) .godot-owner-topbar nav { display: none; }

/* ---- the gate ---- */

.godot-owner-gate {
  width: min(560px, calc(100% - 40px));
  margin: 14vh auto;
  padding: 0 0 34px;
  border-bottom: 1px solid var(--card-rule);
}

.godot-owner-gate h1 {
  margin: 6px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(38px, 6.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.godot-owner-gate p:not(.eyebrow) { margin: 0 0 26px; max-width: 46ch; color: var(--card-chalk); }

/* The first breeding uses the same yard and horses as the owner stable. */
.first-foal-book { width: 100%; margin: 0; padding: 0 0 24px; }
.first-foal-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; }
.first-foal-intro h1 { margin: 2px 0 0; font: 500 clamp(24px, 3vw, 34px)/1.1 var(--font-display); }
.first-foal-intro > p { margin: 0; color: var(--card-chalk); }
#firstFoalForm { display: grid; }
.first-world { position: relative; height: clamp(400px, 57svh, 650px); overflow: hidden; background: var(--card-night); }
.first-world-picture { position: absolute; top: 48px; bottom: 74px; width: 100%; overflow: hidden; }
#firstWorldFrame { width: 100%; height: 100%; border: 0; display: block; }
.first-world[data-view="pair"] #firstWorldFrame { position: absolute; width: 190%; height: 190%; left: -45%; top: -54%; }
.first-world button { color: var(--card-rail); background: none; border: 0; font: inherit; cursor: pointer; }
.first-world-views { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; background: none; padding: 2px 8px; z-index: 2; white-space: nowrap; }
.first-world-views button { min-height: 40px; padding: 6px 13px; color: var(--card-chalk); }
.first-world-views button[aria-pressed="true"] { color: var(--card-rail); text-decoration: underline; text-decoration-color: var(--identity-gold); text-underline-offset: 6px; }
.first-world-status { position: absolute; top: 65px; left: 50%; transform: translateX(-50%); margin: 0; padding: 7px 12px; background: var(--card-night); z-index: 3; }
.first-world-status:empty { display: none; }
.first-parent-nav { position: absolute; bottom: 2px; width: min(40%, 420px); display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; padding: 5px; background: none; }
.first-sire-nav { left: 20px; }
.first-dam-nav { right: 20px; }
.first-parent-nav button { min-height: 44px; padding: 2px; }
.first-parent-nav button[data-step] { font-size: 34px; }
.first-parent-nav small { display: block; color: var(--identity-gold); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.first-parent-nav strong { display: block; font: 500 clamp(16px, 2vw, 22px)/1.1 var(--font-display); }
.first-parent-nav span { display: block; font-size: 12px; margin-top: 3px; }
.first-horse-target { position: absolute; top: 24%; bottom: 105px; width: 43%; }
.first-horse-target:hover { outline: 1px solid var(--identity-gold); outline-offset: -8px; }
.first-sire-target { left: 2%; }
.first-dam-target { right: 2%; }
.first-world:not([data-view="pair"]) .first-horse-target { display: none; }
.first-world[data-view="sire"] .first-dam-nav, .first-world[data-view="dam"] .first-sire-nav { display: none; }
.first-world:not([data-view="pair"]) .first-parent-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(90%, 440px); }
.first-preview-label { position: absolute; left: 50%; bottom: 24px; top: auto; transform: translateX(-50%); margin: 0; padding: 5px 10px; background: color-mix(in srgb, var(--card-night) 85%, transparent); font-size: 13px; text-align: center; }
.first-pair-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 24px; border-bottom: 1px solid var(--card-rule-strong); }
.first-pair-card h2 { margin: 0 0 7px; font: 500 19px var(--font-display); }
.first-pair-card a { color: var(--identity-gold); }
.first-pair-card p { margin: 5px 0 0; color: var(--card-chalk); font-size: 12px; }
.first-pair-colors ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.first-pair-colors button { display: flex; gap: 7px; align-items: center; min-height: 44px; border: 1px solid var(--card-rule-strong); padding: 7px 11px; background: none; color: var(--card-rail); font: inherit; cursor: pointer; }
.first-pair-colors button[aria-pressed="true"] { border-color: var(--identity-gold); }
.first-coat-swatch { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; border: 1px solid var(--card-chalk); border-radius: 50%; }
.first-foal-parents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding: 20px 24px; }
.first-parent-card { min-width: 0; }
.first-parent-details h2 { font: 500 22px var(--font-display); margin: 5px 0; }
.first-parent-details h3 { font: 600 13px var(--font-ui); margin: 12px 0 5px; }
.first-parent-details p { margin: 5px 0; font-size: 13px; color: var(--card-chalk); }
.first-parent-details details { margin-top: 10px; }
.first-parent-details summary { cursor: pointer; min-height: 32px; color: var(--identity-gold); }
.first-parent-details dl { margin: 0; }
.first-parent-details dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px solid var(--card-rule); font-size: 13px; }
.first-parent-details dd { margin: 0; text-align: right; }
.first-parent-details dt { color: var(--card-chalk); }
.first-parent-details .first-parent-strengths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.first-parent-strengths dd { display: flex; gap: 5px; align-items: center; }
.first-parent-strengths meter { width: 60px; accent-color: var(--identity-cream); }
.first-parent-possibilities { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.first-parent-possibilities li { display: flex; align-items: center; gap: 5px; }
.first-foal-finish { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; padding: 24px; border-top: 1px solid var(--card-rule-strong); }
.first-foal-finish h2 { font: 500 28px var(--font-display); margin: 6px 0; }
.first-foal-finish p { color: var(--card-chalk); }
.first-foal-member { display: grid; gap: 8px; align-content: start; }
.first-foal-member label { font-size: 13px; }
.first-foal-book :is(input:not([type="hidden"]), select) { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--card-chalk); background: var(--card-night); color: var(--card-rail); font: inherit; }
.first-foal-book :is(button, input, select, summary):focus-visible { outline: 2px solid var(--identity-gold); outline-offset: 3px; }
#firstContinue, #firstFoalButton { min-height: 46px; padding: 10px 22px; border: 1px solid var(--identity-gold); background: var(--identity-gold); color: var(--card-night); font: 600 15px var(--font-ui); cursor: pointer; white-space: nowrap; }
.first-foal-book button:disabled { opacity: .55; cursor: wait; }
.first-foal-status { margin: 0; padding: 0 24px; color: var(--card-chalk); font-size: 13px; }
@media (max-width: 700px) {
  .first-foal-intro { padding: 12px 14px; }
  .first-foal-intro > p { display: none; }
  .first-world { height: 458px; }
  .first-world-picture { bottom: 88px; }
  .first-world[data-view="pair"] .first-world-picture { top: 60px; height: 252px; }
  .first-world[data-view="pair"] #firstWorldFrame { width: 112%; height: 112%; left: -6%; top: -7.2%; }
  .first-world[data-view="pair"] { height: 406px; }
  .first-world[data-view="pair"] .first-preview-label { bottom: 98px; white-space: nowrap; }
  .first-foal-book[data-view="dam"] .first-parent-card:last-child { order: -1; }
  .first-parent-nav { bottom: 4px; width: 46%; grid-template-columns: 30px minmax(0, 1fr) 30px; padding: 2px; }
  .first-sire-nav { left: 4px; } .first-dam-nav { right: 4px; }
  .first-parent-nav strong { font-size: 15px; }
  .first-parent-nav span { font-size: 11px; }
  .first-pair-card { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px; }
  .first-foal-parents { gap: 24px; padding: 20px 14px; }
  .first-foal-finish { grid-template-columns: 1fr; gap: 16px; padding: 20px 14px; }
  .first-foal-status { padding: 0 14px; }
}

/* Spaced capitals and fine rules carry the original racing identity. */
.eyebrow {
  margin: 0;
  color: var(--card-flood);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- the app ---- */

.godot-owner-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  min-height: calc(100svh - 83px);
}

.godot-owner-stage {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100svh - 83px);
  min-height: 0;
  background: var(--card-night);
}

#engineFrame { color-scheme: dark; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.godot-owner-engine-status {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 7px 11px;
  background: var(--card-night);
  color: var(--card-chalk);
  font-size: 13px;
}

.godot-owner-engine-status:empty { display: none; }

/* The control column IS the programme: one sheet, ruled between entries. */
.godot-owner-controls {
  display: grid;
  align-content: start;
  gap: 0;
  border-left: 1px solid var(--card-rule-strong);
  background: var(--card-turf);
  overflow-y: auto;
}

#stableControls { display: contents; }

.owner-scene-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--card-rule-strong);
  background: var(--card-band);
}

.owner-scene-context div { min-width: 0; }

.owner-scene-context h2,
.owner-scene-context p { margin: 0; }

.owner-scene-context h2 {
  color: var(--card-rail);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

#sceneHorseIdentity {
  max-width: 17ch;
  color: var(--card-chalk);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.owner-scene-context dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 3px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--card-rule);
}

.owner-scene-context dl div {
  display: grid;
  gap: 2px;
}

.owner-scene-context dl div + div {
  padding-left: 9px;
  border-left: 1px solid var(--card-rule);
}

.owner-scene-context dt {
  color: var(--card-chalk);
  font-size: 11px;
}

.owner-scene-context dd {
  margin: 0;
  color: var(--card-rail);
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.owner-scene-context .godot-owner-notice {
  grid-column: 1 / -1;
  margin-top: 3px;
}

.godot-owner-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px 20px;
  border: 0;
  border-top: 1px solid var(--card-rule);
  background: none;
}

#stableControls > .godot-owner-card:first-child { border-top: 0; }

.godot-owner-card h1,
.godot-owner-card h2,
.godot-owner-card p { margin: 0; }

/* The runner's own line: silks patch, then the name in the display face. */
.godot-owner-card h1 {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.godot-owner-card h1::before {
  content: "";
  flex: none;
  width: 21px;
  height: 27px;
  background: var(--card-silk);
  border: 1px solid var(--card-rule-strong);
}

/* ---- owner card builder ---- */

.godot-owner-builder,
.godot-owner-builder form {
  display: grid;
  align-content: start;
}

.godot-owner-builder form > header {
  display: grid;
  gap: 7px;
  padding: 18px;
  border-bottom: 1px solid var(--card-rule);
}

.godot-owner-builder h1,
.godot-owner-builder h2,
.godot-owner-builder p { margin: 0; }

.godot-owner-builder h1 {
  color: var(--card-rail);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.godot-owner-builder form > header > p:last-child,
.owner-builder-section > p,
.owner-builder-choice > p {
  color: var(--card-chalk);
  font-size: 13px;
  line-height: 1.45;
}

.owner-builder-section {
  display: grid;
  gap: 9px;
  padding: 16px 18px 20px;
  border-bottom: 1px solid var(--card-rule);
}

.owner-builder-section h2 {
  margin: -16px -18px 4px;
  padding: 9px 18px;
  background: var(--card-band);
  color: var(--card-rail);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.owner-builder-choices {
  display: grid;
  border-bottom: 1px solid var(--card-rule);
}

.owner-builder-choice {
  border-top: 1px solid var(--card-rule);
}

.owner-builder-choices .owner-builder-choice:first-child { border-top: 0; }

.owner-builder-choice summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--card-rail);
  cursor: pointer;
  list-style: none;
}

.owner-builder-choice summary::-webkit-details-marker { display: none; }
.owner-builder-choice summary:focus-visible { outline: 2px solid var(--card-flood); outline-offset: 2px; }
.owner-builder-choice summary strong { font-size: 13px; }
.owner-builder-choice summary span { color: var(--card-chalk); font-size: 12px; text-align: right; }

.owner-builder-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 0 0 10px;
}

.godot-owner-controls .owner-builder-choice-grid button {
  display: grid;
  min-width: 0;
  min-height: 46px;
  padding: 7px 8px;
  border-color: var(--card-rule-strong);
  background: none;
  color: var(--card-rail);
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
}

.godot-owner-controls .owner-builder-choice-grid button:hover { background: var(--card-band); }
.godot-owner-controls .owner-builder-choice-grid button[aria-pressed="true"] { border-color: var(--identity-gold); }
.owner-builder-choice-grid button > strong { font-size: 12px; overflow-wrap: anywhere; }
.owner-builder-choice-grid button > span { color: var(--card-chalk); font-size: 11px; font-weight: 400; line-height: 1.25; }

.owner-builder-choice-grid button.has-swatch::before {
  content: "";
  width: 100%;
  height: 10px;
  margin-bottom: 3px;
  background: var(--choice-swatch);
  border: 1px solid var(--card-rule-strong);
}

.owner-builder-choice > label {
  display: block;
  margin-bottom: 6px;
  color: var(--card-chalk);
  font-size: 12px;
}

#saddlecloth { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

.owner-builder-actions {
  display: grid;
  gap: 6px;
  padding: 16px 18px 20px;
}

.godot-owner-controls #cancelEditButton {
  background: none;
  border-color: var(--card-rule-strong);
  color: var(--card-rail);
}

.godot-owner-controls #cancelEditButton:hover { background: none; border-color: var(--card-rail); }

.godot-owner-builder .godot-owner-notice { margin: 16px 18px 0; }

/* Section heads sit in a solid band, so a section starts instead of a box. */
.godot-owner-card h2 {
  font-family: var(--font-display);
  margin: -16px -18px 4px;
  padding: 9px 18px;
  background: var(--card-band);
  color: var(--card-rail);
  font-size: 14px;
  font-weight: 600;
}

.godot-owner-card > p:not(.eyebrow),
.godot-owner-card label {
  color: var(--card-chalk);
  font-size: 13px;
}

.godot-owner-card label { font-weight: 500; }

/* ---- fields ---- */

.godot-owner-card select,
.godot-owner-card input,
.godot-owner-controls select,
.godot-owner-controls input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--card-chalk);
  border-radius: 0;
  background: var(--card-night);
  color: var(--card-rail);
  font: inherit;
}

.godot-owner-card select:focus-visible,
.godot-owner-card input:focus-visible,
.godot-owner-topbar button:focus-visible,
.godot-owner-controls button:focus-visible,
.godot-owner-controls a:focus-visible,
.godot-owner-gate a:focus-visible {
  outline: 2px solid var(--card-flood);
  outline-offset: 2px;
}

.godot-owner-card :is(select, input):disabled,
.godot-owner-controls :is(select, input):disabled {
  border-color: var(--card-rule-strong);
  background: var(--card-band);
  color: var(--card-chalk);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Actions share the original board’s outlined gold rule and ivory type. */

.godot-owner-controls button,
.godot-owner-gate a {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--card-flood);
  border-radius: 0;
  background: var(--card-night);
  color: var(--card-rail);
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.godot-owner-controls button:hover,
.godot-owner-gate a:hover { background: var(--card-band); }

.godot-owner-controls button:disabled {
  background: none;
  border-color: var(--card-rule-strong);
  color: var(--card-chalk);
  cursor: not-allowed;
  opacity: 0.6;
}

.godot-owner-card a {
  justify-self: start;
  padding: 2px 0;
  border-bottom: 1px solid var(--identity-gold);
  color: var(--card-rail);
  font-weight: 600;
  text-decoration: none;
}

/* ---- the form line: label left, figure right, ruled between ---- */

.godot-owner-card > dl { display: grid; margin: 4px 0 0; }

.godot-owner-card > dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid var(--card-rule);
}

.godot-owner-card > dl div:first-child { border-top: 0; }
.godot-owner-card > dl dt { color: var(--card-chalk); font-size: 13px; }

.godot-owner-card > dl dd {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.godot-owner-inherited { color: var(--card-chalk); font-size: 13px; }
.godot-owner-inherited dt, .godot-owner-inherited dd em { font-size: 12px; }

.owner-control-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; }

/* ---- the drill ---- */

.owner-drill {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: baseline;
  color: var(--card-chalk);
  font-size: 13px;
}

.owner-drill output { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.owner-drill strong { color: var(--card-rail); font-family: var(--font-data); font-size: 15px; font-variant-numeric: tabular-nums; }
.owner-drill i { grid-column: 1 / -1; height: 6px; background: var(--card-night); }
.owner-drill b { display: block; width: 0; height: 100%; background: var(--identity-gold); }

.owner-drill-actions { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.owner-drill-actions button { padding-inline: 6px; }

/* Hold and whip are held states, not journeys: they stay quiet until pressed. */
.owner-drill-actions button:nth-child(n + 2) {
  background: none;
  border: 1px solid var(--card-rule-strong);
  color: var(--card-rail);
}

.owner-drill-actions button:nth-child(n + 2):hover { border: 1px solid var(--card-rail); background: none; }
.owner-drill-actions button[aria-pressed="true"] { background: none; border-color: var(--identity-gold); color: var(--card-rail); }

.godot-owner-card ol {
  max-height: 190px;
  margin: 0;
  padding-left: 20px;
  overflow-y: auto;
  color: var(--card-chalk);
  font-size: 13px;
}

.godot-owner-switch {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--card-rule);
}

.godot-owner-switch p { margin: 0; color: var(--card-chalk); font-size: 12px; line-height: 1.45; }

/* The horse's own state, when it is something the owner has to be told before
   they spend: a workout that could end the career, or a career already ended. */
.godot-owner-notice {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--card-flood);
  background: var(--card-band);
  color: var(--card-rail);
  font-size: 13px;
  line-height: 1.45;
}

.godot-owner-action-status {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0;
  padding: 11px 18px;
  border-top: 1px solid var(--card-rule-strong);
  background: var(--card-night);
  color: var(--card-flood);
  font-size: 13px;
}

.godot-owner-action-status:empty { display: none; }

@media (max-width: 860px) {
  .godot-owner-topbar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; padding: 0 14px; }
  .godot-owner-brand { padding: 6px 0; }
  .godot-owner-topbar nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .godot-owner-sound { grid-column: 2; grid-row: 1; }
  .godot-owner-topbar button { min-height: 44px; padding: 10px 4px; font-size: 13px; white-space: nowrap; }
  .godot-owner-app { display: block; }
  .godot-owner-stage { position: relative; height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .is-building .godot-owner-stage { position: sticky; top: 0; z-index: 2; }
  .godot-owner-controls { border-top: 1px solid var(--card-rule-strong); border-left: 0; }
  .first-foal-parents { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {


  .godot-owner-card h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Switching which horse stands in the yard is a change
   of view, not the section's action, so it goes quiet beside "Enter this
   horse" instead of competing with it. */
#switchHorseButton {
  background: none;
  border-color: var(--card-rule-strong);
  color: var(--card-rail);
}

#switchHorseButton:hover { background: none; border-color: var(--card-rail); }

/* The picture fills the stable; its controls sit in the unused margins. */
.godot-owner-shell:has(#ownerApp:not([hidden])) .godot-owner-topbar { height: 64px; box-sizing: border-box; }
.godot-owner-shell:has(#ownerApp:not([hidden])) .game-logo { width: 220px; height: 46px; }
.godot-owner-app { display: block; position: relative; background: var(--identity-gloss); height: calc(100svh - 64px); min-height: 560px; }
.godot-owner-stage { position: absolute; inset: 0 0 52px; height: auto; aspect-ratio: auto; align-self: stretch; }
.godot-owner-controls, #stableControls { display: contents; }
.godot-owner-shell:has(#ownerApp:not([hidden])) .godot-owner-topbar nav {
  position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: nowrap; gap: 0; height: 52px;
}
.godot-owner-topbar nav button { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 12px; }
#stableControls > [data-owner-scene="yard"] { display: contents; }
.owner-horse-line { position: absolute; bottom: 6px; left: 18px; max-width: 260px; }
.owner-horse-line #activeLabel { font-size: 10px; letter-spacing: .08em; color: var(--identity-cream); }
.owner-horse-line h1 { font-size: 23px; }
.owner-horse-line h1::before { width: 10px; height: 16px; }
.owner-horse-details, .owner-race-details { position: absolute; z-index: 6; bottom: 14px; font-size: 12px; }
.owner-horse-details { left: 280px; }
.owner-race-details { right: 18px; }
.godot-owner-controls summary { cursor: pointer; min-height: 24px; line-height: 24px; }
.godot-owner-controls details[open]:is(.owner-horse-details, .owner-race-details) {
  width: 270px; max-height: calc(100% - 90px); overflow: auto; padding: 12px;
  border: 1px solid var(--identity-gold); background: var(--card-overlay);
}
.owner-horse-details dl { margin: 8px 0; }
.owner-horse-details dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.owner-horse-details dd { margin: 0; }
.owner-yard-hud { position: absolute; top: 24px; right: 24px; width: 340px; display: grid; gap: 6px; isolation: isolate; }
/* Nick's dark gloss frame: small, floating, and clear of the horse. */
.owner-yard-hud,
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]),
.godot-owner-action-status,
.godot-owner-engine-status,
#horseNotice,
.godot-owner-controls details[open]:is(.owner-horse-details, .owner-race-details) {
  color: var(--identity-cream);
  background: var(--identity-gloss);
  border: 1px solid var(--card-rule-strong); border-top-color: var(--identity-gold);
  border-radius: 8px;
}
.owner-yard-hud { padding: 10px 12px; box-sizing: border-box; }

#inheritedStats { margin: 0; border: 0; background: none; }
#inheritedStats :is(h3, dt, dd, em) { color: var(--identity-cream); font-family: var(--font-ui); font-size: 11px; font-weight: 600; line-height: 1.2; }
#inheritedStats h3 { padding: 0 0 4px; border: 0; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
#inheritedStats .inherited-stats-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 0; margin: 0; }
#inheritedStats .inherited-stat-row { grid-template-columns: 46% 1fr; gap: 5px; padding: 1px 0; border: 0; }
#inheritedStats .inherited-stat-row dd { height: 13px; }
#inheritedStats .inherited-meter { accent-color: var(--identity-cream); }
#inheritedStats :is(.inherited-total, .inherited-build-note) { display: none; }
.owner-yard-hud > button { width: 100%; font-size: 11px; min-height: 30px; padding: 4px 8px; background: none; border-color: var(--identity-cream); color: var(--identity-cream); }
.owner-yard-hud > button:hover { background: color-mix(in srgb, var(--identity-cream) 8%, transparent); }
#editHorseButton { grid-row: auto; }
#horseNotice { position: absolute; left: 20px; top: 18px; max-width: 210px; padding: 8px 10px; font-size: 12px; }
.owner-scene-context { position: absolute; left: 18px; bottom: 6px; width: 280px; padding: 0; border: 0; background: none; }
.owner-scene-context h2 { font-size: 22px; }
.owner-scene-context :is(#sceneHorseIdentity, .eyebrow) { display: none; }
.owner-scene-context .godot-owner-notice { max-width: 260px; }
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) {
  position: absolute; top: 18px; right: 20px; width: 240px; max-height: calc(100% - 100px);
  overflow-y: auto; padding: 12px; gap: 8px;
}
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) h2 { background: none; margin: 0; padding: 0; }
.godot-owner-action-status { position: absolute; left: 20px; bottom: 64px; max-width: 420px; padding: 6px 10px; }
.godot-owner-builder { position: absolute; right: 0; top: 0; bottom: 52px; width: 310px; overflow-y: auto; background: var(--identity-gloss); }
@media (max-width: 860px) {
  .godot-owner-shell:has(#ownerApp:not([hidden])) .godot-owner-topbar { display: flex; padding: 0 14px; }
  .godot-owner-app { height: calc(100svh - 64px); min-height: 620px; }
  .godot-owner-stage { inset: 0 0 90px; }
  .is-building .godot-owner-stage { position: absolute; z-index: auto; }
  .godot-owner-shell:has(#ownerApp:not([hidden])) .godot-owner-topbar nav { width: 100%; justify-content: center; height: 44px; }
  .godot-owner-topbar nav button { padding: 10px; font-size: 11px; }
  .owner-horse-line, .owner-scene-context { bottom: 49px; left: 14px; max-width: 180px; }
  .owner-horse-line h1, .owner-scene-context h2 { font-size: 19px; }
  .owner-horse-line #activeLabel { display: none; }
  .owner-horse-details { bottom: 50px; left: auto; right: 88px; }
  .owner-race-details { bottom: 50px; right: 14px; }
  .owner-yard-hud { top: 24px; right: 14px; width: calc(100% - 28px); }
  #horseNotice { left: 14px; max-width: 150px; }
  #stableControls > .godot-owner-card:not([data-owner-scene="yard"]) { top: 14px; right: 14px; width: min(240px, calc(100% - 52px)); max-height: 280px; }
  .godot-owner-action-status { left: 14px; right: 14px; bottom: 94px; max-width: none; font-size: 11px; }
  .godot-owner-builder { width: min(310px, 90%); bottom: 90px; }
}

#inheritedStats .inherited-meter::-webkit-meter-optimum-value { background: var(--identity-cream); }
#inheritedStats .inherited-meter::-moz-meter-bar { background: var(--identity-cream); }

#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) :is(h2, h3, p, label, select, input, button, span, strong, dt, dd, em) { color: var(--identity-cream); }
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) :is(select, input, button) { background: var(--identity-ground); border-color: var(--identity-cream); }

@media (max-width: 600px) {
  .godot-owner-shell:has(#ownerApp:not([hidden])) .game-logo { width: 44px; height: 44px; }
}

#inheritedStats .inherited-stats-list > div:not(.inherited-stat-row) { display: flex; justify-content: space-between; padding: 3px 0; }

#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) button { font-size: 12px; letter-spacing: .06em; }

/* Character is a race call, never another set of meters. */
.birth-trait-list { display: grid; gap: 8px; margin: 8px 0; }
.birth-trait-list dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.birth-trait-list dd { margin: 2px 0 0; font-size: 14px; line-height: 1.3; }
.first-pair-heart { padding: 16px 24px; border-bottom: 1px solid var(--card-rule); }
.first-pair-heart .birth-trait-list { grid-template-columns: repeat(3, 1fr); gap: 18px; }
.birth-traits h3 { margin: 0; font-size: 14px; }
.birth-traits > p { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.first-parent-details .birth-traits { margin: 12px 0 16px; }
#birthTraits { color: var(--identity-cream); }
#birthTraits { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
#birthTraits h3 { margin: 4px 0 0; padding: 0; border: 0; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
#birthTraits h3::after { content: " ·"; }
#birthTraits .birth-trait-list, #birthTraits .birth-trait-list > div { display: contents; }
#birthTraits .birth-trait-list { margin: 0; gap: 0; }
#birthTraits dt { display: inline; font-weight: 700; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
#birthTraits dd { margin: 0; font-weight: 600; font-size: 11px; line-height: 1.2; text-align: left; flex-basis: 100%; }
#birthTraits > p { display: none; }
@media (max-width: 860px) {
  .first-pair-heart { padding-inline: 14px; }
  .first-pair-heart .birth-trait-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* The plate owns all scenery; the transparent engine supplies this horse and its shadow. */
#stablePlate { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) { isolation: isolate; overflow: visible; -webkit-text-stroke: 0; }
.godot-owner-controls .owner-horse-details[open] { top: 100%; bottom: auto; }
.godot-owner-app:has(.godot-owner-action-status:not(:empty)) .owner-scene-context { bottom: 120px; }
@media (max-width: 860px) {
  .owner-scene-context { width: calc(100% - 28px); max-width: none; }
  .owner-scene-context .godot-owner-notice { max-width: none; }
  .godot-owner-app:has(.godot-owner-action-status:not(:empty)) .owner-scene-context { bottom: 170px; }
  .godot-owner-app:has(.godot-owner-action-status:not(:empty)) .godot-owner-stage { bottom: 110px; }
  .godot-owner-controls details[open]:is(.owner-horse-details, .owner-race-details) {
    top: calc(100% + 12px); bottom: auto; left: 14px; right: 14px;
    width: auto; max-height: none; padding-bottom: 64px;
  }
}

/* Ivory controls and risk copy on the shared gloss frame. */
.owner-horse-line, .owner-scene-context,
.owner-horse-details:not([open]), .owner-race-details:not([open]),
.first-world-views, .first-parent-nav, .first-world-status, .first-preview-label {
  padding: 10px; background: var(--identity-gloss); color: var(--identity-cream); border-radius: var(--radius-md);
  border: 1px solid var(--card-rule-strong); border-top-color: var(--identity-gold);
}
.godot-owner-controls :is(select, input) { color-scheme: dark; }
#stableControls > .godot-owner-card:not([data-owner-scene="yard"]) option { background: var(--identity-ground); color: var(--identity-cream); }
.owner-scene-context dl { display: block; margin: 6px 0 0; }
.owner-scene-context dl > div { display: none; }
.owner-scene-context dl > div:last-child { display: flex; gap: 8px; }
.owner-scene-context dd { margin: 0; }
