/* Touch screens (an iPad, a phone). Loaded last by index.html. The rules under html.touch apply only
   when ui.js has seen that the page is used by touch; a mouse on a desktop sees none of them. */

/* The page itself never scrolls, rubber-bands or grows wider than the window: the table is scaled to fit
   (ui.js). Without position:fixed a phone or tablet browser widens the page to the table's unscaled 1440. */
html,body{position:fixed;inset:0;width:100%;overscroll-behavior:none}

/* ---------- the narrower table a touch screen may have (1200 wide at the least, ui.js) */
/* The lobby gives its two side columns a little less, so the six bloc cards keep their figures. */
html.touch .lb{grid-template-columns:232px minmax(0,1fr) 296px;gap:12px}
html.touch .lb-felt{padding:12px 12px 8px}
html.touch .lb-cards{gap:9px}
html.touch .lb-card{padding:8px 9px 10px}
html.touch .lb-stat{grid-template-columns:50px minmax(0,1fr)}
html.touch .lb-stat>span{gap:5px}
html.touch .lb-card-h b{font-size:15.5px;letter-spacing:.02em}
html.touch .lb-play{font-size:12.5px;letter-spacing:.04em}
html.touch .lb-none{font-size:11px}
/* The pad is narrower: its LEFT and EXPECTED labels take less, so the five figures do not run into each other. */
html.touch .pad-f{grid-template-columns:58px repeat(5,minmax(0,1fr));padding-left:10px;padding-right:6px}
html.touch .pad-f .pv{gap:2px;padding-left:4px;overflow:hidden}
html.touch .pad-f .pv b{font-size:12px;letter-spacing:-.01em}
html.touch .pad-f .pl.est~.pv b:before{content:"≈"}

/* A tablet held upright: the lobby stands in the whole window, as the table does (play.css, --play-h). */
html.touch #table:has(#lobby),html.touch #stage:has(#lobby){height:var(--stage-h,900px)}
html.touch #stage:has(#lobby){background-size:100% var(--stage-h,900px)}

/* ---------- every touch screen */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* No double-tap zoom and no 300 ms wait on the table; the map does its own pinch and pan (svg.map). */
html.touch #table{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
/* A long press on a control or a sign reads its tip (ui.js): it never selects words or brings up the
   browser's callout. Text in reports, help and inputs can still be selected. */
