:root {
	--ink: #14213d;
	--paper: #fffaf0;
	--sun: #ffc531;
	--red: #e5484d;
	--green: #2e9e4f;
	--sky: #9bd8ff;
	--shadow: 0 4px 0 var(--ink);
	--display: 'Lilita One', 'Arial Black', system-ui, sans-serif;
	--body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--top: max(14px, env(safe-area-inset-top));
	--vh: 100vh;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background: var(--sky);
	color: var(--ink);
	font: 600 15px/1.45 var(--body);
	overflow: hidden;
	overscroll-behavior: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-text-size-adjust: 100%;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
#vignette {
	position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 2s;
	background: radial-gradient(ellipse at center, transparent 52%, rgba(150, 30, 10, 0.5) 100%);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }

/* Top bar */
.top {
	position: fixed; top: 0; left: 0; right: 0;
	display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
	padding: var(--top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
	pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo {
	font: 28px/1 var(--display); letter-spacing: 0.5px; text-decoration: none; white-space: nowrap;
	color: var(--ink); background: var(--sun);
	padding: 8px 12px 9px; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow);
	transform: rotate(-2deg);
}
.logo span { color: var(--red); margin-left: 5px; }
.counter {
	text-align: right; background: var(--paper);
	padding: 6px 12px 7px; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow);
}
.counter small { display: block; white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(20, 33, 61, 0.65); }
.counter p { margin: 0; white-space: nowrap; }
.counter b { font: 24px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.counter span { font-weight: 800; opacity: 0.6; }
.counter em {
	display: inline-block; margin-left: 4px; font-style: normal; font-size: 10px; letter-spacing: 1px;
	background: var(--ink); color: var(--sun); padding: 1px 6px; border-radius: 4px; opacity: 1;
}

/* Search */
#search {
	position: fixed; top: calc(var(--top) + 66px); left: 50%; transform: translateX(-50%);
	width: min(440px, calc(100vw - 32px)); display: flex;
	background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
	padding: 4px;
}
#search input {
	flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
	padding: 8px 6px 8px 16px; font-weight: 800; font-size: 16px;
}
#search input::placeholder { color: var(--ink); opacity: 0.45; }
#search input::-webkit-search-cancel-button { display: none; }
#search button {
	border: 0; border-radius: 999px; background: var(--red); color: #fff;
	font: 17px/1 var(--display); letter-spacing: 0.5px; padding: 0 20px;
}
#search:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }

/* Status line and the replay button under the search bar */
#statusrow {
	position: fixed; top: calc(var(--top) + 124px); left: 50%; transform: translateX(-50%);
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
#status {
	margin: 0; text-align: center;
	background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 800;
	font-variant-numeric: tabular-nums;
}
#status:empty { display: none; }
#status.soon { background: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#btn-replay {
	pointer-events: auto; border: 3px solid var(--ink); border-radius: 999px; background: var(--sun); box-shadow: 0 3px 0 var(--ink);
	padding: 4px 14px; font-weight: 800; font-size: 13px;
}
#btn-replay:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* Round tool buttons: sound, whole map, zoom. Top left, under the logo. */
.tools {
	position: fixed; left: max(16px, env(safe-area-inset-left)); top: calc(var(--top) + 66px);
	display: flex; flex-direction: column; gap: 8px;
}
.round {
	width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
	background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow);
}
.round.zoom { font: 26px/1 var(--display); padding-bottom: 3px; }
.round[aria-pressed="true"] { background: var(--sun); }
.round[aria-pressed="true"] .off { display: none; }
/* The volume slider: a small pill to the right of the sound button, shown while the sound is on. */
.sound { position: relative; }
.volume {
	position: absolute; left: 54px; top: 50%; transform: translateY(-50%);
	background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
	padding: 6px 12px; display: flex; align-items: center;
}
.volume[hidden] { display: none; }
.volume input { width: 104px; margin: 0; accent-color: var(--red); cursor: pointer; }
/* On phones the battle countdown sits right beside the sound button: drop the slider just below it. */
@media (max-width: 559px) { .volume { top: 36px; transform: none; padding: 4px 10px; } .volume input { width: 96px; } }
.round:active { transform: translateY(2px); }
.round:focus-visible, .bottom button:focus-visible, .bottom a:focus-visible, .actions button:focus-visible, .wide:focus-visible, #btn-replay:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
@media (pointer: coarse) { .round.zoom { display: none; } } /* phones pinch to zoom */

