/* STOP AND SEARCH — the watch (noir.rest.js). A glance at your watch under the street lamp: the city stays in view, a
   24-hour face rises from where the seat prompt was, low and centred under the seated player. No panel: type and the
   dial sit on a dark pool of shade. Amber is what you can do and the time; teal is the city's word; red its no. The
   actions are drawn like the city's own prompts (noir.css .nr-prompt). The renderer stays shared. */
.rest-watch { --amber: #ffb347; --bone: #f5ede0; --teal: #39d9cc; --dim: rgba(232,239,233,.62); --alert: #ff6a5a; --ease: cubic-bezier(.2,.8,.2,1);
  --dial: clamp(168px, 25vh, 228px);
  position: fixed; inset: 0; z-index: 85; color: var(--bone); font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif; letter-spacing: .02em; user-select: none;
  animation: rest-shade .45s ease-out both; }
.rest-watch[hidden], .rest-watch [hidden] { display: none !important; }
/* the shade: deepest under the watch, light over the player so the bench and the street read */
.rest-watch::before, .rest-watch::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.rest-watch::before { background: radial-gradient(115% 68% at 50% 104%, rgba(3,7,9,.93) 0%, rgba(3,7,9,.8) 34%, rgba(3,7,9,.32) 62%, rgba(3,7,9,.06) 82%), linear-gradient(rgba(3,7,9,.1), rgba(3,7,9,.1)); }
.rest-watch::after { background: radial-gradient(60% 40% at 50% 100%, rgba(255,160,60,.08), transparent 70%); opacity: 0; transition: opacity 1.2s ease; }
.rest-watch[data-state="rest"]::after { opacity: 1; }
.rest-watch.leaving { pointer-events: none; animation: rest-out .2s ease-in both; }

.rest-face { position: absolute; left: 50%; bottom: clamp(48px, 11vh, 112px); transform: translateX(-50%); display: grid; grid-template-columns: var(--dial) minmax(0, 340px); align-items: center; gap: 44px; }

/* ------------------------------------------------------------------ the dial */
.rest-dial { position: relative; width: var(--dial); height: var(--dial); border-radius: 50%; touch-action: none; cursor: default;
  background: radial-gradient(circle, rgba(6,9,11,.82) 0 58%, rgba(6,9,11,.5) 66%, transparent 71%);
  animation: rest-dial .55s var(--ease) both; }
