/* Horse content uses the original Mini Farm colours, type and bento proportions. */
#game-root {
  position: fixed;
  inset: 0;
  isolation: isolate;
  background: #202020;
}

#stage {
  position: absolute;
  transform-origin: top left;
  overflow: hidden;
}

#screen,
#overlay {
  position: absolute;
  inset: 0;
}

#overlay:empty {
  pointer-events: none;
}

#game-root:has(.farm-ui, #title-screen, .game-hud) #stage {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  left: 0 !important;
  top: 0 !important;
}

#world {
  position: absolute;
  inset: 0;
  display: none;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  contain: strict;
}

#menu-background {
  display: none !important;
}

[hidden] {
  display: none !important;
}

#match-report {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(12px, 2.4vh, 26px) 5vw;
  gap: clamp(8px, 1.8vh, 18px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  animation: none;
  transform: none;
  background:
    linear-gradient(#08080899, #08080833 48%, #08080888),
    url("../assets/ui/main-courtyard.webp") center/cover;
}

.farm-ui {
  --card-line: #173f3526;
  --card-soft: #173f3509;
  --card-radius: 9px;
}

:is(#sunny-dialog, #match-report) {
  font-family: "Space Grotesk", sans-serif;
  color: var(--farm-cream);
}

.farm-ui h3 {
  margin: 0;
  font:
    800 22px/1.05 "Barlow Condensed",
    sans-serif;
  text-transform: uppercase;
}

.farm-ui button,
.farm-ui input,
.farm-ui select {
  touch-action: manipulation;
}

.farm-ui :is(button, input, select):focus-visible {
  outline: 3px solid var(--farm-clay) !important;
  outline-offset: 3px;
}

:is(#sunny-dialog, #match-report) .lobby-heading h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
}

:is(#sunny-dialog, #match-report) .lobby-heading h1 em {
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr) minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  max-height: 580px;
}

.farm-left-rail,
.farm-right-rail {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 9px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.farm-right-rail {
  grid-template-rows: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
}

.farm-main-dock {
  min-width: 0;
  min-height: 0;
}

.farm-carousel {
  display: none;
  touch-action: pan-y;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  padding: clamp(14px, 1.3vw, 18px);
  border: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  text-align: left;
  justify-content: flex-start;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-panel h2 {
  margin: 0;
  font:
    800 clamp(24px, 2vw, 29px)/1 "Barlow Condensed",
    sans-serif;
  text-transform: uppercase;
}

.farm-panel .card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.farm-panel .card-body > * {
  flex-shrink: 0;
}

.farm-workspace small {
  display: inline;
  margin: 0;
}

.big-metric strong small,
.horse-care-row strong small {
  display: inline !important;
}

.farm-panel p strong {
  font: inherit;
  font-weight: 700;
  display: inline;
  text-transform: none;
}

:is(#sunny-dialog, #match-report) .farm-workspace p {
  font:
    500 12px/1.55 "Space Grotesk",
    sans-serif;
  margin: 0;
  opacity: 1;
}

.farm-panel .card-body > .sunny-button {
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
}

.farm-panel small,
.primary-copy > small {
  font:
    700 9px/1.5 "Space Grotesk",
    sans-serif;
  letter-spacing: 0.8px;
}

.farm-panel .panel-divider {
  height: 1px;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.2;
  margin: 2px 0;
}

:is(#sunny-dialog, #match-report) .farm-workspace .sunny-button {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  font:
    800 16px/1.1 "Barlow Condensed",
    sans-serif !important;
  letter-spacing: 0.45px;
  gap: 8px;
  flex-shrink: 0;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-main, .tile-cream, .tile-gold, .tile-sage)
  .sunny-button {
  background: var(--farm-pine);
  color: var(--farm-cream);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .sunny-button:hover:not(:disabled) {
  background: var(--farm-clay);
  color: var(--farm-cream);
  filter: none;
}

:is(#sunny-dialog, #match-report) .farm-workspace .sunny-button:disabled {
  background: var(--card-soft);
  color: inherit;
  border-color: var(--card-line);
  opacity: 0.65;
  cursor: default;
}

:is(#sunny-dialog, #match-report) .farm-workspace .button-outline {
  background: transparent;
  color: var(--farm-pine);
  border-color: #173f3540;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-primary {
  justify-content: space-between;
  gap: 14px;
}

.primary-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-primary h2 {
  font-size: clamp(29px, 2.6vw, 38px);
  line-height: 0.98;
}

.farm-primary > .sunny-button {
  width: 100%;
  min-height: 44px !important;
}

:is(#sunny-dialog, #match-report) .farm-footer-end {
  grid-column: 3;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace[data-wide="true"]
  .farm-right-rail
  > .farm-panel:not(.farm-primary) {
  padding: 15px 18px;
  gap: 8px;
  justify-content: center;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace[data-wide="true"]
  .farm-right-rail
  > .farm-panel:not(.farm-primary)
  h2 {
  font-size: 23px;
}

.farm-workspace[data-wide="true"]
  .farm-right-rail
  > .farm-panel:not(.farm-primary)
  .card-body {
  gap: 7px;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace[data-wide="true"]
  .farm-right-rail
  > .farm-panel:not(.farm-primary)
  .sunny-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 15px !important;
}

:is(#sunny-dialog, #match-report) .farm-main {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 21px;
  border: 2px solid var(--farm-cream);
  border-radius: 9px;
  outline: 1px solid #fff8e960;
  outline-offset: 3px;
  color: var(--farm-pine);
  background: linear-gradient(145deg, #fffaf0, #eee5cc);
  text-align: left;
  overflow: hidden;
}

.farm-main-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-line);
  flex-shrink: 0;
}

.farm-main-heading h2 {
  margin: 0;
  font:
    800 clamp(25px, 2.2vw, 32px)/1 "Barlow Condensed",
    sans-serif;
}

.farm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 7px;
  border: 1px solid #173f352f;
  border-radius: 5px;
  color: inherit;
  background: #173f3509;
  font:
    700 9px/1.2 "Space Grotesk",
    sans-serif;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tile-charcoal .farm-badge {
  color: var(--farm-gold);
  border-color: #f3c75f55;
  background: #f3c75f12;
  align-self: flex-start;
}

.farm-main-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b3ac8d transparent;
  padding-right: 2px;
}

.farm-main-body > * {
  flex-shrink: 0;
}

.farm-main-body :is(article, section) {
  min-width: 0;
}

.horse-meter {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #173f351c;
}

.horse-meter::-webkit-progress-bar {
  border-radius: 5px;
  background: #173f351c;
}

.horse-meter::-webkit-progress-value {
  background: var(--farm-green);
  border-radius: 5px;
}

.horse-meter::-moz-progress-bar {
  background: var(--farm-green);
  border-radius: 5px;
}

.tile-charcoal .horse-meter {
  background: #fff8e925;
}

.tile-charcoal .horse-meter::-webkit-progress-bar {
  background: #fff8e925;
}

.tile-charcoal .horse-meter::-webkit-progress-value,
.tile-charcoal .horse-meter::-moz-progress-bar {
  background: var(--farm-gold);
}

.partner-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.partner-name > strong {
  font:
    800 38px/0.95 "Barlow Condensed",
    sans-serif;
  text-transform: uppercase;
}

.partner-name > span {
  font-size: 11px;
}

.big-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.big-metric > strong {
  font:
    800 58px/0.95 "Barlow Condensed",
    sans-serif;
  letter-spacing: -1px;
}

.big-metric strong small {
  font: 700 25px "Barlow Condensed";
  margin-left: 6px;
  opacity: 0.6;
}

.big-metric > span {
  font: 700 9px "Space Grotesk";
  letter-spacing: 1px;
}

:is(#sunny-dialog, #match-report) .farm-workspace .report-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: inherit;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--card-line);
  font:
    500 11px/1.35 "Space Grotesk",
    sans-serif;
}

:is(#sunny-dialog, #match-report) .farm-workspace .report-stat-row strong {
  color: inherit;
  font:
    700 20px/1 "Barlow Condensed",
    sans-serif;
  text-align: right;
  max-width: 65%;
}

:is(#sunny-dialog, #match-report) .farm-workspace .report-stat-row > span {
  font:
    500 11px/1.35 "Space Grotesk",
    sans-serif;
}

.farm-workspace .tile-charcoal {
  --card-line: #fff8e92e;
  --card-soft: #fff8e90d;
}

.horse-portrait {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  aspect-ratio: 1;
}

.care-profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 18px;
}

.care-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  background: radial-gradient(ellipse, #d5dbbb7a, transparent 70%);
}

.care-portrait .horse-portrait {
  height: 148px;
}

.care-portrait > span {
  font: 700 8px/1.4 "Space Grotesk";
  letter-spacing: 0.6px;
  text-align: center;
}

.care-meters {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.horse-care-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  font: 700 10px "Space Grotesk";
  letter-spacing: 0.5px;
}

.horse-care-row > strong {
  font: 700 25px/0.9 "Barlow Condensed";
}

.horse-care-row strong small {
  font-size: 13px;
  margin-left: 2px;
}

.horse-care-row .horse-meter {
  grid-column: 1/-1;
}

.care-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.care-actions > article {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  background: #fff8e97a;
}

:is(#sunny-dialog, #match-report) .care-actions p {
  font-size: 11px;
}

.care-actions h3,
.training-row h3 {
  font-size: 22px;
}

.care-actions .sunny-button {
  margin-top: auto;
}

.training-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-block: 1px solid var(--card-line);
}

.training-row > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.xp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  font: 700 9px "Space Grotesk";
  letter-spacing: 0.4px;
}

