:root {
  --ground: #050807;
  --ink: rgba(226, 236, 231, 0.92);
  --dim: rgba(226, 236, 231, 0.52);
  --line: rgba(226, 236, 231, 0.32);
  --hot: #ff6248;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--ink); font-family: var(--mono); overflow: hidden; }
button { font: inherit; color: inherit; }
#stage { position: fixed; inset: 0; transition: opacity 0.35s; }
#stage.loading { opacity: 0.25; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#rain { image-rendering: auto; }
#marks { cursor: crosshair; touch-action: none; }
#marks.grab { cursor: grabbing; }
#marks.hand { cursor: pointer; }

.hud { position: fixed; z-index: 2; pointer-events: none; text-shadow: 0 0 6px var(--ground); }
/* one static gradient behind the corner text, instead of heavy shadows re-rendered every frame */
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 560px 210px at 0 0, rgba(5, 8, 7, 0.82), transparent 72%),
              radial-gradient(ellipse 330px 150px at 100% 0, rgba(5, 8, 7, 0.7), transparent 72%),
              linear-gradient(to top, rgba(5, 8, 7, 0.75), transparent 110px); }
.kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.tl { top: 64px; left: 32px; max-width: 46vw; }
.clock { font-size: 34px; font-weight: 500; letter-spacing: -0.01em; margin-top: 6px; }
.sub { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 6px; color: var(--dim); }
.sub.hot { color: #ff7a5c; }

/* view switcher */
.views { position: fixed; z-index: 4; top: 22px; left: 32px; display: flex; gap: 6px; }
.vbtn { background: rgba(5, 8, 7, 0.7); border: 1px dashed var(--line); padding: 5px 10px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; color: var(--dim); }
.vbtn:hover { color: var(--ink); }
.vbtn.on { color: var(--ink); border-style: solid; border-color: rgba(226, 236, 231, 0.7); }
.recent { position: static; } /* the menu hangs from the nav's left edge (fits on a phone) */
.menu { position: absolute; top: calc(100% + 6px); left: 0; width: 330px; background: rgba(6, 10, 9, 0.97); border: 1px dashed var(--line); padding: 6px; }
.menu button { display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 6px; cursor: pointer; border-bottom: 1px dashed rgba(226, 236, 231, 0.14); }
.menu button:last-child { border-bottom: 0; }
.menu button:hover, .menu button.on { background: rgba(226, 236, 231, 0.06); }
.menu .n { color: var(--dim); font-size: 11px; grid-row: span 2; padding-top: 1px; }
.menu .nm { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.menu .nm em { font-style: normal; color: var(--dim); font-size: 11px; margin-left: 6px; }
.menu .wh { font-size: 11px; color: var(--dim); }

.tr { top: 28px; right: 32px; width: 220px; }
.ramp { height: 6px; margin-top: 10px; }
.ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-top: 4px; }
.toggle { pointer-events: auto; display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); cursor: pointer; }
.toggle input { accent-color: #b05cff; margin: 0; }

/* zoom (live) */
.zoom { position: fixed; z-index: 4; top: 150px; right: 32px; display: flex; align-items: center; gap: 4px; }
.zoom[hidden] { display: none; }
.zoom button { min-width: 28px; height: 26px; padding: 0 8px; background: rgba(5, 8, 7, 0.7); border: 1px dashed var(--line); color: var(--dim); font-size: 13px; cursor: pointer; }
.zoom button:hover:not(:disabled) { color: var(--ink); }
.zoom button:disabled { opacity: 0.35; cursor: default; }
.zoom button.on { color: var(--ink); border-style: solid; }
.zoom .hint { position: absolute; top: calc(100% + 9px); right: 0; white-space: nowrap; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); pointer-events: none; }

/* hover card */
.card {
  position: fixed; z-index: 3; pointer-events: none; width: 214px;
  background: rgba(6, 10, 9, 0.93); border: 1px dashed var(--line); padding: 8px 10px 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; left: 0; top: 0; will-change: transform;
}
.card-head { color: var(--dim); padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
.card-foot { color: var(--dim); padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--line); font-size: 10px; }
.row { display: grid; grid-template-columns: 22px 1fr auto; padding: 2px 0; }
.row .n, .row .k { color: var(--dim); }
.row .v { text-align: right; }