/* Panels */
.panel {
	position: fixed; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink);
	padding: 16px 16px 14px;
}
.panel h2 { font: 22px/1.1 var(--display); margin: 0 28px 10px 0; letter-spacing: 0.3px; }
.panel h3 { font: 18px/1.2 var(--display); margin: 16px 0 6px; }
.panel p { margin: 0 0 8px; }
.x {
	position: absolute; top: 6px; right: 6px; width: 38px; height: 38px;
	border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; font-weight: 800;
}
.x:hover { background: rgba(20, 33, 61, 0.1); }

#board, #report { left: 16px; bottom: 74px; width: min(300px, calc(100vw - 32px)); max-height: min(60vh, 470px); overflow: auto; }
#board ol, #report ol { list-style: none; margin: 0; padding: 0; }
#board li button, #report li {
	width: 100%; display: grid; grid-template-columns: 22px 30px 1fr auto; align-items: center; gap: 8px;
	border: 0; background: transparent; text-align: left; padding: 5px 4px; border-radius: 8px; font-weight: 800;
}
#report li { grid-template-columns: 30px 1fr auto; }
#board li button:hover { background: rgba(20, 33, 61, 0.08); }
#board .n { opacity: 0.5; font-variant-numeric: tabular-nums; }
#board img, #card img, .lab img, #report img { border: 1.5px solid var(--ink); border-radius: 3px; display: block; }
#board img, #report img { width: 30px; height: 22px; }
#board .c { font-variant-numeric: tabular-nums; opacity: 0.7; }
#board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board .nm small.reserve { margin-left: 6px; font-size: 11px; background: #fff3c4; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 6px; vertical-align: 1px; }
#report li.reserve { opacity: 0.85; font-size: 13px; }
#report li.reserve b { font-variant-numeric: tabular-nums; }
#report .up { color: var(--green); font-variant-numeric: tabular-nums; }
#report .down { color: var(--red); font-variant-numeric: tabular-nums; }
#report .wide { margin-top: 8px; font-size: 14px; padding: 8px; }

#card { right: 16px; bottom: 74px; width: min(300px, calc(100vw - 32px)); max-height: calc(var(--vh) - 220px); overflow: auto; }
.card-head { display: flex; gap: 12px; align-items: center; margin-right: 28px; }
.card-head img { width: 52px; height: 39px; flex: none; }
.card-head h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.card-head p { margin: 2px 0 0; opacity: 0.7; font-weight: 800; }
#card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
#card dl div { background: rgba(20, 33, 61, 0.07); border-radius: 10px; padding: 7px 8px; }
#card dt { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; opacity: 0.6; }
#card dd { margin: 1px 0 0; font: 18px/1.2 var(--display); font-variant-numeric: tabular-nums; }

