:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  color: #f5ead6;
  background: #151a23;
  --muted: #bbb7b2;
  --amber: #ffcd80;
  --line: #66605a;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 50% 0, #2c333d, transparent 680px); }
main { width: min(100% - 32px, 760px); margin: 0 auto; padding: 22px 0 32px; }
header { display: flex; justify-content: space-between; align-items: center; }
header a { color: var(--muted); text-underline-offset: .25em; }
.clock { color: var(--amber); font: 1.05rem ui-monospace, monospace; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 6px; }
h1, h2 { font-family: Georgia, serif; font-weight: normal; line-height: 1.07; }
h1 { margin: .25em 0 .11em; font-size: clamp(3rem, 10vw, 5.2rem); letter-spacing: -.055em; }
.intro { margin: 0 0 16px; color: var(--muted); }
.scene { height: clamp(150px, 33vw, 258px); position: relative; overflow: hidden; border-radius: 10px 10px 0 0; border: 1px solid var(--line); isolation: isolate; background: radial-gradient(ellipse at 51% 12%, #91704b, #393130 48%, #161a23 78%); }
.scene::before { content: ""; position: absolute; inset: 78% -10% -40%; background: linear-gradient(0deg, #121620, #594b3b); transform: perspective(100px) rotateX(40deg); }
.grain { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .14; background: repeating-linear-gradient(0deg, transparent 0 3px, #151a23 4px 5px); }
.art { position: absolute; display: none; left: 50%; transform: translateX(-50%); }
[data-place="door"] .door, [data-place="mail"] .mail, [data-place="window"] .window, [data-place="tram"] .tram { display: block; }
.door { top: 10%; bottom: 10%; width: 23%; min-width: 90px; background: repeating-linear-gradient(90deg, #44342d 0 8px, #46362e 9px 13px); border: 7px solid #252129; box-shadow: 0 0 0 3px #a38158, 12px 8px 20px #211a1b; }
.door b { position: absolute; left: 50%; top: 19%; transform: translateX(-50%); color: var(--amber); font: 1rem Georgia, serif; border-bottom: 1px solid #977749; padding: 0 5px; }
.door i { position: absolute; right: 12%; top: 54%; width: 22%; height: 6px; border-radius: 4px; background: linear-gradient(#cda56a, #523d30); }
.scene[data-place="mail"] { background: radial-gradient(ellipse at 50% 16%, #76634d, #32313a 55%, #161a23); }
.mail { top: 23%; width: 40%; min-width: 140px; height: 48%; border: 6px solid #232630; border-radius: 8px 8px 4px 4px; background: linear-gradient(140deg, #6c706c, #393d42 40%, #282b35); box-shadow: 9px 15px 20px #181920; }
.mail i { position: absolute; inset: 24% 14% auto; height: 12%; background: #161822; border-bottom: 2px solid #838079; }
.mail b { position: absolute; inset: 57% 35% auto; height: 14%; background: #aba18e; }
.scene[data-place="window"], .scene[data-place="tram"] { background: radial-gradient(ellipse at 50% 90%, #4f565d, #232d42 55%, #121825); }
.window { top: 10%; width: 28%; min-width: 104px; height: 80%; border: 8px solid #29272d; outline: 3px solid #53505a; box-shadow: 0 0 0 60px #31323a; background: radial-gradient(ellipse at 68% 30%, #e8c695 0 6%, transparent 7%), linear-gradient(#20283c, #4f5965); }
.window i, .window b { position: absolute; background: #29272d; }
.window i { inset: 0 48%; }
.window b { inset: 48% 0; }
.tram { width: 30%; min-width: 130px; top: 17%; height: 65%; border: 5px solid #31303a; border-radius: 28% 28% 15% 15%; background: linear-gradient(#a66549 0 13%, #e0b877 14% 52%, #9a4639 53% 86%, #342c32 87%); box-shadow: 0 12px 24px #151822; }
.tram i { position: absolute; inset: 23% 12% 49%; border: 2px solid #593f33; border-radius: 7px; background: linear-gradient(90deg, #39313a 48%, #724c43 48% 52%, #473842 52%); }
.tram b { position: absolute; inset: 64% 12% auto; height: 11%; background: radial-gradient(circle at 12%, #ffe1a1 0 7%, transparent 10%), radial-gradient(circle at 88%, #ffe1a1 0 7%, transparent 10%); filter: drop-shadow(0 0 5px #ffd68d); }
[data-outcome="missed"] .tram { display: none; }
.route { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
.route li { text-align: center; padding: 7px 2px; color: var(--muted); font-size: clamp(.72rem, 2.8vw, .9rem); }
.route li + li { border-left: 1px solid var(--line); }
.route [aria-current] { color: var(--amber); background: #ffcd8014; box-shadow: inset 0 -2px var(--amber); }
.panel { padding-top: 16px; }
h2 { margin: 0 0 .3em; font-size: clamp(1.7rem, 5vw, 2.35rem); }
.story p { margin: 0 0 .45rem; }
.thought { color: var(--amber); }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
button { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 46px; background: #262a34; padding: 9px 12px; }
button span { display: inline-block; font-size: .79em; opacity: .85; margin-inline-start: .25em; }
button:hover { background: #393d47; }
.primary { color: #26201b; background: var(--amber); border-color: var(--amber); font-weight: 650; }
.primary:hover { background: #ffdfaa; }
.back { margin-top: 7px; padding-inline: 5px; color: var(--muted); background: transparent; border-color: transparent; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
[hidden] { display: none; }
.actions:has(#check[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 390px) { .actions { grid-template-columns: 1fr; } }