.xp-row .horse-meter {
  grid-column: 1/-1;
  height: 4px;
}

.xp-row strong {
  font: inherit;
  display: inline;
}

.ride-score strong {
  white-space: nowrap;
}

.horse-collection,
.race-collection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.horse-card,
.ride-card,
.track-card,
.quest-card,
.tournament-card {
  padding: 12px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  background: #fffaf080;
}

.horse-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 10px;
}

.horse-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.horse-card > .horse-card-top,
.horse-card > .sunny-button {
  grid-column: 1/-1;
}

.horse-card h3 {
  text-transform: uppercase;
  font-size: 26px;
}

.horse-card .horse-portrait {
  grid-column: 1;
  grid-row: 2/4;
  height: 82px;
  align-self: center;
}

.horse-card p {
  grid-column: 2;
  grid-row: 2;
  font-size: 10px !important;
}

.horse-card .horse-abilities {
  grid-column: 2;
  grid-row: 3;
}

.horse-card .sunny-button {
  width: 100%;
  min-height: 32px !important;
  padding: 7px 9px !important;
}

.horse-abilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 3px 0;
}

.horse-abilities > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 700 7px "Space Grotesk";
  letter-spacing: 0.4px;
  border-right: 1px solid var(--card-line);
  text-align: center;
}

.horse-abilities > span:last-child {
  border: 0;
}

.horse-abilities b {
  font: 700 22px/1 "Barlow Condensed";
}

.is-selected {
  border-color: #527e5f;
  background: #d8e5c663;
  box-shadow: inset 0 0 0 1px #527e5f44;
}

.is-selected .farm-badge {
  background: var(--farm-pine);
  color: var(--farm-cream);
  border-color: transparent;
}

.rider-thumbnail {
  height: 100px;
  min-height: 70px;
  border-radius: 6px;
  background: url("../assets/ui/royal-racing.webp") center 38% / cover;
  flex: 1;
}

.ride-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.entry-number {
  font: 700 8px/1.4 "Space Grotesk";
  letter-spacing: 1px;
  color: #52715e;
}

.ride-card h3 {
  font-size: 25px;
}

.ride-card p {
  font-size: 11px !important;
}

.ride-card .sunny-button {
  margin-top: auto;
  min-height: 33px !important;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.section-label h3 {
  font-size: 23px;
}

.section-label > span {
  font: 700 8px "Space Grotesk";
  letter-spacing: 0.8px;
}

.alternative-rides {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.alternative-rides > button {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 8px;
  border: 1px solid #173f3533;
  border-radius: 7px;
  background: #173f350a;
  color: var(--farm-pine);
  padding: 11px 10px;
  cursor: pointer;
}

.alternative-rides strong {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font: 800 17px/1.05 "Barlow Condensed";
}

.alternative-rides small {
  font: 500 9px/1.4 "Space Grotesk";
}

.alternative-rides button:hover {
  background: var(--farm-gold);
}

.track-collection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.track-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  align-items: center;
}

.horse-map-preview {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: cover;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #aec18b;
}

.track-card > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.track-card h3 {
  font-size: 25px;
}

.track-card p {
  font-size: 10px !important;
  line-height: 1.45 !important;
}

.track-actions {
  display: flex;
  gap: 6px;
}

.track-actions > .sunny-button {
  flex: 1;
  min-width: 0;
  min-height: 31px !important;
  font-size: 14px !important;
  padding: 6px 7px !important;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid > section {
  padding: 12px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fffaf066;
}

.settings-wide {
  grid-column: 1/-1;
}

.settings-grid h3 {
  font-size: 24px;
}

.settings-grid p {
  font-size: 10px !important;
}

.horse-choices,
.guide-tabs {
  display: flex;
  gap: 5px;
}

.horse-choices > * {
  flex: 1;
  min-width: 0;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.horse-choices, .guide-tabs)
  .sunny-button {
  background: transparent;
  color: var(--farm-pine);
  border-color: #173f3540;
  min-height: 34px;
  padding: 7px 5px;
  font-size: 15px !important;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.horse-choices, .guide-tabs)
  [aria-pressed="true"] {
  background: var(--farm-pine);
  color: var(--farm-cream);
  border-color: var(--farm-pine);
  box-shadow: inset 0 -3px var(--farm-gold);
}

.horse-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid var(--card-line);
  font: 500 11px/1.4 "Space Grotesk";
  cursor: pointer;
}

.horse-setting:last-child {
  border: 0;
}

.horse-setting input {
  appearance: none;
  position: relative;
  width: 32px;
  height: 19px;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid #173f3566;
  border-radius: 12px;
  background: #173f3522;
  cursor: pointer;
}

.horse-setting input:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #687e6b;
  transition: transform 0.15s;
}

.horse-setting input:checked {
  background: var(--farm-pine);
  border-color: var(--farm-pine);
}

.horse-setting input:checked:before {
  background: var(--farm-gold);
  transform: translateX(13px);
}

.horse-setting select {
  max-width: 105px;
  min-height: 32px;
  border: 1px solid #173f3540;
  border-radius: 6px;
  padding: 5px 6px;
  background: #fffaf0;
  color: var(--farm-pine);
  font: 500 11px "Space Grotesk";
  color-scheme: light;
}

.horse-volume {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px 0;
  font: 500 11px "Space Grotesk";
}

.horse-volume > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.horse-volume input {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 5px;
  border-radius: 4px;
  background: #173f3526;
  cursor: pointer;
}

.horse-volume input::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--farm-pine);
  background: var(--farm-gold);
}

.horse-volume input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--farm-pine);
  background: var(--farm-gold);
}

.horse-volume output {
  min-width: 34px;
  text-align: right;
  font: 700 18px "Barlow Condensed";
  font-variant-numeric: tabular-nums;
}

.save-note {
  margin-top: auto !important;
  padding: 10px;
  border-radius: 6px;
  background: #173f350c;
  font-size: 10px !important;
}

.guide-tabs > .sunny-button {
  flex: 1;
}

.horse-controls > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-line);
  font: 500 12px "Space Grotesk";
}

.horse-controls > div > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.farm-workspace kbd {
  display: inline-grid;
  place-items: center;
  min-height: 25px;
  min-width: 28px;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid #173f3540;
  border-bottom: 3px solid #173f3550;
  border-radius: 5px;
  background: #fffaf0;
  color: var(--farm-pine);
  font: 700 12px/1 "Space Grotesk";
  white-space: nowrap;
}

.key-or {
  font-size: 9px;
  opacity: 0.6;
}

.touch-note {
  padding: 10px;
  background: var(--card-soft);
  border-radius: 6px;
  font-size: 10px !important;
}

.guide-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: guide;
}

.guide-checklist li {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 4px 9px;
  counter-increment: guide;
}

.guide-checklist li:before {
  content: "0" counter(guide);
  grid-row: span 2;
  font: 800 24px "Barlow Condensed";
  opacity: 0.4;
}

.guide-checklist b {
  font: 800 19px "Barlow Condensed";
}

.guide-checklist span {
  font: 500 11px/1.4 "Space Grotesk";
}

.guide-lessons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-lessons article {
  display: flex;
  gap: 12px;
  padding: 16px 12px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
}

.guide-lessons article > span {
  font: 800 30px "Barlow Condensed";
  color: #73846c;
}

.guide-lessons article > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.guide-lessons h3 {
  font-size: 24px;
}

.quest-collection {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quest-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 9px 12px;
}

.quest-number {
  font: 800 26px/0.95 "Barlow Condensed";
  color: #73846c;
  padding-top: 3px;
}

.quest-card > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
}

.quest-card .horse-card-top,
.quest-card p {
  grid-column: 1/-1;
}

.quest-card h3 {
  font-size: 23px;
}

.quest-card p {
  font-size: 10px !important;
}

.coin-reward {
  font: 700 20px "Barlow Condensed";
  color: #7e6121;
  white-space: nowrap;
}

.coin-reward:after {
  content: " COINS";
  font: 700 8px "Space Grotesk";
}

