/* 3950: the Buy window, two offers, drawn from Scenario kit part 1 (buy-window.mjs).
   The art is the window: the portrait art on a portrait screen, the landscape art on a landscape one,
   contained in the safe area at one scale (--buyw-s, CSS px per art px) and centred over a dim backdrop.
   Everything on it is placed in art pixels times that scale (or percentages of the art box), so it
   follows the art; touch targets never go under 44 px and text never under 12 px (prices 14 px).
   In landscape the stage is the art plus a strip below it (180 art px) for the controls and the note.
   On a screen shorter than the art's own proportions allow, the scale also leaves room below the cards
   for the controls' 44 px minimum and the note (the third term of --buyw-s), and the stage grows to hold them. */
@property --buyw-s { syntax: '<length>'; inherits: true; initial-value: 0px; }

.lantern-buyw {
  position: fixed; inset: 0; box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; outline: none; overflow: hidden; background: var(--l07-colour-044); color: var(--l07-colour-190);
  font-family: var(--l07-font-display); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: var(--l07-colour-044);
  --select-safe-top: env(safe-area-inset-top, 0px); --select-safe-right: env(safe-area-inset-right, 0px);
  --select-safe-bottom: env(safe-area-inset-bottom, 0px); --select-safe-left: env(safe-area-inset-left, 0px);
}
.lantern-buyw:not([open]) { display: none; }
.lantern-buyw::backdrop { background: var(--l07-colour-206); }
.lantern-buyw__form {
  position: absolute; inset: 0; box-sizing: border-box; margin: 0; display: grid; place-items: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  /* 3977 (FAC-10): its own size as px (app.mjs keeps them; no container query, which Safari 15.4 drops) */
  --buyw-cw: 100vw; --buyw-ch: 100vh;
}
.lantern-buyw__stage {
  --buyw-s: min(calc(var(--buyw-cw) / 1080), calc(var(--buyw-ch) / 2340), calc((var(--buyw-ch) - 160px) / 1634), 1px);
  --buyw-r: max(48px, calc(var(--buyw-s) * 150));
  --buyw-row: calc(var(--buyw-s) * 1668);
  position: relative; width: calc(var(--buyw-s) * 1080); height: max(calc(var(--buyw-s) * 2340), calc(var(--buyw-s) * 1634 + 160px));
}
.lantern-buyw__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* The spoken bet and price after a change: read by screen readers, never drawn. */
.lantern-buyw__sr[data-buy-status] { opacity: 0; }

/* The art, and a copy of each card cut to the card's outline: the chosen card glows, the other dims. */
.lantern-buyw__art, .lantern-buyw__card { background: var(--buyw-art-p) center / contain no-repeat; }
.lantern-buyw__art { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--buyw-s) * 2340); }
.lantern-buyw__glows, .lantern-buyw__glow, .lantern-buyw__card { position: absolute; inset: 0; pointer-events: none; }
.lantern-buyw__card { clip-path: var(--clip-p); filter: brightness(.55) saturate(.7); transition: filter .18s ease; }
.lantern-buyw__glow { transition: filter .18s ease; }
.lantern-buyw__glow[data-chosen] { filter: drop-shadow(0 0 max(3px, calc(var(--buyw-s) * 9)) var(--l07-colour-207)) drop-shadow(0 0 max(8px, calc(var(--buyw-s) * 30)) var(--l07-colour-208)); }
.lantern-buyw__glow[data-chosen] .lantern-buyw__card { filter: none; }
.lantern-buyw__glow[data-unavailable] .lantern-buyw__card { filter: grayscale(1) brightness(.38); }