.badges { margin: 10px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.badges:empty, .commander:empty { display: none; }
.badges span { background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 800; }
.badges span.ok { background: #c9f1d2; }
.badges span.bad { background: #ffd3d4; }
.commander { margin: 10px 0 0; font-size: 13px; font-weight: 800; }
.rank { margin: 12px 0 0; }
.rank p { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 4px; }
.rank b { font: 18px/1.1 var(--display); letter-spacing: 0.3px; }
.rank span { font-size: 12px; font-weight: 800; opacity: 0.7; font-variant-numeric: tabular-nums; }
.rank .bar { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--red); border-radius: 0 999px 999px 0; }
.rank small { display: block; margin-top: 3px; font-size: 12px; opacity: 0.75; }
/* The one thing an unverified soldier should do next. */
button.verify { background: var(--green); color: #fff; margin-top: 10px; font-size: 15px; padding: 9px; animation: nudge 2.4s ease-in-out infinite; }
button.verify.quiet { background: var(--paper); color: var(--ink); animation: none; } /* already verified: claiming only links this device */
.bottom button.coffee { background: #fff3c4; }
.bottom button.ideas { background: #e6f4ff; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-1.2deg) scale(1.02); } 95% { transform: rotate(1.2deg) scale(1.02); } }
.tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.tabs button { flex: 1; border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: 5px 8px; font-weight: 800; font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--sun); }
#board-soldiers { list-style: none; margin: 0; padding: 0; }
#board-soldiers button { width: 100%; display: grid; grid-template-columns: 22px 30px 1fr auto; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 5px 4px; border-radius: 8px; font-weight: 800; }
#board-soldiers button:hover { background: rgba(20, 33, 61, 0.08); }
#board-soldiers img { width: 30px; height: 22px; border: 1.5px solid var(--ink); border-radius: 3px; display: block; }
#board-soldiers .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board-soldiers .nm small { display: block; font-size: 11px; opacity: 0.65; }
#board-soldiers .n, #board-soldiers .c { opacity: 0.6; font-variant-numeric: tabular-nums; font-size: 13px; }
#card-share { margin-top: 8px; }
#card-share button { padding: 8px 4px; font-size: 13px; }

/* Skins */
#skins .panel { width: min(460px, 100%); }
#skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.skin {
	position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px;
	border: 3px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 800; font-size: 12px; line-height: 1.2; text-align: center;
}
.skin[aria-pressed="true"] { background: var(--sun); }
.skin:disabled { opacity: 1; cursor: default; background: rgba(20, 33, 61, 0.06); border-style: dashed; }
.skin:disabled .fig { filter: grayscale(0.7); opacity: 0.55; }
.skin small { display: block; font-size: 10.5px; font-weight: 800; opacity: 0.7; }
/* A tiny soldier: helmet, face, uniform. Colours come from --helm and --body. */
.fig { width: 34px; height: 46px; position: relative; }
.fig::before { content: ''; position: absolute; left: 3px; right: 3px; top: 0; height: 14px; border-radius: 12px 12px 2px 2px; background: var(--helm); border: 2px solid var(--ink); }
.fig::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 0; height: 22px; border-radius: 3px; background: var(--body); border: 2px solid var(--ink); }
.fig i { position: absolute; left: 8px; right: 8px; top: 13px; height: 12px; background: #f2c59b; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }

/* Verify */
.code { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.code b { font: 26px/1 var(--display); letter-spacing: 3px; background: var(--sun); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 12px; user-select: all; -webkit-user-select: all; }
.code button, a.dm { border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: 6px 14px; font-weight: 800; font-size: 13px; text-decoration: none; display: inline-block; }
#proof-msg.good { background: #dff5e1; border-color: #2e8b3d; }

#share .panel { width: min(360px, 100%); }
#share-canvas { display: block; margin: 0 auto; height: min(56vh, 520px); width: auto; max-width: 100%; aspect-ratio: 9 / 16; border: 3px solid var(--ink); border-radius: 12px; background: var(--sun); }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions button, .wide {
	flex: 1; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: 0 3px 0 var(--ink);
	padding: 8px 10px; font-weight: 800; font-size: 14px;
}
.actions button:active, .wide:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
button.primary { background: var(--red); color: #fff; }
button:disabled { opacity: 0.55; cursor: default; }
.wide { display: block; width: 100%; margin-top: 12px; font-size: 16px; padding: 11px; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(20, 33, 61, 0.45); padding: 16px; overflow: auto; }
#toast { z-index: 30; }
#loading { z-index: 40; }
.modal .panel { position: relative; width: min(420px, 100%); max-height: calc(var(--vh) - 32px); overflow: auto; overscroll-behavior: contain; }
#buy-form > label, #coffee-form > label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 4px; }
#coffee-form > label { margin-top: 10px; }
#coffee .panel { width: min(440px, 100%); }
/* "Test mode" / "not open yet" notice at the top of the shop panels */
.panel p.mode { background: var(--ink); color: var(--sun); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 800; margin: 0 0 10px; }
/* The three coffees */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.tiers button { border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 8px 4px; font-weight: 800; font-size: 13px; line-height: 1.2; }
.tiers button b { display: block; font: 22px/1.1 var(--display); }
.tiers button[aria-checked="true"] { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
/* Members' name tags, always showing above their soldiers */
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
	position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
	background: var(--ink); color: #fff; border-radius: 6px; padding: 0 6px; font-weight: 800; font-size: 11px; line-height: 17px;
}
.tag.t2 { background: #2b6cb0; }
.tag.t3 { background: var(--sun); color: var(--ink); border: 1.5px solid var(--ink); }
/* The membership block on a member's own card */
.member { margin: 10px 0 0; padding: 8px 10px; border: 2px dashed rgba(20, 33, 61, 0.3); border-radius: 10px; font-size: 13px; }
.member p { margin: 0 0 6px; font-weight: 800; }
.member button { border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: 5px 14px; font-weight: 800; font-size: 12px; margin-right: 6px; }
#coffee .tabs { margin: 0 0 10px; }
/* The supporters wall */
.wall { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wall li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start; background: rgba(20, 33, 61, 0.06); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.wall li b { font-weight: 800; }
.wall li q { display: block; font-style: italic; opacity: 0.8; }
.wall li small { opacity: 0.6; white-space: nowrap; font-size: 11px; }
.wall li.none { display: block; }
/* The ticker: the latest purchase, just above the bottom buttons */
#ticker {
	position: fixed; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px); transform: translateX(-50%);
	max-width: min(520px, calc(100vw - 32px)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	background: var(--ink); color: #fff; border: 2px solid var(--sun); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 800;
	transition: opacity 0.4s;
}
#ticker.swap { opacity: 0; }
body.has-card #ticker, body:has(#board:not([hidden])) #ticker, body:has(#report:not([hidden])) #ticker { display: none; } /* panels use that space */
/* A new purchase since your last visit: a banner across the top of the map */
#alert {
	position: fixed; left: 50%; top: calc(var(--top) + 226px); transform: translate(-50%, 0) rotate(-2deg); z-index: 15; pointer-events: none;
	max-width: calc(100vw - 40px); text-align: center;
	background: var(--sun); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink);
	padding: 10px 18px; font: 20px/1.25 var(--display); letter-spacing: 0.3px;
	animation: pop 5s ease both;
}
#alert small { display: block; font: 800 12px/1.3 var(--body); letter-spacing: 1px; text-transform: uppercase; opacity: 0.7; }
@keyframes pop {
	0% { opacity: 0; transform: translate(-50%, 0) rotate(-2deg) scale(0.6); }
	8% { opacity: 1; transform: translate(-50%, 0) rotate(-2deg) scale(1.06); }
	14%, 86% { opacity: 1; transform: translate(-50%, 0) rotate(-2deg) scale(1); }
	100% { opacity: 0; transform: translate(-50%, -12px) rotate(-2deg) scale(0.96); }
}
.field {
	width: 100%; border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 9px 12px; font-weight: 800; font-size: 16px; outline: 0;
}
.idea-form { display: grid; gap: 6px; margin-top: 10px; }
.idea-form label { font-weight: 800; font-size: 13px; margin-top: 4px; }
.idea-form textarea { resize: vertical; font-family: inherit; }
#how-ideas { margin: 4px 0 8px; background: #fff3c4; }
.field:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
#buy fieldset { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 3px solid var(--ink); border-radius: 12px; padding: 9px 12px; background: #fff; cursor: pointer; }
.opt:has(input:checked) { background: var(--sun); }
.opt:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.opt input { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; }
.opt b { display: block; }
.opt small { display: block; font-size: 12px; opacity: 0.75; }
.opt .price { font: 20px/1 var(--display); }
#buy-form > label.agree, #coffee-form > label.agree {
	display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 12px 0 0;
	font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer;
}
.agree input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.error { margin: 10px 0 0; background: #ffe1e2; border: 2px solid var(--red); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.fine.small { border: 0; padding-top: 0; font-size: 12px; }
.wide + .fine.small { margin-top: 16px; }
#order p { margin: 0; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 0 0 10px; }
.steps li::marker { font-family: var(--display); }
.steps .hint { display: block; margin-top: 6px; font-size: 12px; line-height: 1.35; opacity: 0.75; }
.fine { margin: 12px 0 0; padding-top: 10px; border-top: 2px dashed rgba(20, 33, 61, 0.25); font-size: 13px; opacity: 0.8; }
.shop { margin: 0 0 8px; padding-left: 20px; }
.shop li { margin-bottom: 6px; }
/* The ten ranks and what each adds */
.ranks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.ranks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; background: rgba(20, 33, 61, 0.06); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.ranks li b { font-weight: 800; }
.ranks li i { font-style: normal; opacity: 0.5; font-variant-numeric: tabular-nums; }
.ranks li small { opacity: 0.7; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranks li span span { opacity: 0.75; }

/* Bottom bar */
.bottom {
	position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
	padding: 0 max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	pointer-events: none;
}
.bottom > * { pointer-events: auto; }
.bottom button, .bottom a {
	background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
	padding: 7px 14px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.bottom .s { display: none; } /* shorter labels, used on phones */
.bottom button.me { background: var(--red); color: #fff; }
.bottom button.me.known { background: var(--sun); color: var(--ink); }
.bottom a.ig { margin-left: auto; }
.bottom .legal { font-size: 12px; font-weight: 800; background: rgba(255, 250, 240, 0.85); border-radius: 999px; padding: 3px 10px; }
.bottom .legal a { background: none; border: 0; box-shadow: none; padding: 0; text-decoration: underline; }
#how .panel { width: min(460px, 100%); }

/* "+N new soldiers": appears when people join while the page is open */
.live-new {
	position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15;
	font: 800 13px/1 var(--body); color: var(--ink); background: var(--sun); border: 3px solid var(--ink); border-radius: 999px;
	padding: 9px 14px; box-shadow: var(--shadow); cursor: pointer; white-space: nowrap;
}

/* Welcome: shown once to a first-time visitor */
#welcome .panel { width: min(400px, 100%); text-align: center; padding-top: 20px; }
#welcome .hello { font: 800 12px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; opacity: 0.65; margin: 0 0 12px; }
#welcome h2 { margin: 0 0 18px; }
#welcome .logo { display: inline-block; font-size: 30px; padding: 8px 12px 9px; }
#welcome .lead { font-size: 15px; line-height: 1.45; }
#welcome .live { background: var(--ink); color: var(--sun); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 800; margin: 12px 0; }
#welcome .steps { display: inline-block; text-align: left; margin-bottom: 2px; }
#welcome .steps li { margin-bottom: 6px; }
.bottom button:active, #search button:active { transform: translateY(2px); }

/* Country labels over the map */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lab {
	position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap;
	background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 7px 2px 3px;
	font-weight: 800; font-size: 12px; box-shadow: 0 2px 0 var(--ink); will-change: transform;
}
.lab img { width: 22px; height: 16px; }
.lab i { font-style: normal; opacity: 0.6; font-variant-numeric: tabular-nums; }
.lab.me { background: var(--sun); font-size: 14px; padding: 3px 9px; }

#toast {
	position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
	background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800; text-align: center;
}
#loading {
	position: fixed; inset: 0; display: grid; place-items: center; background: var(--sun);
	font: 26px/1.2 var(--display); transition: opacity 0.4s;
}
#loading.out { opacity: 0; pointer-events: none; }

@media (max-width: 1040px) {
	.bottom .legal { display: none; } /* the same links are inside "How it works" on narrower screens */
	.bottom { flex-wrap: nowrap; }
}
/* Phones */
@media (max-width: 560px) {
	.logo { font-size: 22px; padding: 7px 10px 8px; }
	.counter { padding: 5px 10px 6px; }
	.counter b { font-size: 20px; }
	#search { top: calc(var(--top) + 58px); }
	/* The search bar fills the row under the logo, so the tool buttons start below it. */
	.tools { top: calc(var(--top) + 114px); left: max(12px, env(safe-area-inset-left)); }
	.round { width: 42px; height: 42px; }
	#statusrow { top: calc(var(--top) + 116px); max-width: calc(100vw - 124px); }
	#status { font-size: 12px; padding: 4px 12px; }
	/* Cards become a sheet along the bottom, short enough to leave the map and the soldier in view. */
	#board, #card, #report { left: 10px; right: 10px; width: auto; bottom: calc(62px + env(safe-area-inset-bottom)); }
	#card { max-height: min(56vh, calc(var(--vh) - 240px)); padding: 12px 12px 10px; }
	#card dl { margin-top: 8px; gap: 6px; }
	#card dl div { padding: 5px 8px; }
	#card dd { font-size: 16px; }
	#card .actions { margin-top: 8px; }
	#card .actions button { padding: 7px 6px; font-size: 13px; }
	#card button.verify { margin-top: 8px; padding: 8px; }
	#card .rank { margin-top: 8px; }
	#card .badges { margin-top: 8px; }
	#card .commander { margin-top: 6px; }
	/* With a card open there is little room left, so the replay button steps aside for the soldier's name tag. */
	body.has-card #btn-replay { display: none; }
	.card-head img { width: 44px; height: 33px; }
	#board, #report { max-height: 52vh; }
	.bottom { gap: 6px; flex-wrap: nowrap; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
	.bottom .legal { display: none; } /* the same links are inside "How it works" on small screens */
	.bottom button, .bottom a { padding: 8px 10px; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 var(--ink); }
	.bottom .l { display: none; }
	.bottom .s { display: inline; }
	.bottom button.me { flex: 1 1 auto; }
	.bottom a.ig { margin-left: 0; flex: none; }
	.bottom a.ig span { display: none; }
	.bottom a.ig::before { content: '@'; font: 17px/1 var(--display); }
	.modal { padding: 10px; align-items: end; }
	.modal .panel { max-height: calc(var(--vh) - 20px); }
	#toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
	#ticker { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 50px); font-size: 12px; padding: 4px 12px; }
	#alert { font-size: 17px; }
	.lab { font-size: 11px; padding: 1px 6px 1px 3px; }
	.lab img { width: 19px; height: 14px; }
}
/* Very short screens (a phone on its side): keep the card from covering everything. */
@media (max-height: 480px) {
	#card { max-height: calc(var(--vh) - 130px); }
	#statusrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	#alert { animation-name: none; }
	#loading { transition: none; }
	button.verify, #status.soon { animation: none; }
}