.quest-progress {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.quest-progress > span {
  font: 600 9px "Space Grotesk";
}

.quest-card .sunny-button {
  min-height: 30px !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
}

.is-complete {
  background: #d8e5c663;
}

.is-complete .quest-number {
  color: var(--farm-green);
}

.tournament-card > .entry-number {
  display: none;
}

.tournament-card > .sunny-button {
  grid-row: 1/4;
}

.tournament-collection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
}

.tournament-card > .entry-number,
.tournament-card > h3,
.tournament-card > p {
  grid-column: 1;
}

.tournament-card > h3 {
  font-size: 25px;
}

.tournament-card p {
  font-size: 11px !important;
}

.tournament-card > small {
  grid-column: 1;
  font: 700 8px "Space Grotesk";
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.tournament-card .sunny-button {
  grid-column: 2;
  grid-row: 1/5;
}

.invitational-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 14px;
  border-radius: 8px;
  background: var(--farm-pine);
  color: var(--farm-cream);
}

.invitational-card > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invitational-card small {
  font: 700 8px "Space Grotesk";
  letter-spacing: 1px;
  color: var(--farm-gold);
}

.invitational-card h3 {
  font-size: 24px;
}

.invitational-card p {
  font-size: 10px !important;
}

.invitational-card .sunny-button {
  background: var(--farm-gold) !important;
  color: var(--farm-pine) !important;
}

.invitational-card .sunny-button:disabled {
  background: #fff8e91a !important;
  color: var(--farm-cream) !important;
  border-color: #fff8e955 !important;
}

.ride-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: var(--farm-pine);
  color: var(--farm-cream);
  border-radius: 8px;
}

.ride-score > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ride-score > div:last-child {
  align-items: flex-end;
}

.ride-score small {
  font: 700 8px "Space Grotesk";
  letter-spacing: 1px;
}

.ride-score strong {
  font: 800 38px/0.95 "Barlow Condensed";
  color: var(--farm-gold);
}

.ride-score b {
  font: 800 22px "Barlow Condensed";
}

.ride-score span {
  font: 500 10px "Space Grotesk";
  font-variant-numeric: tabular-nums;
}

.main-intro {
  font-size: 11px !important;
}

.farm-workspace .match-event {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--card-line);
  padding: 7px 10px;
  font: 500 11px "Space Grotesk";
  border-radius: 5px;
}

.farm-workspace .match-event time {
  display: grid;
  place-items: center;
  min-width: 37px;
  min-height: 35px;
  padding: 0;
  border-radius: 5px;
  color: var(--farm-pine);
  font: 700 22px "Barlow Condensed";
  background: var(--card-soft);
  font-variant-numeric: tabular-nums;
}

.farm-workspace .match-event > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.farm-workspace .match-event strong {
  font: 800 23px/1 "Barlow Condensed";
  color: inherit;
}

.farm-workspace .match-event span {
  display: block;
  color: inherit;
  opacity: 0.75;
  font: 500 10px/1.3 "Space Grotesk";
  margin: 0;
}

.farm-workspace .match-event.player {
  background: #f3c75f55;
  border-color: #bca04c66;
}

.farm-workspace .match-event.player time {
  background: var(--farm-gold);
}

.farm-report .ride-records {
  flex: 1;
}

.farm-report .ride-records:has(> .farm-empty) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.farm-report .ride-records > .farm-empty {
  flex: 1;
  min-height: 0;
}

.farm-report .match-event time:first-child {
  white-space: nowrap;
}

.compact-actions {
  display: flex;
  gap: 6px;
}

.compact-actions > * {
  flex: 1;
  min-width: 0;
}

.farm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 35px 24px;
  min-height: 230px;
  border: 1px dashed #173f3540;
  border-radius: 8px;
}

.farm-empty > span {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #e1e6ca;
  font: 700 34px "Barlow Condensed";
}

.farm-empty h3 {
  font-size: 32px;
}

.farm-empty p {
  max-width: 300px;
}

.farm-course .farm-main-body {
  overflow: hidden;
}

.farm-course .course-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  flex-shrink: 1;
}

#large-map {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 1;
  border-radius: 7px;
}

.map-overview {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #10241ef5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  gap: 12px;
  color: #fff8e9;
  font-family: "Space Grotesk", sans-serif;
}

.map-overview > img,
.map-overview > canvas {
  min-height: 0;
  max-height: 80vh;
  max-width: 95vw;
  object-fit: contain;
  border: 2px solid #fff8e9;
  border-radius: 9px;
}

.overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(80vh, 95vw);
  gap: 12px;
  font-size: 12px;
}

.overview-heading button {
  background: #f3c75f;
  color: #173f35;
  padding: 10px 14px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: 800 16px "Barlow Condensed";
}

.map-overview small {
  font-size: 10px;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 85px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 600;
  max-width: min(90vw, 600px);
  padding: 15px 22px;
  border-left: 4px solid #f3c75f;
  background: #171d19f0;
  color: #fff8e9;
  font: 600 14px "Space Grotesk";
  transition:
    opacity 0.2s,
    transform 0.2s;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%);
}

.reduced-motion * {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 1150px) and (min-width: 901px) and (min-height: 720px) {
  :is(#sunny-dialog, #match-report) .farm-workspace .farm-panel {
    padding: 15px;
    gap: 9px;
  }
  :is(#sunny-dialog, #match-report) .farm-workspace p {
    font-size: 11px;
  }
  :is(#sunny-dialog, #match-report) .farm-main {
    padding: 17px;
  }
  .farm-main-heading {
    gap: 8px;
  }
  .farm-main-heading h2 {
    font-size: 25px;
  }
  .farm-badge {
    font-size: 8px;
  }
  .track-card {
    grid-template-columns: 80px 1fr;
    gap: 9px;
  }
  .horse-map-preview {
    width: 80px;
    height: 96px;
  }
  .track-card h3 {
    font-size: 22px;
  }
  .track-actions {
    flex-wrap: wrap;
  }
  .track-actions > .sunny-button {
    font-size: 12px !important;
  }
  .farm-main .horse-card-top {
    flex-wrap: wrap;
  }
  .farm-main .horse-card-top .farm-badge {
    font-size: 7px;
  }
  .care-portrait .horse-portrait {
    height: 140px;
  }
  .care-actions {
    gap: 8px;
  }
  .care-actions > article {
    padding: 9px;
  }
  .care-actions h3 {
    font-size: 20px;
  }
}

@media (max-width: 900px), (max-height: 719px) {
  :is(#sunny-dialog, #match-report) .farm-workspace[data-wide="false"] {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    flex: 1 1 0;
    min-height: 0;
  }
  .farm-workspace[data-wide="false"] .farm-left-rail,
  .farm-workspace[data-wide="false"] .farm-main-dock {
    display: none;
  }
  .farm-workspace[data-wide="false"] .farm-right-rail {
    display: block;
    order: 0;
    flex-shrink: 0;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="false"]
    .farm-primary {
    padding: 10px 13px;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 60px;
    gap: 12px;
  }
  .farm-workspace[data-wide="false"] .primary-copy {
    min-width: 0;
    gap: 0;
  }
  .farm-workspace[data-wide="false"] .primary-copy > small,
  .farm-workspace[data-wide="false"] .primary-copy > p {
    display: none;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="false"]
    .farm-primary
    h2 {
    font-size: 21px;
    line-height: 1;
  }
  .farm-workspace[data-wide="false"] .farm-primary > .sunny-button {
    width: auto;
    min-width: 45%;
    max-width: 60%;
    min-height: 38px !important;
  }
  .farm-workspace[data-wide="false"] .farm-carousel {
    display: block;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    border-radius: 9px;
    order: 1;
  }
  .farm-carousel-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.2s ease;
    will-change: transform;
  }
  .farm-card-slide {
    height: 100%;
    flex: 0 0 100%;
    min-width: 0;
    padding: 0;
    display: block;
    overflow: hidden;
  }
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-panel,
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-main {
    height: 100%;
    max-height: 100%;
    padding: 18px;
    outline: 0;
    gap: 12px;
  }
  :is(#sunny-dialog, #match-report) .farm-workspace .farm-panel h2 {
    font-size: 29px;
  }
  .farm-card-slide > .farm-panel .card-body {
    gap: 16px;
  }
  .farm-card-slide .report-stat-row {
    padding: 12px 0 !important;
  }
  .farm-card-slide .big-metric > strong {
    font-size: 76px;
  }
  .farm-card-slide .partner-name > strong {
    font-size: 46px;
  }
  .farm-card-slide .farm-panel .card-body > .sunny-button {
    margin-top: 0;
  }
}

/* Equestrian artwork stays compact around the working content. */
.main-art {
  display: block;
  width: 100%;
  height: 94px;
  min-height: 94px;
  object-fit: cover;
  object-position: center 27%;
  border-radius: 7px;
  border: 1px solid var(--card-line);
}

.panel-stamp {
  display: none;
}

