/* lands/css/corn-lands.css - THE CORN LANDS' page: the curtain, the door, the corner, the farm (the board, the orders,
 * the bar), the barn, the islands room and the checkout. The Herd's colours are gold, pink and mint; the Horde's violet
 * and toxic green (html[data-side], set by lands/js/corn-lands-main.js). TAKE THE ISLAND BACK (2026-10-20): every square
 * of the board shows its own piece of the island's painting (--paint-you on the player's ground, --paint-foe on the
 * other side's, cut by --gc and --gr), with the border drawn in the gap between the two sides' squares.
 *
 * The series' lessons, kept here from the first draw (docs/READABILITY.md, ARCHITECTURE.md conventions 35 to 37):
 * words never under 16 CSS px; every button 44 px or more (48 on a touch screen), the board's squares included (the
 * board scrolls before a square goes under 44); nothing lies on a button (the World door keeps the bottom right of the
 * door to itself, the round Back the bottom right of the farm); every edge steps in past an iPhone's camera and rounded
 * corners (env(safe-area-inset-*), and --sotc-edge-l/-r from js/friends.js THE ISLAND'S SIDE). */
:root {
  --ink: #120A1E;
  --glass: rgba(22, 12, 36, 0.78);
  --glass-2: rgba(38, 22, 60, 0.86);
  --line: rgba(255, 255, 255, 0.18);
  --text: #FBF3E7;
  --muted: #DCCFF0;
  --gold: #F5C242;
  --a: #FF6FB5;
  --b: #7FE0D6;
  --good: #8EF07A;
  --font: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --title-font: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --edge-l: var(--sotc-edge-l, env(safe-area-inset-left, 0px));
  --edge-r: var(--sotc-edge-r, env(safe-area-inset-right, 0px));
  --tap: 48px;
  --edge: #FFD86B;
  --foe-ring: rgba(167, 139, 250, 0.75);
}
html[data-side="horde"] { --a: #A78BFA; --b: #6BE04A; --ink: #0C0A14; --edge: #C9F27A; --foe-ring: rgba(255, 179, 217, 0.8); }
@media (pointer: fine) { :root { --tap: 44px; } }

html, body { margin: 0; padding: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--font); overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- the loading curtain ---------------------------------------------------------------------------------------------- */
.curtain { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 40%, #3A2160 0%, var(--ink) 72%); transition: opacity 0.5s ease; }
.curtain.is-gone { opacity: 0; }
.curtain-art { width: 132px; height: 132px; object-fit: contain; animation: curtain-bob 1.4s ease-in-out infinite alternate; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45)); }
@keyframes curtain-bob { from { transform: translateY(8px) rotate(-3deg); } to { transform: translateY(-12px) rotate(3deg); } }
.curtain-title { margin: 0; font-family: var(--title-font); font-weight: bold; letter-spacing: 0.2em; font-size: 24px; color: var(--gold); text-align: center; }
.curtain-bar { width: min(280px, 70vw); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.curtain-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--gold), var(--b)); transition: width 0.4s ease; }
.curtain-line { margin: 0; color: var(--muted); font-size: 18px; }

