/* Scoped farm-break styles. The real product remains the primary experience. */
#farm-play, #farm-welcome {
  --fp-ink: #082c20;
  --fp-muted: #49634f;
  --fp-green: #0b6136;
  --fp-lime: #c5ed86;
  --fp-cream: #fffced;
  --fp-border: #ccdbc4;
  color: var(--fp-ink);
  min-width: 0;
}
#farm-play *, #farm-welcome * { box-sizing: border-box; }
#farm-play [hidden], #farm-welcome [hidden], #farm-welcome[hidden] { display: none !important; }
.fp-card { overflow: hidden; border: 1px solid var(--fp-border); border-radius: 24px; background: var(--fp-cream); }
.fp-intro { display: grid; gap: 24px; padding: 28px 24px; align-items: center; }
.fp-intro-art { display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; padding: 16px 24px 8px; border: 2px solid var(--fp-ink); border-radius: 16px; background: var(--fp-lime); box-shadow: 5px 5px 0 var(--fp-ink); }
.fp-intro-art .fp-sprite { width: 52px; height: 52px; flex-shrink: 0; }
#farm-play .fp-title { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.18; letter-spacing: -.045em; margin: 8px 0 12px; max-width: 24ch; }
#farm-play .fp-copy, #farm-welcome p { color: var(--fp-muted); font-size: 1rem; line-height: 1.65; margin: 0; }
#farm-play .fp-eyebrow { color: var(--fp-green); font: 700 .75rem/1.6 Axiforma, system-ui, sans-serif; letter-spacing: .09em; margin: 0; }
.fp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
#farm-play .fp-button, #farm-welcome .fp-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: 12px; font: 700 .875rem/1.5 Axiforma, system-ui, sans-serif; color: var(--fp-ink); text-align: center; text-decoration: none; cursor: pointer; touch-action: manipulation; background: transparent; box-shadow: none; transition: background-color 180ms ease, color 180ms ease; overflow-wrap: anywhere; }
#farm-play .fp-button::before, #farm-play .fp-button::after, #farm-welcome .fp-button::before, #farm-welcome .fp-button::after { display: none; }
#farm-play .fp-primary, #farm-welcome .fp-primary { background: var(--fp-ink); color: var(--fp-cream); }
#farm-play .fp-secondary { background: #fff; border-color: var(--fp-border); }
#farm-play .fp-quiet, #farm-welcome .fp-quiet { border-color: var(--fp-border); padding-inline: 12px; background: #fff; }
#farm-play .fp-button:hover, #farm-welcome .fp-button:hover { background: #e8f1db; color: var(--fp-ink); }
#farm-play .fp-primary:hover, #farm-welcome .fp-primary:hover { background: var(--fp-green); color: #fff; }
#farm-play .fp-button:active, #farm-welcome .fp-button:active { background: #d4e6ba; color: var(--fp-ink); }
#farm-play .fp-button:focus-visible, #farm-welcome .fp-button:focus-visible, #farm-play .fp-controls:focus-visible, #farm-play input:focus-visible { outline: 3px solid #9b590a; outline-offset: 3px; }
#farm-play .fp-small { color: var(--fp-muted); font: 400 .8125rem/1.65 Axiforma, system-ui, sans-serif; margin: 0; }
.fp-stage { padding: 24px; }
.fp-game-top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
#farm-play .fp-game-title { margin: 4px 0 0; font-size: 1.6rem; letter-spacing: -.035em; line-height: 1.2; }
.fp-game-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fp-control-icon { display: none; }
.fp-play-area { display: grid; gap: 24px; align-items: start; }
.fp-landscape { position: relative; width: 100%; max-width: 410px; margin-inline: auto; }
.fp-landscape::before { content: ''; display: block; padding-top: 100%; }
.fp-board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); width: 100%; height: 100%; border: 3px solid var(--fp-ink); border-radius: 12px; overflow: hidden; background: #ddedaf; box-shadow: 5px 5px 0 var(--fp-ink); }
.fp-cell { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; background: #ddedaf; border: 1px solid #cedfa3; }
.fp-cell:nth-child(even) { background: #d4e8a3; }
.fp-cell::after { content: ''; position: absolute; bottom: 6px; right: 5px; width: 3px; height: 4px; background: #739941; box-shadow: -3px -2px #739941; opacity: .7; }
.fp-cell .fp-sprite { width: 83%; height: 83%; margin-top: -7%; }
.fp-cell-label { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; color: var(--fp-ink); font: 700 .625rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0; }
.fp-cell.fp-target { background: #fff9df; box-shadow: inset 0 0 0 3px #8e550b; }
.fp-cell.fp-target::before { content: '↓'; position: absolute; top: -2px; right: 3px; color: #673a05; z-index: 1; font-weight: 900; font-size: 18px; line-height: 1; }
.fp-cell.fp-collected .fp-sprite { opacity: .3; }
.fp-cell.fp-collected .fp-cell-label { text-decoration: line-through; }
.fp-player { position: absolute; left: 0; top: 0; width: 20%; height: 20%; z-index: 2; pointer-events: none; transition: transform 160ms steps(3, end); }
.fp-player .fp-sprite { display: block; width: 100%; height: 100%; filter: drop-shadow(1px 2px 0 #fffced); }
.fp-sprite { display: block; image-rendering: pixelated; stroke: none; stroke-width: 0; }
.fp-pause-cover { position: absolute; inset: 0; z-index: 3; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; border-radius: 12px; background: rgba(255,252,237,.96); }
.fp-pause-cover strong { font-size: 1.5rem; }
#farm-play .fp-pause-cover p { color: var(--fp-muted); }
.fp-controls { border-radius: 14px; min-width: 0; }
.fp-help { margin-top: 8px; border-top: 1px solid var(--fp-border); }
.fp-help summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--fp-ink); font-size: .875rem; font-weight: 700; }
.fp-help summary:focus-visible { outline: 3px solid #9b590a; outline-offset: 3px; }
#farm-play .fp-objective { font-size: 1.35rem; letter-spacing: -.03em; margin: 4px 0 8px; line-height: 1.35; }
.fp-progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 6px; overflow: hidden; margin: 16px 0; accent-color: var(--fp-green); }
.fp-progress::-webkit-progress-bar { background: #d9e3ce; }
.fp-progress::-webkit-progress-value { background: var(--fp-green); }
.fp-progress::-moz-progress-bar { background: var(--fp-green); }
#farm-play .fp-route-hint { font-size: .9375rem; color: var(--fp-ink); font-weight: 700; margin: 0; }
.fp-dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 52px); gap: 8px; justify-content: center; margin: 20px auto 16px; }
#farm-play .fp-direction { padding: 0; min-height: 52px; width: 56px; border: 2px solid var(--fp-ink); background: #fff; font: 700 1.7rem/1 system-ui, sans-serif; border-radius: 10px; }
.fp-direction-up { grid-column: 2; grid-row: 1; }
.fp-direction-left { grid-column: 1; grid-row: 2; }
.fp-direction-down { grid-column: 2; grid-row: 2; }
.fp-direction-right { grid-column: 3; grid-row: 2; }
#farm-play .fp-direction:disabled { opacity: .4; cursor: default; }
#farm-play .fp-status { margin: 12px 0 0; min-height: 3.2em; color: var(--fp-green); font-size: .875rem; line-height: 1.6; }
#farm-play .fp-status.fp-sr-only { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.fp-result { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--fp-border); border-radius: 16px; background: #edf6de; }
#farm-play .fp-result-title { font-size: 1.6rem; letter-spacing: -.035em; line-height: 1.25; margin: 0; }
.fp-result .fp-actions { margin-top: 4px; }
.fp-memory { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 20px 24px; background: #f1f5e8; border-top: 1px solid var(--fp-border); }
.fp-memory-label { min-height: 48px; display: inline-flex; align-items: center; gap: 12px; color: var(--fp-ink); font-size: .875rem; font-weight: 700; cursor: pointer; }
.fp-memory-label input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--fp-green); }
.fp-memory > .fp-small { flex-basis: 100%; max-width: 78ch; }
.fp-memory-status:empty { display: none; }
.fp-welcome { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; padding: 20px 24px; border: 1px solid var(--fp-border); border-radius: 16px; background: #f1f5e8; margin-block: 16px; }
.fp-welcome-copy { flex: 1 1 320px; }
.fp-welcome strong { font-size: 1rem; }
#farm-welcome .fp-welcome p { font-size: .875rem; margin-top: 4px; }
.fp-welcome .fp-actions { margin: 0; }
@media (min-width: 720px) {
  .fp-intro { grid-template-columns: auto 1fr; padding: 36px; gap: 36px; }
  .fp-intro-art { flex-direction: column; padding: 20px 28px 12px; }
  .fp-intro-art .fp-sprite { width: 64px; height: 64px; }
  .fp-stage { padding: 32px; }
  .fp-play-area { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .fp-memory { padding-inline: 36px; }
}
@media (max-width: 719px) {
  .fp-game-top { margin-bottom: 16px; flex-wrap: nowrap; gap: 12px; }
  .fp-game-top > div:first-child { min-width: 0; }
  .fp-game-actions { flex-wrap: nowrap; flex-shrink: 0; }
  .fp-game-actions .fp-button { width: 48px; padding: 0; }
  .fp-control-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .fp-control-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
  #farm-play .fp-game-title { font-size: 1.25rem; }
  #farm-play .fp-game-top .fp-eyebrow { font-size: .625rem; letter-spacing: .04em; }
  .fp-play-area { gap: 20px; }
  .fp-landscape { max-width: 300px; }
  .fp-controls > .fp-copy { display: none; }
  .fp-dpad { grid-template-columns: repeat(4, 52px); grid-template-rows: 52px; margin-block: 12px; }
  #farm-play .fp-direction { width: 52px; }
  .fp-direction-left { grid-column: 1; grid-row: 1; }
  .fp-direction-up { grid-column: 2; grid-row: 1; }
  .fp-direction-down { grid-column: 3; grid-row: 1; }
  .fp-direction-right { grid-column: 4; grid-row: 1; }
  .fp-progress { margin-block: 8px; height: 6px; }
  #farm-play .fp-status { min-height: 0; margin-top: 8px; }
}
@media (max-width: 719px) and (max-height: 700px) {
  .fp-stage { padding: 16px; }
  .fp-game-top { margin-bottom: 12px; }
  .fp-play-area { gap: 12px; }
  .fp-landscape { max-width: clamp(168px, calc(100vh - 380px), 260px); max-width: clamp(168px, calc(100svh - 380px), 260px); }
  .fp-controls > .fp-eyebrow, .fp-progress { display: none; }
  #farm-play .fp-objective { font-size: 1rem; margin: 0 0 4px; }
  .fp-objective::before { content: attr(data-step) ' · '; }
  #farm-play .fp-route-hint { font-size: .8125rem; line-height: 1.5; }
  .fp-dpad { margin-block: 8px; }
}
@media (max-width: 359px) {
  .fp-intro, .fp-stage { padding: 20px 16px; }
  .fp-memory, .fp-welcome { padding: 16px; }
  .fp-intro-art { padding-inline: 16px; gap: 8px; }
  .fp-intro-art .fp-sprite { width: 44px; height: 44px; }
  .fp-result { padding: 16px; }
  .fp-result .fp-actions { display: grid; }
  .fp-game-actions .fp-button { padding-inline: 10px; }
  .fp-dpad { grid-template-columns: repeat(4, 48px); }
  #farm-play .fp-direction { width: 48px; }
}
@media (max-width: 719px) and (max-height: 700px) {
  .fp-stage { padding: 16px; }
}
@media (min-width: 520px) and (max-height: 500px) {
  .fp-stage { padding: 16px; }
  .fp-game-top { margin-bottom: 8px; }
  #farm-play .fp-game-title { font-size: 1.25rem; }
  .fp-game-top .fp-eyebrow, .fp-controls > .fp-eyebrow, .fp-controls > .fp-copy, .fp-progress { display: none; }
  .fp-play-area { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .fp-landscape { max-width: clamp(140px, calc(100vh - 200px), 230px); max-width: clamp(140px, calc(100svh - 200px), 230px); }
  #farm-play .fp-objective { font-size: 1rem; margin: 0 0 4px; }
  .fp-objective::before { content: attr(data-step) ' · '; }
  #farm-play .fp-route-hint { font-size: .8125rem; line-height: 1.5; }
  .fp-dpad { grid-template-columns: repeat(4, 48px); grid-template-rows: 52px; margin-block: 8px; }
  #farm-play .fp-direction { width: 48px; }
  .fp-direction-left { grid-column: 1; grid-row: 1; }
  .fp-direction-up { grid-column: 2; grid-row: 1; }
  .fp-direction-down { grid-column: 3; grid-row: 1; }
  .fp-direction-right { grid-column: 4; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #farm-play *, #farm-welcome * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