/* mission control */
.mc {
  position: fixed; z-index: 5; width: 640px; padding: 10px 12px 12px;
  background: rgba(5, 8, 7, 0.95); border: 1px solid rgba(226, 236, 231, 0.22);
  opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s;
}
.mc.open { opacity: 1; pointer-events: auto; transform: none; }
.mc-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.mc-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.mc-sub { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.mc-x { background: none; border: 1px dashed var(--line); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; cursor: pointer; color: var(--dim); }
.mc-x:hover { color: var(--ink); }
.mc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; height: 150px; display: flex; flex-direction: column; padding: 6px 7px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.tile::before { /* the dashed frame draws first */
  content: ''; position: absolute; inset: 0; border: 1px dashed rgba(226, 236, 231, 0.42); pointer-events: none;
  clip-path: inset(0 100% 100% 0);
}
.mc.open .tile::before { animation: frame 0.32s cubic-bezier(.3, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 45ms); }
.tile > * { opacity: 0; }
.mc.open .tile > * { animation: fill 0.3s ease forwards; animation-delay: calc(0.28s + var(--i) * 45ms); }
@keyframes frame { 0% { clip-path: inset(0 100% 100% 0); } 55% { clip-path: inset(0 0 100% 0); } 100% { clip-path: inset(0 0 0 0); } }
@keyframes fill { from { opacity: 0; } to { opacity: 1; } }
.th { display: grid; grid-template-columns: 20px 1fr auto; gap: 4px; color: var(--dim); white-space: nowrap; }
.th .t { overflow: hidden; text-overflow: ellipsis; }
.th .r { color: var(--ink); }
.tb { position: relative; flex: 1; margin: 5px 0 4px; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tf { color: var(--dim); font-size: 9px; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb img { width: 100%; height: 100%; object-fit: cover; display: block; background: #0b0f0e; }
.tb img.missing { visibility: hidden; }
.tb .cross { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 1px solid rgba(255, 255, 255, 0.85); pointer-events: none; }
.t-tc .cross { display: none; }
.tb canvas { max-width: 100%; max-height: 100%; }
.t-rain .tb canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.rows { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px; overflow-y: auto; scrollbar-width: none; }
.kv { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted rgba(226, 236, 231, 0.14); padding-bottom: 3px; }
.kv span { color: var(--dim); }
.kv b { font-weight: 500; text-align: right; }
.rows p { margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 10.5px; line-height: 1.3; }
.rows p span { display: block; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px; }

/* timeline */
.bottom { left: 32px; right: 32px; bottom: 44px; display: flex; gap: 14px; align-items: center; pointer-events: auto; }
#play { width: 34px; height: 26px; background: transparent; border: 1px dashed var(--line); font-size: 11px; cursor: pointer; }
.timeline { position: relative; flex: 1; height: 26px; border-top: 1px solid var(--line); cursor: pointer; touch-action: none; }
.days span { position: absolute; top: 0; height: 8px; border-left: 1px solid var(--line); font-size: 10px; color: var(--dim); padding: 9px 0 0 4px; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.landfall { position: absolute; top: -4px; height: 8px; min-width: 3px; background: rgba(255, 98, 72, 0.75); }
.now { position: absolute; top: -12px; height: 12px; border-left: 1px solid #9fe8c8; }
.now span { position: absolute; top: -12px; left: 3px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #9fe8c8; }
.head { position: absolute; left: 0; top: -9px; width: 1px; height: 18px; background: var(--ink); will-change: transform; }
.credits { position: fixed; z-index: 2; right: 32px; bottom: 14px; font-size: 10px; color: var(--dim); letter-spacing: 0.04em; }
.by { margin-left: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; white-space: nowrap; }
.by:hover { color: var(--hot); }
.defs { position: absolute; }

@media (max-width: 760px) {
  .tl { top: 56px; left: 16px; max-width: 70vw; }
  .views { left: 16px; top: 14px; }
  .clock { font-size: 24px; }
  .tr { display: none; }
  .bottom { left: 16px; right: 16px; bottom: 60px; } /* clear of the credits' two lines */
  .credits { left: 16px; right: 16px; bottom: 12px; font-size: 9px; line-height: 1.4; }
  .menu { width: calc(100vw - 32px); }
  .mc { left: 8px !important; right: 8px; top: auto !important; bottom: 100px; width: auto; max-height: 62vh; overflow: auto; }
  .mc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zoom { top: auto; bottom: 104px; right: 16px; }
  .zoom .hint { top: auto; bottom: calc(100% + 8px); }
}

/* only some skins use these (graphite): the big title, dotted-leader rows, the landfall band, corner marks, the elapsed bar */
.title, .leaders, .band, .frame, .done { display: none; }

.fps { position: fixed; z-index: 9; left: 32px; bottom: 14px; font-size: 10px; color: #9fe8c8; letter-spacing: 0.06em; text-transform: uppercase; }