.panel-art {
  display: block;
  width: 100%;
  height: 72px;
  min-height: 72px;
  object-fit: cover;
  object-position: center 44%;
  border-radius: 6px;
  border: 1px solid #fff8e92e;
}

.primary-art {
  display: block;
  position: absolute;
  right: 15px;
  top: 15px;
  width: 48px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 1px 8px #173f3520;
}

.farm-primary .primary-copy > small {
  padding-right: 57px;
  min-height: 28px;
}

.home-card-art {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 70px;
  height: 62px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #fff8e92e;
}

.arena-grid .tile-pass .home-card-art,
.arena-grid .tile-rules .home-card-art {
  width: 48px;
  height: 48px;
  top: 14px;
  right: 14px;
}

.arena-grid :is(.tile-pass, .tile-rules) > span:not(.tile-arrow) {
  padding-right: 50px;
}

.arena-grid .tile-symbol {
  position: relative;
  z-index: 1;
}

.care-action-art {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
  object-position: center 72%;
}

.feed-art {
  object-position: right 74%;
}

.groom-art {
  object-position: 72% 40%;
}

.training-art {
  width: 58px;
  height: 45px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}

.training-row > div {
  flex: 1;
}

.royal-track-card {
  overflow: hidden;
  border: 1px solid #173f3535;
  border-radius: 9px;
  background: #fffaf0;
}

.royal-track-visual {
  position: relative;
  min-height: 220px;
  height: 240px;
  overflow: hidden;
  background: #a3d766;
}

.royal-track-visual > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.royal-track-visual > img.royal-route-inset {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 2px solid #fff8e9;
  border-radius: 7px;
  box-shadow: 0 3px 10px #102e2833;
}

