:root {
  --paper: #f6ecdd; --paper2: #efe1cc; --ink: #3a2a20; --ink2: #6b5646; --coral: #c2412c; --coral2: #e8775f;
  --teal: #245f5b; --teal2: #2f7570; --gold: #d9a521; --plum: #6d2c58;
  --cell: 52px; --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sbx: var(--sb); --sbt: var(--sb);
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Noto Serif Display", "Noto Serif", Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
/* inside the OhMyGames page its "How to play" pill floats over the bottom 60 px of the frame: keep buttons and text above it */
html.in-frame { --sbt: max(var(--sb), 62px); }   /* title screen only: the page hides its pill once play starts */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #2a211b; color: var(--ink);
  font: 15px/1.35 var(--sans); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

/* the game column: phone first; on wide screens it stays a phone-shaped column on a blurred atelier */
body::before { content: ""; position: fixed; inset: -40px; background: url(art/title.webp) center/cover; filter: blur(28px) brightness(.55); }
#app { position: fixed; inset: 0; margin: 0 auto; max-width: 600px; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper) radial-gradient(120% 60% at 50% 0%, #fbf5ea 0%, var(--paper) 60%, var(--paper2) 100%);
  padding: calc(var(--st) + 4px) 3px calc(var(--sbx) + 4px); box-shadow: 0 0 60px rgba(0,0,0,.4); }

/* HUD */
#hud { position: relative; display: flex; align-items: center; gap: 6px; height: 46px; flex: none; padding: 0 3px; }
#hud .counters { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
#hud .grow { flex: 1; }
#hud .info { display: none; flex: 1; min-width: 0; align-items: center; gap: 6px; height: 44px; padding: 0 2px 0 4px; border-radius: 14px; background: #fffaf2; box-shadow: inset 0 0 0 1.5px rgba(58,42,32,.14); }
#hud.showInfo .counters { display: none; } #hud.showInfo .info { display: flex; animation: up .18s ease-out; }
#hud.teach .info { background: #fff3d6; box-shadow: 0 0 0 2px var(--gold); } #hud.teach .info b { color: var(--coral); } #hud.teach #infoX { display: none; }
#info img { width: 38px; height: 38px; flex: none; }
#info img:not([src]) { display: none; }
#info .txt { flex: 1; min-width: 0; }
#info b { display: block; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info small { font-size: 12px; color: var(--ink2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#info .round.x { width: 32px; height: 32px; flex: none; font-size: 14px; color: var(--ink2); box-shadow: none; background: none; }
#info .btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; flex: none; }
.pill { display: flex; align-items: center; gap: 3px; height: 36px; padding: 0 10px 0 2px; border-radius: 18px; background: #fffaf2;
  box-shadow: inset 0 0 0 1.5px rgba(58,42,32,.14); font-weight: 800; font-size: 16px; white-space: nowrap; }
