/* Lone Throne on wide screens (iPad, the Duo's inner screen). Nov 26, 2026. Contract: docs/ipad-duo/GAME-WORKER-GUIDE.md.
   Only in --wide builds, linked last with the gate's media query; every rule starts with html.tc-wide, so a phone (and the
   Duo's outer screen, below the gate) never applies a line. Level "column" (game.json), root #app.
   The cards, slots, deck tray and wood are placed by computeLayoutWide() in index.html, which leaves its numbers here as
   --ltw-* variables on #table (dock, tray, Auto-finish) and --ltw-side on #app (the console's width).
     tall (iPad portrait)   the phone's stack (top bar, table, bottom bar), edge to edge, bigger buttons and figures.
     wide (iPad landscape)  the table fills the screen; down its thumb side a wooden console: the frame's top bar,
                            Moves and Time, New deal and Undo, and at its foot the deck tray. tcw-left mirrors it.
     fold (Duo inner)       the same as wide (Scott, Nov 26: ignore the hinge): the columns use the full width beside the console.
                            computeLayoutWide() lays it out as wide; the pop-ups still sit on the console's side.
   The page's own pop-up sheets (victory, no moves left) are centred and roomier; in fold they sit on the console's half. */

/* ------------------------------------------------------------------ every wide mode */
/* the column is the whole window (the cards are capped at 120 px, so there is no runaway size) */
html.tc-wide #app { max-width: none !important; width: 100%; }
/* 52 px controls in the bottom bar (the unified frame's plates; Nov 29, 2026). The top bar keeps the frame's 44 pt sizes. */
html.tc-wide #app .bottombar > .tcf-actions > .tcf-plate { --bh: 52px; font-size: 16px; }
html.tc-wide #app .bottombar > .tcf-actions > [data-act="undo"] { min-width: 112px; }
html.tc-wide #app .stat small { font-size: 12px !important; }
html.tc-wide #app .stat b { font-size: 25px; }

/* the dock (wood) and the tray (felt pocket) from computeLayoutWide(); beats the phone's inline sizes */
html.tc-wide #table > #dockBar { left: var(--ltw-dl, 0px) !important; top: var(--ltw-dt, auto) !important; right: auto !important; bottom: auto !important;
  width: var(--ltw-dw, 100%) !important; height: var(--ltw-dh, 0px) !important; }
html.tc-wide #table > #tray { left: var(--ltw-tl, 0px) !important; top: var(--ltw-tt, auto) !important; right: auto !important; bottom: auto !important;
  width: var(--ltw-tw, 0px) !important; height: var(--ltw-th, 0px) !important; }
html.tc-wide #table > #autoBtn { left: var(--ltw-ax, 50%) !important; bottom: var(--ltw-ab, 12px) !important; min-height: 52px !important; font-size: 18px; padding: 8px 26px; white-space: nowrap; }

/* ------------------------------------------------------------------ tall: the phone stack, bigger */
html.tc-wide.tcw-tall #app { gap: 12px; padding-left: calc(env(safe-area-inset-left) + 12px); padding-right: calc(env(safe-area-inset-right) + 12px); }
html.tc-wide.tcw-tall #app > .tcf-bar { padding: 0 12px; }   /* 12 + 12 = 24 from the screen edge (iPad margins) */
html.tc-wide.tcw-tall #app > .bottombar { padding: 0 12px; }
html.tc-wide.tcw-tall #app > .bottombar > .tcf-actions { gap: 12px; }
/* left-handed: the tray sits at the bottom left, so its rounded corner is the top right one */
html.tc-wide.tcw-tall.tcw-left #table > #tray { border-top-left-radius: 0; border-top-right-radius: 12px; border-bottom-right-radius: 0; border-bottom-left-radius: inherit; }

/* ------------------------------------------------------------------ wide and fold: the table + the console on the thumb side */
html.tc-wide:is(.tcw-wide, .tcw-fold) #app {
  display: grid !important; grid-template-columns: minmax(0, 1fr) var(--ltw-side, 260px);
  grid-template-rows: auto auto minmax(0, 1fr); gap: 0; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app { grid-template-columns: var(--ltw-side, 260px) minmax(0, 1fr); }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > #rim { grid-column: 1 / -1; grid-row: 1 / -1; }
