:root {
  --silk: #eef2ff;
  --silk-dim: rgba(226, 232, 255, 0.5);
  --lit: #ffe2b0;
  --night: #0b0f17;
  --night-2: #131b2a;
  --ink: #e6e9f2;
  --muted: #9aa3b8;
  --accent: #cdb8ff;
  --wall: #1a1517;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}
body.on-landing {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, #2a2124 0%, var(--wall) 55%, #0e0b0c 100%);
}

/* ---------- landing ---------- */
#landing {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#landing[hidden] { display: none; }
.landing-svg { display: block; }
.landing-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stars circle { fill: #dfe7ff; }
.frame .grain path { stroke: rgba(0, 0, 0, 0.28); stroke-width: 1; fill: none; }
.frame-edge { fill: none; stroke: rgba(0, 0, 0, 0.55); stroke-width: 2; }

.web .spokes path { stroke: var(--silk); stroke-width: 1.1; opacity: 0.55; }
.web .ties path { stroke: var(--silk); stroke-width: 1; opacity: 0.6; }
.web .spiral path { stroke: var(--silk); stroke-width: 0.85; opacity: 0.45; }

.words path { stroke: var(--silk); stroke-width: 1.05; opacity: 0.92; transition: stroke 0.25s ease; }
.label.lit path { stroke: var(--lit); }

.hit rect { fill: transparent; stroke: none; }
.hit, .hit rect { cursor: pointer; outline: none; }
.hit:focus-visible rect { stroke: var(--lit); stroke-width: 1.5; stroke-dasharray: 4 5; }

.skip-hint {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: rgba(230, 236, 255, 0.45);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.skip-hint.gone { opacity: 0; }

/* ---------- spider ---------- */
.spider { pointer-events: none; }
.spider .leg-rim { fill: none; stroke: #b9a6e6; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.spider .leg { fill: none; stroke: #16101d; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spider .abdomen { fill: #1b1424; stroke: #b9a6e6; stroke-width: 1.1; }
.spider .shine { fill: rgba(220, 205, 255, 0.22); }
.spider .head { fill: #241a30; stroke: #b9a6e6; stroke-width: 1.1; }
.spider .eye { fill: #fff; }
.spider .pupil { fill: #120c18; }
.spider .smile { fill: none; stroke: #e7dcff; stroke-width: 0.8; stroke-linecap: round; }

/* ---------- subpages ---------- */
#page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% -10%, #23314a 0%, var(--night-2) 45%, var(--night) 100%) fixed;
}
#page[hidden] { display: none; }
.banner { width: 100%; }
.banner-svg { display: block; width: 100%; }
.banner-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.banner-web path { stroke: var(--silk); stroke-width: 1; opacity: 0.55; }
.banner-svg .words path { stroke-width: 1.05; opacity: 0.95; }
.xmark path { stroke: var(--silk); stroke-width: 1; opacity: 0.6; transition: stroke 0.2s; }
.xmark path.x-strand { stroke-width: 2.6; opacity: 1; }
.xmark.lit path.x-strand { stroke: var(--lit); }
.xhit, .xhit rect { cursor: pointer; }

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 24px 72px;
  font-size: 18px;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.content.show { opacity: 1; transform: none; }
.content p { margin: 0 0 1.2em; color: #c9cedb; }
.content .lead { font-size: 1.3em; line-height: 1.45; color: var(--ink); font-style: italic; margin-bottom: 1.4em; }

/* ---------- calendar ---------- */
.content:has(.cal) { max-width: 1040px; }
.cal-month { font-weight: normal; font-size: 1.5em; margin: 0 0 0.1em; letter-spacing: 0.03em; }
.cal-tz { font-size: 0.85em; color: var(--muted); margin: 0 0 1em !important; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid rgba(226, 232, 255, 0.22);
  border-left: 1px solid rgba(226, 232, 255, 0.22);
}
.cal-grid .dow {
  font-size: 0.75em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-right: 1px solid rgba(226, 232, 255, 0.22);
  border-bottom: 1px solid rgba(226, 232, 255, 0.22);
}
.cal-grid .day {
  min-height: 98px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid rgba(226, 232, 255, 0.22);
  border-bottom: 1px solid rgba(226, 232, 255, 0.22);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-grid .num { font-size: 1.05em; margin-bottom: 4px; }
.cal-grid .win { font-size: 0.78em; line-height: 1.3; }
.day.open { cursor: pointer; transition: background 0.2s; }
.day.open .win { color: var(--lit); }
.day.open:hover, .day.open:focus-visible { background: rgba(255, 226, 176, 0.08); outline: none; }
.day.closed { color: #5f6678; }
.day.closed .win { font-style: italic; }
.day.blank { background: rgba(0, 0, 0, 0.12); }

.cal-list { display: none; list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(226, 232, 255, 0.22); }
.cal-list .row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 255, 0.22);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  text-align: left;
}
.cal-list .row.open { cursor: pointer; }
.cal-list .row.open .rwin { color: var(--lit); }
.cal-list .row.closed { color: #5f6678; }
.cal-list .row.closed .rwin { font-style: italic; }
.cal-list .rdate b { font-weight: normal; display: inline-block; width: 2.4em; color: var(--muted); }

@media (max-width: 720px) {
  .cal-grid { display: none; }
  .cal-list { display: block; }
}

.slot-panel {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
}
.slot-panel[hidden] { display: none; }
.slot-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: linear-gradient(#18202f, #10151f);
  border: 1px solid rgba(226, 232, 255, 0.25);
  border-radius: 14px;
  padding: 26px 24px 22px;
  color: var(--ink);
  font-family: var(--serif);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.slot-card h3 { font-weight: normal; font-size: 1.35em; margin: 0 28px 4px 0; }
.slot-card .hint, .slot-card .fine { color: var(--muted); font-size: 0.85em; margin: 0 0 14px; }
.slot-card .fine { margin: 14px 0 6px; line-height: 1.45; }
.slot-card .when { color: var(--lit); margin: 0 0 16px; }
.slot-card .close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px;
  border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1;
}
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot, .btn, .slot-card .back {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(226, 232, 255, 0.05);
  border: 1px solid rgba(226, 232, 255, 0.28);
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.slot small { display: block; color: var(--muted); font-size: 0.78em; }
.slot:hover, .btn:hover, .slot:focus-visible, .btn:focus-visible { background: rgba(255, 226, 176, 0.1); border-color: var(--lit); outline: none; }
.btn.primary { background: var(--lit); color: #1a1208; border-color: var(--lit); }
.btn.primary:hover { background: #fff0d4; }
.actions { display: grid; gap: 8px; margin-top: 6px; }
.slot-card label { display: block; font-size: 0.9em; color: var(--muted); margin-bottom: 12px; }
.slot-card input, .slot-card textarea {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(226, 232, 255, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}
.slot-card input:focus, .slot-card textarea:focus { outline: none; border-color: var(--lit); }
.slot-card .back { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .content { font-size: 17px; padding: 4px 18px 56px; }
}