.pill img { width: 34px; height: 34px; margin: -2px 0; }
.pill small { font-weight: 600; font-size: 11px; color: var(--ink2); margin-left: 2px; }
#coffeePill:active { transform: scale(.96); }
.round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fffaf2; box-shadow: inset 0 0 0 1.5px rgba(58,42,32,.14); }
.round svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round:active, .pill:active { background: #f3e6d2; }

/* orders */
#orders { flex: none; display: flex; gap: 6px; height: 96px; padding: 4px 3px 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  touch-action: pan-x; scroll-snap-type: x proximity; }
#orders::-webkit-scrollbar { display: none; }
.card { position: relative; flex: none; height: 86px; border-radius: 16px; background: #fffaf2; box-shadow: 0 2px 0 rgba(58,42,32,.12), inset 0 0 0 1.5px rgba(58,42,32,.12);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; scroll-snap-align: start; transition: transform .2s; }
.card .who { position: absolute; top: 5px; left: 10px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.card .needs { display: flex; gap: 4px; margin-top: 12px; }
.need { position: relative; width: 46px; height: 46px; border-radius: 12px; background: var(--paper2); display: grid; place-items: center; }
.need img { width: 43px; height: 43px; }
.need.ok::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #2e8b57; color: #fff;
  font: 900 13px/20px var(--sans); text-align: center; box-shadow: 0 0 0 2px #fffaf2; }
.reward { display: flex; flex-direction: column; align-items: center; margin-top: 12px; font-weight: 800; font-size: 14px; }
.reward img { width: 28px; height: 28px; }
.card.ready { background: #fff3d6; box-shadow: 0 0 0 3px var(--gold), 0 4px 14px rgba(217,165,33,.45); animation: breathe 1.4s ease-in-out infinite; }
.card .go { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); padding: 2px 10px; border-radius: 10px; background: var(--coral); color: #fff; font-weight: 800; font-size: 12px; white-space: nowrap; box-shadow: 0 0 0 2px #fff3d6; }
.card.client { padding-left: 4px; background: #fff; }
.card.client .face { width: 54px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--paper); flex: none; }
.card.client .face img { width: 100%; height: 100%; object-fit: cover; }
.card.client .lookName { position: absolute; top: 5px; left: 64px; white-space: nowrap; font: italic 700 13px var(--serif); color: var(--plum); }
.card.client .who { left: 78px; top: 20px; display: none; }
@keyframes breathe { 50% { transform: translateY(-2px); } }

/* the client's wishes, between the orders and the mat (only where the screen has room) */
#wish { flex: none; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; padding: 0 4px 6px; font-size: 12px; font-weight: 800; color: var(--ink2); }
#wish .tag { padding: 3px 9px; font-size: 12px; border-radius: 11px; }
@media (max-height: 860px) { #wish { display: none; } }

/* board = a teal cutting mat */
#boardWrap { flex: 1; min-height: 0; display: grid; place-items: center; }
#board { position: relative; width: calc(var(--cell) * 7); height: calc(var(--cell) * 9); border-radius: 10px; touch-action: none;
  background-color: var(--teal);
  background-image: linear-gradient(rgba(255,248,230,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(255,248,230,.16) 1px, transparent 1px),
    linear-gradient(rgba(255,248,230,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,248,230,.06) 1px, transparent 1px);
  background-size: var(--cell) var(--cell), var(--cell) var(--cell), calc(var(--cell) / 4) calc(var(--cell) / 4), calc(var(--cell) / 4) calc(var(--cell) / 4);
  background-position: -1px -1px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.12), 0 3px 0 #1a4744, 0 8px 18px rgba(36,95,91,.35); }
.it { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); will-change: transform; transition: transform .22s cubic-bezier(.3,1.3,.5,1); z-index: 1; }
.it img { width: 100%; height: 100%; display: block; }
.it.gen img { transform: scale(1.06); }
.it.gen::before { content: ""; position: absolute; inset: 3px; border-radius: 12px; background: rgba(255,250,240,.18); box-shadow: inset 0 0 0 2px rgba(255,250,240,.35); }
.it.w img { opacity: .8; filter: grayscale(.35) sepia(.25); transform: scale(.9); }
.it.w::after { content: ""; position: absolute; inset: 3px; border-radius: 10px; border: 2px dashed rgba(255,244,220,.75); background: rgba(196,164,118,.38); }
.it.w::before { content: ""; position: absolute; right: -2px; top: -4px; width: 46%; height: 46%; background: url(art/items/paper.webp) center/contain no-repeat; z-index: 1; }
.it.sel { z-index: 2; }
.it.sel::before { content: ""; position: absolute; inset: 1px; border-radius: 12px; box-shadow: 0 0 0 3px #fff, 0 0 12px 3px rgba(255,255,255,.6); }
.it.drag { transition: none; z-index: 5; }
.it.drag img { transform: scale(1.18); filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)); }
.it.twin::before { content: ""; position: absolute; inset: 2px; border-radius: 12px; background: rgba(255,214,100,.28); box-shadow: inset 0 0 0 2.5px rgba(255,214,100,.95); animation: blink .9s ease-in-out infinite; }
.it.want::after { content: "✓"; position: absolute; right: 1px; top: 1px; width: 17px; height: 17px; border-radius: 50%; background: #2e8b57; color: #fff;
  font: 900 11px/17px var(--sans); text-align: center; box-shadow: 0 0 0 1.5px #fff; }
.it.pop img { animation: pop .34s cubic-bezier(.3,1.6,.5,1); }
.it.wiggle img { animation: wiggle .5s ease-in-out 3; }
.it.nope img { animation: nope .3s; }
@keyframes pop { 0% { transform: scale(.5); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes wiggle { 25% { transform: rotate(-9deg) scale(1.06); } 75% { transform: rotate(9deg) scale(1.06); } }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.target { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); border-radius: 12px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.75); pointer-events: none; z-index: 0; }
.target.merge { box-shadow: inset 0 0 0 3px var(--gold), 0 0 16px 4px rgba(255,214,100,.7); }
.spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 8px 3px rgba(255,220,120,.9); pointer-events: none; z-index: 6;
  animation: spark .55s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.fly { position: fixed; z-index: 40; width: 44px; height: 44px; pointer-events: none; transition: transform .5s cubic-bezier(.5,0,.4,1), opacity .5s; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 24px; background: var(--coral);
  color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 3px 0 #8e2c1d; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8e2c1d; }
.btn.big { min-height: 56px; font-size: 19px; padding: 0 30px; border-radius: 28px; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn.ghost { background: #fffaf2; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(58,42,32,.2), 0 2px 0 rgba(58,42,32,.15); }
.btn[disabled] { opacity: .45; }

/* full screens */
.screen { position: fixed; inset: 0; margin: 0 auto; max-width: 600px; z-index: 20; background: var(--paper); overflow: hidden; }
#title .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
#title .titleCard { position: absolute; left: 0; right: 0; top: calc(var(--st) + 7vh); text-align: center; padding: 0 20px; }
#title h1 { margin: 0; font: italic 400 clamp(54px, 16vw, 80px)/.92 var(--serif); letter-spacing: .01em; color: var(--ink); text-shadow: 0 2px 0 rgba(255,250,240,.9), 0 0 24px rgba(255,250,240,.95); }
#title p { margin: 6px 0 0; font-weight: 700; font-size: 16px; color: var(--ink); text-shadow: 0 0 10px #fffaf0, 0 0 4px #fffaf0; }
#title .btn { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sbt) + 7vh); white-space: nowrap; box-shadow: 0 3px 0 #8e2c1d, 0 8px 24px rgba(58,42,32,.35); }
#title .btn:active { transform: translate(-50%, 2px); }

/* story */
#story { background: radial-gradient(90% 55% at 50% 30%, #fffaf1, var(--paper) 70%, var(--paper2)); }
#story .stage { position: absolute; left: 0; right: 0; top: var(--st); bottom: calc(var(--sbx) + 150px); }
#story .fig { position: absolute; bottom: 0; height: 100%; max-width: 78%; object-fit: contain; object-position: 50% 100%; transition: opacity .3s, transform .3s, filter .3s; }
#story .fig.a { left: -8%; } #story .fig.b { right: -8%; }
#story .fig.dim { opacity: .5; filter: grayscale(.6) brightness(1.08); transform: scale(.92); transform-origin: 50% 100%; }
#story .fig.solo { left: 50%; right: auto; transform: translateX(-50%); }
#story .fig.solo.dim { transform: translateX(-50%) scale(.92); }
#story .dlg { position: absolute; left: 10px; right: 10px; bottom: calc(var(--sbx) + 12px); min-height: 150px; border-radius: 20px; background: #fffaf2;
  box-shadow: 0 4px 0 rgba(58,42,32,.15), inset 0 0 0 2px rgba(58,42,32,.12); padding: 26px 18px 30px; }
#story .who { position: absolute; top: -14px; left: 16px; padding: 4px 14px; border-radius: 14px; background: var(--plum); color: #fff; font: italic 700 16px var(--serif); }
#story .who.ines { background: var(--coral); } #story .who.valentin { background: #4a3a6b; }
#story .txt { font-size: 17px; line-height: 1.45; min-height: 50px; }
#story .next { position: absolute; right: 16px; bottom: 8px; font-size: 12px; font-weight: 700; color: var(--ink2); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
#story .choices { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
#story .choices .btn { width: 100%; font-size: 16px; }

/* look choice */
#choose { display: flex; flex-direction: column; background: radial-gradient(90% 40% at 50% 0%, #fffaf1, var(--paper)); }
.chooseHead { padding: calc(var(--st) + 14px) 18px 6px; text-align: center; }
.chooseHead small { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); font-size: 12px; }
.chooseHead h2 { margin: 2px 0 8px; font: italic 700 26px var(--serif); }
.chooseHead p { margin: 8px 0 0; font-size: 14px; color: var(--ink2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag { padding: 5px 12px; border-radius: 14px; background: var(--plum); color: #fff; font-weight: 800; font-size: 14px; }
.looks { flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 11vw calc(var(--sbx) + 14px); scrollbar-width: none; touch-action: pan-x; }
.looks::-webkit-scrollbar { display: none; }
.look { flex: none; width: min(78vw, 360px); scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; border-radius: 22px; background: #fffaf2;
  box-shadow: 0 4px 0 rgba(58,42,32,.14), inset 0 0 0 2px rgba(58,42,32,.1); padding: 10px 10px 14px; min-height: 0; }
.look .pic { flex: 1; min-height: 0; width: 100%; position: relative; }
.look .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.look h3 { margin: 4px 0 6px; font: italic 700 22px var(--serif); }
.look .needs { display: flex; gap: 6px; margin-bottom: 10px; }

/* runway */
#runway { display: flex; flex-direction: column; align-items: center; padding: calc(var(--st) + 6px) 10px calc(var(--sbx) + 10px);
  background: radial-gradient(70% 45% at 50% 32%, #fff8ea 0%, #f1e3cc 55%, #dcc7a8 100%); }
#runway .spot { position: absolute; left: 50%; top: 0; width: 140%; height: 70%; transform: translateX(-50%); background: radial-gradient(40% 60% at 50% 55%, rgba(255,255,255,.7), transparent 70%); pointer-events: none; }
.figbox { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; }
#runway .fig { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transition: opacity .6s, transform .6s; }
#runway .fig.after { opacity: 0; transform: scale(.96); transform-origin: 50% 100%; }
#runway.revealed .fig.after { opacity: 1; transform: none; }
#runway.revealed .fig.base { opacity: 0; }
#runway.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .5s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }
.off { opacity: 0; pointer-events: none; }
#runway .rwCard { flex: none; text-align: center; transition: opacity .3s; padding-top: 2px; }
#runway .rwCard h2 { margin: 0; font: italic 700 25px var(--serif); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0; }
.check { padding: 4px 10px; border-radius: 12px; font-weight: 800; font-size: 13px; background: #fffaf2; opacity: 0; transform: translateY(6px); transition: .3s; }
.check.on { opacity: 1; transform: none; }
.check.yes { background: #2e8b57; color: #fff; } .check.no { background: #ead9c1; color: #7a6656; text-decoration: line-through; }
.stars { display: flex; justify-content: center; gap: 4px; height: 40px; }
.stars img { width: 40px; height: 40px; opacity: .18; filter: grayscale(1); transition: .25s; }
.stars img.on { opacity: 1; filter: none; animation: pop .4s; }
#runway .jury { flex: none; width: 100%; height: clamp(150px, 25dvh, 230px); display: flex; flex-direction: column; transition: opacity .3s; }
#runway .jury img { flex: 1; min-height: 0; width: 100%; object-fit: contain; object-position: 50% 100%; }
.bubbles { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; min-height: 52px; }
.bubble { position: relative; padding: 5px 7px; border-radius: 12px; background: #fff; font-size: 12px; line-height: 1.22; font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); opacity: 0; transform: translateY(8px); transition: .3s; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.bubble.on { opacity: 1; transform: none; }
.bubble b { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--plum); }
.rwFoot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 6px; }
.rwFoot small { font-weight: 800; font-size: 13px; color: var(--ink2); min-height: 17px; }
.flyers img { position: absolute; width: 64px; height: 64px; left: 50%; bottom: -10px; transition: transform .7s cubic-bezier(.4,0,.2,1), opacity .4s .5s; z-index: 2; }

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(42,33,27,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { width: 100%; max-width: 520px; max-height: 86dvh; overflow-y: auto; border-radius: 22px 22px 0 0; background: var(--paper); padding: 18px 16px calc(var(--sbx) + 18px);
  box-shadow: 0 -6px 20px rgba(0,0,0,.2); animation: up .25s ease-out; touch-action: pan-y; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet h2 { margin: 0 0 6px; font: italic 700 24px var(--serif); }
.sheet p { margin: 6px 0 12px; color: var(--ink2); }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.sheet .row .btn { flex: 1; }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 4px; border-bottom: 1px solid rgba(58,42,32,.1); font-weight: 700; }
.toggle i { width: 50px; height: 30px; border-radius: 15px; background: #d8c8b2; position: relative; transition: .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on i { background: #2e8b57; } .toggle.on i::after { left: 23px; }
.book { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.book figure { margin: 0; border-radius: 14px; background: #fffaf2; padding: 4px 4px 6px; text-align: center; box-shadow: inset 0 0 0 1.5px rgba(58,42,32,.1); }
.book figure img { width: 100%; aspect-ratio: 2/3; object-fit: contain; }
.book figure.locked img { filter: grayscale(1) blur(2px); opacity: .35; }
.book figure.encore { cursor: pointer; } .book figure.encore figcaption small { color: var(--coral); }
.book figcaption { font: italic 700 13px var(--serif); }
.book figcaption small { display: block; font: 700 11px var(--sans); color: var(--ink2); }

#toast { position: fixed; left: 50%; top: calc(var(--st) + 160px); z-index: 50; transform: translate(-50%, -10px); max-width: 86vw; padding: 10px 16px; border-radius: 16px; background: rgba(42,33,27,.92);
  color: #fff; font-weight: 700; font-size: 15px; text-align: center; opacity: 0; transition: .25s; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#hand { position: fixed; z-index: 45; width: 54px; height: 54px; pointer-events: none; font-size: 44px; line-height: 54px; text-align: center;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); animation: tap 1s ease-in-out infinite; }
#hand::before { content: "👆"; }
@keyframes tap { 50% { transform: translateY(10px) scale(.92); } }
#hand.drag { animation: dragHint 1.6s ease-in-out infinite; }
@keyframes dragHint { 0%, 15% { transform: translate(0, 0); } 70%, 100% { transform: translate(var(--hx), var(--hy)); opacity: .2; } }

@media (prefers-reduced-motion: reduce) { .card.ready, #story .next, #hand { animation: none; } }
@media (orientation: landscape) and (max-height: 560px) { /* phone held sideways: board left, orders right */
  #app { max-width: 920px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 46px 1fr; column-gap: 14px;
    padding-left: calc(env(safe-area-inset-left, 0px) + 8px); padding-right: calc(env(safe-area-inset-right, 0px) + 8px); }
  #boardWrap { grid-column: 1; grid-row: 1 / 3; width: calc((100dvh - var(--st) - var(--sb) - 14px) * 7 / 9); }
  #hud { grid-column: 2; grid-row: 1; }
  #orders { grid-column: 2; grid-row: 2; height: auto; flex-wrap: wrap; align-content: flex-start; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; }
  .screen { max-width: 920px; }
  #story .stage { bottom: calc(var(--sbx) + 112px); } #story .dlg { min-height: 104px; padding: 22px 16px 24px; } #story .txt { min-height: 30px; }
  #story .fig.a { left: 18%; } #story .fig.b { right: 18%; }
  #runway { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 12px; }
  .figbox { grid-column: 1; grid-row: 1 / 4; height: 100%; } #runway .rwCard { grid-column: 2; grid-row: 1; } #runway .jury { grid-column: 2; grid-row: 2; height: 100%; min-height: 0; overflow: hidden; } .rwFoot { grid-column: 2; grid-row: 3; }
  #runway .rwCard h2 { font-size: 21px; } .stars { height: 32px; } .stars img { width: 32px; height: 32px; }
  .looks { padding: 6px 20px calc(var(--sbx) + 10px); } .look { width: min(56vw, 400px); display: grid; grid-template-columns: 46% 1fr; grid-template-rows: 1fr auto auto; column-gap: 8px; align-items: center; justify-items: center; }
  .look .pic { grid-row: 1 / 4; height: 100%; } .look h3 { align-self: end; font-size: 19px; } .look .needs { margin-bottom: 6px; } .look .btn { align-self: start; padding: 0 14px; font-size: 15px; min-height: 42px; }
  #wish { display: none; }
  .chooseHead { padding-top: 8px; } .chooseHead h2 { font-size: 20px; margin: 0 0 4px; } .chooseHead p { display: none; }
}
@media (orientation: landscape) and (max-height: 560px) { /* sideways inside OhMyGames: a round pill sits bottom centre, a small tab top centre, the page bar lies over the top until play starts */
  html.in-frame #hud { padding-left: max(0px, calc(50vw + 8px - (100dvh - var(--st) - var(--sb) - 14px) * 7 / 9)); }   /* clear the page's top-centre tab */
  html.in-frame #title .titleCard { top: 64px; }
}
@media (orientation: portrait) and (max-height: 700px) { /* short phones (and phones inside the OhMyGames page): slimmer strips, bigger mat */
  #hud { height: 42px; gap: 4px; } .pill { height: 32px; font-size: 15px; } .pill img { width: 30px; height: 30px; } .round { width: 36px; height: 36px; }
  #hud .info { height: 40px; } #info img { width: 34px; height: 34px; } #info small { -webkit-line-clamp: 1; }
  #orders { height: 84px; padding: 3px 3px 5px; } .card { height: 76px; padding: 4px 6px; } .need { width: 40px; height: 40px; } .need img { width: 37px; height: 37px; }
  .card.client .face { width: 48px; height: 66px; } .card.client .lookName { left: 58px; font-size: 12px; } .card .needs { margin-top: 10px; } .reward { margin-top: 10px; }
}
