/* Turf Wars 2: game styles. The vendored kit (assets/ui.css) loads first.
   Screens are flex children of .game-scroll in the kit fit shell; one is
   visible at a time and each pads by the --rr-inset-* tokens. */
.screen {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 16px calc(16px + var(--rr-inset-right)) calc(16px + var(--rr-inset-bottom)) calc(16px + var(--rr-inset-left));
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.screen.visible { display: flex; }
.logo { margin: 0; font-size: 2.2rem; line-height: 1.1; }
.tagline { margin: 0; opacity: 0.8; }
.menu-col { display: flex; flex-direction: column; gap: 12px; width: min(100%, 320px); }
.menu-btn { min-height: 48px; min-width: 44px; }
.menu-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* The Result screen (T647): winner, how, both farms' land and water, Play again, View board (T700: the Review screen, see play.css), Replay
   match and Title. A menu screen with the kit header. */
.result-title { margin: 0; font-size: 2rem; line-height: 1.1; }
.result-how, .result-note { margin: 0; max-width: 32ch; }
.result-how { opacity: 0.9; }
.result-note { opacity: 0.75; font-size: 0.9rem; min-height: 0; }
.result-note:empty { display: none; }
.result-farms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 320px); }
.result-farm {
  display: flex; flex-direction: column; gap: 4px; padding: 10px; text-align: left; border-radius: 10px;
  background: var(--rr-panel); border: 1px solid var(--rr-panel-line); border-left: 6px solid;
}
.result-farm.winner { outline: 2px solid var(--rr-accent); outline-offset: -2px; }
.result-farm span { display: flex; justify-content: space-between; gap: 8px; }
.result-farm i { font-style: normal; font-weight: 700; }
.result-farm .total { font-size: 1.25rem; }
/* T710: five Result buttons: Play again on its own row, the other four in two columns, so the Result fits a short phone. */
.result-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-buttons #btn-again { grid-column: 1 / -1; }
.result-buttons .btn { min-width: 0; }
/* Taps skip the rival's playback: buttons stop catching them so the tap reaches the Play screen. */
.play.playback button:not(.hud-menu):not(.hud-results):not(.rv-btn) { pointer-events: none; }

/* Title (T638): a code-drawn crop row, the Play and Settings buttons. Hidden on short screens so the Title fits. */
.title-crops { width: 240px; height: 48px; max-width: 100%; pointer-events: none; }
@media (max-height: 560px) { .title-crops { display: none; } }

/* The Result's deciding round (T638). */
.result-round { margin: 0; font-weight: 700; }
.result-round:empty { display: none; }

/* Settings (T638): four switches (Sound, Music, Rival, Field), Replay guide, a note and Back. */
.settings-title { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.settings-col { gap: 10px; }
.menu-btn.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.menu-btn.switch .sw-state { white-space: nowrap; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--rr-accent); color: #1a1208; min-width: 3.2em; text-align: center; }
.menu-btn.switch.off .sw-state { background: transparent; border: 1px solid var(--rr-panel-line); color: inherit; opacity: 0.8; }
.settings-note { margin: 0; min-height: 0; font-size: 0.9rem; opacity: 0.85; }
.settings-note:empty { display: none; }
.settings-title:focus { outline: none; }

/* New match setup (T709): four rows like the Settings switches (Mode, Field, then Rival and Your deck, or in hot seat Player 1 deck and Player 2 deck), a note, Start and Back. */
.setup-col { gap: 10px; }
.setup-col [hidden] { display: none !important; }      /* T717: the Rival row hides in hot seat, the Player 2 deck row shows only there */

/* Deck (T679): the builder and the draft. The crop grid (or the three draft offers) and the deck row with its buttons.
   Portrait: stacked, the crop grid scrolls inside its own box as a last resort. */
.screen.deck { position: relative; justify-content: flex-start; align-items: stretch; gap: 0; padding-top: 8px; padding-bottom: calc(10px + var(--rr-inset-bottom)); overflow: hidden; }
.deck [hidden] { display: none !important; }
.deck-main { flex: 1 1 auto; min-height: 0; width: min(100%, 440px); margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.deck-pick { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.deck-side { flex: none; display: flex; flex-direction: column; gap: 6px; }
.deck-head { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; text-align: left; min-height: 20px; }
.deck-head span:focus { outline: none; }
.deck-count.ok { color: var(--rr-ok); }
.deck-note { font-weight: 400; font-size: 12px; color: var(--rr-warn); text-align: right; }
.deck-crops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; min-height: 0; overflow-y: auto; }
.deck-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.deck-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dk-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; box-sizing: border-box;
  min-width: 44px; min-height: 72px; padding: 4px 2px; border-radius: 10px; font: inherit; color: var(--rr-ink); text-align: center;
  background: var(--rr-panel); border: 1px solid var(--rr-panel-line); cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-touch-callout: none;
}
.dk-tile.in { border-color: var(--rr-accent); background: var(--rr-accent-soft); }
.dk-tile[disabled] { opacity: 1; cursor: default; }
.dk-tile.empty { border-style: dashed; background: transparent; cursor: default; }
.dk-tile.mini { min-height: 56px; }
.dk-tile.mini .dk-cost { display: none; }
.dk-tile.big { min-height: 150px; gap: 4px; padding: 8px 4px; border-width: 2px; border-color: var(--rr-accent); }
.dk-art { width: 36px; height: 36px; pointer-events: none; }
.dk-tile.big .dk-art { width: 72px; height: 72px; }
.dk-tile.mini .dk-art { width: 30px; height: 30px; }
.dk-name { font-size: 11px; font-weight: 700; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-cost, .dk-sale { font-size: 10px; line-height: 1.1; color: var(--rr-muted); }
.dk-tile.big .dk-name { font-size: 14px; }
.dk-tile.big .dk-cost, .dk-tile.big .dk-sale { font-size: 12px; }
.dk-n { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 700; color: var(--rr-accent); pointer-events: none; }
.deck-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.deck-btn { min-height: 48px; min-width: 44px; padding-left: 2px; padding-right: 2px; font-size: 13px; }
.deck-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.deck-draft-actions { grid-template-columns: 1fr; }

/* Hand-off (T715): a cover for the hot seat pass: "Pass to Player N", a swatch in that farm's colour, the round and Ready. */
.handoff-title { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.handoff-title:focus { outline: none; }
.handoff-swatch { width: 96px; height: 96px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); flex: 0 0 auto; }
.handoff-round { margin: 0; font-weight: 700; opacity: 0.9; }
.handoff-ready { min-height: 56px; min-width: 160px; font-size: 1.2rem; }
