/* Version B: square empires. Five colour roles (neutral, Harvest, Expand, Defend, Attack) per look; ?tweaks flips looks. */
@font-face { font-family: "SG"; src: url("/fonts/space-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "SG"; src: url("/fonts/space-grotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Tide: a deep sea-blue field, sun-yellow harvest, leaf expand, chalk defend, coral attack, tangerine button */
body[data-look="tide"] { --field: #0a6f8f; --deep: #07506a; --ink: #f4fbff; --soft: rgba(244, 251, 255, 0.7); --n: rgba(255, 255, 255, 0.2); --h: #ffd23f; --e: #4ee28a; --d: #eaf4ff; --a: #ff4d5e; --btn: #ff8a2a; --btn-ink: #2b1200; }
/* Tomato: a red field, butter harvest, mint expand, navy defend, ink attack, white button */
body[data-look="tomato"] { --field: #d8432b; --deep: #a92e1b; --ink: #fff6ef; --soft: rgba(255, 246, 239, 0.75); --n: rgba(255, 255, 255, 0.22); --h: #ffe36b; --e: #8ff5b0; --d: #1e2f6e; --a: #2a0a06; --btn: #fff6ef; --btn-ink: #a92e1b; }
/* Moss: a grass-green field, yellow harvest, ice expand, white defend, hot-pink attack, cream button (pink read as Attack) */
body[data-look="moss"] { --field: #2c8c3c; --deep: #1d6a2a; --ink: #f6fff2; --soft: rgba(246, 255, 242, 0.75); --n: rgba(255, 255, 255, 0.2); --h: #ffdc3a; --e: #9ff0ff; --d: #ffffff; --a: #ff3f8e; --btn: #f6fff2; --btn-ink: #17521f; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--field); color: var(--ink); font-family: "SG", system-ui, sans-serif; font-weight: 700; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; height: var(--h, 100dvh); }
.screen { position: absolute; inset: 0; padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); }

.big { display: block; width: 100%; height: 60px; border-radius: 14px; background: var(--btn); color: var(--btn-ink); font-size: 26px; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s; }
.big:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.big.off { background: var(--deep); color: var(--soft); box-shadow: none; }
.big kbd { font: inherit; font-size: 15px; padding: 2px 8px; margin-left: 10px; border-radius: 6px; border: 2px solid currentColor; vertical-align: 3px; opacity: 0.7; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--deep); font-size: 17px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; height: 48px; border-radius: 12px; background: var(--deep); font-size: 20px; color: var(--soft); }
.seg button.on { background: var(--ink); color: var(--field); }

/* ---- door: a loud live field of squares behind the name ---- */
#door { display: flex; align-items: center; justify-content: center; overflow: hidden; }
#doorGrid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); grid-auto-rows: 34px; gap: 6px; padding: 6px; opacity: 0.9; }
#doorGrid i { border-radius: 5px; background: var(--n); transition: background-color 0.6s, transform 0.6s; }
#doorGrid i.h { background: var(--h); } #doorGrid i.e { background: var(--e); } #doorGrid i.d { background: var(--d); } #doorGrid i.a { background: var(--a); transform: scale(0.8); }
.doorFront { position: relative; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; padding: 24px 20px 20px; border-radius: 22px; background: var(--deep); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.title { margin: 0 0 4px; font-size: clamp(56px, 16vw, 92px); line-height: 0.95; letter-spacing: -0.04em; text-align: center; }
.setup { display: flex; flex-direction: column; gap: 10px; }
.pick { display: grid; grid-template-columns: 70px 1fr; align-items: center; font-size: 18px; color: var(--soft); }
.pick .seg button { background: var(--field); }
.pick .seg button.on { background: var(--ink); color: var(--field); }
.small { text-align: center; font-size: 16px; color: var(--soft); text-decoration: none; padding: 6px; }

/* ---- game: fixed rows, nothing here changes height during a game ---- */
#game { display: flex; flex-direction: column; }
#top { flex: none; height: 48px; display: flex; align-items: center; justify-content: space-between; font-size: 20px; }
#rivals { flex: none; height: clamp(104px, 21vh, 190px); display: flex; gap: 8px; }
.rival { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 12px; background: var(--deep); padding: 6px 6px 6px; transition: box-shadow 0.15s, transform 0.15s; }
.rival.hot { box-shadow: 0 0 0 3px var(--a); transform: translateY(2px); }
.rival.out { opacity: 0.4; }
.rival .name { display: flex; justify-content: space-between; gap: 4px; font-size: 15px; line-height: 18px; white-space: nowrap; }
.rival .name b { overflow: hidden; }
.rival .pts { color: var(--h); }
.rival .sub { font-size: 12px; line-height: 15px; color: var(--soft); font-weight: 500; white-space: nowrap; }
.rival .grid { flex: 1; margin-top: 4px; }
.badge { position: absolute; bottom: 4px; right: 4px; height: 34px; min-width: 34px; display: flex; align-items: center; border-radius: 17px; background: var(--a); color: #fff; font-size: 18px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); z-index: 3; animation: pop 0.25s cubic-bezier(.3,1.7,.5,1); }
.badge button { width: 30px; height: 34px; font-size: 20px; }
.badge span { min-width: 16px; text-align: center; }
@keyframes pop { from { transform: scale(0.3); } }
#mine { flex: 1; min-height: 0; position: relative; margin-top: 12px; }
#mineGrid { position: absolute; inset: 0; }
#plots { position: absolute; background-repeat: repeat; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect x='0' y='0' width='86' height='86' rx='15' fill='white' fill-opacity='0.09'/%3E%3C/svg%3E"); }
#meLine { flex: none; height: 30px; display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
#meStats { color: var(--soft); font-weight: 500; }
#meStats b { color: var(--h); font-weight: 700; }
#bar { flex: none; position: relative; height: 56px; border-radius: 12px; overflow: hidden; background: var(--deep); touch-action: none; }
#bar .segm { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; overflow: hidden; white-space: nowrap; transition: left 0.12s, width 0.12s; }
#bar .segm.h { background: var(--h); color: rgba(0, 0, 0, 0.7); } #bar .segm.e { background: var(--e); color: rgba(0, 0, 0, 0.7); }
#bar .segm.d { background: var(--d); color: rgba(0, 0, 0, 0.7); } #bar .segm.a { background: var(--a); color: #fff; }
#bar .segm.a + .segm.a { box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.35); }
#bar .segm.stub { background: transparent; color: var(--ink); font-size: 19px; border-radius: 10px; border: 3px dashed; padding: 0; transform: scale(0.86); }
#bar .segm.stub.h { border-color: var(--h); color: var(--h); } #bar .segm.stub.e { border-color: var(--e); color: var(--e); }
#bar .segm.stub.d { border-color: var(--d); color: var(--d); } #bar .segm.stub.a { border-color: var(--a); color: var(--a); }
#bar.still { opacity: 0.5; }
/* paint input: four job buttons, equal and fixed, the one you paint with raised */
body[data-input="paint"] #bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: none; overflow: visible; border-radius: 0; }
#bar .brush { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 12px; color: rgba(0, 0, 0, 0.72); line-height: 1; transform: translateY(3px) scale(0.94); transition: opacity 0.12s, transform 0.12s, box-shadow 0.12s; min-width: 0; }
#bar .brush span { font-size: clamp(11px, 3.2vw, 14px); font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
#bar .brush b { font-size: clamp(18px, 5.4vw, 24px); }
#bar .brush.h { background: var(--h); } #bar .brush.e { background: var(--e); } #bar .brush.d { background: var(--d); } #bar .brush.a { background: var(--a); color: #fff; }
#bar .brush.on { opacity: 1; transform: none; box-shadow: 0 0 0 3px var(--ink), 0 4px 0 rgba(0, 0, 0, 0.3); }
#bar .brush .ic { width: 14px; height: 14px; }
#mineGrid { touch-action: none; }
.rival { cursor: pointer; }
.rival.nudge { animation: nudge 0.9s ease-in-out 2; }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px var(--a); transform: translateY(-3px); } }
#bar .segm:first-child { border-radius: 12px 0 0 12px; }
#bar .div { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; z-index: 2; cursor: ew-resize; display: flex; justify-content: center; }
#bar .div::after { content: ""; width: 8px; border-radius: 4px; background: var(--ink); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
#bar .div.drag::after { width: 12px; }
#foot { flex: none; height: 122px; padding-top: 6px; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding-bottom: 8px; }
#say { margin: 0; height: 40px; font-size: clamp(13px, 3.9vw, 16px); line-height: 20px; text-align: center; color: var(--soft); font-weight: 500; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#say.warn { color: var(--ink); font-weight: 700; }

/* squares */
.grid { position: relative; }
.grid .sq { position: absolute; border-radius: 18%; background: var(--n); transition: background-color 0.18s; }
body[data-sq="tile"] .grid .sq, body[data-sq="tile"] #fly .sq { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
body[data-sq="flat"] .grid .sq, body[data-sq="flat"] #fly .sq { border-radius: 8%; box-shadow: none; }
.sq.h { background: var(--h); } .sq.e { background: var(--e); } .sq.d { background: var(--d); } .sq.a { background: var(--a); }
.sq.x { background: var(--a); outline: 3px solid var(--ink); outline-offset: -3px; }
.sq.flip { animation: flip 0.36s ease-in-out; }
@keyframes flip { 50% { transform: scaleX(0); } }
.sq.pulse { animation: pulse 0.5s ease-out; }
@keyframes pulse { 40% { transform: scale(1.3); filter: brightness(1.3); } }
.sq.born { animation: born 0.35s cubic-bezier(.3,1.8,.5,1); }
@keyframes born { from { transform: scale(0); } }
.grid .stack { position: absolute; left: 0; right: 0; top: 50%; height: 26px; margin-top: -13px; display: flex; border-radius: 6px; overflow: hidden; }
.grid .stack i { display: block; height: 100%; }
.grid .stack b { position: absolute; inset: 0; text-align: center; line-height: 26px; font-size: 16px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
#fly { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#fly .sq { position: absolute; border-radius: 18%; }
.ghost { position: fixed; z-index: 30; pointer-events: none; border-radius: 18%; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35); }
.ghost b { position: absolute; right: -12px; top: -12px; min-width: 26px; height: 26px; line-height: 26px; border-radius: 13px; background: var(--ink); color: var(--field); text-align: center; font-size: 15px; }

/* sheets: log and end; they wait for a tap */
#logSheet { position: absolute; left: 0; right: 0; bottom: 0; top: calc(48px + env(safe-area-inset-top)); z-index: 40; padding: 8px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 12px; }
#game.logOpen > :not(#logSheet):not(#top) { visibility: hidden; }
#endSheet { flex: none; height: 160px; padding: 6px 0 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.logBody { flex: 1; overflow: auto; font-size: 17px; line-height: 1.45; font-weight: 500; }
.logBody p { margin: 0 0 2px; }
.logBody h3 { margin: 10px 0 4px; font-size: 15px; color: var(--soft); }
#endLine { margin: 0; font-size: clamp(30px, 9vw, 48px); line-height: 1.05; letter-spacing: -0.02em; text-align: center; }
#home { align-self: center; }

#tweaks { position: fixed; right: 10px; top: 56px; z-index: 50; width: 220px; padding: 10px; border-radius: 14px; background: var(--deep); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
#tweaksHead { text-align: left; }
#tweaks.shut { width: auto; }
#tweaks.shut .seg { display: none; }
#tweaks .seg button { height: 36px; font-size: 14px; }

/* wide screens: rivals across the top, your empire big in the middle */
@media (min-width: 900px) {
  .screen { padding-left: 6vw; padding-right: 6vw; }
  #rivals { height: clamp(150px, 24vh, 230px); gap: 14px; }
  .rival .name { font-size: 18px; line-height: 22px; }
  .rival .sub { font-size: 14px; }
  #game > #mine, #game > #meLine, #game > #bar, #game > #foot, #game > #endSheet { width: min(100%, 860px); align-self: center; }
}
/* a phone on its side: rivals down the left, your empire and controls on the right */
@media (orientation: landscape) and (max-height: 520px) {
  #game { display: grid; grid-template-columns: 38% 1fr; grid-template-rows: 40px 1fr 26px 48px 60px; column-gap: 14px; }
  #game > * { min-width: 0; }
  #top { grid-column: 1; grid-row: 1; height: 40px; }
  #rivals { grid-column: 1; grid-row: 2 / 6; height: auto; flex-wrap: wrap; align-content: flex-start; padding-bottom: 8px; }
  .rival { flex: 1 1 45%; height: calc(50% - 4px); }
  #mine { grid-column: 2; grid-row: 1 / 3; margin-top: 8px; }
  #meLine { grid-column: 2; grid-row: 3; height: 26px; }
  #bar { grid-column: 2; grid-row: 4; height: 44px; }
  #foot { grid-column: 2; grid-row: 5; height: 60px; flex-direction: row; align-items: center; padding: 6px 0 4px; }
  #foot #say { flex: 1; text-align: left; justify-content: flex-start; }
  #foot .big { width: 170px; height: 48px; font-size: 21px; }
  #endSheet { grid-column: 2; grid-row: 4 / 6; height: auto; display: grid; grid-template-columns: 1fr 150px; grid-template-rows: 1fr 1fr; column-gap: 12px; align-items: center; }
  #endLine { grid-row: 1 / 3; text-align: left; font-size: 30px; }
  #endSheet .big { height: 44px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .sq.flip, .sq.pulse, .sq.born, .badge { animation: none; } }
.sq.hold { visibility: hidden; }
.sq.gone { opacity: 0.18; transform: scale(0.7); transition: opacity 0.3s, transform 0.3s; }

/* ======== New style (default; ?tweaks → Plain shows the first look) ======== */
.chips { display: flex; gap: 8px; }
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.3em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ic.h { --icon: url("/art/harvest.webp"); } .ic.e { --icon: url("/art/expand.webp"); } .ic.d { --icon: url("/art/defend.webp"); } .ic.a { --icon: url("/art/attack.webp"); }
.race { display: none; }
.float { position: fixed; z-index: 25; pointer-events: none; font-size: 26px; color: var(--h); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); white-space: nowrap; }
.float.word { font-size: 18px; color: var(--deep); background: var(--d); padding: 2px 8px; border-radius: 8px; text-shadow: none; }
body[data-style="plain"] .jobs { display: none; }

body[data-style="new"] {
  background: radial-gradient(120% 80% at 50% 110%, var(--deep) 0%, var(--field) 60%);
}
/* every square wears its job: a dark glyph cut into the tile */
body[data-style="new"] .grid .sq.h::after, body[data-style="new"] .grid .sq.e::after, body[data-style="new"] .grid .sq.d::after, body[data-style="new"] .grid .sq.a::after,
body[data-style="new"] #fly .sq.a::after {
  content: ""; position: absolute; inset: 22%; background: rgba(0, 0, 0, 0.34); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
body[data-style="new"] .sq.h { --icon: url("/art/harvest.webp"); } body[data-style="new"] .sq.e { --icon: url("/art/expand.webp"); }
body[data-style="new"] .sq.d { --icon: url("/art/defend.webp"); } body[data-style="new"] .sq.a { --icon: url("/art/attack.webp"); }
body[data-style="new"] .sq.a::after { background: rgba(255, 255, 255, 0.55) !important; }
body[data-style="new"] .grid.tiny .sq::after { display: none; }
body[data-style="new"][data-sq="tile"] .grid .sq:not(.n), body[data-style="new"][data-sq="tile"] #fly .sq { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 3px 6px rgba(0, 0, 0, 0.18); }
body[data-style="new"] .grid .sq.n { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.sq.clang { animation: clang 0.45s ease-out; }
@keyframes clang { 0% { filter: brightness(2.2); transform: scale(1.18); } 100% { filter: none; transform: none; } }

/* your empire builds up from the bar; the empty plots fade out above it */
body[data-style="new"] #plots { -webkit-mask-image: linear-gradient(to top, #000 0, #000 var(--solid, 30%), transparent calc(var(--solid, 30%) + 45%)); mask-image: linear-gradient(to top, #000 0, #000 var(--solid, 30%), transparent calc(var(--solid, 30%) + 45%)); }

/* race to the winning score */
body[data-style="new"] .race { display: block; position: relative; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.25); overflow: hidden; }
body[data-style="new"] .race b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--h); transition: width 0.4s ease-out; }
body[data-style="new"] .rival .race { flex: none; margin-top: 6px; }
body[data-style="new"] #meLine { position: relative; padding-bottom: 6px; }
body[data-style="new"] #meRace { position: absolute; left: 0; right: 0; bottom: 2px; height: 5px; }

/* rivals: bolder names and scores, no box-in-a-box */
body[data-style="new"] .rival { border-radius: 14px; background: rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06); padding: 8px 8px 8px; }
body[data-style="new"] .rival .name { font-size: 18px; line-height: 21px; }
body[data-style="new"] .rival .pts { font-size: 20px; }
body[data-style="new"] .rival .sub { font-size: 13px; }
body[data-style="new"] .rival.hot { box-shadow: inset 0 0 0 3px var(--a), 0 0 24px rgba(255, 77, 94, 0.45); }
body[data-style="new"] #top { font-size: 21px; }
body[data-style="new"] .chip { font-size: 15px; background: rgba(0, 0, 0, 0.22); }

