:root { --stone:#2a2118; --stone2:#3b2e20; --bronze:#c8a052; --parch:#e8d9b0; --ink:#1a130c; --blue:#3b82f6; --red:#ef4444; --ok:#4ade80; }
/* Smoked-glass surfaces: the world shows through, blurred and darkened enough that text keeps its contrast
   (each tint is at least 70% opaque and the blur flattens busy terrain). Readers who ask for less transparency,
   and browsers without backdrop-filter, get the same colours solid (see the overrides below). */
:root {
  --blur: blur(16px) saturate(150%);
  --hud-top: linear-gradient(rgb(59 46 32 / .8), rgb(35 26 17 / .74));
  --hud-bottom: linear-gradient(rgb(44 33 23 / .7), rgb(22 16 10 / .82));
  --glass: rgb(30 22 14 / .76);
  --card: linear-gradient(rgb(46 35 24 / .8), rgb(22 16 10 / .88));
  --scrim: rgb(10 7 4 / .45);
  --edge: inset 0 1px 0 rgb(255 236 190 / .14);
  --legible: 0 1px 2px rgb(0 0 0 / .75);
}
@media (prefers-reduced-transparency: reduce) {
  :root { --blur: none; --hud-top: linear-gradient(#3b2e20,#231a11); --hud-bottom: linear-gradient(#2c2117,#1a130c); --glass: #1e160e;
    --card: linear-gradient(#2c2117,#1a130c); --scrim: rgb(10 7 4 / .85); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --hud-top: linear-gradient(#3b2e20f2,#231a11f2); --hud-bottom: linear-gradient(#2c2117f2,#1a130cf2); --glass: #1e160eeb;
    --card: linear-gradient(#2c2117f7,#1a130cf7); --scrim: rgb(10 7 4 / .75); }
}
.glass, #topbar, #bottom, #kingdoms-standings, #toast, #idlebtn, .card { -webkit-backdrop-filter:var(--blur); backdrop-filter:var(--blur); }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:#0b0d09; overflow:hidden; font-family: Georgia, 'Palatino Linotype', serif; color: var(--parch); user-select:none; }
#app { position:fixed; inset:0; }
#viewport { position:absolute; inset:0; }
#viewport canvas { width:100%; height:100%; display:block; }
#topbar { position:absolute; left:0; right:0; top:0; height:40px; display:flex; align-items:center; gap:18px; padding:0 14px; background:var(--hud-top); border-bottom:1px solid var(--bronze); box-shadow:var(--edge), 0 1px 0 rgb(0 0 0 / .45), 0 6px 18px rgb(0 0 0 / .3); font-size:15px; text-shadow:var(--legible); z-index:5; }
#topbar .res { display:flex; align-items:center; gap:5px; font-variant-numeric: tabular-nums; white-space:nowrap; }
/* Counters are chips: the resource's glyph in its colour, then the number in a lining, tabular sans (the serif's
   old-style figures bob up and down). The chip is tinted with the resource colour, --rc. */
#topbar .res-group { display:flex; align-items:center; gap:6px; }
#topbar .chip { --rc:var(--parch); display:inline-flex; align-items:center; gap:5px; height:26px; padding:0 10px 0 6px; border-radius:13px;
  background:rgb(0 0 0 / .32); background:linear-gradient(90deg, color-mix(in srgb, var(--rc) 24%, rgb(0 0 0 / .3)), rgb(0 0 0 / .3) 70%);
  box-shadow:inset 0 0 0 1px rgb(255 255 255 / .09), inset 0 1px 0 rgb(255 255 255 / .07); }
#topbar .res-group .chip { min-width:68px; }
#topbar .chip b { font:600 14px/1 ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-variant-numeric:tabular-nums lining-nums; color:#fbf1d6; }
#topbar .chip small { font:inherit; font-size:12px; font-weight:500; color:#cbbb95; }
#topbar .hico { width:16px; height:16px; flex:none; color:var(--rc); filter:drop-shadow(0 1px 1px rgb(0 0 0 / .65)); }
#topbar .chip.pop.full { --rc:#ff8a7a; background:rgb(150 40 30 / .55); box-shadow:inset 0 0 0 1px rgb(255 138 122 / .55); }
#topbar .chip.pop.full b, #topbar .chip.pop.full small { color:#ffe0db; }
#topbar .match-clock { --rc:#d9c28e; }
#topbar .chip.age { --rc:var(--bronze); }
#topbar .chip.age b { font:15px/1 Georgia, 'Palatino Linotype', serif; color:#e7c77e; letter-spacing:.02em; }
#topbar .age i { margin-left:1px; font-size:9px; font-style:normal; color:var(--ok); animation:rise 1.4s ease-in-out infinite; }
@keyframes rise { 0%, 100% { transform:translateY(1px); opacity:.6 } 50% { transform:translateY(-2px); opacity:1 } }
@media (prefers-reduced-motion: reduce) { #topbar .age i { animation:none; } }
#topbar .grow { flex:1; text-align:center; color:var(--bronze); letter-spacing:.04em; }
#topbar .grow { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#topbar > button { flex-shrink:0; }
@media (max-width:1200px) {
  body:not(.touch) #topbar { gap:8px; padding:0 8px; font-size:13px; }
  body:not(.touch) #topbar .res-group .chip { min-width:0; }
  body:not(.touch) #topbar .res-group { gap:4px; }
  body:not(.touch) #topbar button { padding:4px 7px; }
}
@media (max-width:800px) {
  body:not(.touch) #topbar { gap:4px; font-size:12px; }
  body:not(.touch) #topbar .grow { display:none; }
}
#topbar .obj { color:#f5e6b8; }
#kingdoms-standings { position:absolute; top:52px; left:12px; z-index:4; width:240px; padding:10px 12px; background:var(--glass); border:1px solid #c8a05277; border-radius:8px; pointer-events:none; box-shadow:var(--edge), 0 3px 14px #0006; font-size:12px; text-shadow:var(--legible); }
.kingdom-heading { color:var(--bronze); font-weight:bold; margin-bottom:6px; }
.kingdom-row { display:grid; grid-template-columns:1fr auto; gap:2px 8px; padding:5px 0; border-top:1px solid #c8a05233; font-variant-numeric:tabular-nums; }
.kingdom-row > small { grid-column:1 / -1; color:#e1d2ae; }
.kingdom-row i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:6px; border:1px solid #fff6; }
.kingdom-row.fallen { opacity:.5; }
.kingdom-final { max-width:420px; margin:18px auto; text-align:left; }
body:not(.ingame) #kingdoms-standings { visibility:hidden; }
body.touch #kingdoms-standings { top:calc(72px + var(--sat)); left:calc(8px + var(--sal)); width:174px; padding:6px 8px; font-size:10px; }
body.touch #kingdoms-standings .kingdom-row { padding:3px 0; gap:1px 3px; }
body.touch #kingdoms-standings .kingdom-heading { margin-bottom:3px; }
@media (orientation:landscape) and (max-height:500px) {
  body.touch #kingdoms-standings { width:166px; top:calc(65px + var(--sat)); left:calc(68px + var(--sal)); }
}
#topbar .match-clock { white-space:nowrap; }
#topbar button, .btn { background:linear-gradient(#5a4327,#3a2a16); color:var(--parch); border:1px solid var(--bronze); border-radius:3px; padding:4px 10px; font:inherit; cursor:pointer; }
#topbar button { border-color:rgb(200 160 82 / .75); border-radius:5px; background:linear-gradient(rgb(98 74 44 / .78), rgb(52 38 20 / .82)); box-shadow:var(--edge), 0 1px 3px rgb(0 0 0 / .35); text-shadow:var(--legible); }
#topbar button:hover, .btn:hover { background:linear-gradient(#7a5a33,#4a3620); }
#topbar button.on { outline:2px solid var(--ok); }
#bottom { position:absolute; left:0; right:0; bottom:0; height:168px; display:flex; gap:10px; padding:8px 10px; background:radial-gradient(70% 150% at 88% 115%, rgb(200 160 82 / .3), transparent 70%), radial-gradient(45% 110% at 62% -10%, rgb(130 96 52 / .28), transparent 70%), var(--hud-bottom); border-top:1px solid var(--bronze); box-shadow:var(--edge), 0 -1px 0 rgb(0 0 0 / .45), 0 -6px 18px rgb(0 0 0 / .3); z-index:5; }
#minimap-wrap { border:2px solid var(--bronze); border-radius:3px; overflow:hidden; background:#000; width:224px; height:134px; flex:none; box-shadow:0 2px 10px rgb(0 0 0 / .5); }
#minimap { display:block; cursor:pointer; }
/* Desktop "next idle villager" button, floating above the minimap like the phone's round buttons; the badge counts idle villagers. */
#idlebtn { position:absolute; left:10px; bottom:178px; z-index:5; width:44px; height:44px; border-radius:22px; padding:0; font-size:21px; background:var(--glass); color:var(--parch); border:1px solid var(--bronze); cursor:pointer; opacity:.78; box-shadow:var(--edge), 0 2px 8px rgb(0 0 0 / .4); }
#idlebtn.has { opacity:1; box-shadow:var(--edge), 0 0 0 2px #c0392b88, 0 2px 8px rgb(0 0 0 / .4); }
#idlebtn:hover { background:linear-gradient(#7a5a33,#4a3620); opacity:1; }
#idlebtn .badge { position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; padding:0 4px; box-sizing:border-box; border-radius:9px; background:#c0392b; color:#fff; font:bold 11px/18px system-ui; text-align:center; }
#idlebtn .badge:empty { display:none; }
body.touch #idlebtn, body:not(.ingame) #idlebtn { display:none; }
#info { flex:1; min-width:160px; overflow:hidden; font-size:14px; line-height:1.35; text-shadow:var(--legible); }
#info h3 { margin:0 0 4px; font-size:17px; color:var(--bronze); font-weight:normal; }
#info .bar { height:8px; background:#111; border:1px solid #000; border-radius:2px; margin:3px 0 6px; width:200px; }
#info .bar > i { display:block; height:100%; background:var(--ok); }
#cmds { flex:none; width:min(52vw,640px); display:grid; grid-template-columns:repeat(auto-fill,minmax(124px,1fr)); gap:6px; align-content:start; overflow:auto; padding:2px; margin:-2px; }
/* ---------- liquid-glass command tiles + hover card ---------- */
.t-bld { --t:224 168 74; --tl:255 226 160; } .t-civ { --t:96 200 128; --tl:190 245 205; } .t-mil { --t:226 84 78; --tl:255 190 180; }
.t-siege { --t:128 150 230; --tl:200 214 255; } .t-fut { --t:60 200 220; --tl:170 245 250; } .t-age { --t:250 204 21; --tl:255 240 160; }
.t-del { --t:239 52 52; --tl:255 168 160; } /* danger: the Delete tile */
#cmds .tile { --g:.17; --sh:inset 0 1px 0 rgb(255 255 255 / .5), inset 0 -10px 16px -8px rgb(var(--t) / .38), inset 0 0 0 1px rgb(var(--t) / .2), 0 5px 12px rgb(0 0 0 / .4);
  position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; gap:7px; height:44px; padding:4px 8px 4px 5px; text-align:left; font-size:12px; line-height:1.15; color:#fbf1d6;
  border:1px solid rgb(255 255 255 / .22); border-radius:14px;
  background:radial-gradient(130% 110% at 0% 0%, rgb(var(--t) / .4), transparent 62%), linear-gradient(165deg, rgb(255 255 255 / var(--g)), rgb(255 255 255 / .03) 48%, rgb(var(--t) / .16));
  -webkit-backdrop-filter:blur(12px) saturate(170%); backdrop-filter:blur(12px) saturate(170%);
  box-shadow:var(--sh), 0 0 0 0 transparent; transition:transform .2s cubic-bezier(.3,1.5,.5,1), box-shadow .2s, opacity .2s; }
#cmds .tile::before { content:''; position:absolute; inset:0 0 52% 0; border-radius:inherit; background:linear-gradient(rgb(255 255 255 / .26), rgb(255 255 255 / .02)); pointer-events:none; z-index:-1; }
#cmds .tile::after { content:''; position:absolute; top:-20%; bottom:-20%; left:-60%; width:40%; transform:skewX(-20deg); background:linear-gradient(90deg, transparent, rgb(255 255 255 / .38), transparent); opacity:0; pointer-events:none; z-index:-1; }
@media (hover:hover) {
  #cmds .tile:not(.off):hover { --g:.28; transform:translateY(-2px) scale(1.025); box-shadow:var(--sh), 0 0 16px rgb(var(--t) / .35); }
  #cmds .tile:not(.off):hover::after { animation:glint .75s ease-out; }
}
#cmds .tile:not(.off):active { transform:translateY(0) scale(.97); transition-duration:.06s; }
#cmds .tile:focus-visible { outline:2px solid rgb(var(--tl)); outline-offset:2px; }
#cmds .tile.off { --t:150 140 126; --tl:205 197 184; opacity:.6; cursor:not-allowed; }
#cmds .tile.age:not(.off) { animation:breathe 2.8s ease-in-out infinite; }
#cmds .tile.t-del { border-color:rgb(var(--t) / .55); }
@keyframes glint { 0% { left:-60%; opacity:0 } 25% { opacity:1 } 100% { left:130%; opacity:0 } }
@keyframes breathe { 0%, 100% { box-shadow:var(--sh), 0 0 0 0 rgb(var(--t) / 0) } 50% { box-shadow:var(--sh), 0 0 18px 1px rgb(var(--t) / .55) } }
.orb { position:relative; flex:none; width:30px; height:30px; border-radius:50%; display:grid; place-items:center; color:rgb(var(--tl));
  background:radial-gradient(circle at 32% 24%, rgb(255 255 255 / .6), rgb(255 255 255 / .08) 40%, transparent 58%), radial-gradient(circle at 50% 125%, rgb(var(--t) / .6), rgb(var(--t) / .12) 62%), rgb(20 14 8 / .4);
  box-shadow:inset 0 1px 1px rgb(255 255 255 / .65), inset 0 -3px 6px rgb(var(--t) / .4), 0 0 0 1px rgb(255 255 255 / .18), 0 2px 6px rgb(0 0 0 / .45); }
.orb .ico { width:19px; height:19px; filter:drop-shadow(0 0 3px rgb(var(--t) / .75)); }
.orb .lock { position:absolute; right:-4px; bottom:-4px; width:15px; height:15px; border-radius:50%; display:grid; place-items:center; color:#fff; background:rgb(20 14 8 / .88); border:1px solid rgb(255 255 255 / .3); }
.orb .lock .ico { width:10px; height:10px; filter:none; }
#cmds .lbl { display:flex; flex-direction:column; justify-content:center; min-width:0; gap:1px; }
#cmds .lbl b { font-weight:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-shadow:0 1px 2px rgb(0 0 0 / .55); }
#cmds .lbl small { display:flex; gap:6px; font-size:10.5px; white-space:nowrap; overflow:hidden; color:rgb(var(--tl)); }
.c { display:inline-flex; align-items:center; gap:3px; font-variant-numeric:tabular-nums; }
.c .dot { width:7px; height:7px; border-radius:50%; flex:none; box-shadow:0 0 0 1px #0007, inset 0 1px 1px rgb(255 255 255 / .5); }
.c.short { color:#ff9c8f; }
#tip { --t:224 168 74; --tl:255 226 160; position:fixed; z-index:13; left:0; top:0; width:max-content; max-width:min(272px, calc(100vw - 16px)); padding:11px 13px 12px; pointer-events:none; border-radius:16px; color:#f3e7c6; font-size:12.5px; line-height:1.45;
  background:radial-gradient(120% 90% at 0% 0%, rgb(var(--t) / .3), transparent 60%), linear-gradient(170deg, rgb(255 255 255 / .16), rgb(255 255 255 / .04) 50%), rgb(24 17 10 / .68);
  border:1px solid rgb(255 255 255 / .22); -webkit-backdrop-filter:blur(18px) saturate(180%); backdrop-filter:blur(18px) saturate(180%);
  box-shadow:inset 0 1px 0 rgb(255 255 255 / .5), inset 0 0 0 1px rgb(var(--t) / .2), 0 14px 34px rgb(0 0 0 / .55);
  opacity:0; visibility:hidden; transform:translateY(6px) scale(.97); transform-origin:50% 100%; transition:opacity .12s, transform .12s, visibility 0s .12s; }
#tip.show { opacity:1; visibility:visible; transform:none; transition:opacity .14s, transform .2s cubic-bezier(.3,1.4,.5,1); }
#tip.show.move { transition:opacity .14s, transform .2s cubic-bezier(.3,1.4,.5,1), left .16s ease-out, top .16s ease-out; }
#tip .tip-h { display:flex; gap:10px; align-items:center; }
#tip .orb { width:38px; height:38px; } #tip .orb .ico { width:24px; height:24px; }
#tip h4 { margin:0; font-size:15px; font-weight:normal; color:rgb(var(--tl)); line-height:1.15; }
#tip .sub { font-size:11.5px; opacity:.72; }
#tip p { margin:8px 0 0; }
#tip dl { display:grid; grid-template-columns:1fr 1fr; gap:3px 14px; margin:9px 0 0; padding-top:8px; border-top:1px solid rgb(255 255 255 / .14); }
#tip dl:empty { display:none; }
#tip dl > div { display:flex; justify-content:space-between; gap:8px; } #tip dl > div.wide { grid-column:1 / -1; flex-direction:column; gap:0; }
#tip dt { opacity:.68; } #tip dd { margin:0; font-variant-numeric:tabular-nums; }
#tip .tip-cost { display:flex; flex-wrap:wrap; gap:3px 12px; margin-top:9px; padding-top:8px; border-top:1px solid rgb(255 255 255 / .14); }
#tip .tip-cost:empty { display:none; }
#tip .tip-cost .dot { width:9px; height:9px; } #tip .tip-cost em { font-style:normal; opacity:.68; margin-left:1px; }
#tip .note { margin-top:8px; color:#ff9c8f; }
body.touch #tip { display:none; }
@media (prefers-reduced-motion: reduce) { #cmds .tile.age:not(.off), #cmds .tile:not(.off):hover::after { animation:none; } #cmds .tile, #tip, #tip.show, #tip.show.move { transition:none; } }
#toast { position:absolute; left:50%; bottom:186px; transform:translateX(-50%); background:var(--glass); border:1px solid var(--bronze); padding:7px 16px; border-radius:8px; box-shadow:var(--edge), 0 6px 20px rgb(0 0 0 / .45); text-shadow:var(--legible); opacity:0; transition:opacity .25s; pointer-events:none; z-index:6; }
#toast.show { opacity:1; }
#dragbox { position:fixed; border:1px solid #4ade80; background:#4ade8022; z-index:4; pointer-events:none; }
.hidden { display:none !important; }
/* Menus with no match behind them: a warm glow over a faint isometric lattice, the map grid, for the glass card to frost.
   Over a live match (the result screen) the screen is only a scrim, so the final battlefield shows through. */
#screen { position:absolute; inset:0; z-index:10; display:flex; align-items:center; justify-content:center; overflow:auto;
  background:radial-gradient(55% 45% at 50% 30%, rgb(214 168 84 / .2), transparent 70%), radial-gradient(40% 35% at 15% 85%, rgb(120 150 90 / .12), transparent 70%),
    radial-gradient(40% 35% at 88% 80%, rgb(90 120 160 / .1), transparent 70%),
    repeating-linear-gradient(30deg, rgb(200 160 82 / .08) 0 1px, transparent 1px 56px), repeating-linear-gradient(-30deg, rgb(200 160 82 / .08) 0 1px, transparent 1px 56px),
    radial-gradient(circle at 50% 40%, #3b2e20, #0b0805 78%); }
#viewport:has(canvas) ~ #screen { background:radial-gradient(circle at 50% 40%, rgb(59 46 32 / .35), rgb(11 8 5 / .7)); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.card { max-width:1100px; width:92vw; max-height:92vh; overflow:auto; padding:26px 32px; border:1px solid var(--bronze); border-radius:8px; background:var(--card); box-shadow:var(--edge), 0 0 0 1px rgb(0 0 0 / .5), 0 18px 60px rgb(0 0 0 / .7); text-align:center; text-shadow:0 1px 2px rgb(0 0 0 / .5); }
.card h1 { font-size:44px; letter-spacing:.08em; margin:0 0 4px; color:var(--bronze); font-weight:normal; text-transform:uppercase; }
.card h2 { font-weight:normal; color:var(--bronze); margin:.2em 0; }
.card p { margin:.5em auto; max-width:720px; line-height:1.5; }
.card .btn { font-size:18px; padding:9px 24px; margin:10px 6px 0; }
#delete-confirmation { width:calc(100vw - 24px); max-width:440px; max-height:90dvh; color:var(--parch); }
#delete-confirmation::backdrop { background:rgb(10 7 4 / .55); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
#delete-confirmation .delete-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin-top:18px; }
#delete-confirmation .btn { flex:1; min-height:44px; margin:0; padding:9px 12px; white-space:nowrap; }
#delete-confirmation .danger { border-color:var(--red); background:linear-gradient(#79362c,#4b201a); }
#delete-confirmation .btn:focus-visible { outline:2px solid var(--parch); outline-offset:3px; }
/* Main menu: a header, the Rules and Play panels side by side, the quick-match tiles, then controls and footer. */
.card.menu { max-width:1080px; padding:30px 36px 22px; text-align:left; border:1px solid var(--bronze); border-radius:10px;
  background:radial-gradient(ellipse 70% 40% at 50% 0, #6b4f2a40, transparent), var(--card); box-shadow:var(--edge), 0 0 0 5px rgb(18 13 8 / .6), 0 0 0 6px #c8a05259, 0 18px 60px #000; }
.menu-head { text-align:center; margin-bottom:22px; }
.menu-head .crest { display:block; width:64px; height:64px; margin:0 auto 4px; color:var(--bronze); filter:drop-shadow(0 2px 5px #000b); }
.card.menu h1 { font-size:50px; letter-spacing:.12em; line-height:1.1; background:linear-gradient(#f6e2a8,#d2a957 55%,#9c7634); -webkit-background-clip:text; background-clip:text; color:transparent; text-shadow:none; filter:drop-shadow(0 2px 2px #000c); }
.card.menu .tagline { display:flex; align-items:center; gap:16px; max-width:820px; margin:6px auto 0; font-size:17px; font-style:italic; color:#d9c28e; }
.tagline::before, .tagline::after { content:''; flex:1 1 30px; min-width:16px; height:1px; background:linear-gradient(90deg,transparent,var(--bronze)); }
.tagline::after { background:linear-gradient(90deg,var(--bronze),transparent); }
.menu-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:18px; }
.panel { padding:15px 18px 18px; border:1px solid #c8a05238; border-radius:6px; background:#00000030; }
.panel-title { display:flex; align-items:center; gap:10px; margin:0 0 12px; font-size:13px; font-weight:normal; letter-spacing:.22em; text-transform:uppercase; color:var(--bronze); }
.panel-title::after { content:''; flex:1; height:1px; background:linear-gradient(90deg,#c8a05266,transparent); }
.panel-title small { font-size:13px; font-style:italic; letter-spacing:.02em; text-transform:none; color:#a9997a; }
.setting + .setting { margin-top:16px; }
.setting-name { display:block; margin-bottom:6px; font-size:16px; color:var(--parch); }
.card.menu .setting p { max-width:none; margin:6px 0 0; font-size:13.5px; line-height:1.45; color:#c2b28f; }
.seg { display:flex; gap:3px; padding:3px; border:1px solid #c8a05266; border-radius:6px; background:#00000059; }
.card.menu .seg .btn { flex:1; min-height:38px; margin:0; padding:6px 10px; font-size:15px; border:0; border-radius:4px; background:transparent; color:#cbb98f; }
.card.menu .seg .btn:hover { background:#c8a0521f; color:var(--parch); }
.card.menu .seg .btn.on { background:linear-gradient(#e6c679,#b38a3e); color:var(--ink); box-shadow:0 1px 4px #0009, inset 0 1px 0 #fff6; }
.card.menu .btn:focus-visible, .controls summary:focus-visible { outline:2px solid var(--parch); outline-offset:2px; }
.time-option label, .time-scale { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.time-option .setting-name { margin:0; }
.time-option output { color:var(--bronze); font-variant-numeric:tabular-nums; }
.time-option input { --fill:0%; display:block; width:100%; height:36px; margin:0; background:transparent; cursor:pointer; -webkit-appearance:none; appearance:none; }
.time-option input::-webkit-slider-runnable-track { height:6px; border:1px solid #c8a05266; border-radius:4px; background:linear-gradient(90deg,var(--bronze) var(--fill),#00000080 var(--fill)); }
.time-option input::-webkit-slider-thumb { width:20px; height:20px; margin-top:-8px; border:2px solid #17110a; border-radius:50%; background:radial-gradient(circle at 35% 35%,#f6e2a8,#b38a3e); box-shadow:0 0 0 1px var(--bronze), 0 2px 4px #000a; -webkit-appearance:none; appearance:none; }
.time-option input::-moz-range-track { height:6px; border:1px solid #c8a05266; border-radius:4px; background:#00000080; }
.time-option input::-moz-range-progress { height:6px; border-radius:4px; background:var(--bronze); }
.time-option input::-moz-range-thumb { width:16px; height:16px; border:2px solid #17110a; border-radius:50%; background:radial-gradient(circle at 35% 35%,#f6e2a8,#b38a3e); box-shadow:0 0 0 1px var(--bronze), 0 2px 4px #000a; }
.time-option input:focus-visible { outline:2px solid var(--bronze); outline-offset:3px; }
.time-scale { font-size:12px; color:#a9997a; }
.mode { padding:14px 16px 16px; border:1px solid #c8a05238; border-radius:6px; background:#00000026; text-align:center; }
.mode + .mode { margin-top:12px; }
.mode.tournament { border-color:#e3ba3799; background:radial-gradient(ellipse at 50% 0,#e3ba3726,transparent 70%), #00000033; }
.mode h4 { display:flex; align-items:center; justify-content:center; gap:10px; margin:0; font-size:21px; font-weight:normal; color:#f0dcaa; }
.card.menu .mode p { max-width:460px; margin:6px auto 0; font-size:14.5px; line-height:1.45; color:#d0bf98; }
.mode-tag { padding:2px 8px; border:1px solid #c8a05299; border-radius:10px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--bronze); }
/* The tournament's field halving each round, down to the crown. */
.ladder { display:flex; align-items:center; justify-content:center; margin:12px 0 2px; padding:0; list-style:none; }
.ladder li { position:relative; display:grid; place-items:center; width:30px; height:30px; border:1px solid #c8a05299; border-radius:50%; background:#00000059; color:#d9c28e; font-size:12px; font-variant-numeric:tabular-nums; }
.ladder li + li { margin-left:16px; }
.ladder li + li::before { content:''; position:absolute; right:calc(100% + 1px); top:50%; width:16px; height:1px; background:#c8a05288; }
.ladder .crown { border-color:#e3ba37; background:#e3ba3726; color:#f0cf62; font-size:17px; }
.card.menu .btn.primary { display:block; width:100%; max-width:340px; margin:12px auto 0; padding:11px 24px; font-size:21px; letter-spacing:.04em; color:var(--ink); border:1px solid #f6e2a8; border-radius:4px;
  background:linear-gradient(#ecd08a,#c39645 55%,#a47a33); box-shadow:0 3px 12px #0009, inset 0 1px 0 #fff8; }
.card.menu .btn.primary:hover { background:linear-gradient(#f6dc9a,#d4a754 55%,#b3873a); box-shadow:0 0 20px #e3ba3759, 0 3px 12px #0009, inset 0 1px 0 #fff8; }
.card.menu .kingdoms-start { margin:12px auto 0; padding:8px 22px; font-size:17px; border-radius:4px; }
.quick-row { margin-top:18px; }
.quick-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.card.menu .quick { display:flex; flex-direction:column; align-items:center; gap:2px; min-width:0; margin:0; padding:10px 8px 11px; font-size:15px; line-height:1.2; border-color:#c8a05266; border-radius:6px; background:linear-gradient(rgb(62 47 29 / .72),rgb(39 29 18 / .78)); box-shadow:var(--edge); }
.card.menu .quick:hover { border-color:var(--bronze); background:linear-gradient(#57422a,#33261a); transform:translateY(-1px); }
.quick .num { display:grid; place-items:center; width:28px; height:28px; margin-bottom:4px; border:1px solid #c8a05299; border-radius:50%; color:var(--bronze); font-size:12px; letter-spacing:.04em; }
.quick b { font-weight:normal; color:var(--parch); }
.quick small { font-size:11.5px; color:#a9997a; }
.card.menu .btn { transition:background .15s, box-shadow .15s, transform .15s, color .15s; }
.controls { margin-top:16px; border-top:1px solid #c8a05233; }
.controls summary { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; cursor:pointer; list-style:none; font-size:15px; letter-spacing:.06em; color:var(--bronze); }
.controls summary::-webkit-details-marker { display:none; }
.controls summary::before { content:'\25B8'; transition:transform .15s; }
.controls[open] summary::before { transform:rotate(90deg); }
.controls summary:hover { color:var(--parch); }
.controls .keys { margin:2px auto 8px; }
.card.menu .project { margin-top:4px; text-align:center; }
@media (prefers-reduced-motion: reduce) { .card.menu .btn, .controls summary::before { transition:none; } .card.menu .quick:hover { transform:none; } }
@media (max-width:760px) {
  .menu-grid { grid-template-columns:minmax(0,1fr); }
  .quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-grid .quick:last-child { grid-column:1 / -1; }
  .card.menu .tagline { display:block; text-align:center; } .tagline::before, .tagline::after { display:none; }
}
/* Main menu footer: repository link and contribution note. */
.card .project { margin:20px auto 0; padding-top:14px; border-top:1px solid #6b5230; max-width:720px; }
.card .project h3 { margin:12px 0 0; font-weight:normal; font-size:17px; color:var(--bronze); }
.card .project p { font-size:14px; opacity:.85; }
.repo { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px; color:var(--parch); text-decoration:none; border:1px solid var(--bronze); border-radius:3px; background:#0004; }
.repo:hover { color:var(--bronze); background:#0008; }
.repo:focus-visible { outline:2px solid var(--parch); outline-offset:3px; }
[data-tip]:not(.tile) { cursor:help; }
.btn[data-tip] { cursor:pointer; }
[data-tip]:not(.tile):focus-visible { outline:2px solid var(--bronze); outline-offset:3px; }
.win { color:var(--ok); } .lose { color:var(--red); }
.bracket { display:flex; gap:14px; justify-content:center; text-align:left; margin:12px 0; font-size:12.5px; }
.bracket .col { min-width:130px; } .bracket h4 { margin:0 0 6px; color:var(--bronze); font-weight:normal; text-align:center; }
.bracket .m { border:1px solid #6b5230; margin-bottom:4px; padding:2px 6px; background:#0004; }
.bracket .m span { display:block; color:#a89468; } .bracket .m span.w { color:#f5e6b8; font-weight:bold; } .bracket .m .you { color:var(--ok); }
.bracket .m.cur { border-color:var(--ok); }
.keys { display:grid; grid-template-columns:auto 1fr; gap:3px 14px; text-align:left; max-width:600px; margin:10px auto; font-size:14px; } .keys b { color:var(--bronze); }
.prog { width:340px; height:12px; border:1px solid var(--bronze); margin:14px auto; background:#000; } .prog i { display:block; height:100%; width:0; background:var(--bronze); }
.card h1.win { color: var(--ok); } .card h1.lose { color: var(--red); }

/* ---------- touch / phone layout (iPhone 17 Pro: 402x874 portrait, 874x402 landscape) ---------- */
:root { --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); }
html, body { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { touch-action: manipulation; }
#objective, #touchbar, #placebar, #gamemenu { display: none; }
body.touch #app { position: fixed; inset: 0; height: 100dvh; touch-action: none; }
/* An old iPhone Home Screen install whose viewport stops above the home indicator (install.js): no bottom margin. */
body.short-viewport { --sab: 0px; }
body.touch #viewport { touch-action: none; }
body.touch #topbar { height: calc(36px + var(--sat)); padding: var(--sat) calc(var(--sar) + 8px) 0 calc(var(--sal) + 8px); gap: 10px; font-size: 14px; }
/* iOS 26 Safari lays a soft blur-and-dim fade ("scroll edge effect") under the status bar that reaches the first row
   of counters, unless a fixed bar with a solid background touches the top edge: then it extends that bar's colour
   into the status bar instead. So on phones the top bar is fixed and opaque (the theme colour), not smoked glass. */
body.touch #topbar { position: fixed; background: #231a11; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.touch #topbar .res-group { gap: 4px; }
body.touch #topbar .res-group .chip { min-width: 0; }
body.touch #topbar .chip { height: 26px; gap: 4px; padding: 0 8px 0 5px; }
body.touch #topbar .hico { width: 15px; height: 15px; }
body.touch #topbar button { min-width: 44px; height: 32px; font-size: 18px; padding: 0 8px; }
body.touch #objective { display: block; position: absolute; left: 50%; transform: translateX(-50%); top: calc(40px + var(--sat)); max-width: min(92vw, 640px); padding: 3px 12px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--edge), 0 2px 8px rgb(0 0 0 / .35); border: 1px solid #c8a05266; border-radius: 12px; font-size: 12px; text-align: center; z-index: 4; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--legible); }
body.touch #bottom { position: absolute; inset: 0; height: auto; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
body.touch #bottom > * { pointer-events: auto; }
body.touch #minimap-wrap { position: absolute; left: calc(var(--sal) + 8px); bottom: calc(var(--sab) + 8px); width: 150px; height: 92px; border-width: 1px; opacity: .92; }
body.touch #minimap { width: 100%; height: 100%; touch-action: none; }
body.touch #info { position: absolute; left: calc(var(--sal) + 168px); bottom: calc(var(--sab) + 8px); width: min(36vw, 250px); min-width: 0; max-height: min(160px, 40vh); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 6px 9px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid #c8a05299; border-radius: 8px; box-shadow: var(--edge), 0 3px 12px rgb(0 0 0 / .4); font-size: 12px; line-height: 1.3; }
body.touch #info h3 { font-size: 14px; margin: 0 0 2px; } body.touch #info .bar { width: 100%; height: 6px; margin: 2px 0 3px; } body.touch #info small { display: none; }
/* Tile counts are data-driven (13 buildings, 10 Barracks units): the panel grows up from the bottom and scrolls from its top, so no tile is pushed out of reach. */
body.touch #cmds { position: absolute; right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px); top: auto; max-height: calc(100% - 84px - var(--sat) - var(--sab)); width: 246px; grid-template-columns: 1fr 1fr; grid-auto-rows: 48px; gap: 6px; align-content: start; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
body.touch #cmds:empty { display: none; }
body.touch #cmds .tile { height: 48px; min-width: 0; padding: 4px 6px 4px 5px; }
body.touch #touchbar { display: flex; flex-direction: column; gap: 8px; position: absolute; left: calc(var(--sal) + 8px); bottom: calc(var(--sab) + 108px); z-index: 5; }
body.touch #touchbar button { position: relative; width: 48px; height: 48px; border-radius: 24px; font-size: 22px; padding: 0; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--parch); border: 1px solid var(--bronze); box-shadow: var(--edge), 0 2px 8px rgb(0 0 0 / .4); }
body.touch #touchbar button.on { background: rgb(20 83 45 / .82); border-color: var(--ok); }
body.touch #touchbar .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #c0392b; color: #fff; font: bold 11px/18px system-ui; text-align: center; }
body.touch #touchbar .badge:empty { display: none; }
body.touch #placebar { display: flex; gap: 12px; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 14px); z-index: 7; }
body.touch #placebar.hidden { display: none; }
body.touch #placebar .btn { height: 52px; min-width: 128px; font-size: 17px; } body.touch #placebar .ok { background: linear-gradient(#2f7d45, #1d5a30); }
body.touch #toast { bottom: calc(var(--sab) + 110px); font-size: 13px; max-width: 86vw; text-align: center; }
#gamemenu:not(.hidden) { display:flex; position:absolute; inset:0; z-index:12; background:var(--scrim); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); align-items:center; justify-content:center; }
#pausemodal:not(.hidden) { display:flex; position:absolute; inset:0; z-index:11; background:var(--scrim); align-items:center; justify-content:center; }
#pausemodal .card { max-width:380px; padding:20px 24px; }
#pausemodal h2 { font-size:32px; letter-spacing:.08em; text-transform:uppercase; }
#pausemodal .btn { min-width:160px; min-height:44px; }
#pausemodal .btn:focus-visible { outline:2px solid var(--parch); outline-offset:3px; }
#viewport.grab { cursor:grab; } #viewport.grabbing { cursor:grabbing; }
#gamemenu .card { width:min(400px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); box-sizing:border-box; overflow:auto; padding:18px 20px 20px; border-radius:6px; }
#gamemenu h2 { margin:0; font-size:26px; letter-spacing:.1em; text-transform:uppercase; }
#gamemenu .menu-status { margin:0 0 12px; font-size:13px; font-style:italic; color:#a9997a; }
#gamemenu .btn { margin:0; min-height:44px; font-size:16px; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
#gamemenu .btn.primary { display:block; width:100%; font-size:18px; color:var(--ink); border-color:#f6e2a8; border-radius:4px; background:linear-gradient(#e6c679,#c49a48 55%,#a37a33); box-shadow:0 3px 12px #0009, inset 0 1px 0 #fff8; }
#gamemenu .btn.primary:hover { background:linear-gradient(#f6dc9a,#d4a754 55%,#b3873a); }
#gamemenu .menu-set { margin:16px 0 0; padding:0; border:0; text-align:left; }
#gamemenu .menu-set legend { padding:0 0 6px; font-size:12px; letter-spacing:.2em; text-transform:uppercase; color:var(--bronze); }
#gamemenu .seg .btn { flex:1; min-width:0; padding:6px 4px; font-size:15px; border:0; border-radius:4px; background:transparent; color:#cbb98f; }
#gamemenu .seg .btn:hover { background:#c8a0521f; color:var(--parch); }
#gamemenu .seg .btn.on, #gamemenu .seg .btn.on:hover { background:linear-gradient(#e6c679,#b38a3e); color:var(--ink); box-shadow:0 1px 4px #0009, inset 0 1px 0 #fff6; }
#gamemenu .menu-set p { max-width:none; margin:8px 0 0; font-size:12px; line-height:1.45; color:#c7b795; }
#gamemenu .menu-exit { display:flex; gap:8px; margin-top:18px; padding-top:14px; border-top:1px solid #c8a05266; }
#gamemenu .menu-exit .btn { flex:1; padding:6px 8px; font-size:15px; }
#gamemenu .menu-exit .btn.armed { background:linear-gradient(#8a2a22,#5a1712); border-color:var(--red); }
#gamemenu .btn:focus-visible { outline:2px solid var(--parch); outline-offset:2px; }
@media (hover: none) { #gamemenu .seg .btn:hover { background:transparent; color:#cbb98f; } }
@media (max-height: 480px) { #gamemenu .card { padding:12px 16px 14px; } #gamemenu .menu-set { margin-top:10px; } #gamemenu .menu-exit { margin-top:12px; padding-top:10px; } #gamemenu .menu-set p { display:none; } }
body.touch #topbar .grow, body.touch #topbar [data-speed], body.touch #topbar [data-pause], body.touch #topbar [data-resign] { display: none; }
/* phone screens (menus, bracket, results) */
body.touch #screen { align-items: flex-start; padding: calc(var(--sat) + 8px) calc(var(--sar) + 8px) calc(var(--sab) + 8px) calc(var(--sal) + 8px); }
body.touch .card { width: 100%; max-height: none; padding: 16px 14px; margin: auto; }
body.touch .card h1 { font-size: 30px; } body.touch .card h2 { font-size: 17px; } body.touch .card p { font-size: 15px; }
body.touch .card .btn { min-height: 48px; font-size: 17px; padding: 8px 18px; margin: 8px 4px 0; }
body.touch .bracket { justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; font-size: 11.5px; }
body.touch .bracket .col { min-width: 116px; }
body.touch .keys { grid-template-columns: 1fr; gap: 1px; text-align: center; } body.touch .keys b { margin-top: 6px; }
body.touch .card.menu { padding: 18px 14px 14px; }
body.touch .card.menu h1 { font-size: 30px; letter-spacing: .08em; } body.touch .menu-head .crest { width: 46px; height: 46px; margin-bottom: 0; }
body.touch .card.menu .tagline { font-size: 15px; gap: 10px; } body.touch .menu-head { margin-bottom: 16px; }
body.touch .card.menu .seg .btn { min-height: 44px; } body.touch .panel { padding: 13px 12px 14px; } body.touch .mode { padding: 12px 10px 14px; }
body.touch .card.menu .quick { min-height: 44px; } body.touch .ladder li { width: 26px; height: 26px; } body.touch .ladder li + li { margin-left: 10px; }
body.touch .ladder li + li::before { width: 10px; }
/* portrait: commands become a bottom strip, minimap moves top-right */
@media (orientation: portrait) {
  body.touch #minimap-wrap { left: auto; right: calc(var(--sar) + 8px); top: calc(96px + var(--sat)); bottom: auto; width: 120px; height: 74px; }
  body.touch #objective { font-size: 11px; }
  body.touch #info { left: calc(var(--sal) + 8px); right: calc(var(--sar) + 72px); width: auto; bottom: calc(var(--sab) + 8px); max-height: 132px; }
  body.touch.has-cmds #info { bottom: calc(var(--sab) + 70px); }
  body.touch #cmds { left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); top: auto; width: auto; height: 56px; display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; align-items: stretch; touch-action: pan-x; }
  body.touch #cmds .tile { flex: 0 0 128px; height: 56px; }
  /* the strip is 6px taller than its tiles and hangs 6px lower, so their bottom edge and shadow are not clipped */
  body.touch #cmds { height: 64px; padding: 2px 2px 6px; margin-bottom: -6px; }
  body.touch #cmds:empty { display: none; }
  body.touch #touchbar { left: auto; right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px); }
  body.touch.has-cmds #touchbar { bottom: calc(var(--sab) + 76px); }
  body.touch #toast { bottom: calc(var(--sab) + 150px); }
  body.touch #placebar { bottom: calc(var(--sab) + 84px); }
}
/* short landscape phones: compact menus */
@media (max-height: 500px) {
  body.touch .card { padding: 10px 14px; }
  body.touch .card h1 { font-size: 24px; margin: 0; } body.touch .card h2 { font-size: 13px; margin: 2px 0; }
  body.touch .card p { font-size: 13px; margin: 4px auto; }
  body.touch .keys { grid-template-columns: auto 1fr; gap: 2px 12px; text-align: left; font-size: 12px; margin: 6px auto; } body.touch .keys b { margin-top: 0; }
  body.touch .card .btn { min-height: 40px; font-size: 15px; margin: 6px 4px 0; padding: 4px 14px; }
  body.touch .bracket { margin: 6px 0; }
  body.touch .card.menu h1 { font-size: 26px; } body.touch .menu-head .crest { width: 34px; height: 34px; margin-bottom: 0; }
  body.touch .card.menu .tagline { font-size: 13px; } body.touch .menu-head { margin-bottom: 10px; }
  body.touch .card.menu .seg .btn { min-height: 40px; }
}
body.touch.placing #info { display: none; }
body.touch #placebar .btn { min-width: 116px; }
body:not(.ingame) #topbar, body:not(.ingame) #bottom, body:not(.ingame) #touchbar, body:not(.ingame) #objective, body:not(.ingame) #placebar { visibility: hidden; }
body.touch #topbar .spacer { flex: 1; }
/* Portrait phones are too narrow for one row: the four resources share the first row with the menu button, each chip
   an equal quarter so a five-digit stockpile still fits; population, Age and clock take the second row. */
@media (orientation: portrait) {
  body.touch #topbar { flex-wrap: wrap; align-content: center; height: calc(66px + var(--sat)); gap: 4px 6px; font-size: 13px;
    padding: calc(var(--sat) + 3px) calc(var(--sar) + 6px) 3px calc(var(--sal) + 6px); }
  body.touch #topbar > * { order: 2; }
  body.touch #topbar .res-group { order: 0; flex: 1 1 calc(100% - 60px); gap: 4px; }
  body.touch #topbar .res-group .chip { flex: 1 1 0; justify-content: center; }
  body.touch #topbar > [data-menu] { order: 1; height: 28px; }
  body.touch #topbar .chip { height: 26px; }
  body.touch #objective { top: calc(70px + var(--sat)); }
  body.touch #kingdoms-standings { top: calc(98px + var(--sat)); }
}
/* Full screen and Install: the row under the main menu's title on phones. */
.screen-row { display:flex; justify-content:center; margin:-8px 0 16px; }
.card.menu .screen-btn { margin:0; min-height:44px; padding:6px 18px; font-size:16px; border-radius:6px; }
/* Phone menu button: a glass pill like the chips beside it. */
body.touch #topbar > [data-menu] { height: 28px; min-width: 46px; border-radius: 14px; font-size: 17px; line-height: 1; border-color: rgb(200 160 82 / .55);
  background: linear-gradient(rgb(255 255 255 / .1), rgb(0 0 0 / .25)), rgb(0 0 0 / .25); }
/* Phone info panel: only for a selection, with a small x to let go of it. */
body.touch.no-info #info { display: none; }
body.touch #info { padding-right: 38px; }
.info-close { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; padding: 0; border-radius: 16px; display: grid; place-items: center;
  color: var(--parch); font: 14px/1 system-ui, sans-serif; background: rgb(255 255 255 / .08); border: 1px solid rgb(200 160 82 / .5); cursor: pointer; }
.info-close:active { background: rgb(255 255 255 / .2); }
/* Full screen and Install as an app buttons (main menu on phones, and the in-game menu). */
.screen-btns, .screen-row { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
#gamemenu .screen-btns .screen-btn { flex:1 1 140px; width:auto; padding:6px 10px; }
/* The install guide: browser tabs, then the steps as illustrated cards (two across on a phone). */
#install-guide { width:min(860px, calc(100vw - 20px)); max-height:calc(100dvh - 20px); padding:18px 18px 16px; color:var(--parch); }
#install-guide::backdrop { background:rgb(10 7 4 / .6); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
#install-guide h2 { margin:0; font-size:26px; letter-spacing:.08em; text-transform:uppercase; }
#install-guide .guide-lead { margin:4px auto 12px; font-size:14px; color:#d9c9a3; }
#install-guide .guide-tabs { max-width:520px; margin:0 auto 14px; }
#install-guide .guide-tabs .btn { flex:1; margin:0; min-height:40px; padding:6px 4px; font-size:14px; border:0; border-radius:4px; background:transparent; color:#cbb98f; }
#install-guide .guide-tabs .btn.on { background:linear-gradient(#e6c679,#b38a3e); color:var(--ink); box-shadow:0 1px 4px #0009, inset 0 1px 0 #fff6; }
.guide-steps { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin:0; padding:0; list-style:none; }
.guide-steps figure { margin:0; height:100%; display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid #c8a05244; border-radius:10px; background:rgb(0 0 0 / .25); }
.guide-art { display:block; width:100%; max-width:150px; margin:0 auto; }
.guide-art .tap { animation:tap-pulse 1.6s ease-out infinite; transform-box:fill-box; transform-origin:center; }
@keyframes tap-pulse { 0% { opacity:1; transform:scale(.9) } 70%, 100% { opacity:0; transform:scale(1.25) } }
@media (prefers-reduced-motion: reduce) { .guide-art .tap { animation:none; } }
.guide-steps figcaption { font-size:13.5px; line-height:1.4; text-align:left; color:#e6d8b6; }
.step-n { display:inline-grid; place-items:center; width:20px; height:20px; margin-right:3px; border-radius:50%; background:var(--bronze); color:var(--ink); font:600 12px/1 system-ui, sans-serif; vertical-align:1px; }
#install-guide .guide-close { display:block; min-width:160px; margin:14px auto 0; }
@media (max-width:700px) { .guide-steps { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; } .guide-steps figure { padding:8px; } .guide-steps figcaption { font-size:12.5px; } #install-guide h2 { font-size:21px; } }
@media (max-height:500px) { .guide-art { width:auto; max-height:150px; } #install-guide .guide-lead { margin-bottom:8px; } #install-guide .guide-tabs { margin-bottom:8px; } }
