:root { color-scheme: dark; font-family: system-ui, sans-serif; background:#0b100f; color:#eef3f0; }
* { box-sizing:border-box; letter-spacing:0; }
[hidden] { display:none !important; }
body { margin:0; }
header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid #48544e; }
header img { width:60px; height:60px; object-fit:cover; clip-path:circle(45%); }
header span { flex:1; font-weight:700; }
main { max-width:580px; margin:auto; padding:16px; }
h1 { font-size:28px; margin:16px 0; overflow-wrap:anywhere; }
h2 { font-size:19px; }
button,.button { border:1px solid #ecd061; border-radius:6px; background:#d5b22d; color:#101715; padding:12px 16px; font:700 16px system-ui; cursor:pointer; text-align:center; text-decoration:none; display:inline-block; }
button:disabled { opacity:.5; cursor:default; }
.danger { background:#ae2439; color:white; border-color:#ee7183; }
.secondary { background:#18392b; color:#b8e6cf; border-color:#6a9d80; }
a { color:#ead05b; }
.scores { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:20px 0; border-block:1px solid #48544e; }
.scores div { min-width:0; border-bottom:3px solid #d5b22d; padding-bottom:12px; }
.scores span { font-size:14px; overflow-wrap:anywhere; }
.scores strong { display:block; font-size:48px; }
.actions { display:grid; gap:12px; margin-top:20px; }
.actions button { width:100%; min-height:58px; font-size:18px; }
#connection { padding:10px 12px; background:#18392b; color:#b8e6cf; border-left:3px solid #6a9d80; }
#connection.offline { background:#3c2820; color:#ffd4a7; border-color:#e7a94e; }
#notice { min-height:42px; overflow-wrap:anywhere; }
.activity { border-top:1px solid #48544e; margin:24px 0; }
#activity { max-height:190px; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-gutter:stable; padding-right:8px; }
.section-heading { display:flex; gap:12px; align-items:center; justify-content:space-between; }
ul { list-style:none; padding:0; }
li { padding:12px 0; border-bottom:1px solid #48544e; overflow-wrap:anywhere; }
li small { display:block; margin-top:5px; color:#adbcb4; }
dialog { border:1px solid #d5b22d; border-radius:6px; color:#eef3f0; background:#101715; width:min(440px,calc(100% - 24px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; }
dialog::backdrop { background:#000b; }
.close { float:right; font-size:24px; width:44px; height:44px; padding:0; }
#qr { background:white; padding:16px; width:100%; display:grid; place-items:center; margin:24px 0; }
#qr img,#qr canvas { max-width:100%; height:auto; }
video { width:100%; aspect-ratio:1; object-fit:cover; background:#050505; margin-top:16px; }
.emergency-warning { color:#ffb4bd; font-weight:700; }
#emergencyDialog button { width:100%; margin-top:12px; }
#emergencyStatus { white-space:pre-wrap; overflow-wrap:anywhere; }
.sound-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:8px 0 16px; }
.sound-controls label { display:flex; align-items:center; gap:8px; min-height:44px; }
.sound-controls input { width:20px; height:20px; accent-color:#d5b22d; }
.sound-controls small { flex-basis:100%; color:#adbcb4; }
.whistle-steps { display:flex; gap:12px; margin:16px 0; }
.whistle-step { display:grid; place-items:center; width:48px; height:48px; border:2px solid #b4c0b9; border-radius:50%; font-weight:700; }
.whistle-step.pulse-active { background:#f0d15b; color:#101715; border-color:#f0d15b; }
#whistleTiming { min-height:48px; font-weight:700; }
#powerFreshness { color:#ffd4a7; font-size:13px; }
#remoteForm { display:grid; gap:16px; margin:20px 0; }
#remoteForm[hidden] { display:none; }
#remoteDistrict { display:block; width:100%; padding:12px; margin-top:8px; font:inherit; }
#powerDialog button:not(.close) { width:100%; margin:8px 0; }
.control-message { position:fixed; inset:0; width:100%; height:100dvh; max-width:none; max-height:none; margin:0; padding:24px 16px; padding-bottom:max(24px,env(safe-area-inset-bottom)); border:0; border-top:12px solid var(--message-colour); border-radius:0; background:#0b100f; overflow-y:auto; }
.control-message::backdrop { background:#0b100f; }
.priority-safety { --message-colour:#ef4444; }
.priority-power { --message-colour:#fb923c; }
.priority-general { --message-colour:#4ade80; }
.message-content { max-width:580px; margin:0 auto; }
#messagePriority { color:var(--message-colour); font-weight:700; }
.message-body { white-space:pre-wrap; overflow-wrap:anywhere; font-size:18px; line-height:1.6; }
#acknowledgeMessage { width:100%; min-height:58px; white-space:normal; background:var(--message-colour); border-color:var(--message-colour); }
@media(max-width:360px) { header { gap:8px; } header img { width:44px; height:44px; } header span { font-size:13px; } header button { font-size:13px; padding:10px; } }

body { background:#0b100f url('woodland.png') center top / cover fixed no-repeat; }
header { max-width:580px; margin:auto; border:0; align-items:flex-start; justify-content:space-between; padding:18px 16px 0; }
header img { width:160px; height:160px; flex-shrink:0; clip-path:circle(44.5%); filter:drop-shadow(0 4px 8px #0009); }
header #openSettings { width:44px; height:44px; padding:0; font-size:25px; border-radius:50%; background:#101715; color:#edce63; }
header .danger { padding:10px 8px; font-size:12px; margin-top:3px; }
main { padding-top:0; }
.test-banner { margin:4px 0; text-align:center; font-size:10px; color:#fff; text-shadow:0 1px 3px #000; }
#connection { margin:8px 0; font-size:11px; padding:7px 10px; background:#0b100fe8; }
#name { margin:12px auto 6px; width:85%; padding:8px 12px; text-align:center; color:#11190f; background:#edc84e; text-transform:uppercase; font-size:26px; clip-path:polygon(2% 0,100% 3%,97% 25%,100% 45%,98% 70%,100% 96%,0 100%,3% 65%,0 35%); }
#gameState { text-align:center; font-size:12px; color:white; text-shadow:0 1px 4px #000; margin:6px 0; }
.scores { display:flex; flex-direction:column; align-items:center; gap:12px; padding:8px 0; border:0; }
.scores>div:first-child { width:174px; height:174px; border:8px solid #dfba3e; border-radius:50%; background:#101715ef; display:flex; flex-direction:column; align-items:center; justify-content:center; box-shadow:0 0 0 2px #fff1a3, inset 0 0 0 2px #8c731d,0 6px 18px #0008; padding:0; }
.scores>div:first-child span { text-transform:uppercase; font-weight:800; color:#edce63; }
.scores>div:first-child strong { font-size:64px; line-height:1.15; color:#edce63; }
#district { --district-colour:#2563eb; width:100%; background:#0b100fe8; border:0; border-left:6px solid var(--district-colour); border-bottom:3px solid var(--district-colour); padding:10px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
#districtName { font-size:18px; font-weight:800; }
#districtPoints { font-size:28px; }
.actions { margin-top:8px; gap:10px; }
.actions button { min-height:56px; font-size:18px; text-transform:uppercase; background:#edc84e; border-color:#ffe89b; box-shadow:0 3px 0 #9b7518; }
#notice:empty { min-height:0; margin:12px 0; }
#notice:not(:empty) { background:#101715f2; padding:12px; border-left:3px solid #edc84e; }
.power-section,.activity { background:#0b100fee; padding:12px 16px; margin:16px 0; border-block:1px solid #79857c; }
.power-section h2 { text-transform:uppercase; font-size:15px; margin:4px 0; }
#powers { margin:8px 0; }
#powers li:last-child { border:0; }
#logout { display:block; text-align:center; padding:14px; background:#0b100fee; border:1px solid #79857c; border-radius:6px; margin-bottom:max(16px,env(safe-area-inset-bottom)); }
.control-message { background:#0b100f url('woodland.png') center / cover no-repeat; }
.message-logo { display:block; width:150px; height:150px; object-fit:cover; clip-path:circle(44.5%); margin:0 auto 18px; }
#messagePriority { background:var(--message-colour); color:#101715; padding:14px; text-align:center; text-transform:uppercase; font-size:20px; }
.message-paper { background:#f3dcaa; color:#172219; padding:24px 20px; border:1px solid #ad864d; box-shadow:0 5px 20px #0007; }
.message-paper h1 { font-size:22px; margin:0 0 20px; }
#captureOutcome { --outcome-colour:#a5ed45; position:fixed; inset:0; width:100%; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; border-top:6px solid var(--outcome-colour); border-radius:0; background:#08100c; text-align:center; overflow:hidden; display:none; }
#captureOutcome::backdrop { background:#050907; }
#captureOutcome[open] { display:flex; flex-direction:column; }
#captureOutcome.outcome-blue { --outcome-colour:#57c6ff; }
#captureOutcome.outcome-red { --outcome-colour:#ff565f; }
#captureOutcome.outcome-yellow { --outcome-colour:#ffdc47; }
.outcome-content { width:100%; max-width:580px; margin:auto; padding:16px 20px; overflow-y:auto; min-height:0; flex:1; background:linear-gradient(#08100ce6,#08100cd9),url('woodland.png') center / cover; }
#captureOutcomeArt { display:block; width:min(290px,100%); height:auto; aspect-ratio:1; object-fit:contain; margin:0 auto 12px; }
#captureOutcomeArt[hidden] { display:none; }
#captureOutcomeTitle { font-size:32px; line-height:1.05; text-transform:uppercase; background:var(--outcome-colour); color:#08100c; padding:16px 12px; margin:0 0 16px; width:100%; font-weight:900; font-style:italic; clip-path:polygon(0 7%,99% 0,97% 25%,100% 50%,98% 94%,1% 100%,3% 70%,0 45%); }
#captureOutcomePoints { display:block; color:var(--outcome-colour); font-size:30px; text-transform:uppercase; line-height:1.2; }
#captureOutcomeDetail { font-size:17px; line-height:1.5; margin:16px 0; overflow-wrap:anywhere; }
#captureOutcomeDistrict { display:inline-block; border-left:6px solid; background:#08100ce8; padding:10px 18px; margin:0; font-weight:800; }
.outcome-footer { flex-shrink:0; width:100%; max-width:580px; margin:0 auto; padding:12px 20px max(16px,env(safe-area-inset-bottom)); background:#08100c; }
#captureOutcome button { width:100%; min-height:56px; background:var(--outcome-colour); border-color:var(--outcome-colour); color:#08100c; font-size:18px; font-weight:800; text-transform:uppercase; }
@media(max-height:650px) { #captureOutcomeArt { width:180px; } #captureOutcomeTitle { font-size:26px; padding:12px; } #captureOutcomePoints { font-size:26px; } }
@media(prefers-reduced-motion:no-preference) { #captureOutcome[open] #captureOutcomeArt { animation:outcome-impact .35s ease-out; } @keyframes outcome-impact { from { transform:scale(.8); opacity:.3; } to { transform:scale(1); opacity:1; } } }
#messageStatus { background:#0b100fee; padding:10px; }
#acknowledgeMessage { background:#edc84e; border-color:#ffe89b; color:#101715; margin-top:12px; }
@media(max-width:360px) { header img { width:135px; height:135px; } header { gap:4px; } }
@media(prefers-reduced-motion:no-preference) { dialog[open] { animation:reveal .2s ease-out; } @keyframes reveal { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } } }

body { isolation:isolate; background:#080d0a; }
/* Keep mandatory acknowledgement visible while the parchment text scrolls. */
.control-message { padding:0; border:0; overflow:hidden; background:#080d0a url('quiet-woodland.png') center / cover no-repeat; display:none; }
.control-message[open] { display:block; }
.control-message .message-content { height:100%; max-width:480px; padding:16px 16px max(16px,env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:8px; }
.message-banner { position:relative; isolation:isolate; flex-shrink:0; text-align:center; padding:14px 12px; color:#fff5d8; font-family:'Avenir Next Condensed','Arial Narrow',Impact,sans-serif; font-weight:900; text-transform:uppercase; font-size:27px; line-height:1.1; }
.message-banner::before { content:''; position:absolute; inset:0; z-index:-1; background:var(--message-colour); -webkit-mask:url('gold-brush.png') center / 100% 100% no-repeat; mask:url('gold-brush.png') center / 100% 100% no-repeat; }
.control-message.priority-safety { --message-colour:#b71923; }
.control-message.priority-power { --message-colour:#c95705; }
.control-message.priority-general { --message-colour:#237d38; }
.control-message #messagePriority { flex-shrink:0; background:none; color:#fff5d8; margin:0; padding:0 8px; text-align:center; font-size:14px; font-weight:800; }
.control-message .message-paper { flex:1; min-height:0; margin:0; padding:clamp(40px,9dvh,76px) 11% clamp(44px,10dvh,84px); border:0; box-shadow:none; background:transparent url('message-parchment.png') center / 100% 100% no-repeat; color:#19170f; display:flex; }
.message-reading { width:100%; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; text-align:center; }
.message-symbol { color:var(--message-colour); font-size:58px; line-height:1.1; font-weight:900; }
.message-kind { font-family:'Avenir Next Condensed','Arial Narrow',Impact,sans-serif; font-size:27px; font-weight:900; line-height:1.15; text-transform:uppercase; margin:12px 0 16px; padding-bottom:12px; border-bottom:1px solid #a78a56; }
.message-reading span { display:none; }
.priority-safety .symbol-safety,.priority-power .symbol-power,.priority-general .symbol-general { display:inline; }
.control-message .message-body { font-family:Georgia,serif; font-size:20px; line-height:1.5; margin:12px 0 24px; }
.control-message #messageTitle { font-family:Georgia,serif; font-size:17px; line-height:1.4; margin:12px 0; font-weight:400; overflow-wrap:anywhere; }
.message-footer { flex-shrink:0; }
.control-message #messageStatus { margin:0; font-size:13px; padding:6px; text-align:center; }
.control-message #messageStatus:empty { display:none; }
.control-message #acknowledgeMessage { background:var(--message-colour); color:#fff5d8; border:1px solid #ffffff66; border-radius:4px; margin:0; min-height:58px; padding:12px; font-family:'Avenir Next Condensed','Arial Narrow',Impact,sans-serif; font-size:22px; font-weight:900; text-transform:uppercase; }
@media(max-height:650px) { .control-message .message-content { padding-top:8px; gap:4px; } .message-banner { font-size:22px; padding:10px; } .message-symbol { font-size:38px; } .message-kind { font-size:22px; margin:6px 0; } .control-message .message-body { font-size:18px; } }
body::before { content:''; position:fixed; z-index:-1; top:0; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,480px); background:#080d0a url('quiet-woodland.png') center / cover no-repeat; pointer-events:none; }
.score-medallion #points.score-medium { font-size:58px; }
.score-medallion #points.score-small { font-size:32px; }
.score-medallion #points.score-long { font-size:22px; }
.connection-strip { max-width:480px; margin:auto; padding:5px 16px 0; text-align:center; }
.connection-strip .test-banner { font-size:9px; margin:0; }
.connection-strip #connection { background:#080d0abe; border:0; margin:2px 0 0; padding:3px 6px; font-size:10px; line-height:1.4; }
.connection-strip #connection.offline { color:#ffe4b5; background:#49261ed9; }
header { position:relative; max-width:480px; height:150px; display:flex; justify-content:center; align-items:center; padding:0; }
header img { width:150px; height:150px; clip-path:circle(44.5%); filter:drop-shadow(0 4px 5px #0009); }
header #openSettings { position:absolute; left:16px; top:18px; width:44px; height:44px; background:#080d0aec; border:2px solid #cfaa38; }
header .danger { position:absolute; right:16px; top:8px; padding:8px; font-size:10px; min-height:44px; border-radius:20px; box-shadow:0 2px 8px #0007; }
main { max-width:480px; padding:0 20px 16px; }
#name,.scores>div:first-child span,.scores>div:first-child strong,#districtName,.district-total,.actions button,.power-section h2 { font-family:'Avenir Next Condensed','Arial Narrow',Impact,sans-serif; font-stretch:condensed; font-weight:900; }
#name { width:76%; min-height:52px; margin:0 auto; padding:8px 20px; display:grid; place-items:center; font-size:30px; line-height:1.1; background:transparent url('gold-brush.png') center / 100% 100% no-repeat; clip-path:none; }
#gameState { margin:2px 0; font-size:10px; }
.scores { padding:0; gap:0; }
.scores>div:first-child { width:224px; height:224px; border:0; border-radius:0; background:transparent url('score-medallion.png') center / contain no-repeat; box-shadow:none; padding:0 38px; margin:0 auto; gap:0; }
.scores>div:first-child span { font-size:23px; line-height:1.15; color:#edc84e; }
.scores>div:first-child strong { font-size:88px; line-height:1; color:#edc84e; max-width:100%; text-shadow:0 2px 0 #695011; }
#district { position:relative; isolation:isolate; width:100%; min-height:86px; margin:0; padding:10px 22px; background:transparent; border:0; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:0; text-align:center; }
#district::before { content:''; position:absolute; inset:0; z-index:-1; background-color:var(--district-colour); -webkit-mask:url('gold-brush.png') center / 100% 100% no-repeat; mask:url('gold-brush.png') center / 100% 100% no-repeat; }
#districtName { font-size:30px; text-transform:uppercase; line-height:1.15; color:white; text-shadow:0 2px 4px #000; }
#district .district-total { display:flex; align-items:center; justify-content:center; gap:14px; border:0; padding:0; min-width:0; }
#district .district-total span { font-size:17px; text-transform:uppercase; color:white; text-shadow:0 1px 3px #000; }
#districtPoints { font-size:34px; line-height:1.1; color:white; text-shadow:0 2px 3px #000; }
.actions { gap:4px; margin-top:6px; }
.actions button { min-height:60px; border:0; border-radius:0; box-shadow:none; background:transparent url('gold-brush.png') center / 100% 100% no-repeat; color:#100e06; font-size:25px; padding:12px 24px; }
.actions button:disabled { opacity:.7; }
.actions button:focus-visible { outline:3px solid white; outline-offset:2px; }
.power-section { padding:10px 14px; margin:10px 0; border:1px solid #b0a17a; background:#080d0ae8; }
.power-section h2 { text-align:center; font-size:17px; color:#d1d2ce; }
.power-section p { margin:4px 0; }
#powers { margin:4px 0; }
#powers li { padding:8px 0; font-weight:700; }
.activity { margin:12px 0; }
@media(max-height:740px) { header { height:130px; } header img { width:130px; height:130px; margin-top:12px; } .scores>div:first-child { width:196px; height:196px; } .scores>div:first-child span { font-size:20px; } .scores>div:first-child strong { font-size:76px; } #name { min-height:46px; font-size:27px; } }