.rest-watch[data-state="choose"] .rest-dial { cursor: pointer; }
.rest-sky { position: absolute; inset: 1%; border-radius: 50%; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 2.5px)); }
.rest-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.rest-ticks line { stroke: rgba(232,239,233,.22); stroke-width: 1; }
.rest-ticks .major { stroke: rgba(232,239,233,.55); stroke-width: 1.4; }
.rest-dial text { fill: rgba(232,239,233,.4); font: 600 9px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: .12em; text-anchor: middle; dominant-baseline: middle; }
.rest-track { stroke: rgba(232,239,233,.07); stroke-width: 1; }
.rest-span, .rest-arc { stroke-linecap: round; stroke-dasharray: 0 1; transform-origin: 100px 100px; }
.rest-span { stroke: rgba(255,179,71,.5); stroke-width: 4.5; transition: stroke-dasharray .2s var(--ease); animation: rest-draw .7s .12s var(--ease) both; }
.rest-arc { stroke: var(--amber); stroke-width: 4.5; filter: drop-shadow(0 0 4px rgba(255,160,60,.75)); }
.rest-now, .rest-wake { transform-origin: 100px 100px; }
.rest-now circle { fill: var(--bone); filter: drop-shadow(0 0 3px rgba(255,255,255,.6)); }
.rest-wake { transition: transform .2s var(--ease); }
.rest-them { transform-origin: 100px 100px; transition: transform .2s var(--ease); }
.rest-them circle { fill: #0a0d0e; stroke: rgba(255,179,71,.75); stroke-width: 1.6; }
.rest-wake circle { fill: var(--amber); stroke: #0a0d0e; stroke-width: 2; filter: drop-shadow(0 0 6px rgba(255,160,60,.9)); }
.rest-watch[data-state="rest"] .rest-wake { transition: none; }
.rest-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rest-day { font-weight: 600; font-size: 9.5px; letter-spacing: .34em; color: rgba(57,217,204,.8); margin-left: .34em; }
.rest-time { margin-top: 2px; font: 600 calc(var(--dial) * .25)/1 "Barlow Condensed", sans-serif; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--amber);
  text-shadow: 0 0 22px rgba(255,160,60,.42); transition: text-shadow .6s ease; }
.rest-watch[data-state="rest"] .rest-time { text-shadow: 0 0 30px rgba(255,160,60,.8), 0 0 4px rgba(255,190,110,.6); }
.rest-watch[data-state="rest"] .rest-arc { animation: rest-glow 2.4s ease-in-out infinite; }

/* ------------------------------------------------------------------ the words */
.rest-copy { text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.rest-copy > * { animation: rest-rise .4s var(--ease) both; }
.rest-copy > :nth-child(2) { animation-delay: .04s; } .rest-copy > :nth-child(3), .rest-copy > :nth-child(4) { animation-delay: .08s; }
.rest-copy > :nth-child(5), .rest-copy > :nth-child(6) { animation-delay: .12s; } .rest-copy > :nth-child(7) { animation-delay: .16s; }
/* a new state slides its words in again (a different keyframe name restarts the animation) */
.rest-watch[data-state="wait"] .rest-copy > * { animation-name: rest-rise-b; }
.rest-watch[data-state="rest"] .rest-copy > * { animation-name: rest-rise-c; }
.rest-kicker { display: flex; align-items: center; gap: 9px; margin: 0; font-weight: 600; font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--teal); }
.rest-kicker i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.rest-watch[data-state="wait"] .rest-kicker, .rest-watch[data-state="rest"] .rest-kicker { color: var(--amber); }
.rest-watch[data-state="wait"] .rest-kicker i { animation: rest-pulse 1.6s ease-in-out infinite; }
.rest-watch h2 { margin: 7px 0 0; font: 700 38px/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--bone); white-space: nowrap; }
.rest-note { margin: 9px 0 0; font-weight: 600; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--bone); animation: rest-flash .35s var(--ease) both !important; }
.rest-note[data-tone="bad"] { color: var(--alert); }
.rest-note[data-tone="good"] { color: var(--teal); }