/* The cards: each is a radio button over its card, with its price on the card's plate. */
.lantern-buyw__offers { position: absolute; inset: 0; }
.lantern-buyw__offer, .lantern-buyw__plate-box { position: absolute; left: var(--px); top: var(--py); width: var(--pw); height: var(--ph); }
.lantern-buyw__offer {
  box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: calc(var(--buyw-s) * 30);
  background: var(--l07-colour-044); color: inherit; font: inherit; cursor: pointer; touch-action: manipulation;
}
.lantern-buyw__offer[aria-disabled="true"] { cursor: default; }
.lantern-buyw__plate-box { display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0; } /* 3955: the box is the plate's clear area */
.lantern-buyw__price, .lantern-buyw__unavailable {
  white-space: nowrap; line-height: 1; letter-spacing: .02em; font-weight: 700;
  text-shadow: 0 1px 2px var(--l07-colour-209), 0 0 8px var(--l07-colour-210);
}
.lantern-buyw__price { font-size: clamp(14px, calc(var(--buyw-s) * 64), 64px); color: var(--l07-colour-211); font-variant-numeric: lining-nums tabular-nums; }
.lantern-buyw__offer[aria-checked="false"] .lantern-buyw__price { color: var(--l07-colour-212); }
.lantern-buyw__offer[data-short] .lantern-buyw__price { color: var(--l07-colour-213); }
.lantern-buyw__unavailable { font-size: clamp(12px, calc(var(--buyw-s) * 40), 40px); color: var(--l07-colour-214); }
.lantern-buyw__unavailable[hidden] { display: none; }

/* BET: - and + around the game's drop-down, drawn as the kit's BET plate and the round caret. */
.lantern-buyw__bet {
  position: absolute; left: 0; width: 100%; top: var(--buyw-row); height: var(--buyw-r);
  display: flex; align-items: center; justify-content: center; gap: max(4px, calc(var(--buyw-s) * 18));
}
.lantern-buyw__round, #buyDialog .lantern-buyw__bet .lantern-select329__caret {
  flex: none; box-sizing: border-box; width: var(--buyw-r); height: var(--buyw-r); aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: var(--buyw-round) no-repeat; background-size: var(--buyw-sprite-size); background-position: var(--buyw-sprite-pos);
}
.lantern-buyw__round { cursor: pointer; touch-action: manipulation; }
#buyDialog .lantern-buyw__bet .lantern-select329 { flex: none; display: flex; }
#buyDialog .lantern-buyw__bet .lantern-select329__button {
  flex: none; display: flex; align-items: center; gap: max(2px, calc(var(--buyw-s) * 8)); min-width: 0; min-height: 0; height: var(--buyw-r);
  margin: 0; padding: 0; border: 0; border-radius: calc(var(--buyw-r) / 2); background: none; color: var(--l07-colour-215);
  font: inherit; letter-spacing: 0; cursor: pointer; touch-action: manipulation;
}
.lantern-buyw__plate { position: relative; flex: none; width: calc(var(--buyw-r) * 3); height: var(--buyw-r); background: var(--buyw-plate) center / contain no-repeat; }
.lantern-buyw__plate-text {
  position: absolute; /* 3955: left, top, width and height: the bet plate's clear area (buy-window.mjs) */
  display: flex; align-items: center; justify-content: center; gap: .4em; white-space: nowrap;
  font-size: clamp(13px, calc(var(--buyw-r) * .31), 44px); line-height: 1; text-shadow: 0 1px 2px var(--l07-colour-209);
}
.lantern-buyw__bet-label { font-size: max(12px, .78em); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--l07-colour-216); }
#buyDialog .lantern-buyw__plate-text .lantern-select329__value { font-size: inherit !important; line-height: 1 !important; overflow: visible; font-weight: 700; color: var(--l07-colour-215); font-variant-numeric: lining-nums tabular-nums; }
.lantern-buyw__round:disabled, #buyDialog .lantern-buyw__bet .lantern-select329--disabled .lantern-select329__button {
  filter: grayscale(1); opacity: 1; cursor: default;
}

/* The note, or the refusal in its place. */
.lantern-buyw__line {
  position: absolute; left: 50%; width: max(90%, min(var(--buyw-cw) - 16px, 300px)); translate: -50% 0; margin: 0; text-align: center;
  top: calc(var(--buyw-row) + var(--buyw-r) + max(6px, calc(var(--buyw-s) * 22)));
  font-size: clamp(12px, calc(var(--buyw-s) * 36), 30px); line-height: 1.3; font-weight: 700; letter-spacing: .02em;
  color: var(--l07-colour-190); text-shadow: 0 1px 2px var(--l07-colour-039), 0 0 6px var(--l07-colour-217);
}
.lantern-buyw__refusal { color: var(--l07-colour-218); }
.lantern-buyw__line[hidden], .lantern-buyw__stage[data-refused] .lantern-buyw__note { display: none; }