.royal-track-label {
  position: absolute;
  inset: auto 0 0;
  padding: 45px 16px 13px;
  color: #fff8e9;
  background: linear-gradient(transparent, #102e28ed);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.royal-track-label > small {
  font: 700 8px "Space Grotesk";
  letter-spacing: 1.2px;
}

.royal-track-label h3 {
  font-size: 36px;
}

.royal-track-label .farm-badge {
  background: #f3c75f;
  color: #173f35;
  border-color: transparent;
  font-size: 8px;
}

.royal-track-details {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.royal-track-details > p {
  font-size: 11px !important;
}

.course-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding-block: 11px;
  border-block: 1px solid var(--card-line);
}

.course-facts > span {
  font: 700 7px/1.5 "Space Grotesk";
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.course-facts b {
  font: 800 23px/1 "Barlow Condensed";
  white-space: nowrap;
}

.course-facts > span:last-child b {
  font-size: 18px;
}

.course-tip {
  border-left: 3px solid var(--farm-green);
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.course-tip > strong {
  font: 800 21px "Barlow Condensed";
}

.course-tip > p {
  font-size: 10px !important;
}

/* Native wheel, touch and keyboard scrolling with accessible arrow-only chrome. */
.farm-ui,
.farm-ui * {
  scrollbar-width: none !important;
}

.farm-ui::-webkit-scrollbar,
.farm-ui ::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.farm-scroll-shell {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-panel, .farm-main)
  > .farm-scroll-shell {
  position: static !important;
}

.farm-scroll-shell > :is(.card-body, .farm-main-body) {
  height: 100%;
  min-height: 0;
  flex: 1;
  min-width: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-right: 1px;
  scroll-padding-block: 10px;
}

.farm-scroll-shell > :is(.card-body, .farm-main-body):focus-visible {
  outline: 2px solid var(--farm-clay);
  outline-offset: -2px;
  border-radius: 5px;
}

.farm-scroll-arrows {
  position: absolute;
  right: var(--scroll-right, 18px);
  bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  height: var(--scroll-edge, 18px);
  z-index: 5;
}

:is(#cod-lobby, #sunny-dialog, #match-report) .farm-scroll-arrows button {
  display: grid;
  place-items: center;
  width: 24px;
  height: min(20px, 100%);
  min-height: 0;
  flex-shrink: 0;
  border: 1px solid #173f3533;
  border-radius: 4px;
  background: var(--farm-pine);
  color: #fff8e9;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 5px #173f3510;
  transition:
    background 0.15s,
    opacity 0.15s;
}

:is(#cod-lobby, #sunny-dialog, #match-report)
  .farm-scroll-arrows
  button:hover:not(:disabled) {
  background: var(--farm-clay);
  color: #fff8e9;
}

:is(#cod-lobby, #sunny-dialog, #match-report)
  .farm-scroll-arrows
  button:disabled {
  opacity: 0.28;
  cursor: default;
}

.farm-scroll-arrows svg {
  display: block;
  width: 14px;
  height: 100%;
  max-height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-charcoal .farm-scroll-arrows button {
  background: var(--farm-gold) !important;
  color: var(--farm-pine) !important;
}

.farm-scroll-shell .farm-main-body > .main-art {
  flex-shrink: 0;
}

@media (min-width: 901px) and (min-height: 720px) {
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary) {
    padding: 12px 14px !important;
    gap: 6px !important;
    justify-content: flex-start !important;
  }
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    > h2 {
    padding-right: 47px;
    font-size: 21px !important;
    min-height: 22px;
  }
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    .panel-art {
    display: none;
  }
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    > .panel-stamp {
    display: block;
    position: absolute;
    right: 12px;
    top: 10px;
    width: 40px;
    height: 32px;
    object-fit: cover;
    pointer-events: none;
    border-radius: 5px;
    z-index: 1;
  }
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    .card-body
    > p {
    font-size: 10px !important;
    line-height: 1.35 !important;
  }
  .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    .card-body {
    gap: 6px;
    flex: 1;
  }
}

@media (max-width: 600px) {
  .main-art {
    height: 78px;
    min-height: 78px;
  }
  .panel-art {
    height: 120px;
    min-height: 120px;
  }
  .home-card-art {
    width: 52px;
    height: 42px;
    right: 12px;
    top: 12px;
  }
  .arena-grid :is(.tile-pass, .tile-rules) .home-card-art {
    width: 39px;
    height: 35px;
    top: 12px;
    right: 12px;
  }
  .primary-art {
    display: none;
  }
  .farm-primary .primary-copy > small {
    padding-right: 0;
    min-height: 0;
  }
  .royal-track-visual {
    height: 240px;
  }
  .course-facts b {
    font-size: 20px;
  }
  .royal-track-label h3 {
    font-size: 32px;
  }
  .royal-track-details {
    padding: 12px;
  }
  .training-art {
    width: 40px;
    height: 40px;
  }
  .training-row {
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .royal-track-visual {
    height: 220px;
  }
  .course-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .track-actions {
    flex-direction: column;
  }
  .main-art {
    height: 68px;
    min-height: 68px;
  }
}

@media (max-height: 570px) and (min-width: 480px) {
  .main-art {
    height: 64px;
    min-height: 64px;
  }
  .panel-art {
    height: 70px;
    min-height: 70px;
  }
  .primary-art {
    display: none;
  }
  .royal-track-visual {
    height: 250px;
  }
}

@media (max-width: 600px) {
  #match-report {
    padding: max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  :is(#sunny-dialog, #match-report) .farm-page-body {
    overflow: hidden;
    min-height: 0;
  }
  .farm-main-heading {
    gap: 7px;
    padding-bottom: 10px;
    flex-wrap: wrap;
  }
  .farm-main-heading h2 {
    font-size: 26px;
  }
  .farm-badge {
    font-size: 8px;
  }
  .farm-main-body {
    gap: 12px;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="false"]
    .farm-primary
    h2 {
    font-size: 19px;
  }
  .farm-workspace[data-wide="false"] .farm-primary > .sunny-button {
    font-size: 15px !important;
    padding: 8px 10px !important;
  }
  .farm-workspace[data-wide="false"] .farm-primary {
    min-height: 56px !important;
  }
  .care-profile {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .care-portrait .horse-portrait {
    height: 128px;
  }
  .care-portrait > span {
    font-size: 7px;
  }
  .care-meters {
    gap: 15px;
  }
  .horse-care-row {
    font-size: 9px;
    gap: 6px;
  }
  .horse-care-row > strong {
    font-size: 23px;
  }
  .care-actions {
    gap: 8px;
  }
  .care-actions > article {
    padding: 10px;
  }
  .care-actions h3,
  .training-row h3 {
    font-size: 21px;
  }
  .care-actions p {
    min-height: 32px;
  }
  .care-actions .sunny-button {
    font-size: 15px !important;
    padding: 8px !important;
  }
  .training-row p {
    font-size: 10px !important;
  }
  .horse-collection {
    grid-template-columns: 1fr;
  }
  .horse-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 8px;
  }
  .horse-card .horse-portrait {
    height: 130px;
  }
  .horse-card h3 {
    font-size: 30px;
  }
  .horse-card p {
    font-size: 11px !important;
  }
  .horse-abilities b {
    font-size: 25px;
  }
  .horse-abilities > span {
    font-size: 8px;
  }
  .horse-card .sunny-button {
    min-height: 38px !important;
  }
  .race-collection {
    gap: 8px;
  }
  .ride-card {
    padding: 10px;
    gap: 8px;
  }
  .ride-card h3 {
    font-size: 24px;
  }
  .ride-card p {
    font-size: 10px !important;
  }
  .entry-number {
    font-size: 7px;
  }
  .ride-card .sunny-button {
    font-size: 15px !important;
    padding: 7px !important;
  }
  .alternative-rides {
    grid-template-columns: 1fr;
  }
  .alternative-rides > button {
    padding: 12px;
    gap: 5px;
  }
  .alternative-rides strong {
    font-size: 21px;
  }
  .alternative-rides small {
    font-size: 10px;
  }
  .section-label > span {
    display: none;
  }
  .track-card {
    grid-template-columns: 80px 1fr;
    gap: 10px;
    align-items: start;
  }
  .horse-map-preview {
    width: 80px;
    height: 90px;
  }
  .track-card .horse-card-top {
    flex-wrap: wrap;
    gap: 4px;
  }
  .track-card h3 {
    font-size: 24px;
  }
  .track-actions {
    grid-column: 1/-1;
    flex-wrap: wrap;
  }
  .track-actions > .sunny-button {
    font-size: 13px !important;
    min-height: 33px !important;
  }
  .track-card > div {
    gap: 7px;
  }
  .track-card p {
    font-size: 10px !important;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-wide {
    grid-column: auto;
  }
  .settings-grid > section {
    padding: 13px;
  }
  .settings-grid p {
    font-size: 11px !important;
  }
  .horse-setting {
    min-height: 41px;
    font-size: 12px;
  }
  .horse-volume {
    font-size: 12px;
    padding: 8px 0;
  }
  .horse-volume input {
    height: 6px;
  }
  .horse-volume input::-webkit-slider-thumb {
    width: 19px;
    height: 19px;
  }
  .horse-choices .sunny-button {
    min-height: 38px !important;
    font-size: 16px !important;
  }
  .horse-controls > div {
    font-size: 11px;
    padding: 11px 0;
  }
  .farm-workspace kbd {
    font-size: 10px;
    padding: 4px 5px;
    min-width: 25px;
  }
  .horse-controls > div > div {
    gap: 4px;
  }
  .guide-lessons article {
    padding: 12px 10px;
    gap: 10px;
  }
  .guide-lessons h3 {
    font-size: 23px;
  }
  .guide-lessons p {
    font-size: 11px !important;
  }
  .quest-card {
    padding: 12px 10px;
    grid-template-columns: 23px 1fr;
    gap: 8px;
  }
  .quest-card h3 {
    font-size: 22px;
  }
  .quest-card .horse-card-top {
    align-items: start;
  }
  .coin-reward:after {
    display: none;
  }
  .quest-card > div {
    column-gap: 8px;
  }
  .quest-card .sunny-button {
    font-size: 13px !important;
    padding: 7px 9px !important;
  }
  .tournament-card {
    padding: 13px;
    grid-template-columns: 1fr;
  }
  .tournament-card .sunny-button {
    grid-column: 1;
    grid-row: auto;
    margin-top: 4px;
  }
  .tournament-card h3 {
    font-size: 27px;
  }
  .invitational-card {
    flex-direction: column;
    align-items: stretch;
  }
  .invitational-card h3 {
    font-size: 26px;
  }
  .ride-score {
    padding: 12px;
  }
  .ride-score strong {
    font-size: 35px;
  }
  .ride-score b {
    font-size: 20px;
  }
  .farm-workspace .match-event {
    padding: 6px 5px;
    gap: 10px;
  }
  .farm-workspace .match-event strong {
    font-size: 22px;
  }
  .farm-workspace .match-event span {
    font-size: 9px;
  }
  .farm-empty {
    padding: 24px 15px;
  }
  .farm-empty h3 {
    font-size: 29px;
  }
}

@media (max-width: 360px) {
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-main,
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-panel {
    padding: 13px;
    gap: 10px;
  }
  .farm-main-heading h2 {
    font-size: 24px;
  }
  .farm-main-heading .farm-badge {
    font-size: 7px;
    padding: 4px 5px;
  }
  .farm-main-heading {
    gap: 5px;
  }
  .farm-workspace[data-wide="false"] .farm-primary > .sunny-button {
    max-width: 62%;
    font-size: 14px !important;
  }
  .farm-workspace[data-wide="false"] .farm-primary h2 {
    font-size: 17px !important;
  }
  .farm-workspace[data-wide="false"] .farm-primary {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .care-portrait .horse-portrait {
    height: 105px;
  }
  .care-actions h3,
  .training-row h3 {
    font-size: 19px;
  }
  .horse-care-row {
    font-size: 8px;
  }
  .race-collection {
    grid-template-columns: 1fr;
  }
  .track-card {
    grid-template-columns: 65px 1fr;
    padding: 9px;
    gap: 8px;
  }
  .horse-map-preview {
    width: 65px;
    height: 80px;
  }
  .track-card h3 {
    font-size: 22px;
  }
  .quest-card h3 {
    font-size: 20px;
  }
  .quest-card .sunny-button {
    font-size: 12px !important;
  }
  .quest-card {
    padding: 10px 8px;
  }
  .horse-controls > div {
    font-size: 10px;
  }
  .farm-workspace kbd {
    font-size: 9px;
  }
}

@media (max-height: 570px) and (min-width: 480px) {
  #match-report {
    padding: 10px 3vw;
    gap: 8px;
  }
  :is(#sunny-dialog, #match-report) .farm-workspace[data-wide="false"] {
    gap: 8px;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="false"]
    .farm-primary {
    min-height: 45px !important;
    padding: 6px 12px;
  }
  .farm-workspace[data-wide="false"] .farm-primary > .sunny-button {
    min-height: 31px !important;
    min-width: 180px;
    font-size: 15px !important;
  }
  .farm-workspace[data-wide="false"] .farm-primary h2 {
    font-size: 22px !important;
  }
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-main,
  :is(#sunny-dialog, #match-report) .farm-card-slide > .farm-panel {
    padding: 12px 16px;
    gap: 10px;
  }
  .farm-main-heading {
    padding-bottom: 8px;
  }
  .farm-main-heading h2 {
    font-size: 25px;
  }
  .farm-main-body {
    gap: 10px;
  }
  .race-collection {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .ride-card {
    padding: 9px;
    gap: 6px;
  }
  .ride-card h3 {
    font-size: 23px;
  }
  .ride-card p {
    font-size: 10px !important;
  }
  .ride-card .sunny-button {
    font-size: 14px !important;
    padding: 7px !important;
  }
  .horse-collection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .horse-card .horse-portrait {
    height: 90px;
  }
  .care-profile {
    grid-template-columns: 1fr 2fr;
  }
  .care-portrait .horse-portrait {
    height: 120px;
  }
  .care-meters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .care-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .track-card {
    grid-template-columns: 90px 1fr;
  }
  .horse-map-preview {
    width: 90px;
    height: 90px;
  }
  .tournament-collection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .tournament-card {
    grid-template-columns: 1fr;
  }
  .tournament-card .sunny-button {
    grid-column: 1;
    grid-row: auto;
  }
  .invitational-card {
    align-items: stretch;
    flex-direction: column;
  }
  .horse-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .guide-lessons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .guide-lessons article {
    padding: 12px;
    gap: 8px;
  }
  .guide-lessons p {
    font-size: 10px !important;
  }
}

@media (max-width: 900px), (max-height: 719px) {
  #cod-lobby[data-layout="compact"] .arena-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 56px minmax(90px, 1fr) 82px 82px;
    gap: 7px;
  }
  #cod-lobby[data-layout="compact"] .tile-ai {
    grid-area: 1/1/2/3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
  }
  #cod-lobby[data-layout="compact"] .tile-ai > .home-card-art {
    position: static;
    width: 44px;
    height: 35px;
    flex-shrink: 0;
  }
  #cod-lobby[data-layout="compact"] .tile-ai > .tile-symbol {
    display: none;
  }
  #cod-lobby[data-layout="compact"] .tile-ai > span:not(.tile-arrow) {
    flex: 1;
  }
  #cod-lobby[data-layout="compact"] .tile-ai .tile-arrow {
    position: static;
  }
  #cod-lobby[data-layout="compact"] .tile-ai strong {
    font-size: 25px;
  }
  #cod-lobby[data-layout="compact"] .tile-hero {
    grid-area: 2/1/3/3;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy {
    position: absolute;
    right: 12px;
    bottom: 12px;
    max-width: 65%;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy strong {
    font-size: 48px;
    line-height: 0.84;
    margin: 6px 0 8px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy small {
    font-size: 6px;
    letter-spacing: 0.7px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy > span {
    padding: 0;
    font-size: 6px;
    gap: 10px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy b {
    font-size: 16px;
  }
  #cod-lobby[data-layout="compact"] .tile-controls {
    grid-area: 3/1/4/2;
  }
  #cod-lobby[data-layout="compact"] .tile-stats {
    grid-area: 3/2/4/3;
  }
  #cod-lobby[data-layout="compact"] .tile-pass {
    grid-area: 4/1/5/2;
  }
  #cod-lobby[data-layout="compact"] .tile-rules {
    grid-area: 4/2/5/3;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-pass, .tile-rules) strong {
    font-size: 20px;
    margin-top: 4px;
  }
  #cod-lobby[data-layout="compact"]
    :is(.tile-pass, .tile-rules)
    > span:not(.tile-arrow) {
    padding-right: 0;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-pass, .tile-rules) small {
    max-width: calc(100% - 34px);
    font-size: 6px;
    line-height: 1.3;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-controls, .tile-stats) {
    padding: 10px 12px;
    justify-content: flex-end;
  }
  #cod-lobby[data-layout="compact"]
    :is(.tile-controls, .tile-stats)
    .tile-symbol {
    display: none;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-controls, .tile-stats) small {
    max-width: calc(100% - 28px);
    font-size: 6px;
    line-height: 1.25;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-controls, .tile-stats) strong {
    font-size: 25px;
  }
  #cod-lobby[data-layout="compact"]
    :is(.tile-pass, .tile-rules)
    .home-card-art {
    width: 32px;
    height: 22px;
    right: 10px;
    top: 8px;
  }
  #cod-lobby[data-layout="compact"] .tile-stats .home-card-art,
  #cod-lobby[data-layout="compact"] .tile-controls .home-card-art {
    width: 30px;
    height: 26px;
    right: 10px;
    top: 10px;
  }
  #cod-lobby[data-layout="compact"] .tile-stats #lobby-record {
    font-size: 7px;
    margin-top: 4px;
  }
}