/* for / until, and the value between two arrows */
.rest-choose { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.rest-watch button { color: inherit; background: transparent; border: 0; padding: 0; font: inherit; letter-spacing: inherit; cursor: pointer; }
.rest-watch button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.rest-value:focus { outline: 0; }
.rest-modes { display: flex; gap: 14px; }
.rest-modes button { position: relative; padding: 4px 0; font-weight: 600; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(232,239,233,.45); transition: color .15s; }
.rest-modes button::after { content: ""; position: absolute; left: 0; right: .3em; bottom: -2px; height: 2px; background: var(--amber); box-shadow: 0 0 6px rgba(255,160,60,.7); transform: scaleX(0); transition: transform .2s var(--ease); }
.rest-modes button:hover { color: var(--bone); }
.rest-modes button[aria-pressed="true"] { color: var(--bone); }
.rest-modes button[aria-pressed="true"]::after { transform: none; }
.rest-step { display: flex; align-items: center; gap: 6px; }
.rest-step button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 600 20px/1 "Barlow Condensed", sans-serif; color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255,179,71,.35); transition: background .15s, box-shadow .15s; }
.rest-step button:hover { background: rgba(255,179,71,.14); box-shadow: inset 0 0 0 1px var(--amber); }
.rest-value { position: relative; display: block; min-width: 4.4em; padding: 2px 0 5px; text-align: center; font: 700 28px/1 "Barlow Condensed", sans-serif; letter-spacing: .05em; text-transform: uppercase; font-variant-numeric: tabular-nums; color: var(--bone); transition: color .15s; }
/* the value in hand: lamp-lit, underlined like the chosen For / Until */
.rest-value::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2px; background: var(--amber); box-shadow: 0 0 6px rgba(255,160,60,.7); transform: scaleX(0); transition: transform .2s var(--ease); }
.rest-value:focus-visible { color: #ffd59a; }
.rest-value:focus-visible::after { transform: none; }
.rest-status { margin: 12px 0 0; font-size: 14px; color: var(--dim); }
.rest-status b { font: 700 17px/1 "Barlow Condensed", sans-serif; letter-spacing: .05em; color: var(--amber); }
.rest-crowd { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 12px; color: rgba(232,239,233,.5); }
/* one pip per player; lit when they're resting */
.rest-pips { flex: none; position: relative; height: 10px; background: radial-gradient(circle at 5px 5px, transparent 3.3px, rgba(232,239,233,.5) 3.8px, rgba(232,239,233,.5) 4.5px, transparent 5px) 0 0 / 12px 10px repeat-x; }
.rest-pips b { position: absolute; inset: 0 auto 0 0; background: radial-gradient(circle at 5px 5px, var(--amber) 4.4px, transparent 5px) 0 0 / 12px 10px repeat-x; filter: drop-shadow(0 0 3px rgba(255,160,60,.8)); transition: width .3s var(--ease); }

/* the actions: the city's prompt, a key in a lamp-lit circle */
.rest-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 20px; }
.rest-actions button { display: inline-flex; align-items: center; gap: 11px; padding: 5px 18px 5px 5px; border-radius: 22px; background: rgba(6,9,11,.74); box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.08); transition: background .15s, box-shadow .15s, transform .15s; }
.rest-actions kbd { display: grid; place-items: center; box-sizing: border-box; min-width: 30px; height: 30px; padding: 1px 7px 0; border-radius: 15px; font: 700 15px/1 "Barlow Condensed", sans-serif; letter-spacing: .04em; }
.rest-actions b { font: 700 19px/1 "Barlow Condensed", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.rest-ready kbd { background: var(--amber); color: #170f07; box-shadow: 0 0 16px rgba(255,160,60,.5), inset 0 -2px 0 rgba(0,0,0,.2); }
.rest-ready b { color: var(--bone); }
.rest-ready:hover { background: rgba(28,22,14,.9); box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,179,71,.6); }
.rest-ready:hover b { color: #ffd59a; }
.rest-ready:active { transform: translateY(1px); }
.rest-ready:disabled { cursor: wait; }
.rest-ready:disabled kbd { background: rgba(255,179,71,.4); box-shadow: none; }
.rest-cancel kbd { font-size: 11px; letter-spacing: .14em; color: var(--bone); box-shadow: inset 0 0 0 1px rgba(232,239,233,.4); }
.rest-cancel b { font-size: 16px; color: rgba(232,239,233,.84); }
.rest-cancel small { font-weight: 600; font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: rgba(232,239,233,.45); }
.rest-cancel small:empty { display: none; }
.rest-cancel:hover { box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 1px rgba(232,239,233,.35); }
.rest-cancel:hover b { color: var(--bone); }
.rest-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rest-open .hints, .rest-open .roster { visibility: hidden; }

@keyframes rest-shade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rest-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes rest-dial { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes rest-draw { from { stroke-dasharray: 0 1; } }
@keyframes rest-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rest-rise-b { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rest-rise-c { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rest-flash { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes rest-pulse { 50% { opacity: .3; } }
@keyframes rest-glow { 50% { filter: drop-shadow(0 0 9px rgba(255,170,70,1)); } }

/* a narrow window: the watch above the words, centred at the bottom */
@media (max-width: 760px) {
  .rest-watch { --dial: clamp(132px, 20vh, 168px); }
  .rest-face { bottom: 18px; width: calc(100vw - 32px); grid-template-columns: 1fr; justify-items: center; gap: 14px; text-align: center; }
  .rest-copy { display: flex; flex-direction: column; align-items: center; }
  .rest-watch h2 { font-size: 30px; white-space: normal; }
  .rest-choose { flex-wrap: wrap; justify-content: center; gap: 10px 16px; margin-top: 12px; }
  .rest-crowd { justify-content: center; flex-wrap: wrap; }
  .rest-actions { justify-content: center; margin-top: 14px; }
  .rest-watch::before { background: linear-gradient(transparent 22%, rgba(3,7,9,.72) 48%, rgba(3,7,9,.94)); }
}
@media (max-height: 620px) and (min-width: 761px) { .rest-watch { --dial: 150px; } .rest-face { bottom: 28px; } .rest-actions { margin-top: 14px; } }
@media (prefers-reduced-motion: reduce) {
  .rest-watch, .rest-watch.leaving, .rest-dial, .rest-span, .rest-copy > *, .rest-note, .rest-kicker i, .rest-watch[data-state="rest"] .rest-arc { animation: none !important; }
  .rest-span, .rest-wake, .rest-them, .rest-value::after, .rest-pips b, .rest-modes button::after, .rest-time, .rest-watch::after { transition: none; }
}