/* CANCEL and CONFIRM: the kit's plates; the words are in the art. */
.lantern-buyw__actions {
  position: absolute; left: 0; width: 100%;
  top: max(calc(var(--buyw-s) * 2045), calc(var(--buyw-row) + var(--buyw-r) + max(6px, calc(var(--buyw-s) * 22)) + 3.9 * clamp(12px, calc(var(--buyw-s) * 36), 30px) + 6px));
  display: flex; justify-content: center; gap: max(12px, calc(var(--buyw-s) * 56));
}
.lantern-buyw__action {
  flex: none; box-sizing: border-box; height: max(44px, calc(var(--buyw-s) * 200)); aspect-ratio: var(--buyw-ratio);
  margin: 0; padding: 0; border: 0; border-radius: calc(var(--buyw-s) * 60); cursor: pointer; touch-action: manipulation;
  background: var(--buyw-actions) no-repeat; background-size: var(--buyw-sprite-size); background-position: var(--buyw-sprite-pos);
}
.lantern-buyw__action:disabled { cursor: default; }
 .lantern-buyw__action:disabled:not([aria-busy="true"]) { filter: grayscale(1); opacity: 1; }
.lantern-buyw__action[aria-busy="true"] { animation: lantern-buyw-busy .9s ease-in-out infinite alternate; }
@keyframes lantern-buyw-busy { from { opacity: 1; filter: brightness(1); } to { opacity: .6; filter: brightness(.8); } }

.lantern-buyw__offer:focus-visible, .lantern-buyw__round:focus-visible, .lantern-buyw__action:focus-visible,
#buyDialog .lantern-buyw__bet .lantern-select329__button:focus-visible { outline: 3px solid var(--l07-colour-219); outline-offset: 2px; }

/* 3977 (FAC-10): what was @container buyw (orientation: landscape), on a wide form (app.mjs data-buyw-landscape) */
  /* 3977 (2.11): the room under the art is 83 px (it was 92): at 568x220 the price plates' clear area (15 px tall) was
     no taller than an 11 px price's line, and the matrix found "15.06" 0.02 px outside it; 83 px gives the plates 7 %
     more, the actions keep 44 px and the line still ends inside the window. */
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
    --buyw-s: min(calc(var(--buyw-cw) / 2340), calc(var(--buyw-ch) / 1260), calc((var(--buyw-ch) - 83px) / 921), 1px);
    --buyw-r: max(48px, calc(var(--buyw-s) * 130));
    --buyw-row: calc(var(--buyw-s) * 921 + max(4px, calc(var(--buyw-s) * 14)));
    width: calc(var(--buyw-s) * 2340); height: max(calc(var(--buyw-s) * 1260), calc(var(--buyw-s) * 921 + 83px));
  }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__art { height: calc(var(--buyw-s) * 1080); }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__art, .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__card { background-image: var(--buyw-art-l); }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__card { clip-path: var(--clip-l); }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__offer, .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__plate-box { left: var(--lx); top: var(--ly); width: var(--lw); height: var(--lh); }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__price { font-size: clamp(14px, calc(var(--buyw-s) * 58), 58px); }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__actions { top: var(--buyw-row); left: 50%; width: max(100%, min(var(--buyw-cw) - 8px, 500px)); translate: -50% 0; justify-content: space-between; box-sizing: border-box; padding: 0 calc(var(--buyw-s) * 60); pointer-events: none; }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__action { height: var(--buyw-r); pointer-events: auto; }
  .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__line { width: max(92%, min(var(--buyw-cw) - 16px, 520px)); top: calc(var(--buyw-row) + var(--buyw-r) + max(4px, calc(var(--buyw-s) * 12))); font-size: clamp(12px, calc(var(--buyw-s) * 34), 30px); }


@media (prefers-reduced-motion: reduce) {
  .lantern-buyw__card, .lantern-buyw__glow { transition: none; }
  .lantern-buyw__action[aria-busy="true"] { animation: none; opacity: .7; }
}

