@font-face {
  font-family: Montserrat;
  src: url('../assets/fonts/montserrat.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
}
:root {
  color-scheme: dark;
  font-family: Montserrat, system-ui, sans-serif;
  background: #142035;
  color: #f9f1dd;
  --panel: #202e44;
  --ink: #f7e6bb;
  --quiet: #bec9d7;
  --line: #a9b9cf3f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 22% 0%,#24344e,#142035 60%); }
button,select,input { font: inherit; }
button, select { cursor: pointer; }
button, select, .link { border: 1px solid var(--line); border-radius: 10px; background: #2c3e55; color: inherit; font-size: .84rem; font-weight: 740; padding: 8px 12px; min-height: 39px; }
button:hover:enabled, select:hover { background: #405470; }
button:disabled { opacity: .42; cursor: default; }
:focus-visible { outline: 2px solid #ffdc98; outline-offset: 2px; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,p { margin: 0; }
h2 { font-size: 1.03rem; letter-spacing: -.02em; }
.shell { width: min(1500px, 96%); margin: 0 auto; padding: 16px max(8px,env(safe-area-inset-left)) 24px max(8px,env(safe-area-inset-right)); }
.yard-header { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.yard-header h1 { margin-top: 5px; font-size: clamp(1.55rem,4.1vw,2.9rem); line-height: 1.12; letter-spacing: -.065em; font-weight: 850; }
.back { font-size: .77rem; font-weight: 720; }
.head-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: end; }
.gold { background: #efd097; color: #292943; border-color: #ffda9fc4; }
.gold:hover:enabled { background: #ffe0a6; }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 11px; }
.stage { height: clamp(380px,calc(100svh - 130px),900px); overflow: hidden; position: relative; border-radius: 16px; background: #394862; border: 1px solid var(--line); }
#yard-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#yard-canvas:active { cursor: grabbing; }
#yard-canvas:focus-visible { outline-offset: -2px; }
.role { position: absolute; top: 11px; left: 11px; padding: 7px 10px; border-radius: 999px; background: #172941d7; font-size: .72rem; color: #f1e1bd; font-weight: 760; pointer-events: none; }
.camera-bar { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.camera-bar button { background: #172941df; padding-inline: 11px; }
.panel, .gate { height: fit-content; border: 1px solid var(--line); border-radius: 16px; padding: 13px; background: var(--panel); }
.panel h2 { margin-bottom: 10px; }
.catalog, .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.catalog { margin-top: 10px; }
.catalog button { display: flex; align-items: center; gap: 6px; padding: 7px 8px; text-align: left; min-height: 41px; font-size: .73rem; line-height: 1.25; }
.catalog button i { flex: 0 0 8px; height: 8px; border-radius: 2px; }
.catalog button[aria-pressed="true"] { border-color: #f6d396; background: #564c4c; color: #fff1c7; }
.selection { margin: 0 0 7px; font-size: .77rem; font-weight: 700; color: var(--ink); }
.themes { margin-bottom: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.themes label { display: block; margin-bottom: 6px; font-size: .74rem; font-weight: 760; color: var(--quiet); }
.themes select { width: 100%; text-overflow: ellipsis; }
#theme-name { font-size: .87rem; font-weight: 750; }
#festival { margin-top: 10px; }
#festival h2 { margin-bottom: 5px; font-size: .78rem; }
#festival-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
#festival-goals button { display: flex; width: 100%; min-height: 32px; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 8px; text-align: left; font-size: .72rem; }
#festival-goals button:disabled { opacity: 1; background: #28384c; }
#festival-goals button[aria-pressed="true"] { border-color: #f6d396; color: #fff0c9; }
#festival-goals button span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
#festival-goals button[data-complete="true"] span:last-child,#festival-done { color: #c7efd5; }
#festival-done:not(:empty) { margin-top: 7px; font-size: .73rem; line-height: 1.4; }
.yard-gallery { display: grid; gap: 6px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.yard-gallery h2 { margin: 0; overflow-wrap: anywhere; }
.yard-gallery p, .yard-gallery a { font-size: .74rem; line-height: 1.45; }
.yard-gallery p { color: var(--quiet); }
.yard-gallery a { width: fit-content; font-weight: 720; }
.gallery-reactions { display: flex; flex-wrap: wrap; gap: 5px; }
.gallery-reactions button { flex: 1 1 auto; padding: 5px 7px; min-height: 34px; font-size: .72rem; }
.gallery-reactions button[aria-pressed="true"] { background: #554b4c; border-color: #f1d197; }
#gallery-settings, #gallery-report { width: fit-content; padding-inline: 9px; min-height: 34px; font-size: .74rem; }
:is(#gallery-settings-dialog,#gallery-report-dialog) :is(input,select) { width: 100%; padding: 8px; color: inherit; border-radius: 8px; background: #18273c; border: 1px solid var(--line); }
:is(#gallery-settings-dialog,#gallery-report-dialog) p { line-height: 1.55; font-size: .79rem; color: var(--quiet); }
.gallery-form-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.gallery-form-actions,#gallery-submit-report { margin-top: 11px; }
:is(#gallery-settings-status,#gallery-report-status):not(:empty) { margin-top: 9px; }
.panel-foot { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 10px; color: var(--quiet); font-size: .73rem; line-height: 1.55; }
#status { display: block; min-height: 17px; margin-bottom: 4px; color: #c6edc9; font-weight: 760; }
#status[data-error="true"] { color: #ffd5a9; }
.gate { margin-top: 20px; padding: 22px; }
.gate .link, .gate button { display: inline-flex; margin-top: 12px; align-items: center; }
dialog { background: #25354c; border: 1px solid #9caec174; border-radius: 15px; color: inherit; padding: 16px; width: min(480px,calc(100% - 24px)); }
dialog::backdrop { background: #111932a8; }
.dialog-head, .link-row { display: flex; align-items: center; gap: 7px; }
.dialog-head { justify-content: space-between; margin-bottom: 10px; }
.dialog-head button { font-size: 1.20rem; }
dialog label { display: block; font-size: .79rem; font-weight: 720; margin: 8px 0 5px; }
.link-row { margin-bottom: 12px; }
.link-row input { width: 100%; min-width: 0; background: #18273c; color: #dee8f4; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
#share-status { color: #d7e9c9; font-size: .78rem; margin-top: 7px; min-height: 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 740px) {
  .workspace { grid-template-columns: 1fr; gap: 7px; }
  .stage { height: clamp(240px,49svh,540px); border-radius: 12px; }
  .yard-header { gap: 7px; }
  .head-tools button,.head-tools select { padding-inline: 8px; font-size: .72rem; }
  .catalog { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .panel { padding: 9px; }
  .camera-bar { bottom: 7px; right: 7px; }
}
@media (max-height: 500px) and (min-width: 741px) {
  .stage { height: 74svh; min-height: 230px; }
  .shell { padding-top: 6px; }
  .yard-header h1 { font-size: 1.55rem; }
  .catalog button { min-height: 35px; }
  .panel { padding: 8px; }
}
.coop-hud {
  position: absolute; inset: 11px auto auto 11px; max-width: min(320px, calc(100% - 22px));
  background: #172941ed; color: #f9e9bf; border-radius: 12px; padding: 10px 11px; pointer-events: none;
  border: 1px solid #fce2ad4a; font-size: .77rem;
}
.coop-hud div { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
#coop-roster { color: #bbebd2; white-space: nowrap; }
#coop-status { margin-top: 5px; color: #f1e4c6; line-height: 1.4; font-size: .73rem; }
.station-pin { position: absolute; transform: translate(-50%,-50%); pointer-events: none; border: 1px solid #f4dba389; background: #2c3c53e8;
  padding: 4px 7px; border-radius: 7px; color: #ffe6b2; font-weight: 780; font-size: .65rem; white-space: nowrap; }
.coop-touch { display: none; }
@media (pointer: coarse) { .coop-touch { display: block; } }
.stage[data-touch="true"] .coop-touch { display: block; }
#coop-stick { position: absolute; left: 12px; bottom: 13px; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%;
  background: #1931459c; border: 1px solid #c6f4d9a8; touch-action: none; }
#coop-stick i { width: 34px;height: 34px;border-radius: 50%;background: #d3f1dbbc;pointer-events:none;
  transform:translate(var(--stick-x,0px),var(--stick-y,0px)); }
#coop-jump { position: absolute; right: 12px; bottom: 61px; min-height: 43px; background: #172941df; }
#coop-activate-wrap { position: absolute; bottom: 69px; left: 50%; transform: translateX(-50%); }
#coop-activate { min-height: 43px; white-space: nowrap; }
#coop-panel { margin-bottom: 13px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#coop-guide { font-size: .74rem; color: var(--quiet); line-height: 1.5; }
.emotes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.emotes button { flex: 1 1 auto; min-height: 34px; font-size: .69rem; padding: 4px 6px; }
@media (max-width: 740px) {
  .coop-hud { max-width: min(270px, calc(100% - 22px)); padding: 7px 8px; }
  #coop-status { font-size: .67rem; }
  #coop-stick { width: 66px; height: 66px; }
}