/* ---- buttons and chips ------------------------------------------------------------------------------------------------- */
.btn { appearance: none; min-height: var(--tap); border: 1px solid var(--line); background: var(--glass-2); color: var(--text); border-radius: 14px;
  padding: 10px 18px; font-size: 18px; font-weight: bold; cursor: pointer; transition: transform 0.12s ease, filter 0.12s ease, background 0.2s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .chip:focus-visible, .cell:focus-visible, .order:focus-visible, .g-btn:focus-visible, .g-back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-ghost { background: var(--glass); }
.btn-play { position: relative; border: 0; min-height: 64px; padding: 14px 40px; font-size: 26px; letter-spacing: 0.14em; text-transform: uppercase; color: #1A0F24;
  background: linear-gradient(135deg, var(--gold), #FFE9A8 45%, var(--a)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) inset, 0 10px 34px rgba(245, 194, 66, 0.45); }
html[data-side="horde"] .btn-play { background: linear-gradient(135deg, #C9F27A, #F5E9A8 40%, var(--a)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) inset, 0 10px 34px rgba(107, 224, 74, 0.4); }
.btn-play::after { content: ''; position: absolute; inset: -5px; border-radius: 18px; border: 2px solid var(--gold); opacity: 0.6; animation: halo 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.05); opacity: 0.15; } }
.chip { appearance: none; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--glass);
  color: var(--text); border-radius: 999px; padding: 6px 16px; font-size: 16px; font-weight: bold; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-sizing: border-box; flex: none; }
.chip-acct { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-friends { gap: 6px; border-color: rgba(245, 194, 66, 0.55); color: #FFE9A8; }
.chip-friends::before { content: ''; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M1 20c0-4 3.6-7 8-7s8 3 8 7z'/%3E%3Ccircle cx='17' cy='9' r='3'/%3E%3Cpath d='M15.5 13.2c4 .2 7.5 2.6 7.5 6.8h-4.6c0-2.6-1-4.9-2.9-6.8z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M1 20c0-4 3.6-7 8-7s8 3 8 7z'/%3E%3Ccircle cx='17' cy='9' r='3'/%3E%3Cpath d='M15.5 13.2c4 .2 7.5 2.6 7.5 6.8h-4.6c0-2.6-1-4.9-2.9-6.8z'/%3E%3C/svg%3E") center / contain no-repeat; }
.chip-friends[aria-expanded="true"] { border-color: var(--gold); background: rgba(245, 194, 66, 0.22); }
.chip-side { padding: 4px 16px 4px 10px; cursor: default; }
.chip-side.side-badge--herd { border-color: rgba(255, 143, 199, 0.5); }
.chip-side.side-badge--horde { border-color: rgba(107, 224, 74, 0.5); }
.chip-side[role="button"] { cursor: pointer; }
/* the shared badge's two lines are 9px and 14px: the series' least is 16px (a guest's practice badge shows them) */
.chip-side .side-badge__kick { font-size: 16px; letter-spacing: 0.02em; text-transform: none; opacity: 1; }
.chip-side .side-badge__name { font-size: 16px; letter-spacing: 0.1em; }

/* ---- the door ---------------------------------------------------------------------------------------------------------- */
/* The island the side is on fills the window behind the column, its two paintings crossfading with the stars won.
   Upright: one column in the middle, the corner above it and the World door below it. Wide: the column on the left. */
.door { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; overflow-x: hidden;
  box-sizing: border-box; padding: calc(72px + var(--safe-t)) calc(16px + var(--edge-r)) calc(122px + var(--safe-b)) calc(16px + var(--edge-l)); }
.door-paint { position: fixed; inset: 0; z-index: -1; background: #1B1430; }
.door-paint img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transition: opacity 0.9s ease; }
.door-paint::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, rgba(12, 6, 22, 0.7) 0%, rgba(12, 6, 22, 0.5) 55%, rgba(12, 6, 22, 0.25) 100%); }
.door-col { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: auto 0; }
.door-kicker { margin: 0; color: var(--muted); letter-spacing: 0.3em; text-transform: uppercase; font-size: 16px; font-weight: bold; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.door-title { margin: 0; font-family: var(--title-font); font-weight: bold; line-height: 0.95; font-size: clamp(44px, 12vw, 88px); letter-spacing: 0.04em; }
.door-title span { display: block; background: linear-gradient(180deg, #FFF6D0 0%, var(--gold) 50%, var(--a) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 0 22px rgba(245, 194, 66, 0.35)); }
.door-title span:first-child { font-size: 0.62em; letter-spacing: 0.12em; background: linear-gradient(180deg, #FFFFFF 0%, var(--b) 55%, var(--a) 100%); -webkit-background-clip: text; background-clip: text; }
.door-sub { margin: 0 0 4px; font-size: 19px; line-height: 1.35; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85); }
.door-isle { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); text-align: left; }
.door-isle__label { margin: 0; font-size: 16px; color: var(--muted); }
.door-isle__name { margin: 0; font-size: 22px; font-weight: bold; color: var(--gold); font-family: var(--title-font); }
.door-isle__line { margin: 0 0 4px; font-size: 16px; line-height: 1.35; color: var(--text); }
.door-next { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); overflow: hidden; border: 1px solid var(--line); }
.door-next span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #FFE9A8); transition: width 0.6s ease; }
html[data-side="horde"] .door-next span { background: linear-gradient(90deg, #6BE04A, #C9F27A); }
.door-next-text { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.35; }
.door-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.door-copy { position: fixed; left: calc(14px + var(--edge-l)); bottom: calc(8px + var(--safe-b)); margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 13px; z-index: 21; pointer-events: none; }
@media (min-aspect-ratio: 5/4) {
  .door { justify-content: flex-start; padding: calc(70px + var(--safe-t)) calc(24px + var(--edge-r)) calc(24px + var(--safe-b)) calc(max(24px, 6vw) + var(--edge-l)); }
  .door-paint::after { background: linear-gradient(90deg, rgba(12, 6, 22, 0.78) 0%, rgba(12, 6, 22, 0.5) 38%, rgba(12, 6, 22, 0.05) 70%); }
  .door-paint img { object-position: 70% 40%; }
  .door-col { align-items: flex-start; text-align: left; width: min(460px, 46vw); }
  .door-row { justify-content: flex-start; }
  .door-copy { left: auto; right: calc(124px + var(--edge-r)); }
}
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  .door { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .door-col { gap: 8px; width: min(420px, 52vw); }
  .door-kicker, .door-sub, .door-isle__line { display: none; }
  .door-title { font-size: clamp(34px, 9vh, 52px); }
  .door-title span { display: inline; }
  .door-title span:first-child { font-size: 1em; letter-spacing: 0.04em; }
  .door-title span + span::before { content: ' '; }
  .door-isle { padding: 8px 12px; }
  .btn-play { min-height: 56px; font-size: 22px; padding: 10px 34px; }
}

/* ---- the corner: top right, in past the island when it is on the right ---------------------------------------------------- */
.corner { position: fixed; top: calc(12px + var(--safe-t)); right: calc(12px + var(--edge-r)); z-index: 45; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  max-width: calc(100vw - 24px - var(--edge-l) - var(--edge-r)); }
@media (max-width: 420px) { .corner { left: calc(12px + var(--edge-l)); justify-content: center; } .corner .chip { padding: 6px 11px; } .chip-acct { max-width: 120px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) { .corner { flex-direction: column; align-items: flex-end; flex-wrap: nowrap; } }

/* ---- THE FARM ---------------------------------------------------------------------------------------------------------------- */
.game { position: fixed; inset: 0; z-index: 20; display: grid; gap: 6px; box-sizing: border-box; isolation: isolate;
  padding: calc(8px + var(--safe-t)) calc(8px + var(--edge-r)) calc(8px + var(--safe-b)) calc(8px + var(--edge-l)); --cell: 44px; --cols: 7; --rows: 9; }
.g-paint { position: absolute; inset: 0; z-index: -1; background: #1B1430; }
.g-paint img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.9s ease; }
.g-paint::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 6, 22, 0.62), rgba(12, 6, 22, 0.42) 40%, rgba(12, 6, 22, 0.62)); }
/* upright: the panel's parts stack round the board */
.game[data-layout="tall"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "orders" "info" "board" "bar"; }
.game[data-layout="tall"] .g-panel { display: contents; }
.g-top { grid-area: top; }
.g-orders { grid-area: orders; }
.g-say { grid-area: info; display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-say .g-info { flex: 1 1 auto; min-width: 0; }
.g-board-wrap { grid-area: board; }
.g-bar { grid-area: bar; }
/* a computer, or a phone held sideways: the board on the left, the panel beside it, the two together in the middle
   (corn-lands-main.js layout() measures with data-measure on, then sizes the board column to the board: the squares, the
   gaps, the 8 px padding and the 1 px border each side, so the board never scrolls) */
.game[data-layout="wide"], .game[data-layout="short"] { grid-template-rows: minmax(0, 1fr); grid-template-areas: "board panel"; justify-content: center; gap: 14px;
  grid-template-columns: calc(var(--cols) * var(--cell) + (var(--cols) - 1) * 4px + 18px) minmax(280px, 400px); }
.game[data-measure] { grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); justify-content: stretch; }
.game[data-layout="tall"][data-measure] { grid-template-columns: minmax(0, 1fr); }
.g-panel { grid-area: panel; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.game[data-layout="wide"] .g-panel { justify-content: center; }

.g-board-wrap { min-height: 0; min-width: 0; display: flex; overflow: auto; }
.g-board { margin: auto; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-template-rows: repeat(var(--rows), var(--cell)); gap: 4px; padding: 8px;
  border-radius: 18px; background: rgba(16, 10, 28, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); touch-action: none; }
.cell { position: relative; width: var(--cell); height: var(--cell); padding: 0; margin: 0; border: 0; border-radius: 12px; cursor: pointer; touch-action: none;
  background-color: #2A1E3E; background-repeat: no-repeat;
  background-image: linear-gradient(rgba(255, 246, 220, 0.06), rgba(255, 246, 220, 0.06)), var(--paint-you, none);
  background-size: 100% 100%, var(--pw, 100%) var(--ph, 100%);
  background-position: 0 0, calc(var(--ox, 0px) - var(--gc, 0) * (var(--cell) + 4px)) calc(var(--oy, 0px) - var(--gr, 0) * (var(--cell) + 4px));
  box-shadow: inset 0 0 0 1px rgba(255, 246, 220, 0.28); }
/* the other side's ground: their painting, under a dusk */
.cell.is-foe { background-image: linear-gradient(rgba(14, 6, 26, 0.5), rgba(14, 6, 26, 0.5)), var(--paint-foe, none); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.g-board-wrap[data-scroll] .g-board, .g-board-wrap[data-scroll] .cell { touch-action: pan-x pan-y; }
/* THE BORDER: drawn from the player's side, in the gap between the two sides' squares */
.cell::after { content: ''; position: absolute; inset: -4px; border: 0 solid var(--edge); border-radius: 6px; pointer-events: none; z-index: 2; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6)); }
.cell.e-t::after { border-top-width: 3px; } .cell.e-r::after { border-right-width: 3px; } .cell.e-b::after { border-bottom-width: 3px; } .cell.e-l::after { border-left-width: 3px; }
.cell__art { position: absolute; left: 5%; top: 5%; width: 90%; height: 90%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.55)); }
.cell.is-gen { box-shadow: inset 0 0 0 2px rgba(245, 194, 66, 0.75), inset 0 0 18px rgba(245, 194, 66, 0.5); }
html[data-side="horde"] .cell.is-gen { box-shadow: inset 0 0 0 2px rgba(107, 224, 74, 0.7), inset 0 0 18px rgba(107, 224, 74, 0.45); }
.cell.is-theirs { box-shadow: inset 0 0 0 2px var(--foe-ring); }
.cell.is-gen.is-theirs { box-shadow: inset 0 0 0 2px var(--foe-ring), inset 0 0 18px var(--foe-ring); }
.cell.is-resting .cell__art { filter: grayscale(0.7) brightness(0.65); }
.cell.is-withering .cell__art { filter: grayscale(0.65) brightness(0.7) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.55)); }
/* one of the player's pieces on the other side's ground: it withers at the start of the next turn unless claimed */
.cell.is-raid { box-shadow: inset 0 0 0 3px #FF9A62; animation: raid 1s ease-in-out infinite alternate; }
@keyframes raid { from { box-shadow: inset 0 0 0 2px rgba(255, 154, 98, 0.55); } to { box-shadow: inset 0 0 0 3px #FF9A62, 0 0 12px rgba(255, 154, 98, 0.6); } }
.cell.is-chest { animation: chest 1.4s ease-in-out infinite alternate; }
@keyframes chest { from { box-shadow: inset 0 0 0 2px rgba(255, 233, 168, 0.4); } to { box-shadow: inset 0 0 0 2px rgba(255, 233, 168, 0.95), 0 0 16px rgba(255, 233, 168, 0.6); } }
.cell__fence { position: absolute; right: 1px; top: 1px; width: 42%; height: 42%; object-fit: contain; z-index: 1; pointer-events: none; filter: drop-shadow(0 1px 2px #000); }
/* NOPE: a producer of the player's that has given its piece this turn (or stands overrun) wears a no sign, no words
   needed (Goliath, 2026-10-20: "put some sort of mark on top of it to say to the person nope") */
.cell__nope { position: absolute; right: 2px; top: 2px; width: 46%; height: 46%; z-index: 2; pointer-events: none; display: none; border-radius: 50%;
  background: #D8324A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.2'/%3E%3Cpath d='M6.4 6.4l11.2 11.2'/%3E%3C/svg%3E") center / 84% no-repeat;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.6); }
.cell.is-spent .cell__nope, .cell.is-overrun .cell__nope { display: block; }
.cell.is-overrun .cell__nope { background-color: #7A3FB0; }
.cell.is-shake { animation: shake 0.36s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
/* THE STRIKE of a served order: the bite of the other side's front flares as it changes hands */
.cell.is-strike { animation: strike 0.9s ease-out; }
@keyframes strike { 0% { filter: brightness(2.2) saturate(1.6); box-shadow: inset 0 0 0 3px #FFE9A8, 0 0 18px rgba(255, 210, 94, 0.9); } 100% { filter: none; } }
/* the other side's turn, shown move by move: the squares it moved, and the squares that changed hands */
.cell.is-move { box-shadow: inset 0 0 0 3px #FFFFFF, 0 0 14px rgba(255, 255, 255, 0.6); z-index: 1; }
.cell.is-took { animation: took 0.7s ease-out; }
@keyframes took { from { filter: brightness(1.9) saturate(1.4); } to { filter: none; } }
.cell.is-top { box-shadow: inset 0 0 0 2px var(--gold), 0 0 12px rgba(245, 194, 66, 0.45); }
.cell.is-wanted::before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; z-index: 1; pointer-events: none;
  background: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.3 6.9.7-5.2 4.6 1.5 6.8L12 17l-6.1 3.4 1.5-6.8L2.2 9l6.9-.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.3 6.9.7-5.2 4.6 1.5 6.8L12 17l-6.1 3.4 1.5-6.8L2.2 9l6.9-.7z'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 1px 1px #000); }
.cell.is-sel { box-shadow: inset 0 0 0 3px var(--gold), 0 0 16px rgba(245, 194, 66, 0.7); filter: brightness(1.18); }
.cell.is-sel .cell__art { transform: translateY(-3px) scale(1.06); }
.cell.is-over { box-shadow: inset 0 0 0 3px #FFFFFF, 0 0 14px rgba(255, 255, 255, 0.55); }
.cell.is-lifted .cell__art { opacity: 0.3; }
.cell.is-hint { animation: hint 0.7s ease-in-out infinite alternate; }
@keyframes hint { from { box-shadow: inset 0 0 0 2px rgba(127, 224, 214, 0.4); } to { box-shadow: inset 0 0 0 3px var(--b), 0 0 16px var(--b); } }
.cell.is-pop .cell__art { animation: pop 0.38s ease; }
@keyframes pop { 0% { transform: scale(0.6); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
.cell__n { position: absolute; right: 1px; bottom: 1px; z-index: 1; font-size: 16px; font-weight: bold; line-height: 1; padding: 2px 4px; border-radius: 8px;
  background: rgba(12, 6, 22, 0.86); color: #FFE9A8; pointer-events: none; font-variant-numeric: tabular-nums; }
.cell__n:empty { display: none; }
.ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.55)); will-change: transform; }

/* the top: the island and its stars, the Islands and Sound chips */
.g-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-isle { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 6px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
/* a long name takes the lines it needs rather than losing its end ("The Moonstone Cr..." on a 6.3 inch iPhone and on a PC):
   two in the iPhone's and the Mac's fonts, three in a wider stand-in serif on a PC that has no Palatino */
.g-isle__name { margin: 0; font-size: 16px; font-weight: bold; color: var(--gold); overflow: hidden; }
.g-isle__row { display: flex; align-items: center; gap: 8px; }
.g-stars { flex: 1 1 auto; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.g-stars span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #FFE9A8); transition: width 0.5s ease; }
html[data-side="horde"] .g-stars span { background: linear-gradient(90deg, #6BE04A, #C9F27A); }
.g-stars__text { flex: none; font-size: 16px; font-weight: bold; font-variant-numeric: tabular-nums; }

/* the orders: three cards, each one button */
.g-orders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
/* a finished round's way back to its result board, across the whole row (it read VIEW RESU on a phone in one column) */
.g-orders > .btn-play { grid-column: 1 / -1; min-height: 52px; padding: 8px 16px; font-size: 18px; letter-spacing: 0.08em; }
.order { appearance: none; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 4px 6px;
  min-height: 44px; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--glass-2); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.order__face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: center 20%; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line); }
.order__wants { display: flex; gap: 4px; justify-content: flex-end; }
.order__want { position: relative; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; }
.order__want img { width: 36px; height: 36px; object-fit: contain; }
.order__want.is-have::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--good)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23123'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 2px #123; }
/* a label too wide for its card (a two-figure order, a 320 px phone, a wider font) takes a second line, never "..." */
.order__foot { grid-column: 1 / -1; font-size: 16px; font-weight: bold; text-align: center; line-height: 1.2; padding: 3px 4px; border-radius: 8px; color: #FFE9A8; }
.order.is-ready { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35), 0 0 18px rgba(245, 194, 66, 0.45); animation: ready 1.2s ease-in-out infinite alternate; }
.order.is-ready .order__foot { background: linear-gradient(135deg, var(--gold), #FFE9A8); color: #1A0F24; }
@keyframes ready { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.order:hover { filter: brightness(1.1); }
.order.is-hint { border-color: var(--b); box-shadow: 0 0 0 3px var(--b), 0 0 16px var(--b); }

/* the line that says what just happened: two lines held, so the board never jumps */
.g-info { margin: 0; font-size: 16px; line-height: 1.3; min-height: 2.6em; max-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  padding: 0 4px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); }
.g-info[data-tone="good"] { color: #E5FFD9; }
.g-info[data-tone="warn"] { color: #FFE2A8; }

/* the bar: the Sunset (End turn), the Barn, Compost, Hint, How to play, and the round Back in the bottom right corner */
.g-bar { display: flex; align-items: center; gap: 8px; }
.g-btn { appearance: none; min-height: var(--tap); min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--glass-2); font-size: 16px; font-weight: bold; cursor: pointer; flex: none; }
.g-btn:disabled { opacity: 0.55; cursor: default; }
.g-btn:not(:disabled):hover { filter: brightness(1.15); }
.g-btn--barn { position: relative; padding: 4px 12px 4px 4px; }
.g-btn__art { width: 40px; height: 40px; object-fit: contain; }
.g-btn__n { color: #FFE9A8; font-variant-numeric: tabular-nums; }
/* THE SUNSET: End turn, first in the bar at the bottom (Goliath, 2026-10-20: "an icon-based end turn at the bottom ..
   maybe a sunset button"); the moon while the other side's host plays its turn. Far from the round Back, so a thumb
   reaching for one never lands on the other. */
#g-end { width: 56px; min-width: 56px; height: 52px; padding: 0; margin-right: 6px; border-radius: 16px; border: 2px solid rgba(255, 196, 92, 0.75);
  background: linear-gradient(180deg, #F59A3C 0%, #C4487A 58%, #4A2A6E 100%); color: #FFF4D6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
#g-end svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#g-end .g-end__disc { fill: #FFD25E; stroke: #FFF4D6; }
#g-end .g-end__moon { display: none; fill: #E8E0FF; stroke: none; }
#g-end.is-night { background: linear-gradient(180deg, #2B2350, #120D24); border-color: rgba(201, 168, 245, 0.55); }
#g-end.is-night .g-end__sun { display: none; }
#g-end.is-night .g-end__moon { display: block; }
#g-end:disabled { opacity: 1; filter: saturate(0.75); }
#g-end:disabled:not(.is-night) { opacity: 0.55; }
#g-end.is-due { border-color: #FFE9A8; box-shadow: 0 0 0 3px rgba(255, 210, 94, 0.55), 0 0 22px rgba(255, 170, 70, 0.8); animation: sunset 1.1s ease-in-out infinite alternate; }
@keyframes sunset { from { transform: translateY(0); filter: brightness(1); } to { transform: translateY(-3px); filter: brightness(1.18); } }
/* THE BADGE beside the line that says what happened: No moves left, Boxed in (Goliath: "The No More Moves needs to be
   more prominent as some sort of badge") */
.g-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; font-size: 16px; font-weight: bold; line-height: 1.1; white-space: nowrap;
  color: #2A1406; background: linear-gradient(135deg, #FFD25E, #FF9A62); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(255, 154, 98, 0.45); }
.g-badge::before { content: ''; width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6l12.8 12.8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 5.6l12.8 12.8'/%3E%3C/svg%3E") center / contain no-repeat; }
.g-badge[data-tone="boxed"] { color: #FFF0F0; background: linear-gradient(135deg, #C2324A, #6E1530); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(194, 50, 74, 0.55); }
.g-badge.is-flash { animation: badge 0.45s ease-out 2; }
@keyframes badge { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.g-pips { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: -1px; }
.g-pips i { width: 11px; height: 11px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--gold); }
.g-pips i.is-on { background: var(--gold); box-shadow: 0 0 6px rgba(245, 194, 66, 0.7); }
html[data-side="horde"] .g-pips i { border-color: #C9F27A; }
html[data-side="horde"] .g-pips i.is-on { background: #C9F27A; box-shadow: 0 0 6px rgba(201, 242, 122, 0.7); }
.g-back { appearance: none; margin-left: auto; flex: none; width: 52px; height: 52px; border-radius: 50%; padding: 0; cursor: pointer; position: relative;
  border: 3px solid #E9C36A; background: radial-gradient(circle at 50% 35%, #4A3170, #23153A); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45); }
.g-back::before { content: ''; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; border-left: 5px solid #FFE9A8; border-bottom: 5px solid #FFE9A8; transform: translate(-30%, -50%) rotate(45deg); }
.g-back:active { transform: scale(0.94); }
#g-back { position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 3; }
.game[data-layout="short"] .g-panel, .game[data-layout="wide"] .g-panel { margin-bottom: 64px; }
.game[data-layout="tall"] .g-bar { padding-right: 64px; }
/* a phone upright: the barn is its picture with its count in the corner, so the whole bar stands in one row */
@media (max-width: 480px) { .g-btn--barn .g-btn__word { display: none; } .g-btn { padding: 4px 10px; } .g-btn--barn { width: 52px; min-width: 52px; padding: 2px; }
  .g-btn--barn .g-btn__n { position: absolute; right: -4px; bottom: -6px; padding: 1px 5px; border-radius: 9px; font-size: 16px; line-height: 1.1; background: rgba(12, 6, 22, 0.92); border: 1px solid var(--line); } }
/* a phone held sideways: the panel beside the board is narrow, so the barn shows its picture and its count (the word is
   in its label), and the bar may take a second line with the round Back still at its bottom right */
.game[data-layout="short"] .g-bar { flex-wrap: wrap; gap: 6px; }
.game[data-layout="short"] .g-btn--barn .g-btn__word { display: none; }
.game[data-layout="short"] .g-btn { padding: 4px 10px; }
.game[data-layout="short"] .g-btn--barn { width: 52px; min-width: 52px; padding: 2px; }
.game[data-layout="short"] .g-btn--barn .g-btn__n { position: absolute; right: -4px; bottom: -6px; padding: 1px 5px; border-radius: 9px; font-size: 16px; line-height: 1.1; background: rgba(12, 6, 22, 0.92); border: 1px solid var(--line); }

/* beside the board (a computer, a phone held sideways): the orders stand in a column, each a row of its own */
.game[data-layout="wide"] .g-orders, .game[data-layout="short"] .g-orders { grid-template-columns: minmax(0, 1fr); }
.game[data-layout="wide"] .order, .game[data-layout="short"] .order { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; }
.game[data-layout="wide"] .order__foot, .game[data-layout="short"] .order__foot { grid-column: auto; min-width: 4.5em; }
.game[data-layout="wide"] .order__face { width: 48px; height: 48px; }
.game[data-layout="wide"] .order__wants { justify-content: flex-start; }
.game[data-layout="wide"] .order__want { width: 52px; height: 52px; }
.game[data-layout="wide"] .order__want img { width: 48px; height: 48px; }
.game[data-layout="wide"] .g-info, .game[data-layout="short"] .g-info { max-height: none; -webkit-line-clamp: 4; min-height: 2.6em; }
.game[data-layout="wide"] .g-isle__name { font-size: 20px; font-family: var(--title-font); }
.game[data-layout="short"] .g-panel { gap: 6px; }
.game[data-layout="short"] { grid-template-columns: minmax(0, 1fr) minmax(180px, 36%); }
.game[data-layout="short"] .g-top .chip { padding: 6px 10px; }
.game[data-layout="short"] .order { padding: 4px 6px; }
.game[data-layout="short"] .order__face { width: 30px; height: 30px; }
/* a phone held sideways: the three orders side by side without their faces (the faces are in the orders' labels), so the
   whole panel, the bar with the Sunset included, stands in the screen's height */
.game[data-layout="short"] .g-orders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game[data-layout="short"] .order { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; padding: 4px 3px; }
.game[data-layout="short"] .order__face { display: none; }
.game[data-layout="short"] .order__wants { justify-content: center; }
/* a ready order's "Serve 2★" read "Serve 2..." in a card 88 px wide (an iPhone held sideways): two pixels more room keep
   it on one line there (a second line would push the bottom row under the panel's fold) */
.game[data-layout="short"] .order__foot { grid-column: 1 / -1; min-width: 0; padding: 1px; }

/* ---- THE ISLANDS (a readable room: js/room-ui.js) ------------------------------------------------------------------------ */
.rui.cl-room[data-paint] { background: linear-gradient(180deg, rgba(11, 8, 20, 0.82), rgba(11, 8, 20, 0.9)), var(--rui-paint) center / cover no-repeat, #120D1D; }
.cl-isle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(220px * var(--rui-s, 1)), 100%), 1fr)); gap: 14px; margin: 12px 0; }
.cl-isle { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.cl-isle.is-here { border-color: var(--rui-gold, #F5C242); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.3), 0 8px 26px rgba(245, 194, 66, 0.2); }
.cl-isle__art { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #1B1430; }
.cl-isle__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.cl-isle__words { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.cl-isle__kick { margin: 0; font-size: var(--rui-min, 16px); color: var(--rui-soft, #DED4F2); }
.cl-isle__name { margin: 0; font-size: var(--rui-h2, 22px); font-weight: bold; color: var(--rui-gold, #F5C242); font-family: var(--title-font); line-height: 1.15; }
.cl-isle__line { margin: 0; font-size: var(--rui-min, 16px); line-height: 1.35; }
.cl-isle__state { margin: 4px 0 0; font-size: var(--rui-min, 16px); font-weight: bold; }
.cl-isle__state.is-good { color: var(--rui-good, #8EF07A); }
.cl-isle__state.is-gold { color: var(--rui-gold, #F5C242); }
.cl-isle__state.is-warn { color: var(--rui-warn, #FFD27A); }
.cl-buy { margin-top: 6px; align-self: flex-start; }

/* ---- the barn, the checkout and How to play (js/room-ui.js dialogs) ------------------------------------------------------- */
.cl-h { margin: 18px 0 6px; font: bold var(--rui-h2, 22px)/1.2 var(--title-font); color: var(--rui-gold, #F5C242); }
.cl-h:first-child { margin-top: 0; }
.cl-barn__head { display: flex; align-items: center; gap: 14px; }
.cl-barn__look { flex: none; width: 104px; height: 104px; object-fit: contain; border-radius: 16px; background: radial-gradient(circle at 50% 65%, rgba(245, 194, 66, 0.35), rgba(255, 111, 181, 0.08) 72%); }
.cl-barn__words { min-width: 0; }
.cl-barn__name { margin: 0 0 4px; font-size: var(--rui-h2, 22px); font-weight: bold; color: var(--rui-gold, #F5C242); }
.cl-stalls { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cl-stall { appearance: none; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 6px 4px; border-radius: 14px; cursor: pointer;
  background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); font: inherit; }
.cl-stall img { width: 52px; height: 52px; object-fit: contain; }
.cl-stall__name { font-size: 16px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.cl-stall.is-free { cursor: default; background: transparent; border-style: dashed; opacity: 0.5; min-height: 96px; box-sizing: border-box; }
.cl-ware { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cl-ware__words { flex: 1 1 240px; }
.cl-ware__name { margin: 0 0 4px; font-size: var(--rui-body, 18px); font-weight: bold; color: var(--rui-gold, #F5C242); }
.cl-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.cl-look { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 16px; background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.cl-look.is-on { border-color: var(--rui-gold, #F5C242); }
.cl-look__art { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: radial-gradient(circle at 50% 65%, rgba(245, 194, 66, 0.3), rgba(255, 111, 181, 0.06) 72%); }
.cl-look__name { margin: 0; font-size: var(--rui-body, 18px); font-weight: bold; color: var(--rui-gold, #F5C242); line-height: 1.2; }
.cl-look__line { margin: 0; font-size: 16px; line-height: 1.3; color: var(--rui-soft, #DED4F2); flex: 1 1 auto; }
.cl-look__state { margin: 0; min-height: 44px; display: flex; align-items: center; font-size: 16px; font-weight: bold; color: var(--rui-good, #8EF07A); }
.cl-fine { margin-top: 12px; color: var(--rui-soft, #DED4F2); }
.cl-pay__head { display: flex; gap: 14px; align-items: flex-start; }
.cl-pay__art { flex: none; width: 96px; height: 96px; object-fit: cover; border-radius: 14px; background: #1B1430; }
.cl-pay__price { margin: 6px 0 0; font-size: var(--rui-h2, 22px); font-weight: bold; color: var(--rui-gold, #F5C242); }
.cl-pay__test { color: var(--rui-warn, #FFD27A); font-weight: bold; }
.cl-pay__terms { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 6px; font-size: 16px; line-height: 1.35; cursor: pointer; min-height: 44px; }
.cl-pay__terms input { flex: none; width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--rui-gold, #F5C242); }
.cl-pay__line { min-height: 1.4em; }
.cl-pay__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---- small things -------------------------------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; top: calc(76px + var(--safe-t)); transform: translateX(-50%); z-index: 80; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 14px;
  background: var(--glass-2); border: 1px solid var(--line); font-size: 18px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); pointer-events: none; }

/* ---- a big screen: the door's column and the corner grow with it -------------------------------------------------------- */
@media (min-width: 1400px) and (min-height: 820px) { .door-col, .corner, .door-copy { zoom: 1.3; } .g-panel { font-size: 18px; } }
@media (min-width: 2300px) and (min-height: 1250px) { .door-col, .corner, .door-copy { zoom: 1.65; } }

@media (prefers-reduced-motion: reduce) {
  .btn-play::after, .curtain-art, .cell.is-chest, .cell.is-hint, .order.is-ready, .cell.is-pop .cell__art, .cell.is-raid, .cell.is-took, #g-end.is-due, .cell.is-shake, .cell.is-strike, .g-badge.is-flash, .cl-coach__icon { animation: none; }
  .door-paint img, .g-paint img { transition: none; }
}

/* RESTORE PURCHASES (the iPhone and iPad app only: js/game-shop.js restoreButton) on The Islands and in the barn */
.cl-restore { margin: 12px 0 0; text-align: center; }
.cl-restore .gs-restore { min-height: 48px; }

/* Round progress, themed celebrations and picture-led teaching. */
.g-run { margin: 3px 0 0; font-size: 16px; line-height: 1.2; white-space: nowrap; color: var(--parchment, #fff0d6); }
.game[data-layout="short"] .g-top { position: relative; padding-bottom: 24px; }
.game[data-layout="short"] .g-run { position: absolute; left: 8px; bottom: 0; margin: 0; white-space: nowrap; }
.game[data-layout="short"] .g-panel { gap: 4px; }
.game[data-layout="short"] .g-info { min-height: 2.6em; max-height: 2.6em; -webkit-line-clamp: 2; flex-shrink: 0; }
.game[data-layout="short"] .g-bar { flex-wrap: nowrap; }
.game[data-layout="short"] .g-bar .g-btn { padding-left: 6px; padding-right: 6px; }
.game[data-layout="short"] .g-panel > * { flex-shrink: 0; }
.g-panel { container-type: inline-size; }
@container (max-width: 260px) {
  .g-top { flex-wrap: wrap; padding-bottom: 0 !important; }
  .g-top .g-isle { flex-basis: 100%; }
  .g-top .g-run { position: static !important; white-space: normal !important; }
  .g-bar { flex-wrap: wrap !important; }
  .g-bar .g-back { margin-left: 0; }
}
/* An iPhone held sideways (844 x 390, the panel 277 px): four round buttons in one row beside the island left it 65 px,
   its bar gone, its name "Th..." and its count under The Islands. Under 380 px the buttons stand two by two and the
   island keeps about 175 px, its turn line inside it. Only 22 px taller, so the panel still clears the round Back. */
@container (min-width: 261px) and (max-width: 380px) {
  .g-top { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; gap: 4px; padding-bottom: 0 !important; }
  .g-top .g-isle { grid-row: 1 / span 2; justify-content: center; }
  .g-top .g-run { position: static !important; white-space: normal !important; }
}
/* The narrowest iPhone upright (320 x 568: the first iPhone SE, or an SE or a mini with Display Zoom on): four round
   buttons in a row left the island 96 px (its name three lines and still cut, its bar 9 px) and the bottom row ran
   20 px under the round Back. Under 360 px the round buttons stand two by two, as on a phone held sideways, and the
   bottom row closes up to end 6 px short of Back. The board keeps its 44 px squares and pans ("Swipe the board"). */
@media (max-width: 359px) {
  .game[data-layout="tall"] .g-top { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; gap: 4px; }
  .game[data-layout="tall"] .g-top .g-isle { grid-row: 1 / span 2; justify-content: center; }
  .game[data-layout="tall"] .g-bar { gap: 4px; padding-right: 60px; }
  .game[data-layout="tall"] #g-end { width: 48px; min-width: 48px; margin-right: 0; }
  .game[data-layout="tall"] .g-btn--barn { width: 48px; min-width: 48px; }
}
.g-icon { width: 44px; min-width: 44px; padding: 8px; }
.g-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.g-help { min-width: 44px; }
.g-help svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.g-btn > svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#g-compost, #g-hint, #g-help { width: 44px; padding: 8px; box-sizing: border-box; }
#g-compost .g-btn__word, #g-hint .g-btn__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px), (max-height: 560px) {
  #g-compost .g-btn__word, #g-hint .g-btn__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .g-bar { gap: 6px; }
}
.g-board-wrap { position: relative; }
.g-board-wrap[data-victory] .cell { box-shadow: inset 0 0 12px #d9ffc555, 0 0 9px #8fe7b544; transition: filter .8s ease, box-shadow .8s ease; filter: saturate(1.3) brightness(1.15); }
html[data-side="horde"] .g-board-wrap[data-victory] .cell { filter: saturate(.7) brightness(.65); box-shadow: inset 0 0 12px #ad63e977, 0 0 9px #dd616644; }
.game[data-island="2"] .g-paint { box-shadow: inset 0 0 150px #e9b54735; }
.game[data-island="3"] .g-paint { box-shadow: inset 0 0 150px #4dbd8a45; }
.game[data-island="4"] .g-paint { box-shadow: inset 0 0 150px #f06cab45; }
.game[data-island="5"] .g-paint { box-shadow: inset 0 0 150px #85b0ff55; }
.game[data-island="2"] { --land-glow: #f5c76b; }.game[data-island="3"] { --land-glow: #80d6aa; }.game[data-island="4"] { --land-glow: #f599d1; }.game[data-island="5"] { --land-glow: #a4b6ff; }
.game[data-island="2"] .g-paint::before, .game[data-island="3"] .g-paint::before, .game[data-island="4"] .g-paint::before, .game[data-island="5"] .g-paint::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .35; background: radial-gradient(ellipse at 18% 25%, var(--land-glow), transparent 24%), radial-gradient(circle at 70% 30%, var(--land-glow), transparent 2%), radial-gradient(circle at 62% 18%, var(--land-glow), transparent 1%), radial-gradient(circle at 36% 42%, var(--land-glow), transparent 1.5%); }
.game[data-phase="3"] .g-paint::before { opacity: .55; }
.cl-isle__power { color: #b5e6c3; font-size: 16px; line-height: 1.5; }
.cl-intro-scene { display: grid; grid-template-columns: minmax(100px, 30%) minmax(0, 1fr); gap: 22px; align-items: center; }
.cl-intro-scene > img { width: 100%; max-height: 330px; object-fit: contain; filter: drop-shadow(0 10px 22px #0008); }
.cl-guide-kicker { color: #d6b7fa; font-size: 16px; }
.cl-guide-jump { width: 100%; min-height: 48px; padding: 8px 10px; border-radius: 10px; background: #241934; color: #fff0d6; border: 1px solid #8d7043; font: inherit; font-size: 16px; }
.cl-guide-diagram { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; padding: 16px 8px; border: 1px solid #9d81574d; border-radius: 16px; background: linear-gradient(140deg, #304b3c88, #2c194c88); }
.cl-guide-figure { position: relative; width: min(25%, 170px); min-width: 90px; margin: 0; text-align: center; }
.cl-guide-figure img { width: 100%; height: 120px; object-fit: contain; filter: drop-shadow(0 5px 7px #0008); }
.cl-guide-figure figcaption { margin-top: 8px; font-size: 16px; line-height: 1.4; }
.cl-guide-figure.is-brambled::after { content: ''; position: absolute; inset: 8px 0 35px; border: 5px double #958849; border-radius: 35% 60% 30% 55%; transform: rotate(-14deg); background: repeating-linear-gradient(35deg, transparent 0 20px, #60583c99 21px 25px, transparent 26px 45px); }
.cl-guide-arrow { font-size: 27px; color: #f6cf78; }
.cl-guide-tip { padding: 12px; border-left: 3px solid #8ce5c1; background: #8ce5c111; font-size: 16px; line-height: 1.55; }
.cl-guide-nav { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 14px 0; font-size: 16px; }
/* A button's own picture, copied for the How to play key and the sunset coach (main's iconOf()): drawn as it looks on the farm. */
.cl-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; box-sizing: border-box; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text); }
.cl-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cl-icon--g-end { width: 56px; height: 52px; border-radius: 16px; border: 2px solid rgba(255, 196, 92, 0.75); background: linear-gradient(180deg, #F59A3C 0%, #C4487A 58%, #4A2A6E 100%); color: #FFF4D6; }
.cl-icon--g-end svg { width: 34px; height: 34px; stroke-width: 1.8; }
.cl-icon--g-end .g-end__disc { fill: #FFD25E; stroke: #FFF4D6; }
.cl-icon--g-end .g-end__moon { display: none; }
.cl-icon--g-hint, .cl-icon--g-compost, .cl-icon--g-help { border-radius: 14px; }
.cl-guide-figure .cl-guide-icon { margin: 34px auto 30px; }
.cl-guide-key { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; margin: 16px 0; padding: 0; }
.cl-guide-key__row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 10px 4px 4px; border-radius: 14px; background: #ffffff0d; font-size: 16px; line-height: 1.35; }
.cl-coach__row { display: flex; align-items: center; gap: 16px; }
.cl-coach__row .rui-p { margin: 0; }
.cl-coach__icon { animation: sunset 1.1s ease-in-out infinite alternate; }
.cl-guide a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px; margin-right: 12px; box-sizing: border-box; color: #f3d68c; text-underline-offset: 3px; }
@media (max-width: 420px) { .cl-intro-scene { grid-template-columns: 1fr; gap: 8px; }.cl-intro-scene > img { max-height: 160px; }.cl-guide-figure { min-width: 70px; width: 21%; }.cl-guide-diagram { gap: 8px; }.cl-guide-arrow { font-size: 22px; }.cl-guide-figure img { height: 95px; }.g-run-row { gap: 4px; } }
@media (max-height: 440px) { .cl-intro-scene > img { max-height: 180px; }.cl-guide-figure img { height: 85px; } }
@media (prefers-reduced-motion: reduce) { .g-board-wrap[data-victory] .cell { transition: none; } }
/* the line beside the badge gives way to it on every layout (the sideways panel's rule above keeps its children whole) */
.game .g-say .g-info { flex: 1 1 auto; min-width: 0; }
.game .g-say .g-badge { flex: none; }
