/* Gate to Gate — isolated finished-game presentation. */
.meadow-rally-page { background: #f5efe3; }
.meadow-rally-main { padding-block: clamp(1.5rem, 4vw, 3.5rem); }
.meadow-rally-main .breadcrumb { margin-bottom: 1rem; color: var(--muted); }
.meadow-rally-main .breadcrumb a { color: var(--green-800); }
.meadow-rally-intro { max-width: 900px; margin-bottom: 1.35rem; }
.meadow-rally-intro h1 { font-size: clamp(2.65rem, 7vw, 5.4rem); }
.meadow-rally-intro .lead { max-width: 760px; margin-bottom: 0; }
.meadow-rally-eyebrow { display: flex; align-items: center; gap: .6rem; }
.meadow-rally-eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #d47649; box-shadow: 0 0 0 5px rgba(212,118,73,.14); }

.meadow-rally-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(270px, 360px); gap: clamp(1rem, 3vw, 2rem); align-items: start; justify-content: center; }
.meadow-rally-game { min-width: 0; }
.meadow-rally-scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: .65rem; align-items: stretch; margin-bottom: .7rem; padding: .65rem; border-radius: 14px; background: var(--green-950); color: #fff; box-shadow: var(--shadow-soft); }
.meadow-rally-score { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem; padding: .65rem .8rem; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(255,255,255,.055); }
.meadow-rally-score--farm { direction: rtl; }
.meadow-rally-score--farm > * { direction: ltr; }
.meadow-rally-score-label { color: var(--gold-light); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.meadow-rally-score strong { color: #fff; font: 400 clamp(1.7rem, 5vw, 2.5rem)/1 var(--serif); }
.meadow-rally-meta { min-width: 112px; display: grid; align-content: center; justify-items: center; gap: .12rem; text-align: center; }
.meadow-rally-meta span { display: block; color: rgba(255,255,255,.62); font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.meadow-rally-meta strong { color: #fff; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }

.meadow-rally-board-frame { position: relative; width: min(100%, 620px); margin-inline: auto; padding: clamp(.45rem, 1.5vw, .75rem); border-radius: 18px; background: #0c281f; box-shadow: 0 18px 45px rgba(12,40,31,.22); }
.meadow-rally-canvas { display: block; width: 100%; aspect-ratio: 4 / 5; border: 2px solid rgba(216,196,155,.58); border-radius: 11px; background: #143c2f; touch-action: pan-y; user-select: none; outline: none; }
.meadow-rally-canvas:focus-visible { outline: 4px solid #efc56e; outline-offset: 4px; }
.meadow-rally-canvas-hint { position: absolute; left: 50%; bottom: 1.35rem; z-index: 2; width: max-content; max-width: calc(100% - 2.5rem); transform: translateX(-50%); margin: 0; padding: .38rem .62rem; border-radius: 999px; background: rgba(7,27,21,.8); color: rgba(255,255,255,.78); font-size: .68rem; text-align: center; pointer-events: none; }

.meadow-rally-drag-wrap { width: min(100%, 620px); margin: .75rem auto 0; }
.meadow-rally-drag-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; color: var(--green-950); font-size: .7rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.meadow-rally-drag-label span:last-child { color: var(--muted); font-weight: 650; letter-spacing: 0; text-transform: none; }
.meadow-rally-drag { --rally-control-x: 50%; position: relative; height: 62px; border: 1px solid #9f927b; border-radius: 14px; background: linear-gradient(180deg, #fffdf8, #eadfc9); box-shadow: inset 0 2px 8px rgba(21,51,39,.09); touch-action: pan-y; user-select: none; cursor: ew-resize; outline: none; }
.meadow-rally-drag::before { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; height: 7px; transform: translateY(-50%); border-radius: 999px; background: #b9aa8e; box-shadow: inset 0 1px 3px rgba(0,0,0,.16); }
.meadow-rally-drag::after { content: ""; position: absolute; left: clamp(28px, var(--rally-control-x), calc(100% - 28px)); top: 50%; width: 54px; height: 38px; transform: translate(-50%, -50%); border: 3px solid #7f592f; border-radius: 8px; background: repeating-linear-gradient(90deg, #d2aa69 0 8px, #8b6339 8px 11px); box-shadow: 0 4px 10px rgba(27,52,39,.2); }
.meadow-rally-drag:focus-visible { outline: 4px solid #d5a950; outline-offset: 3px; }
.meadow-rally-drag.is-active { background: #fff9e9; }

.meadow-rally-actions { width: min(100%, 620px); display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: .55rem; margin: .75rem auto 0; }
.meadow-rally-actions button { min-height: 50px; }
.meadow-rally-actions button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.meadow-rally-secondary-actions { width: min(100%, 620px); display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin: .55rem auto 0; }
.meadow-rally-sound { min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--line); background: transparent; color: var(--green-900); font-weight: 800; }
.meadow-rally-status { min-height: 2.8rem; flex: 1; margin: 0; padding: .65rem .8rem; border-left: 4px solid var(--gold); background: #f4ead7; color: var(--green-950); font-weight: 700; }

.meadow-rally-sidebar { display: grid; gap: 1rem; }
.meadow-rally-panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-soft); }
.meadow-rally-panel h2 { font-size: 1.45rem; }
.meadow-rally-panel > :last-child { margin-bottom: 0; }
.meadow-rally-difficulty { margin: 0; padding: 0; border: 0; }
.meadow-rally-difficulty legend { margin-bottom: .7rem; color: var(--green-900); font: 400 1.45rem var(--serif); }
.meadow-rally-difficulty-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.meadow-rally-difficulty-option { position: relative; min-width: 0; }
.meadow-rally-difficulty-option input { position: absolute; opacity: 0; pointer-events: none; }
.meadow-rally-difficulty-option label { min-height: 48px; display: grid; place-items: center; padding: .55rem .4rem; border: 1px solid #a99e8b; border-radius: 8px; background: #fff; cursor: pointer; }
.meadow-rally-difficulty-option input:checked + label { border-color: var(--green-900); background: var(--green-900); color: #fff; }
.meadow-rally-difficulty-option input:focus-visible + label { outline: 3px solid #d5a950; outline-offset: 2px; }
.meadow-rally-difficulty-option input:disabled + label { opacity: .55; cursor: not-allowed; }
.meadow-rally-keyboard { display: grid; grid-template-columns: auto 1fr; gap: .55rem .7rem; margin: 0; }
.meadow-rally-keyboard dt, .meadow-rally-keyboard dd { margin: 0; }
.meadow-rally-keyboard kbd { min-width: 43px; display: inline-grid; place-items: center; padding: .35rem .45rem; border: 1px solid #aa9d88; border-bottom-width: 3px; border-radius: 6px; background: #fff; font: 800 .75rem var(--sans); }
.meadow-rally-tip { padding-left: 1.1rem; }
.meadow-rally-tip li + li { margin-top: .42rem; }
.meadow-rally-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--green-800); font-weight: 800; text-underline-offset: .22rem; }

@media (max-width: 900px) {
  .meadow-rally-layout { grid-template-columns: minmax(0, 650px); }
  .meadow-rally-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meadow-rally-sidebar .meadow-rally-panel:first-child { grid-column: 1 / -1; }
}
.meadow-rally-board-frame{background-image:linear-gradient(rgba(6,32,23,.55),rgba(6,32,23,.82)),url("/assets/images/wellness/heartworks-field-dusk.webp");background-size:cover;background-position:center}.meadow-rally-canvas{opacity:.91;background:rgba(20,60,47,.8)}
.meadow-rally-ball-status{display:block;margin-top:.25rem;padding:.18rem .4rem;border-radius:999px;background:#d5ad54;color:#17382a;font-size:.62rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase}

@media (max-width: 600px) {
  .meadow-rally-main { padding-top: 1.1rem; }
  .meadow-rally-intro { margin-bottom: 1rem; }
  .meadow-rally-intro h1 { margin-bottom: .5rem; }
  .meadow-rally-scoreboard { gap: .35rem; padding: .4rem; border-radius: 11px; }
  .meadow-rally-score { grid-template-columns: 1fr; gap: .08rem; padding: .45rem .55rem; }
  .meadow-rally-score--farm { direction: ltr; text-align: right; }
  .meadow-rally-meta { min-width: 86px; }
  .meadow-rally-meta span { font-size: .52rem; }
  .meadow-rally-canvas { aspect-ratio: 1 / 1.08; }
  .meadow-rally-canvas-hint { display: none; }
  .meadow-rally-drag { height: 54px; }
  .meadow-rally-actions { grid-template-columns: 1fr 1fr; }
  .meadow-rally-actions [data-rally-start] { grid-column: 1 / -1; }
  .meadow-rally-secondary-actions { align-items: stretch; flex-direction: column; }
  .meadow-rally-status, .meadow-rally-sound { width: 100%; }
  .meadow-rally-sidebar { grid-template-columns: 1fr; }
  .meadow-rally-sidebar .meadow-rally-panel:first-child { grid-column: auto; }
}

@media (max-width: 430px) {
  .meadow-rally-main{padding-top:.45rem}.meadow-rally-main .breadcrumb{margin-bottom:.35rem}.meadow-rally-intro{margin-bottom:.45rem}.meadow-rally-intro .lead,.meadow-rally-eyebrow{display:none}.meadow-rally-intro h1{font-size:2rem;margin:.1rem 0}.meadow-rally-scoreboard{margin-bottom:.35rem}.meadow-rally-board-frame{padding:5px}.meadow-rally-drag-wrap{margin-top:.35rem}.meadow-rally-drag-label{margin-bottom:.2rem}.meadow-rally-actions{margin-top:.4rem}.meadow-rally-actions button{min-height:50px}
}

@media (max-width: 390px) {
  .meadow-rally-score-label { font-size: .59rem; }
  .meadow-rally-meta { min-width: 76px; }
  .meadow-rally-actions button { padding-inline: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .meadow-rally-drag, .meadow-rally-drag::after { transition: none; }
}