/* z1670: notes retain their words and 19 px floor; scrolling keeps the existing controls reachable. */
.lantern-buyw__line, .lantern-buyw__bet-label, .lantern-buyw__unavailable { font-size:20px !important; }
.lantern-buyw__price { font-size:max(20px,calc(var(--buyw-s)*64)); }
.lantern-buyw__form { overflow:auto; }
.lantern-buyw__line { min-height:50px; }
.lantern-buyw__form[data-buyw-landscape] .lantern-buyw__line { min-height:50px; font-size:20px; }
.lantern-buyw button { min-width:48px; min-height:48px; }

#buyDialog .lantern-select329 { --dd-h:48px; }
#buyDialog .lantern-buyw__stage { min-height:260px; }

/* Existing approved message plaque grows around the unchanged note at its floor. */
.lantern-buyw__stage {
 --buyw-s:min(calc(var(--buyw-cw) / 1080),calc((var(--buyw-ch) - 280px) / 1634),1px);
 display:flex; flex-direction:column; align-items:center; gap:6px;
 height:auto; min-height:0; padding-top:var(--buyw-row); padding-bottom:6px;
}
.lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
 --buyw-s:min(calc(var(--buyw-cw) / 2340),calc((var(--buyw-ch) - 264px) / 921),1px);
 height:auto; min-height:0;
}
.lantern-buyw__bet { position:relative; top:auto; width:max(100%,min(calc(var(--buyw-cw) - 12px),500px)); min-height:48px; }
.lantern-buyw__line, .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__line {
 position:relative; left:auto; top:auto; translate:none; flex:none; box-sizing:border-box;
 width:max(100%,min(calc(var(--buyw-cw) - 16px),740px)); min-height:0;
 padding:6px 10px; border:14px solid transparent;
 border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 14px stretch;
 text-shadow:none; color:#ffeac0;
}
.lantern-buyw__actions, .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__actions {
 position:relative; left:auto; top:auto; translate:none; width:max(100%,min(calc(var(--buyw-cw) - 16px),500px));
 justify-content:center; padding:0; gap:12px; min-height:48px;
}
.lantern-buyw__form { place-items:safe center; }
/* BET and the three existing controls keep the phone's full usable row. */
@media (max-width:400px) {
 #buyDialog .lantern-buyw__bet {
  display:flex; gap:6px; width:max(100%,min(calc(var(--buyw-cw) - 16px),304px));
  align-self:center; height:auto;
 }
 #buyDialog .lantern-buyw__bet .lantern-select329--field { --dd-w:132px !important; --dd-h:48px !important; }
 #buyDialog .lantern-buyw__bet > .lantern-buyw__bet-label {
  flex:none; width:56px; box-sizing:border-box; margin:0;
  border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch;
  padding:0; text-align:center;
 }
}