@media (max-width: 360px) {
  #cod-lobby[data-layout="compact"] .hero-tile-copy strong {
    font-size: 34px;
    line-height: 0.82;
    margin: 4px 0 6px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy small {
    font-size: 5px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy > span {
    font-size: 5px;
  }
}

@media (max-height: 570px) and (min-width: 480px) {
  #cod-lobby[data-layout="compact"] .arena-grid {
    grid-template-rows: 44px minmax(70px, 1fr) 54px 54px;
    gap: 6px;
  }
  #cod-lobby[data-layout="compact"] .tile-ai {
    padding: 5px 14px;
  }
  #cod-lobby[data-layout="compact"]
    :is(.tile-controls, .tile-stats, .tile-pass, .tile-rules) {
    padding: 6px 12px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy strong {
    font-size: 48px;
    margin: 6px 0 8px;
  }
  #cod-lobby[data-layout="compact"] .hero-tile-copy > span {
    padding: 0;
    font-size: 7px;
  }
}

/* Black gradients keep illustrated lobby cards clear behind light copy. */
.farm-ui
  :where(
    .arena-tile,
    .care-actions > article,
    .training-row,
    .royal-track-card
  ) {
  --card-wash: #000;
}

#cod-lobby .arena-tile {
  isolation: isolate;
}

#cod-lobby .arena-grid > .arena-tile {
  background-color: #0b0b0b;
  color: var(--farm-cream);
}

#cod-lobby .arena-tile:has(> .home-card-art)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--card-wash) 78%, transparent),
    color-mix(in srgb, var(--card-wash) 38%, transparent) 38%,
    color-mix(in srgb, var(--card-wash) 97%, transparent) 83%
  );
}

#cod-lobby .arena-tile > .home-card-art {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: 65% center;
  border: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

#cod-lobby .arena-tile > span {
  z-index: 2;
}

#cod-lobby .arena-tile:has(> .home-card-art) > span:not(.tile-arrow) {
  position: relative;
}

#cod-lobby :is(.tile-stats, .tile-pass)::before {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--card-wash) 78%, transparent),
    color-mix(in srgb, var(--card-wash) 45%, transparent) 34%,
    color-mix(in srgb, var(--card-wash) 97%, transparent) 82%
  ) !important;
}

#cod-lobby :is(.tile-pass, .tile-rules)::before {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--card-wash) 97%, transparent),
    color-mix(in srgb, var(--card-wash) 90%, transparent) 53%,
    color-mix(in srgb, var(--card-wash) 74%, transparent)
  ) !important;
}

#cod-lobby :is(.tile-symbol, .tile-arrow) {
  color: var(--farm-gold);
}

#cod-lobby .tile-stats #lobby-record {
  color: var(--farm-cream);
  text-shadow: 0 1px 4px #000;
}

#cod-lobby :is(.tile-pass, .tile-rules) > span:not(.tile-arrow) {
  padding-right: 0;
}

#cod-lobby .tile-hero {
  background-image:
    linear-gradient(155deg, #0000001f 25%, #00000070 58%, #000000f5),
    url("../assets/ui/stable-courtyard.webp");
}

