/* An opaque native modal keeps the task list and navigation out of view. */
dialog#focusRoom {
  --room-bg:#f2f8f3; --room-ink:#203f34; --room-secondary:#526b5d;
  --room-rule:#d5e4d8; --room-ring:#448a71; --room-track:#dbe9df;
  --room-accent:#276c56; --room-on-accent:#fff; --room-card:#fffefb;
  margin:0; inset:0; width:100%; max-width:none; height:100%; max-height:none;
  height:100dvh; border:0; border-radius:0; padding:0; box-shadow:none;
  background:var(--room-bg); color:var(--room-ink); overflow:auto; overscroll-behavior:contain;
}
#focusRoom::backdrop { background:#263e33; backdrop-filter:none; }
#focusRoom[data-kind="move"], #focusRoom[data-phase="movementPrompt"], #focusRoom[data-phase="break"] {
  --room-bg:#fcf6e9; --room-ink:#4e422d; --room-secondary:#6c5c40;
  --room-rule:#e6dbc0; --room-ring:#ad8248; --room-track:#ebe0c7;
  --room-accent:#805d32;
}
#focusRoom[data-kind="play"][data-phase="focus"], #focusRoom[data-kind="play"][data-phase="check"] {
  --room-bg:#eff5fa; --room-ink:#273f53; --room-secondary:#4e6579;
  --room-rule:#cedee8; --room-ring:#5187a8; --room-track:#d7e5ee;
  --room-accent:#39627d; --room-card:#fbfdff;
}
#focusRoom[data-phase="movementPrompt"] .room-heading {
  padding:clamp(18px,3.6vw,32px); border:1px solid var(--room-rule);
  border-radius:20px; background:var(--room-card);
}
.room-shell {
  min-height:100%; display:flex; flex-direction:column; max-width:1000px; margin:auto;
  padding:max(18px,env(safe-area-inset-top)) max(clamp(16px,4vw,52px),env(safe-area-inset-right))
    max(22px,env(safe-area-inset-bottom)) max(clamp(16px,4vw,52px),env(safe-area-inset-left));
}
.room-top {
  display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px;
  padding-bottom:10px; border-bottom:1px solid var(--room-rule);
}
.room-identity, #focusRoom button { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; }
.room-identity { min-width:0; font-size:1rem; font-weight:650; color:var(--room-secondary); }
.room-identity > svg, #focusRoom .room-undo { flex-shrink:0; }
#roomOwner { min-width:0; overflow-wrap:anywhere; }
#focusRoom button[hidden], #focusRoom [hidden] { display:none; }
#focusRoom button { min-height:48px; border-radius:12px; touch-action:manipulation; }
#focusRoom .room-undo { color:var(--room-secondary); padding:4px 8px; font-size:.9rem; }
.room-main {
  width:min(100%,570px); margin:auto; text-align:center; padding-block:clamp(24px,6vh,72px);
  display:grid; justify-items:center; gap:clamp(18px,3vh,32px);
}
.room-heading { width:100%; min-width:0; overflow-wrap:anywhere; }
#roomState { margin:0 0 8px; font-size:1rem; font-weight:600; color:var(--room-secondary); }
#roomTaskTitle { margin:0; color:var(--room-ink); font-size:clamp(1.7rem,4.5vw,3.25rem); letter-spacing:.02em; line-height:1.34; }
#roomTaskTitle:focus { outline:none; }
#roomFirstStep { margin:12px auto 0; max-width:34em; color:var(--room-secondary); font-size:clamp(1rem,2vw,1.16rem); line-height:1.65; }
#roomTool { margin-top:14px; }
.room-tool-link { display:inline-flex; align-items:center; justify-content:center; min-height:46px; max-width:100%; padding:8px 20px; border-radius:12px; border:1px solid var(--room-accent); color:var(--room-accent); background:var(--room-card); font-weight:650; text-decoration:none; overflow-wrap:anywhere; }
.room-tool-link:active { background:var(--room-track); }
.room-tool-link.room-primary { background:var(--room-accent); color:var(--room-on-accent); }
.room-tool-link:focus-visible { outline:3px solid var(--room-accent); outline-offset:2px; }
#roomTool p { color:var(--room-secondary); font-size:1rem; margin:6px 0 0; }
.room-dial { display:grid; place-items:center; position:relative; width:clamp(190px,33vmin,320px); aspect-ratio:1; max-width:100%; }
.room-dial > svg { width:100%; height:100%; overflow:visible; }
.room-dial circle { fill:none; stroke-width:6; }
.room-track { stroke:var(--room-track); }
#roomRing { stroke:var(--room-ring); stroke-linecap:round; }
#focusRoom[data-status="ended"] #roomRing { stroke-opacity:0; }
.room-digits { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:6px; }
.room-readout { display:grid; justify-items:center; gap:6px; }
.room-readout > span { color:var(--room-secondary); font-size:1rem; }
#focusRoom .room-duration {
  min-height:44px; padding:4px 12px; border:1px solid var(--room-rule); border-radius:24px;
  background:var(--room-card); color:var(--room-accent); font-size:.9rem; font-weight:650;
}
#focusRoom .room-duration:focus-visible { outline:3px solid var(--room-accent); outline-offset:2px; }
#roomTime {
  font:700 clamp(2.8rem,7.6vmin,4.85rem)/1.1 ui-rounded, system-ui, sans-serif;
  font-variant-numeric:tabular-nums; letter-spacing:-.055em;
}
.room-actions { display:flex; align-items:stretch; justify-content:center; flex-wrap:wrap; gap:10px; }
#focusRoom .room-actions button {
  padding:11px clamp(16px,2.6vw,28px); background:var(--room-card);
  color:var(--room-ink); border:1px solid var(--room-rule); font-size:1rem; font-weight:650;
}
#focusRoom .room-actions .room-primary {
  background:var(--room-accent); border-color:var(--room-accent); color:var(--room-on-accent);
}
.room-question {
  display:grid; justify-items:center; gap:13px; border-radius:19px; border:1px solid var(--room-rule);
  padding:clamp(20px,4vw,38px); color:var(--room-ink); background:var(--room-card); font-size:1.2rem;
}
.room-question svg { color:var(--room-accent); }
.room-question p { margin:0; line-height:1.65; overflow-wrap:anywhere; }
.room-award { background:#f8e7b8; color:#906323; border-radius:50%; width:92px; height:92px; display:grid; place-items:center; }
.room-award svg { fill:#e9ba5f; }
#roomRadio { width:min(100%,420px); }
#roomRadio .camp-radio { margin:0; }
.room-accessible { position:absolute; width:1px; height:1px; padding:0; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
@media (max-height:540px) and (min-width:560px) {
  .room-main:has(.room-dial:not([hidden])) {
    width:min(100%,700px); grid-template-columns:1fr auto; align-items:center; column-gap:25px;
    grid-template-areas:"heading clock" "buttons clock"; padding-block:18px;
  }
  .room-main:has(.room-dial:not([hidden])) .room-heading { grid-area:heading; }
  .room-main:has(.room-dial:not([hidden])) .room-dial { grid-area:clock; width:min(175px,50vh); }
  .room-main:has(.room-dial:not([hidden])) .room-actions { grid-area:buttons; }
}
@media (max-width:370px) { .room-actions { width:100%; } #focusRoom .room-actions button { flex:1 1 100%; } }
@media (prefers-reduced-motion:no-preference) {
  #roomRing { transition:stroke-dashoffset .8s linear; }
}
@media (prefers-color-scheme:dark) {
  dialog#focusRoom {
    --room-bg:#182920; --room-ink:#e6f0e7; --room-secondary:#b7cbbd;
    --room-rule:#3f594b; --room-ring:#a2d6b3; --room-track:#365141;
    --room-accent:#9ed0af; --room-on-accent:#173426; --room-card:#243b2e;
  }
  #focusRoom[data-kind="move"], #focusRoom[data-phase="movementPrompt"], #focusRoom[data-phase="break"] {
    --room-bg:#2b281e; --room-ink:#f1e5c8; --room-secondary:#d0c3a7;
    --room-rule:#5b513b; --room-ring:#ddbb78; --room-track:#4d4531;
    --room-accent:#d7b477; --room-on-accent:#322b1e; --room-card:#3b3528;
  }
  #focusRoom[data-kind="play"][data-phase="focus"], #focusRoom[data-kind="play"][data-phase="check"] {
    --room-bg:#1c2935; --room-ink:#e6edf5; --room-secondary:#bacbda;
    --room-rule:#40586a; --room-ring:#9fc6df; --room-track:#314a5c;
    --room-accent:#aacbdf; --room-on-accent:#19364b; --room-card:#283b4a;
  }
  .room-award { background:#493e29; color:#f3d69b; }
}
@media (forced-colors:active) {
  #roomRing { stroke:Highlight; }
  .room-track { stroke:GrayText; }
  #focusRoom .room-actions button { border:1px solid ButtonText; }
}