/* the top bar and the bottom bar sit on the console's wood (no node moves: grid placement only) */
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .tcf-bar,
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar { grid-column: 2; position: relative; z-index: 3; min-width: 0; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .tcf-bar,
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .bottombar { grid-column: 1; }
/* the frame's top bar on the console: the name plaque on a row of its own, then Back on the left and Help, Menu on the right */
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .tcf-bar { grid-row: 1; height: auto; flex-wrap: wrap; row-gap: 8px; margin: 0 5px 0 0; padding: 16px 14px 0; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .tcf-bar { margin: 0 0 0 5px; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .tcf-bar > .tcf-title { order: -1; flex: 1 1 100%; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .tcf-bar > .tcf-back { margin-right: auto; }
/* Moves | Time over New deal | Undo, on the skin's well (its ::before) inset into the wood; Undo on the outer (thumb) edge, New deal on the inner one */
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar { grid-row: 2; align-self: start; margin: 16px 15px 0 10px; padding: 14px; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar > .tcf-actions {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 10px; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .bottombar { margin: 16px 10px 0 15px; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar > .tcf-actions > .stat { grid-row: 1; padding: 8px 0 7px; border-radius: 10px;
  background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1px rgba(224, 180, 76, .28); }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar > .tcf-actions > .stat + .stat::before { display: none; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar > .tcf-actions > [data-act="new"] { grid-row: 2; grid-column: 1; width: 100%; min-width: 0; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #app > .bottombar > .tcf-actions > [data-act="undo"] { grid-row: 2; grid-column: 2; width: 100%; min-width: 0; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .bottombar > .tcf-actions > [data-act="new"] { grid-column: 2; }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #app > .bottombar > .tcf-actions > [data-act="undo"] { grid-column: 1; }
/* the console: the dock's wood, full height, with a shadow on its inner edge; the tray pocket at its foot */
html.tc-wide:is(.tcw-wide, .tcw-fold) #table > #dockBar { border-radius: 0; box-shadow: -2px 0 0 #1d1208, -12px 0 18px -8px rgba(0, 0, 0, .55); }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #table > #dockBar { box-shadow: 2px 0 0 #1d1208, 12px 0 18px -8px rgba(0, 0, 0, .55); }
html.tc-wide:is(.tcw-wide, .tcw-fold).tcw-left #table > #tray { border-top-left-radius: 0; border-top-right-radius: 12px; border-bottom-right-radius: 0; border-bottom-left-radius: inherit; }
html.tc-wide:is(.tcw-wide, .tcw-fold) #table > #autoBtn { z-index: 900; }

/* ------------------------------------------------------------------ pop-up sheets: centred and roomier */
html.tc-wide .overlay { align-items: center; padding: 24px; }
html.tc-wide .overlay > .sheet:not(#\9#\9#\9) { max-width: 600px; padding: 26px 28px calc(env(safe-area-inset-bottom) + 24px); gap: 16px; border-radius: 20px; }
html.tc-wide .overlay > .sheet h2 { font-size: 34px; }
html.tc-wide .overlay > .sheet .note { font-size: 15px; }
html.tc-wide .overlay > .sheet .tcf-plate { --bh: 56px; font-size: 17px; }
html.tc-wide .overlay .statsline b { font-size: 24px; }
html.tc-wide .overlay .statsline small:not(#\9#\9#\9) { font-size: 12px; }
html.tc-wide .overlay .bigstats b { font-size: 40px; }
html.tc-wide .overlay .bigstats small:not(#\9#\9#\9) { font-size: 13px; }
html.tc-wide .overlay .wincrest svg { width: 96px; height: 96px; }
/* fold: on the console's half of the screen, clear of the hinge */
html.tc-wide.tcw-fold .overlay { justify-content: flex-end; padding: 12px 16px; }
html.tc-wide.tcw-fold.tcw-left .overlay { justify-content: flex-start; }
html.tc-wide.tcw-fold .overlay > .sheet:not(#\9#\9#\9) { max-width: calc((var(--tcw-w) - var(--tcw-hinge-w)) / 2 - 32px); padding: 18px 18px calc(env(safe-area-inset-bottom) + 16px); gap: 12px; }
html.tc-wide.tcw-fold .overlay > .sheet h2 { font-size: 28px; }
/* the victory banner over the columns' half; the toast over the console's half */
html.tc-wide.tcw-fold #fxText { left: 0; right: auto; width: var(--tcw-hinge-x); font-size: 64px; }
html.tc-wide.tcw-fold.tcw-left #fxText { left: calc(var(--tcw-hinge-x) + var(--tcw-hinge-w)); right: 0; width: auto; }
html.tc-wide.tcw-fold #toast { left: calc(var(--tcw-hinge-x) + var(--tcw-hinge-w) + (var(--tcw-w) - var(--tcw-hinge-x) - var(--tcw-hinge-w)) / 2); max-width: 40vw; }
html.tc-wide.tcw-fold.tcw-left #toast { left: calc(var(--tcw-hinge-x) / 2); }
/* (tall, left-handed) Undo under the left thumb, New deal at the far right */
html.tc-wide.tcw-tall.tcw-left #app > .bottombar > .tcf-actions { flex-direction: row-reverse; }