/* Live lettering on existing approved blank kit pieces keeps inactive controls legible. */
.lantern-buyw__round { background:url(./assets/kit/bar/round-button-backed.87a4219a90af4b81.webp) center/100% 100% no-repeat; }
.lantern-buyw__action { width:max(136px,calc(var(--buyw-r) * 2.84)); aspect-ratio:auto; background:none; border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch; }
.lantern-buyw__control-label { color:#fff4cf; font:700 20px/1 var(--l07-font-display); text-shadow:none; }
.lantern-buyw__round .lantern-buyw__control-label { font-size:26px; -webkit-text-stroke:1px currentColor; }
.lantern-buyw__round:disabled, .lantern-buyw__action:disabled:not([aria-busy="true"]) { filter:grayscale(1); opacity:1; }
/* Reserve the content's actual height rather than allowing the desktop form to scroll. */
@media (min-width:1024px) and (min-height:501px) {
 .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage { --buyw-s:min(calc(var(--buyw-cw) / 2340),calc((var(--buyw-ch) - 304px) / 921),1px); }
}
@media (orientation:landscape) and (max-height:300px) {
 .lantern-buyw__form { align-items:start; }
 .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage { --buyw-s:min(calc(var(--buyw-cw) / 2340),.18px); }
}

/* z1814: show the session balance at selection and retain full currency amounts. */
.lantern-buyw__balance { display:flex; align-items:center; justify-content:center; gap:6px; min-height:48px; width:max(100%,min(calc(var(--buyw-cw) - 12px),500px)); font-size:20px; }
.lantern-buyw__balance strong { padding:6px 12px; min-width:0; white-space:nowrap; background:none; border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch; color:#fff4cf; font-size:20px; }
#buyDialog .lantern-select329--field .lantern-select329__button { padding:0 6px !important; background:none; border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch; box-sizing:border-box; }
#buyDialog .lantern-select329--field .lantern-select329__button::before,
#buyDialog .lantern-select329--field .lantern-select329__button::after { display:none !important; }
#buyDialog .lantern-select329--field .lantern-select329__value { font-size:20px !important; }
@media (orientation:landscape) and (max-height:500px) and (min-width:700px) {
 #buyDialog .lantern-buyw__form { padding:6px; }
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
  --buyw-s:min(calc((var(--buyw-cw) * .55 - 12px) / 2340),calc((var(--buyw-ch) - 72px) / 1080));
  display:grid; grid-template-columns:55% minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr) auto; column-gap:6px; row-gap:6px;
  width:100%; height:100%; padding:0; min-height:0; box-sizing:border-box;
 }
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__art { grid-area:1/1/5/2; position:relative; align-self:start; justify-self:center; width:calc(var(--buyw-s)*2340); height:calc(var(--buyw-s)*1080); }
 #buyDialog .lantern-buyw__balance { grid-area:1/2; width:100%; flex-wrap:wrap; gap:0 6px; }
 #buyDialog .lantern-buyw__bet { grid-area:2/2; width:100%; gap:6px; }
 #buyDialog .lantern-buyw__bet > .lantern-buyw__bet-label { display:none; }
 #buyDialog .lantern-buyw__bet .lantern-select329--field { flex:1; min-width:0; --dd-w:100% !important; }
 #buyDialog .lantern-buyw__bet .lantern-select329__button { width:100%; }
 #buyDialog .lantern-buyw__line { grid-area:3/2; align-self:center; width:100%; padding:4px; border-width:6px; border-image-width:6px; font-size:20px !important; }
 #buyDialog .lantern-buyw__actions { grid-area:4/2; width:100%; gap:6px; }
 #buyDialog .lantern-buyw__action { flex:1; min-width:0; width:0; height:48px; }
 #buyDialog .lantern-buyw__plate-box { top:100% !important; left:0 !important; width:100% !important; height:48px !important; margin-top:6px; padding:0 6px; border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch; }
 #buyDialog .lantern-buyw__price { color:#fff4cf !important; text-shadow:none; }
}

#buyDialog .lantern-buyw__balance { flex-wrap:nowrap; }
#buyDialog .lantern-buyw__balance strong { flex:0 1 auto; width:auto !important; height:48px !important; min-height:48px; box-sizing:border-box; padding:0 12px; }
/* Currency prices use the same approved amount backing at the standing floor. */
#buyDialog .lantern-buyw__plate-box { left:0 !important; top:auto !important; bottom:0; width:100% !important; height:48px !important; box-sizing:border-box; padding:0 6px; border:6px solid transparent; border-image:url(./assets/plaque/plaque.50cea69a7fb7a4ff.webp) 60 fill / 6px stretch; }
#buyDialog .lantern-buyw__price { color:#fff4cf !important; text-shadow:none; }
#buyDialog .lantern-buyw__form:not([data-buyw-landscape]) { align-items:start; padding:6px; }
#buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__stage { --buyw-s:min(calc((var(--buyw-cw) - 12px) / 1080),.5px); width:calc(var(--buyw-s)*1080); padding-top:0; }
#buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__art { position:relative; flex:none; height:calc(var(--buyw-s)*2340); }
@media (orientation:landscape) and (max-height:500px) and (min-width:700px) {
 #buyDialog .lantern-buyw__plate-box { top:100% !important; bottom:auto; }
}

/* At the shortest landscape sizes the existing balance and art share the left
   region; the bet, offer/refusal line and actions have the full right height. */
