/* Website (Deep Space): Daily Orbit, The Odyssey, Mission Log. */
body {
  color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--ink);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(238,241,255,.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 9%, rgba(238,241,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 34% 62%, rgba(238,241,255,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 41%, rgba(238,241,255,.6) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 91% 73%, rgba(238,241,255,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 88%, rgba(238,241,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 27%, rgba(255,209,102,.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 52%, rgba(76,201,240,.9) 50%, transparent 51%),
    radial-gradient(60vw 50vh at 85% -10%, rgba(167,139,250,.22), transparent 70%),
    radial-gradient(55vw 45vh at -5% 105%, rgba(76,201,240,.16), transparent 70%);
  background-size: 420px 420px, 380px 380px, 520px 520px, 300px 300px, 460px 460px, 340px 340px, 600px 600px, 560px 560px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}
main { flex: 1; }

.site-header { background: rgba(7,11,26,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); color: var(--text); padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 5; }
.site-header-inner { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { padding: 9px 14px; border-radius: 10px; color: var(--text-2); font-weight: 700; font-size: 15px; text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--gold); color: var(--ink); }
.header-actions { margin-left: auto; display: flex; gap: 10px; }
.pill-outline, .pill-light { padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.pill-outline { border: 1.5px solid var(--line); background: transparent; color: var(--text); }
.pill-light { background: var(--text); color: var(--ink); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 32px 24px 64px; }
.play { display: flex; flex-wrap: wrap; gap: 40px; }
.play-main { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.play-side { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { font-size: clamp(30px, 5vw, 40px); }
.badge { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.badge.easy { background: #0F3B2E; color: #7EE8C1; }
.badge.medium { background: #40300B; color: #FFD98A; }
.badge.hard { background: #47162A; color: #FFA3B7; }
.badge.expert { background: #2C2160; color: #C9BBFF; }
.badge.archive { background: var(--panel-2); color: var(--text-2); }

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 620px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 12px; border: 0; font-weight: 700; font-size: 14px; background: var(--panel-2); color: var(--text-2); }
.chip.done { background: #0F3B2E; color: #7EE8C1; }
.chip.now { background: var(--gold); color: var(--ink); }
.chip:disabled { opacity: .5; }
.timer { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums; }
.rule-line { margin: 0; max-width: 620px; color: var(--text-2); font-size: 15px; line-height: 1.45; }
.rule-line b { color: var(--gold); letter-spacing: 2px; margin-right: 4px; }

.board-shell { position: relative; max-width: 620px; width: 100%; }
.cover { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; background: rgba(7,11,26,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cover-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); text-align: center; padding: 16px; }
.cover-inner p { margin: 0; color: var(--text-2); font-size: 14px; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; max-width: 620px; }
.tools .toggle { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 20px; }
.card ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card-glow { background: linear-gradient(150deg, #2A1F63, var(--panel) 62%); border-color: rgba(167,139,250,.45); }
.card-glow p { color: var(--text-2); font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.streak-num { display: flex; align-items: baseline; gap: 8px; }
.streak-num b { font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1; }
.streak-num span { color: var(--muted); font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.week i { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--panel-2); }
.week i.on { background: var(--gold); }
.week i.today { box-shadow: inset 0 0 0 2px var(--text); }

/* Mission Log */
.log-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.log-head p { margin: 6px 0 0; color: var(--text-2); font-size: 16px; }
.seg { display: flex; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg button { padding: 9px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 14px; min-height: 40px; }
.seg button[aria-selected="true"] { background: var(--text); color: var(--ink); }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { font-size: 24px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel-2); color: var(--text); display: grid; place-items: center; }
.icon-btn:disabled { opacity: .35; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); padding-bottom: 4px; }
.day { aspect-ratio: 1; border-radius: 14px; background: var(--panel-2); color: var(--text); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px; min-width: 0; }
.day b { font-size: 15px; }
.day small { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.done { background: var(--gold); color: var(--ink); }
.day.started { background: #5A4310; color: #FFE2A1; }
.day.future { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: #4A5488; pointer-events: none; }
.day.today { box-shadow: inset 0 0 0 2.5px var(--text); }
.day.blank { background: transparent; pointer-events: none; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--panel-2); }
.legend i.done { background: var(--gold); }
.legend i.started { background: #5A4310; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stats div { background: var(--ink); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-family: var(--display); font-weight: 700; font-size: 28px; }
.stats span { font-size: 13px; color: var(--muted); }

/* Dialogs */
.sheet { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--text); padding: 26px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.sheet::backdrop { background: rgba(2,4,12,.7); }
.sheet h2 { font-size: 28px; margin-bottom: 8px; }
.sheet p { line-height: 1.55; color: var(--text-2); font-size: 15px; }
.sheet .rules { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; color: var(--text-2); font-size: 15px; }
.sheet .rules b { color: var(--gold); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.win-star { width: 64px; height: 64px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M24 4.5l5.7 12.4 13.5 1.6-10 9.3 2.7 13.4L24 34.5l-11.9 6.7 2.7-13.4-10-9.3 13.5-1.6z' fill='%23FFD166'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 14px rgba(255,209,102,.6)); }
.win-times { display: flex; flex-wrap: wrap; gap: 8px; }

.site-footer { max-width: 1160px; width: 100%; margin: 0 auto; padding: 24px; display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.site-footer span { margin-right: auto; font-weight: 700; }
.site-footer { flex-wrap: wrap; }
.more-games { flex-basis: 100%; margin: 0 0 4px; }
.more-games a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.more-games a:hover { color: var(--text); }
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.try-row:empty { display: none; }
.try-label { color: var(--muted); font-weight: 700; margin-right: auto; }
.try-game { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 700; text-decoration: none; }
.try-game img { border-radius: 7px; }
.try-game:hover { color: var(--text); }

@media (max-width: 640px) {
  .site-header-inner { gap: 10px 16px; padding: 10px 16px; }
  .header-actions { margin-left: 0; width: 100%; justify-content: flex-end; order: 2; }
  .site-nav { order: 3; width: 100%; }
  .site-nav a { padding: 8px 10px; font-size: 14px; }
  .logo { font-size: 22px; }
  .wrap { padding: 20px 16px 48px; }
  .play { gap: 28px; }
  .day { padding: 6px; border-radius: 10px; }
  .day small { font-size: 10px; }
  .cal { gap: 5px; }
}
@media (max-width: 380px) { .header-actions .pill-outline { display: none; } }
.invite-note { padding: 10px 12px; border-radius: 12px; background: rgba(255,209,102,.12); color: var(--text) !important; }
.invite-note b { color: var(--gold); letter-spacing: .12em; }
.card-preview { display: grid; place-items: center; min-height: 240px; margin: 14px 0 4px; }
.card-preview img { max-width: 100%; max-height: 52vh; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