/* the bar: chunky tiles with icons */
body[data-style="new"] #bar { background: rgba(0, 0, 0, 0.22); border-radius: 14px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.18); }
body[data-style="new"] #bar .segm { font-size: 19px; }
body[data-style="new"] #bar .segm:not(.stub) { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
body[data-style="new"] #bar .segm.stub { font-size: 20px; }
body[data-style="new"] #bar .segm.stub .ic { margin: 0 0 0 2px; }
body[data-style="new"] #bar .div::after { width: 10px; border-radius: 5px; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3); }
body[data-style="new"] .big { border-radius: 16px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 10px 24px rgba(0, 0, 0, 0.18); letter-spacing: -0.01em; }
body[data-style="new"] .big:not(.off):hover { filter: brightness(1.06); }

/* door: the name huge over a live field, what each job does, then the choices along the bottom */
body[data-style="new"] #door { align-items: stretch; }
body[data-style="new"] #doorGrid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); grid-auto-rows: 46px; gap: 8px; padding: 8px; }
body[data-style="new"] #doorGrid i { border-radius: 9px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
body[data-style="new"] #door::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, transparent 30%, var(--deep) 78%); }
body[data-style="new"] .doorFront { z-index: 1; max-width: none; height: 100%; padding: max(4vh, 20px) 0 max(3vh, 16px); border-radius: 0; background: none; box-shadow: none; justify-content: flex-end; gap: 14px; }
body[data-style="new"] .title { position: absolute; top: max(5vh, 24px); left: 0; right: 0; font-size: clamp(76px, 24vw, 220px); text-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); animation: titleIn 0.7s cubic-bezier(.3,1.5,.5,1); }
@keyframes titleIn { from { transform: translateY(-30px) scale(0.9); opacity: 0; } }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jobs li { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); }
.jobs .ic { grid-row: 1 / 3; width: 44px; height: 44px; margin: 0; border-radius: 10px; -webkit-mask: none; mask: none; background: var(--c); position: relative; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.4); }
.jobs .ic::after { content: ""; position: absolute; inset: 22%; background: rgba(0, 0, 0, 0.34); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.jobs .a .ic::after { background: rgba(255, 255, 255, 0.6); }
.jobs .h { --c: var(--h); } .jobs .e { --c: var(--e); } .jobs .d { --c: var(--d); } .jobs .a { --c: var(--a); }
.jobs b { font-size: 19px; line-height: 1.1; color: var(--c); }
.jobs span { font-size: 15px; line-height: 1.2; font-weight: 500; color: var(--ink); }
body[data-style="new"] .pick .seg button { background: rgba(0, 0, 0, 0.28); color: var(--ink); }
body[data-style="new"] .pick .seg button.on { background: var(--ink); color: var(--field); }
body[data-style="new"] #play { height: 68px; font-size: 30px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 0 0 6px rgba(255, 255, 255, 0.18), 0 10px 30px rgba(0, 0, 0, 0.2); } }
@media (min-width: 900px) {
  body[data-style="new"] .doorFront { align-items: center; }
  body[data-style="new"] .doorFront > :not(.title) { width: min(100%, 640px); }
  body[data-style="new"] .jobs { grid-template-columns: repeat(4, 1fr); }
  body[data-style="new"] .jobs li { grid-template-columns: 1fr; grid-template-rows: 52px auto auto; justify-items: center; text-align: center; padding: 12px 8px; }
  body[data-style="new"] .jobs .ic { grid-row: 1; width: 48px; height: 48px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  body[data-style="new"] .title { font-size: 64px; top: 10px; }
  body[data-style="new"] .doorFront { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto auto; column-gap: 16px; align-content: end; padding-top: 90px; }
  body[data-style="new"] .jobs { grid-column: 1; grid-row: 1 / 4; align-self: end; }
  body[data-style="new"] .jobs li { padding: 5px 8px; }
  body[data-style="new"] .jobs .ic { width: 36px; height: 36px; }
  body[data-style="new"] .setup, body[data-style="new"] #play, body[data-style="new"] .small { grid-column: 2; }
  body[data-style="new"] #play { height: 54px; }
}

/* end: the result big, and it waits for Again */
body[data-style="new"] #endLine { font-size: clamp(34px, 10vw, 60px); text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); animation: titleIn 0.6s cubic-bezier(.3,1.5,.5,1); }
body[data-style="new"] #endSheet.won #endLine { color: var(--h); }
@media (prefers-reduced-motion: reduce) { .title, #endLine, #play, .sq.clang { animation: none !important; } }
.chips .chip { white-space: nowrap; }
#turn { white-space: nowrap; }
@media (orientation: landscape) and (max-height: 520px) {
  #top .toZ { display: none; }
  #top .chip { padding: 5px 10px; font-size: 14px; }
}
@media (orientation: landscape) and (max-height: 520px) { body[data-style="new"] #endLine { font-size: 30px; } }
#tweaks.away { display: none; }
/* room for the attack count under every rival's squares, always reserved so nothing moves when it appears */
.rival .grid { margin-bottom: 36px; }
@media (orientation: landscape) and (max-height: 520px) { .rival .grid { margin-bottom: 34px; } }
@media (max-width: 359px) { #top .toZ { display: none; } }

/* playing together */
.online { display: flex; gap: 10px; }
.online .big { flex: 1; min-width: 0; height: 52px; font-size: 21px; white-space: nowrap; }
.big.alt { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
#nameSheet { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px max(20px, calc(50% - 230px)); background: var(--deep); }
#nameHead { margin: 0; font-size: 22px; line-height: 1.25; }
#nameIn { height: 56px; border-radius: 12px; border: 3px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-size: 22px; padding: 0 14px; }
#nameIn::placeholder { color: var(--soft); }
#nameSheet .chip { align-self: center; }
@media (max-width: 479px) { body.online #top .toZ { display: none; } }
@media (max-width: 379px), (orientation: landscape) and (max-height: 500px) {
  body.online #top .chip { font-size: 13px; padding: 5px 9px; }
  body.online #top .chips { gap: 4px; }
  body.online #top .toZ { display: none; }
}
#inviteSheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px max(20px, calc(50% - 230px)); background: var(--deep); }
#inviteSheet p { margin: 0; font-size: 20px; line-height: 1.3; }
#inviteUrl { font-size: clamp(20px, 6.4vw, 30px) !important; color: var(--h); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
#inviteSheet .chip { align-self: center; }
#inviteSheet > * { flex: none; }
#inviteSheet .big { height: 60px; }