@media (orientation:landscape) and (max-height:500px) and (max-width:699px) {
 #buyDialog .lantern-buyw__form { padding:2px; overflow:hidden; }
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
  --buyw-s:calc((var(--buyw-cw)*.55 - 6px)/2340);
  width:100%; height:100%; padding:0; min-height:0; display:grid;
  grid-template-columns:minmax(0,55%) minmax(0,1fr); grid-template-rows:48px minmax(0,1fr) 48px; gap:6px;
 }
 #buyDialog .lantern-buyw__art { grid-area:1/1/4/2; position:relative; width:100%; height:100%; background-position:center; }
 #buyDialog .lantern-buyw__balance { position:absolute; left:0; top:0; width:55%; min-height:48px; height:48px; font-size:20px; gap:6px; z-index:2; }
 #buyDialog .lantern-buyw__balance strong { padding:0 6px; }
 #buyDialog .lantern-buyw__offers { top:48px; }
 #buyDialog .lantern-buyw__offer { top:0 !important; height:100% !important; width:50% !important; left:0 !important; }
 #buyDialog .lantern-buyw__offer:nth-child(2) { left:50% !important; }
 #buyDialog .lantern-buyw__plate-box { left:3px !important; right:3px !important; top:auto !important; bottom:0; width:calc(100% - 6px) !important; margin:0; }
 #buyDialog .lantern-buyw__bet { grid-area:1/2; width:100%; gap:6px; }
 #buyDialog .lantern-buyw__bet-label { display:none; }
 #buyDialog .lantern-buyw__bet .lantern-select329--field { flex:1; min-width:0; --dd-w:100% !important; }
 #buyDialog .lantern-buyw__line { grid-area:2/2; width:100%; padding:0 2px; border-width:6px; border-image-width:6px; line-height:1.1; align-self:center; }
 #buyDialog .lantern-buyw__actions { grid-area:3/2; width:100%; gap:6px; }
 #buyDialog .lantern-buyw__action { flex:1; width:0; min-width:0; height:48px; }
}
@media (min-width:1024px) and (min-height:501px) {
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage { --buyw-s:min(calc(var(--buyw-cw) / 2340),calc((var(--buyw-ch) - 360px) / 921),1px); }
}
#buyDialog [data-buy-refusal] { font-size:20px !important; }

/* z1849 G1/G2: art participates in flow before BALANCE. Portrait uses the
   approved landscape offer composition so both cards and all purchase rows
   remain on the same screen, including Safari's shorter visual viewport. */
#buyDialog { background:var(--l07-colour-175); }
#buyDialog .lantern-buyw__form { overflow:auto; align-items:start; padding:6px; }
#buyDialog .lantern-buyw__stage {
 --buyw-s:min(calc((var(--buyw-cw) - 12px) / 2340),calc((var(--buyw-ch) - 320px) / 1080),1px);
 width:calc(var(--buyw-s)*2340); height:auto; min-height:0; padding:0;
 flex:none; gap:6px; box-sizing:border-box;
}
@media (min-height:501px) {
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
  --buyw-s:min(calc((var(--buyw-cw) - 12px) / 2340),calc((var(--buyw-ch) - 320px) / 1080),1px);
  padding:0;
 }
}
#buyDialog .lantern-buyw__art {
 position:relative; flex:none; width:100%; height:calc(var(--buyw-s)*1080);
 background-image:var(--buyw-art-l);
}
#buyDialog .lantern-buyw__card { background-image:var(--buyw-art-l); clip-path:var(--clip-l); }
#buyDialog .lantern-buyw__offer { left:var(--lx); top:var(--ly); width:var(--lw); height:var(--lh); }
#buyDialog .lantern-buyw__balance, #buyDialog .lantern-buyw__bet,
#buyDialog .lantern-buyw__line, #buyDialog .lantern-buyw__actions { flex:none; }
@media (orientation:portrait) {
 #buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__stage {
  --buyw-s:calc((var(--buyw-cw) - 12px) / 2340); width:calc(var(--buyw-cw) - 12px); padding:0;
 }
 #buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__art { height:calc(var(--buyw-s)*1080); }
 #buyDialog .lantern-buyw__balance, #buyDialog .lantern-buyw__bet,
 #buyDialog .lantern-buyw__line, #buyDialog .lantern-buyw__actions { width:100%; }
 #buyDialog .lantern-buyw__offer { min-height:48px; }
 #buyDialog .lantern-buyw__actions { gap:6px; }
 #buyDialog .lantern-buyw__action { min-width:0; flex:1; width:auto; height:48px; }
 #buyDialog .lantern-buyw__plate-box {
  left:calc(var(--buyw-s) * -464 + 3px) !important;
  width:calc(var(--buyw-s) * 1170 - 6px) !important;
 }
 #buyDialog .lantern-buyw__offer:nth-child(2) .lantern-buyw__plate-box { left:calc(var(--buyw-s) * -90 + 3px) !important; }
}