html.touch button,html.touch [data-act],html.touch [data-k],html.touch [data-o],html.touch [data-tip],html.touch [data-order],
html.touch .pad li,html.touch .sc,html.touch .tool,html.touch .mini,html.touch .btn,html.touch svg{
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html.touch input,html.touch textarea{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}

/* A press shows at once under the finger (a finger has no hover to say "this one"). */
html.touch button:not(:disabled):active,html.touch .pad li[data-order]:active,html.touch .sc[data-act]:active{filter:brightness(.92)}

/* The tip, for a finger: larger (ui.js scales it to read at its designed size), and with a small pointer
   at the thing it explains. data-side says whether it stands above or below that thing. */
.tip[data-side]{box-shadow:0 6px 14px rgba(0,0,0,.5),0 0 0 1.5px rgba(246,239,221,.35)}
.tip[data-side]:after{content:"";position:absolute;left:var(--tip-arrow,50%);width:0;height:0;margin-left:-8px;border:8px solid transparent}
.tip[data-side="above"]:after{top:100%;border-top-color:var(--ink);border-bottom:0}
.tip[data-side="below"]:after{bottom:100%;border-bottom-color:var(--ink);border-top:0}

/* No stuck hover: a finger "hovers" whatever it last tapped until the next tap elsewhere. ui.js turns
   every :hover rule of the page's own stylesheets off on a touch screen (it adds html:not(.touch) to them). */

/* ---------- room for a finger. The table is scaled (about 0.85 on a 1024-wide iPad), so a control needs
   about 52 table units to be 44 screen pixels. Where there is room the control itself grows; where its
   neighbours sit close, an invisible margin (::after) widens the area that answers a tap, up to about
   the middle of the gap. tools/playtest/touch.py measures what a finger can really hit. */
html.touch .tool,html.touch .mini,html.touch .of-title,html.touch .of-done,
html.touch .tb-phase .ph,html.touch .lb-reroll{position:relative}
html.touch .of-x:not(.of-alert .of-x){position:relative}
html.touch .tool:after,html.touch .mini:after,html.touch .of-title:after,html.touch .of-done:after,html.touch .of-x:after,
html.touch .tb-phase .ph:after,html.touch .lb-reroll:after{content:"";position:absolute;inset:-8px -4px}
/* the top strip is 52 high: its buttons answer over all of it */
html.touch .topbar .tool:after,html.touch .tb-phase .ph:after{inset:-12px -4px}
/* the map's tools: bigger buttons, floating over the map */
/* Find a place is a magnifier at the end of the row, as tall as the buttons: it never hangs over the map. Touched,
   it opens leftwards over the buttons to take the name, and folds back when it is left empty. */
html.touch .maptools{gap:8px;flex-wrap:nowrap;justify-content:flex-end}
html.touch .maptools .find{flex:none;display:block;width:52px;height:52px}
html.touch .maptools .tool{height:52px;min-width:52px;font-size:15px;padding:6px 11px 5px}
html.touch .maptools .tool:after{inset:-4px}
html.touch .find input{position:absolute;right:0;top:0;height:52px;width:52px;font-size:16px;padding:0 0 0 46px;cursor:pointer;
  background:var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='%232B241E' stroke-width='2.4'/%3E%3Cpath d='M15 15l6 6' stroke='%232B241E' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") 14px 50%/24px 24px no-repeat;transition:width .15s}
html.touch .find input::placeholder{color:transparent}
html.touch .find input:focus,html.touch .find input:not(:placeholder-shown){width:240px;z-index:6;padding-right:8px;cursor:text}
html.touch .find input:focus::placeholder{color:var(--ink3)}
html.touch .findlist{top:58px;z-index:6}
html.touch .findlist button{padding:12px 8px;font-size:15px}
/* the pad: taller lines, a bigger remove mark, bigger undo and redo */
html.touch .pad li{min-height:38px;gap:6px}   /* closer-set on a 1024 iPad so a build line ("+ army 1 [Atlantic West] $3B 1 2") stays on one line */
html.touch button.ox{width:38px;height:36px;font-size:24px;margin-right:-6px}
html.touch .pad-tools{gap:10px}
html.touch .pad-tools .mini{min-width:40px;height:30px;font-size:16px;padding:3px 6px}
html.touch .pad-tools .mini:after{inset:-9px -5px}
html.touch .pad-f .padshort{height:30px}
html.touch .pad-f .padshort:after{inset:-4px -2px}
html.touch .pad-f .pv.long b{font-size:9.5px;letter-spacing:-.04em}
html.touch .pad-f .pv.longer b{font-size:8.5px;letter-spacing:-.05em}
/* order cards: bigger steppers and buttons (the card has room to grow) */
html.touch .stepper button{width:52px;height:52px;font-size:24px}
html.touch .stepper b{min-width:40px}
html.touch .pop .mini{min-height:34px;padding:7px 10px 6px;font-size:12px}
html.touch .pop .btn,html.touch .modal-card .btn{min-height:52px;padding:12px 16px 11px;font-size:14px}
html.touch .pop-f{gap:12px}
html.touch .pop input.num{min-height:52px;min-width:56px;font-size:22px}
/* the close mark of a card, the Undo in a message, the report's round buttons */
html.touch .pop .pop-h .ox{width:50px;height:50px;font-size:26px;margin:-9px -9px -9px 0}
html.touch .toast .mini:after{inset:-12px -6px}
html.touch [data-act="show-report"].mini{min-width:44px;min-height:32px}
/* sheets in the middle: the close button */
html.touch .modal-card [data-act="close"]{min-width:52px;min-height:46px}
/* the lobby's choices */
html.touch .lb-setup .lb-seg,html.touch .lb-setup .lb-unpicked .lb-seg{height:46px}
html.touch .lb-clock{height:46px}
html.touch .lb-setup .lb-dd-btn{height:46px}
html.touch .lb-setup .lb-dd-btn,html.touch .lb-setup .lb-dd-btn b,html.touch .lb-setup .lb-dd-btn i{line-height:44px}
html.touch .lb-setup .lb-dd-list{top:49px}
html.touch .lb-dd-list li{min-height:44px}
html.touch .lb-title .input.small{height:46px}
html.touch .lb-reroll{width:44px}
html.touch .lb-play,html.touch .lb-who{height:48px}
/* Help: its tabs, the menu's choices, the sound sliders and boxes */
html.touch .htab{min-height:38px;position:relative}
html.touch .htab:after{content:"";position:absolute;inset:-7px -2px}
html.touch .modal-card button.action{min-height:52px}
html.touch .modal-card input[type=range]{height:34px}
html.touch .modal-card .chk,html.touch .pc-never{min-height:40px;display:flex;align-items:center;gap:10px}
html.touch .modal-card .chk input,html.touch .pc-never input{width:22px;height:22px}
/* Talks: the answers to an offer */
html.touch #offers .btn{min-height:48px}
/* the Talks bar: its title and close mark answer over the bar's full height */
html.touch .of-title:after,html.touch .of-bar .of-x:after{inset:-12px -4px}
html.touch .of-bar .of-x{min-width:44px}
/* the red banner's close mark (a broken promise, a bluff): a full finger's size, in its corner */
html.touch .of-alert{padding-right:56px;min-height:50px}
html.touch .of-alert .of-x{top:0;right:0;width:52px;height:100%;min-height:50px;font-size:24px;border-radius:0 6px 6px 0}
html.touch .of-alert .of-x:after{inset:0}
/* the guide's buttons */
html.touch .coach .btn{min-height:50px}
html.touch #offers .of-step button{width:48px;height:48px}
html.touch #offers .of-res{gap:6px}
html.touch #offers .of-res button{width:48px;height:48px}
html.touch #offers .mini{min-height:36px;padding-inline:10px}
html.touch #offers .of-bloc,html.touch #offers .of-lands button,html.touch #offers .of-forms button{min-height:48px;padding-inline:10px}
html.touch #offers .of-fh .of-x{min-width:44px;min-height:40px}
/* the playback's controls, and the report's Details and its lines */
html.touch .pc-f .btn{min-height:50px}
html.touch .pc-speed .mini{min-height:44px;min-width:48px}
html.touch .rg-more{position:relative;min-height:28px}
html.touch .rg-more:after{content:"";position:absolute;inset:-8px -4px}
html.touch .strip summary{padding:8px 0}
html.touch .gy-line.pt{padding-block:4px}

/* ---------- the narrower top strip and playback card */
html.touch .rc{width:15px}
html.touch .rc.now{width:25px}
html.touch .pc-h{gap:10px}
html.touch .pp{padding:6px 6px 5px;letter-spacing:.03em}
/* keyboard hints say nothing to a finger */
html.touch .pc-keys{display:none}

/* The report window's × (added with the "no Next round" change). */
html.touch .rp-x{min-width:50px;min-height:50px}
/* Offer answers shown outside the Talks panel (the hand-in check, since talks are open all round). */
html.touch .btn[data-o]{min-height:48px}

/* ---------- the bloc card's stock rows (they are the market) and the "What I make" line (makes.css):
   - and + are 52 x 52 table units: 44 screen pixels on a 1024x768 iPad held sideways (the table is drawn
   about 0.85 of its size there). The name stands over what you hold, so it never gives way to them. */
html.touch .stockmk .res.tr,html.touch .stockmk .res-h.tr{grid-template-columns:34px 84px minmax(0,1fr) 52px 52px;gap:0 4px}
html.touch .stockmk .res-h.tr .bs{grid-template-columns:52px 52px;gap:4px}
html.touch .stockmk .res.tr{grid-template-rows:16px 38px 16px}
html.touch .stockmk .res.tr.nosub{grid-template-rows:16px 38px}
html.touch .stockmk .res.tr .tb{width:52px;height:52px}
html.touch .stockmk .res.tr .rn{font-size:13px}
html.touch .stockmk .mk-f{overflow:visible;margin-top:8px}
html.touch .stockmk .mk-f .same{min-height:42px;padding:0 12px}
html.touch .stockmk .mk-f .same:after{inset:-4px -4px}
html.touch .mkstrip{height:44px;position:relative;overflow:visible}
html.touch .mkstrip:after{content:"";position:absolute;inset:-6px -2px 0}
/* A menu of choices beside the map (the Nuclear menu): a row with no price line (Launch a warhead) was 36 screen pixels tall at 1024x768 (the table is drawn 900 high and scaled down) */
html.touch #pop button.action{min-height:48px}
/* Better deposits (modules.mines with a choice of resource): each resource is its own entry, and one greyed by
   specialising is held to read why. Both answer a finger over 44 screen pixels at 1024x768 (the table is scaled about 0.85). */
html.touch #pop button.action[data-key^="mines_"]{min-height:53px}
html.touch #pop button.action.off[data-key^="mines_"]{min-height:53px;min-width:53px}
/* Factories (modules.factories): "Build a factory", and the grey sign held to read why it cannot be built, both answer a
   finger over 44 screen pixels at 1024x768 (the table is scaled about 0.85). */
html.touch #pop button.action[data-key="build_factory"]{min-height:53px}
html.touch #pop button.action.off[data-key="build_factory"]{min-height:53px;min-width:53px}
/* Sail and carry (modules.sea_transport "voyage"): the entry on a sea's card, and the grey sign held to read why no
   voyage can start, both answer a finger over 44 screen pixels at 1024x768 (the table is scaled about 0.85). */
html.touch #pop button.action[data-key="voyage"]{min-height:53px}
html.touch #pop button.action.off[data-key="voyage"]{min-height:53px;min-width:53px}
/* a threat with no cap: the quick sums beside the stepper; a threat paid after the hand-in: Stand down / Strike anyway */
html.touch #offers .of-quick .of-q{height:48px;min-width:52px}
html.touch #offers .of-cbtns .btn{min-height:52px}
html.touch .hi-choice .hi-ch-btns .btn{min-height:50px}