@media (max-width: 900px), (max-height: 719px) {
  #cod-lobby[data-layout="compact"] .tile-ai::before {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--card-wash) 95%, transparent),
      color-mix(in srgb, var(--card-wash) 84%, transparent) 55%,
      color-mix(in srgb, var(--card-wash) 68%, transparent)
    );
  }
  #cod-lobby[data-layout="compact"] .tile-ai > .home-card-art {
    object-position: center 43%;
  }
  #cod-lobby[data-layout="compact"] :is(.tile-pass, .tile-rules) small,
  #cod-lobby[data-layout="compact"] :is(.tile-controls, .tile-stats) small {
    max-width: none;
  }
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .farm-panel,
    .farm-main,
    .care-actions > article,
    .training-row,
    .royal-track-card
  ) {
  position: relative;
  isolation: isolate;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .farm-panel,
    .farm-main,
    .farm-primary,
    .care-actions > article,
    .training-row,
    .royal-track-card
  )::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .farm-panel,
    .farm-main,
    .farm-primary,
    .care-actions > article,
    .training-row,
    .royal-track-card
  )
  > :not(.panel-art):not(.main-art):not(.primary-art):not(.care-action-art):not(
    .training-art
  ):not(.royal-track-art) {
  position: relative;
  z-index: 2;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .farm-panel,
    .farm-main,
    .farm-primary,
    .care-actions > article,
    .training-row,
    .royal-track-card
  )
  > :is(
    .panel-art,
    .main-art,
    .primary-art,
    .care-action-art,
    .training-art,
    .royal-track-art
  ) {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  object-fit: cover !important;
  border: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  pointer-events: none;
  z-index: 0;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-panel::before {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--card-wash) 97%, transparent),
    color-mix(in srgb, var(--card-wash) 83%, transparent) 52%,
    color-mix(in srgb, var(--card-wash) 78%, transparent)
  );
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-main::before {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--card-wash) 96%, transparent),
    color-mix(in srgb, var(--card-wash) 75%, transparent) 45%,
    color-mix(in srgb, var(--card-wash) 94%, transparent)
  );
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-primary::before {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--card-wash) 97%, transparent),
    color-mix(in srgb, var(--card-wash) 87%, transparent) 55%,
    color-mix(in srgb, var(--card-wash) 78%, transparent)
  );
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-panel .panel-art {
  object-position: center 42% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-main .main-art {
  object-position: center 32% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-primary .primary-art {
  object-position: center 42% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-care .main-art {
  object-position: center 38% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-settings .main-art {
  object-position: center 44% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .care-actions > article {
  overflow: hidden;
  background: #0b0b0b;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .care-actions
  > article::before {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--card-wash) 97%, transparent),
    color-mix(in srgb, var(--card-wash) 86%, transparent) 58%,
    color-mix(in srgb, var(--card-wash) 78%, transparent)
  );
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .care-actions
  > article
  > :not(.care-action-art) {
  position: relative;
  z-index: 2;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .care-actions
  .care-action-art {
  object-position: center 52% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .care-actions .feed-art {
  object-position: right 67% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .care-actions .groom-art {
  object-position: 72% 40% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .training-row {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  overflow: hidden;
}

:is(#sunny-dialog, #match-report) .farm-workspace .training-row::before {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--card-wash) 97%, transparent),
    color-mix(in srgb, var(--card-wash) 86%, transparent) 58%,
    color-mix(in srgb, var(--card-wash) 78%, transparent)
  );
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .training-row
  > :not(.training-art) {
  position: relative;
  z-index: 2;
}

:is(#sunny-dialog, #match-report) .farm-workspace .training-row .training-art {
  object-position: center 40% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .royal-track-card {
  display: flex;
  flex-direction: column;
  min-height: clamp(300px, 40vh, 410px);
  border: 1px solid #173f3535;
}

:is(#sunny-dialog, #match-report) .farm-workspace .royal-track-card::before {
  background: linear-gradient(
    180deg,
    #0000001a,
    #00000033 34%,
    #000000bf 62%,
    #000000f2
  );
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .royal-track-card
  > .royal-track-art {
  object-position: center 45% !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .royal-track-visual {
  position: relative;
  z-index: 2;
  height: clamp(150px, 21vh, 220px);
  min-height: 150px;
  flex-shrink: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.78));
}

:is(#sunny-dialog, #match-report) .farm-workspace .royal-track-label {
  inset: auto 0 0;
  background: none;
}

:is(#sunny-dialog, #match-report) .farm-workspace .royal-track-details {
  position: relative;
  z-index: 2;
  margin-top: auto;
  background: linear-gradient(180deg, #000000d9, #000000f5);
  border-top: 1px solid var(--card-line);
}

/* Light copy and gold controls stay readable over the dark illustrated surfaces. */
:is(#sunny-dialog, #match-report) .farm-workspace :is(.farm-panel, .farm-main) {
  --card-line: #fff8e92e;
  --card-soft: #fff8e914;
  background-color: #0b0b0b;
  color: var(--farm-cream);
  color-scheme: dark;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-main {
  background: #0b0b0b;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .horse-card,
    .ride-card,
    .track-card,
    .quest-card,
    .tournament-card,
    .settings-grid > section,
    .guide-lessons article
  ) {
  background: #000000ba;
  border-color: var(--card-line);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-badge, .farm-empty) {
  border-color: #fff8e940;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-badge {
  background: #00000099;
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .entry-number,
    .coin-reward,
    .quest-number,
    .guide-lessons article > span,
    .horse-card.is-selected h3
  ) {
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-card.is-selected {
  background: #262626b8;
  border-color: #f3c75f88;
}

:is(#sunny-dialog, #match-report) .farm-workspace .quest-card.is-complete {
  background: #262626b8;
}

:is(#sunny-dialog, #match-report) .farm-workspace .care-portrait {
  background: radial-gradient(ellipse, #ffffff12, transparent 70%);
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-meter {
  background: #fff8e926;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .horse-meter::-webkit-progress-bar {
  background: #fff8e926;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .horse-meter::-webkit-progress-value,
:is(#sunny-dialog, #match-report)
  .farm-workspace
  .horse-meter::-moz-progress-bar {
  background: var(--farm-gold);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-main, .farm-panel)
  .sunny-button {
  background: var(--farm-gold);
  color: var(--farm-pine);
  border-color: transparent;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-main, .farm-panel)
  .sunny-button:hover:not(:disabled) {
  background: var(--farm-cream);
  color: var(--farm-pine);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-main, .farm-panel)
  .sunny-button:disabled {
  background: #fff8e91a;
  color: var(--farm-cream);
  border-color: #fff8e933;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.horse-choices, .guide-tabs)
  .sunny-button,
:is(#sunny-dialog, #match-report) .farm-workspace .sunny-button.button-outline {
  background: #00000080;
  color: var(--farm-cream);
  border-color: #fff8e940;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.horse-choices, .guide-tabs)
  [aria-pressed="true"] {
  background: var(--farm-gold);
  color: var(--farm-pine);
  border-color: var(--farm-gold);
  box-shadow: inset 0 -3px #b68d33;
}

:is(#sunny-dialog, #match-report) .farm-workspace .alternative-rides > button {
  background: #000000ba;
  color: var(--farm-cream);
  border-color: #fff8e940;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .alternative-rides
  > button:hover {
  background: var(--farm-gold);
  color: var(--farm-pine);
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-setting input {
  background: #fff8e91a;
  border-color: #fff8e966;
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-setting input:before {
  background: #d0d9c6;
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-setting input:checked {
  background: var(--farm-green);
  border-color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .horse-setting
  input:checked:before {
  background: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-setting select {
  background: #0b0b0b;
  color: var(--farm-cream);
  border-color: #fff8e940;
  color-scheme: dark;
}

:is(#sunny-dialog, #match-report) .farm-workspace .horse-volume input {
  background: #fff8e92e;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-empty > span {
  background: #fff8e91a;
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace .match-event time {
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace .match-event.player time {
  color: var(--farm-pine);
}

/* Keep the bottom and right edges distinct from the bright courtyard behind them. */
#cod-lobby .arena-tile:has(> .home-card-art)::before,
:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-panel, .farm-main, .care-actions > article, .training-row)::before {
  box-shadow:
    inset -12px 0 22px #0006,
    inset 0 -18px 26px #0008;
}

@media (min-width: 901px) and (min-height: 720px) {
  #cod-lobby[data-layout="compact"] .arena-grid {
    max-height: 580px;
  }
  :is(#sunny-dialog, #match-report) .farm-page-body {
    max-height: 688px;
  }
  :is(#sunny-dialog, #match-report)
    .farm-page-body:not(
      :has(> .market-tabs, > .farm-service-tabs, > .farm-pause-links)
    ) {
    max-height: 636px;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    > h2 {
    padding-right: 0;
    min-height: 0;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    .panel-art {
    display: block !important;
  }
  :is(#sunny-dialog, #match-report)
    .farm-workspace[data-wide="true"]
    .farm-right-rail
    > .farm-panel:not(.farm-primary)
    .card-body {
    gap: 6px;
    flex: 1;
  }
}

@media (max-width: 600px) {
  :is(#sunny-dialog, #match-report) .farm-workspace .farm-primary .primary-art {
    display: block !important;
  }
  :is(#sunny-dialog, #match-report) .farm-workspace .royal-track-visual {
    height: 220px;
    min-height: 150px;
  }
  :is(#sunny-dialog, #match-report) .farm-workspace .royal-route-inset {
    width: 62px;
    height: 62px;
  }
}

/* Lobby subpages share the main lobby's courtyard, deep-teal surfaces and gold accents. */
:is(#sunny-dialog, #match-report) .arena-tabs button {
  background: rgba(255, 248, 233, 0.11);
  border: 0;
  box-shadow: none;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(.farm-panel:not(.farm-primary), .farm-main) {
  --card-line: #edcf8055;
  --card-soft: #fff8e914;
  --card-wash: #071710;
  background-color: #091a13;
  color: var(--farm-cream);
  border: 1px solid #edcf8055;
  box-shadow: 0 12px 30px #0008;
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-main {
  background: linear-gradient(145deg, #10271ded, #07130ef5);
  outline: 1px solid #edcf8038;
  outline-offset: 2px;
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  .farm-panel:not(.farm-primary)::before {
  background: linear-gradient(110deg, #071710d9, #0717109c 52%, #071710d9);
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-main::before {
  background: linear-gradient(155deg, #071710d9 10%, #071710a6 48%, #071710e8);
}

:is(#sunny-dialog, #match-report)
  .farm-workspace
  :is(
    .horse-card,
    .ride-card,
    .track-card,
    .quest-card,
    .tournament-card,
    .settings-grid > section,
    .guide-lessons article
  ) {
  background: #07130ee0;
  border-color: #edcf8055;
}

/* Reuse the lobby's center hero styling for the info page feature tile. */
:is(#sunny-dialog) .farm-workspace .farm-main-dock:has(> .farm-info-hero) {
  display: flex;
  min-width: 0;
  min-height: 0;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  background-image:
    linear-gradient(155deg, #0000001f 25%, #00000070 58%, #000000f5),
    url("../assets/ui/stable-courtyard.webp");
  background-position: 30% center;
  background-size: cover;
  color: var(--farm-cream);
  cursor: default;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero:hover {
  transform: none;
  box-shadow: none;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero .hero-tile-copy {
  margin-top: auto;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero .hero-tile-copy small {
  display: block;
  margin-bottom: 5px;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero .hero-tile-copy h2 {
  font-size: clamp(60px, 6vw, 91px);
  line-height: 0.82;
  margin: 12px 0 18px;
  text-align: right;
}

:is(#sunny-dialog) .farm-workspace .farm-info-hero .hero-tile-copy h2 em {
  color: var(--farm-gold);
}

/* Every lobby page shares the home page's hero height, artwork and side surfaces. */
@media (min-width: 901px) and (min-height: 720px) {
  .farm-ui {
    --lobby-height: min(580px, calc(100dvh - 230px));
  }
  #cod-lobby,
  #sunny-dialog .farm-screen,
  #match-report {
    padding: 26px 5vw 22px;
    gap: 18px;
  }
  #lobby-hero-view,
  :is(#sunny-dialog, #match-report) .farm-page-body {
    flex: 0 1 auto;
    max-height: none !important;
    max-width: 1160px;
    width: 100%;
    margin: auto;
    gap: 17px;
    justify-content: center;
  }
  #cod-lobby[data-layout="compact"] .arena-grid,
  :is(#sunny-dialog, #match-report) .farm-workspace {
    height: var(--lobby-height);
    min-height: var(--lobby-height);
    max-height: var(--lobby-height);
    flex: none;
    gap: 9px;
  }
  #cod-lobby[data-layout="compact"] .arena-grid {
    grid-template-rows: 2fr 1fr 1fr;
  }
  :is(#sunny-dialog, #match-report) .farm-menu-footer {
    min-height: 20px;
  }
  .lobby-workspace .farm-left-rail {
    display: flex;
    flex-direction: column;
  }
  .lobby-workspace .farm-left-rail > .farm-panel {
    height: 100%;
    flex: 1;
  }
  .lobby-workspace .farm-right-rail {
    display: flex;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 9px;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace
    .farm-right-rail
    > .farm-panel {
    min-height: 210px;
    max-height: none;
    flex: 0 0 210px;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace
    .farm-right-rail
    > .farm-primary {
    min-height: 240px;
    flex-basis: 240px;
  }
  .lobby-workspace
    .farm-content
    :is(
      .horse-collection,
      .race-collection,
      .settings-grid,
      .care-profile,
      .care-actions,
      .tournament-collection
    ) {
    grid-template-columns: minmax(0, 1fr);
  }
  .lobby-workspace .farm-content .care-portrait .horse-portrait {
    height: 125px;
  }
  .lobby-workspace .farm-content .care-meters {
    gap: 12px;
  }
  .lobby-workspace .farm-content :is(.training-row, .invitational-card) {
    flex-direction: column;
    align-items: stretch;
  }
  .lobby-workspace .farm-content .training-art {
    display: none !important;
  }
  .lobby-workspace .farm-content .course-facts {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .lobby-workspace .farm-content .track-actions {
    flex-direction: column;
  }
  .lobby-workspace .farm-content :is(.quest-card, .tournament-card) {
    grid-template-columns: 1fr;
  }
  .lobby-workspace .farm-content .quest-number {
    display: none;
  }
  .lobby-workspace .farm-content .tournament-card > .sunny-button {
    grid-column: 1;
    grid-row: auto;
  }
  .lobby-workspace .farm-content .horse-card-top {
    flex-wrap: wrap;
  }
  .lobby-workspace .farm-content .farm-main-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

:is(#sunny-dialog, #match-report) .farm-workspace .lobby-feature {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: flex-end;
  padding: 26px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  cursor: default;
  border: 3px solid var(--farm-cream);
  outline: 1px solid #fff8e950;
  outline-offset: 3px;
  border-radius: 9px;
  background: #10271d;
  color: var(--farm-cream);
}

:is(#sunny-dialog, #match-report) .farm-workspace .lobby-feature::before {
  background: linear-gradient(155deg, #0000001f 25%, #00000070 58%, #000000f5);
  box-shadow: none;
}

:is(#sunny-dialog, #match-report) .farm-workspace .lobby-feature .main-art {
  object-position: 30% center !important;
}

:is(#sunny-dialog, #match-report) .farm-workspace .lobby-feature:hover {
  transform: none;
  box-shadow: none;
}

.lobby-feature .hero-tile-copy {
  margin-top: auto;
  width: 100%;
  position: relative;
  z-index: 2;
  text-align: right;
}

:is(#sunny-dialog, #match-report) .lobby-feature .hero-tile-copy h2 {
  font:
    800 clamp(48px, 5.4vw, 82px)/0.87 "Barlow Condensed",
    sans-serif;
  margin: 15px 0;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.lobby-feature .hero-tile-copy h2 em {
  display: block;
  color: var(--farm-gold);
}

.lobby-feature .hero-tile-copy > small {
  font: 700 9px/1.4 "Space Grotesk";
  letter-spacing: 1.4px;
}

.lobby-feature .hero-tile-copy > span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  font: 700 9px/1.4 "Space Grotesk";
  letter-spacing: 1px;
}

.lobby-feature .hero-tile-copy > span > b {
  font-size: 24px;
  color: var(--farm-gold);
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-content {
  border: 1px solid #edcf8055;
  background: #091a13;
  color: var(--farm-cream);
}

:is(#sunny-dialog, #match-report) .farm-workspace .farm-content::before {
  background: linear-gradient(180deg, #07171088, #08120cef 30%, #08120cf5);
}

.farm-content .farm-main-heading {
  gap: 8px;
  align-items: flex-start;
}

.farm-content .farm-main-heading h2 {
  font-size: 25px !important;
  overflow-wrap: break-word;
}

.farm-content .farm-main-body {
  width: 100%;
  padding: 0;
}

.farm-content .settings-wide {
  grid-column: 1/-1;
}

.farm-content .horse-choices {
  flex-wrap: wrap;
}

.farm-content .horse-choices .sunny-button {
  font-size: 13px !important;
  padding-inline: 5px !important;
}

.farm-content .farm-badge {
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 900px), (max-height: 719px) {
  :is(#sunny-dialog, #match-report)
    .lobby-workspace[data-wide="false"]
    .farm-main-dock {
    display: block;
    flex: 0 0 clamp(76px, 17vh, 140px);
    order: 1;
    min-height: 0;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace[data-wide="false"]
    .farm-carousel {
    order: 2;
  }
  :is(#sunny-dialog, #match-report) .lobby-workspace .lobby-feature {
    padding: 12px 16px;
    outline: 0;
    border-width: 2px;
  }
  :is(#sunny-dialog, #match-report) .lobby-feature .hero-tile-copy h2 {
    font-size: clamp(27px, 5vh, 44px);
    margin: 5px 0;
    line-height: 0.9;
  }
  .lobby-feature .hero-tile-copy h2 em {
    display: inline;
  }
  .lobby-feature .hero-tile-copy > small {
    font-size: 6px;
  }
  .lobby-feature .hero-tile-copy > span {
    font-size: 6px;
    gap: 8px;
  }
  .lobby-feature .hero-tile-copy > span > b {
    font-size: 14px;
  }
  :is(#sunny-dialog, #match-report) .bp-header-strip {
    display: flex;
    flex-wrap: nowrap;
    min-height: 32px;
  }
  :is(#sunny-dialog, #match-report) .bp-brand-dock {
    display: flex;
  }
  :is(#sunny-dialog, #match-report) .bp-header-icon-btn {
    padding: 6px;
    letter-spacing: 0;
  }
  :is(#sunny-dialog, #match-report) .bp-header-icon-btn > span {
    display: none;
  }
  :is(#sunny-dialog, #match-report) .bp-quick-dock {
    padding: 4px;
    gap: 2px;
  }
  :is(#sunny-dialog, #match-report) .bp-header-icon-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-height: 500px) and (min-width: 480px) {
  :is(#sunny-dialog, #match-report) .bp-header-strip {
    display: none;
  }
  :is(#sunny-dialog, #match-report) .lobby-workspace[data-wide="false"] {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace[data-wide="false"]
    .farm-right-rail {
    grid-column: 1/-1;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace[data-wide="false"]
    .farm-main-dock {
    grid-column: 1;
    grid-row: 2;
  }
  :is(#sunny-dialog, #match-report)
    .lobby-workspace[data-wide="false"]
    .farm-carousel {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (min-width: 901px) and (min-height: 720px) {
  .lobby-workspace .farm-content .horse-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px;
    padding: 9px;
  }
  .lobby-workspace .farm-content .horse-card .horse-portrait {
    height: 66px;
  }
  .lobby-workspace .farm-content .horse-abilities b {
    font-size: 20px;
  }
  .lobby-workspace .farm-content .horse-abilities > span {
    font-size: 6px;
    letter-spacing: 0;
  }
  .lobby-workspace .farm-content .horse-card-top {
    gap: 5px;
  }
}

@media (max-width: 900px), (max-height: 719px) {
  :is(#sunny-dialog, #match-report) .bp-header-icon-btn {
    min-width: 28px;
    min-height: 28px;
    justify-content: center;
  }
  :is(#sunny-dialog, #match-report) .bp-header-icon-btn svg {
    display: block !important;
    flex-shrink: 0;
  }
}

@media (max-width: 900px), (max-height: 719px) {
  #cod-lobby[data-layout="compact"] .arena-tile small,
  #cod-lobby[data-layout="compact"] .home-card-meta,
  #cod-lobby[data-layout="compact"] .hero-tile-copy > span,
  #cod-lobby[data-layout="compact"] #lobby-record,
  #cod-lobby[data-layout="compact"] .tile-stats #lobby-record,
  #cod-lobby[data-layout="compact"] .home-progress > span {
    font-size: clamp(10px, 1.1vw, 12px);
    line-height: 1.3;
    letter-spacing: 0.2px;
  }
}

@media (max-height: 570px) and (min-width: 480px) {
  #cod-lobby[data-layout="compact"] .home-card-meta,
  #cod-lobby[data-layout="compact"] .home-progress {
    display: none;
  }

  #cod-lobby[data-layout="compact"] .hero-tile-copy strong {
    font-size: clamp(30px, 6vh, 42px);
    margin: 4px 0 6px;
  }
}