/* Price backings share the two clear halves of the existing landscape art
   column, independently of the narrower illustrated card hit areas. */
@media (orientation:landscape) and (max-height:500px) and (min-width:700px) {
 #buyDialog .lantern-buyw__plate-box { left:calc(var(--buyw-s) * -464 + 3px) !important; width:calc(var(--buyw-s) * 1170 - 6px) !important; }
 #buyDialog .lantern-buyw__offer:nth-child(2) .lantern-buyw__plate-box { left:calc(var(--buyw-s) * -90 + 3px) !important; }
}

/* At narrow landscape widths the balance has its own top row, followed
   by the uniformly scaled existing offer art. */
@media (orientation:landscape) and (max-height:500px) and (max-width:699px) {
 #buyDialog .lantern-buyw__art { align-self:start; margin-top:54px; }
}

/* Keep the purchase controls at their existing minimum usable size as the
   desktop offer illustration grows; the reserved rows remain in view. */
#buyDialog .lantern-buyw__stage { --buyw-r:48px; }
#buyDialog .lantern-buyw__action { height:48px; }

/* Late R02-CDX-01 uses the existing desktop button lettering floor. */
@media (pointer:fine) {
 #buyDialog .lantern-buyw__action .lantern-buyw__control-label { font-size:20px; }
}

/* The inherited percentage art padding cannot enlarge this flow row. */
#buyDialog .lantern-buyw__balance > strong.kit-plate.kit-plate--meter {
 padding:0 12px !important; aspect-ratio:auto !important; background:none !important;
 height:48px !important; min-height:48px !important; max-height:48px !important;
}

/* Round07: six pixels between targets; the unchanged card illustration keeps
   its proportions while existing offer names are repeated as readable text. */
#buyDialog .lantern-buyw__bet { gap:6px !important; }
@media (orientation:landscape) and (max-height:500px) {
 #buyDialog .lantern-buyw__offer { width:calc(50% - 3px) !important; }
 #buyDialog .lantern-buyw__offer:nth-child(2) { left:calc(50% + 3px) !important; }
}
#buyDialog .lantern-buyw__name { display:block; font:700 20px/22px var(--l07-font-display); white-space:normal; overflow-wrap:normal; text-align:center; }
#buyDialog .lantern-buyw__plate-box { display:flex; flex-direction:column; justify-content:center; gap:6px; padding:4px; box-sizing:border-box; height:auto !important; min-height:96px; top:0 !important; }
#buyDialog .lantern-buyw__price { flex:none; font-size:20px !important; line-height:24px; }

/* The enlarged landscape card targets and price/name backings share each
   half of the existing art column, with a six-pixel gutter. */
@media (orientation:landscape) and (max-height:500px) {
 #buyDialog .lantern-buyw__offer:first-child { left:0 !important; }
 #buyDialog .lantern-buyw__offer .lantern-buyw__plate-box { left:3px !important; width:calc(100% - 6px) !important; }
}

/* Bound the existing label backing; keep original card artwork visible. */

#buyDialog .lantern-buyw__plate-box { flex-direction:column; height:96px !important; min-height:96px; top:auto !important; bottom:0; padding:4px; }
#buyDialog .lantern-buyw__name { position:static; display:block; font:700 20px/22px var(--l07-font-display); white-space:normal; text-align:center; }
@media (orientation:portrait) {
 #buyDialog .lantern-buyw__art { margin-bottom:102px; }
 #buyDialog .lantern-buyw__offer::before { content:""; position:absolute; left:calc(var(--buyw-s)*24); right:calc(var(--buyw-s)*24); top:calc(var(--buyw-s)*32); height:calc(var(--buyw-s)*58); background:var(--l07-colour-175); pointer-events:none; }
 #buyDialog .lantern-buyw__plate-box { top:100% !important; bottom:auto; }
}

@media (orientation:landscape) and (min-height:501px) {
 #buyDialog .lantern-buyw__offer::before { content:""; position:absolute; left:calc(var(--buyw-s)*24); right:calc(var(--buyw-s)*24); top:calc(var(--buyw-s)*32); height:calc(var(--buyw-s)*58); background:var(--l07-colour-175); pointer-events:none; }
}

@media (orientation:portrait) and (max-height:600px) {
 #buyDialog .lantern-buyw__line { padding:2px 4px !important; letter-spacing:normal; }
}

/* #36: reserve one note row in either state so every purchase control stays put. */
#buyDialog .lantern-buyw__line {
 height:110px; min-height:110px; max-height:110px; line-height:22px;
 display:flex; align-items:center; justify-content:center; padding:0 6px;
 letter-spacing:normal;
}
#buyDialog .lantern-buyw__line[hidden],
#buyDialog .lantern-buyw__stage[data-refused] .lantern-buyw__note { display:none; }
#buyDialog .lantern-buyw__offer { min-width:48px; min-height:48px; }
#buyDialog .lantern-buyw__round { border-radius:0; }
@media (orientation:portrait) and (max-height:600px) {
 #buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__stage {
  --buyw-s:min(calc((var(--buyw-cw) - 12px) / 2340),calc((var(--buyw-ch) - 420px) / 1080));
  width:calc(var(--buyw-cw) - 12px);
 }
 #buyDialog .lantern-buyw__form:not([data-buyw-landscape]) .lantern-buyw__art {
  width:calc(var(--buyw-s)*2340); align-self:center;
 }
}
/* Short landscape shares the full width for the message, below separate
   purchase and offer rows. All existing artwork retains its aspect ratio. */
@media (orientation:landscape) and (max-height:500px) {
 #buyDialog .lantern-buyw__form { padding:6px; overflow:hidden; }
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__stage {
  --buyw-s:calc((var(--buyw-cw)*.5 - 3px)/2340);
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-template-rows:60px minmax(80px,1fr) 56px; gap:6px;
  width:100%; height:100%; min-height:0; padding:0;
 }
 #buyDialog .lantern-buyw__balance { grid-area:1/1; position:relative; left:auto; top:auto; width:100%; height:60px; min-height:60px; }
 #buyDialog .lantern-buyw__art {
  grid-area:2/1; position:relative; align-self:stretch; width:100%; height:100%; margin:0 !important;
  background-position:center; background-size:contain;
 }
 #buyDialog .lantern-buyw__offers { top:0; }
 #buyDialog .lantern-buyw__offer { top:0 !important; height:100% !important; width:calc(50% - 3px) !important; left:0 !important; }
 #buyDialog .lantern-buyw__offer:nth-child(2) { left:calc(50% + 3px) !important; }
 #buyDialog .lantern-buyw__plate-box {
  top:auto !important; bottom:0; left:0 !important; width:100% !important;
  height:80px !important; min-height:80px; padding:2px; gap:2px;
 }
 #buyDialog .lantern-buyw__bet { grid-area:1/2; align-self:center; width:100%; height:60px; }
 #buyDialog .lantern-buyw__bet-label { display:none; }
 #buyDialog .lantern-buyw__line {
  grid-area:3/1/4/3; align-self:stretch; width:100%; height:56px; min-height:56px; max-height:56px;
  padding:0 4px !important; border-width:6px 6.428571429px; border-image-width:6px 6.428571429px;
 }
 #buyDialog .lantern-buyw__actions { grid-area:2/2; align-self:center; width:100%; gap:6px; }
 #buyDialog .lantern-buyw__action { flex:1; min-width:48px; width:0; height:48px; }
}
/* Retain the same grid area when the inherited wide-phone selector matches. */
@media (orientation:landscape) and (max-height:500px) {
 #buyDialog .lantern-buyw__form[data-buyw-landscape] .lantern-buyw__art {
  grid-area:2/1; align-self:stretch; width:100%; height:100%; margin:0 !important;
 }
}
