/* TCG Calendar — theme matches VirtualLGS store */

:root {
  --bg: #0a0a0b;
  --bg-1: #0f0f11;
  --bg-2: #15161a;
  --bg-3: #1c1d22;
  --line: #26272d;
  --line-2: #33343c;
  --ink: #e8e6df;
  --ink-2: #a8a59a;
  --ink-3: #6a6860;
  --ink-4: #454348;
  --amber: #d4a34a;
  --amber-2: #f0c168;
  --amber-dim: #8b6b2e;
  --blue: #5a9fd4;
  --green: #6aad6a;
  --red: #d46a5a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 30% -200px, rgba(212,163,74,0.06), transparent 60%),
    radial-gradient(800px 500px at 100% 400px, rgba(90,159,212,0.03), transparent 60%),
    var(--bg);
}

/* Subtle grid texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ───────── Header ───────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 24px 0 68px;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.app-header .brand .logo {
  width: 28px; height: 28px;
  border: 1.5px solid var(--amber);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.05em;
}
.app-header .brand b { font-weight: 600; }
.app-header .brand i { color: var(--amber); font-style: normal; font-weight: 600; }
.app-header .jp-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.15em;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  margin-left: 4px;
}
.app-header nav {
  display: flex;
  gap: 22px;
  margin-left: 40px;
  font-size: 13px;
  color: var(--ink-2);
}
.app-header nav a {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
  position: relative;
}
.app-header nav a:hover { color: var(--ink); }
.app-header nav a.active {
  color: var(--amber);
}
.app-header nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -19px;
  height: 1px;
  background: var(--amber);
}
.app-header .spacer { flex: 1; }
.app-header .hd-right {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.app-header .hd-right .chip {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-header .hd-right .chip b { color: var(--amber); font-weight: 500; }

/* ───────── Left nav rail (matches store) ───────── */
.nav-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 56px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50;
}
.nav-rail .nr-logo {
  width: 28px; height: 28px;
  margin: 14px 0 28px;
  background: var(--amber);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: 0.05em;
}
.nav-rail .nr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0;
  color: var(--ink-3);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  position: relative;
  width: 100%;
  transition: color .15s;
}
.nav-rail .nr-item:hover { color: var(--ink-2); }
.nav-rail .nr-item.active { color: var(--amber); }
.nav-rail .nr-item .jp {
  font-size: 13px;
  color: inherit;
  opacity: 0.65;
}
.nav-rail .nr-item .num {
  font-size: 8px;
  color: var(--ink-4);
  margin-top: 3px;
}
.nav-rail .nr-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px; bottom: 10px;
  width: 2px;
  background: var(--amber);
}

/* ───────── Page layout ───────── */
.page {
  padding-left: 56px;
  position: relative;
  z-index: 1;
}

.calendar-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 56px);
  position: relative;
}

/* ───────── TCG filter rail ───────── */
.tcg-rail {
  border-right: 1px solid var(--line);
  padding: 28px 0 40px;
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: linear-gradient(to right, rgba(0,0,0,0.2), transparent);
}
.tcg-rail .rail-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 24px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.tcg-rail .rail-label .jp {
  color: var(--ink-4);
  letter-spacing: 0.1em;
  font-size: 11px;
}
.tcg-rail .rail-actions {
  padding: 0 20px 12px;
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tcg-rail .rail-actions button {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 5px 9px;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: all .15s;
}
.tcg-rail .rail-actions button:hover {
  color: var(--ink);
  border-color: var(--line-2);
}
.tcg-rail .rail-actions button.active {
  color: var(--amber);
  border-color: var(--amber-dim);
}
.tcg-rail ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tcg-rail li {
  position: relative;
}
.tcg-rail .tcg-btn {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 20px 10px 20px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  transition: all .15s;
  position: relative;
}
.tcg-rail .tcg-btn:hover {
  background: rgba(255,255,255,0.02);
  color: var(--ink);
}
.tcg-rail .tcg-btn.solo {
  background: rgba(212,163,74,0.06);
  border-left-color: var(--amber);
  color: var(--ink);
}
.tcg-rail .tcg-btn.muted {
  opacity: 0.35;
}
.tcg-rail .tcg-btn .chip {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.tcg-rail .tcg-btn .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.tcg-rail .tcg-btn .count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.05em;
}
.tcg-rail .tcg-btn.solo .count { color: var(--amber); }

/* ───────── Timeline main area ───────── */
.timeline-main {
  padding: 36px 64px 160px;
  position: relative;
  min-width: 0;
}

.page-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}
.page-title .jp {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--amber);
  text-transform: uppercase;
}
.page-title h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.page-sub {
  color: var(--ink-2);
  font-size: 14px;
  margin: 6px 0 28px;
  max-width: 620px;
}
.page-sub b { color: var(--ink); font-weight: 500; }

/* Meta bar: stats */
.meta-bar {
  display: flex;
  gap: 36px;
  padding: 16px 0 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.meta-bar .stat { display: flex; flex-direction: column; gap: 4px; }
.meta-bar .stat .num {
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.meta-bar .stat .num b { color: var(--amber); font-weight: 500; }
.meta-bar .stat .lbl { font-size: 10px; }

/* ───────── Timeline ───────── */
.timeline {
  position: relative;
  padding: 20px 0;
}

/* The central line */
.timeline::before {
  content: "";
  position: absolute;
  left: 160px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--line-2) 3%,
    var(--line-2) 97%,
    transparent 100%);
}

/* Month blocks */
.month {
  position: relative;
  padding: 32px 0 48px;
  min-height: 120px;
}
.month.current { /* hosting today */ }

.month-head {
  position: sticky;
  top: 56px;
  z-index: 5;
  display: grid;
  grid-template-columns: 140px 40px 1fr;
  align-items: center;
  gap: 0;
  padding: 12px 0;
  margin-bottom: 8px;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 60%, transparent 100%);
}
.month-head .m-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-4);
  text-align: right;
  padding-right: 20px;
}
.month-head .m-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  justify-self: center;
  position: relative;
  z-index: 2;
}
.month-head .m-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-left: 20px;
}
.month-head .m-label h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.month-head .m-label .jp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.15em;
}
.month-head .m-label .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* Individual release nodes */
.release {
  display: grid;
  grid-template-columns: 140px 40px 1fr;
  align-items: start;
  gap: 0;
  margin-bottom: 20px;
  position: relative;
  animation: riseIn .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.release .r-date {
  text-align: right;
  padding-right: 20px;
  padding-top: 14px;
  position: relative;
}
.release .r-date .day {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.release .r-date .weekday {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}
.release .r-date .countdown {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  margin-top: 3px;
}
.release.past .r-date .day { color: var(--ink-3); }
.release.past .r-date .weekday { color: var(--ink-4); }
.release.today-adjacent .r-date .day { color: var(--amber); }

.release .r-marker {
  justify-self: center;
  padding-top: 18px;
  position: relative;
  z-index: 2;
  width: 40px;
  display: flex;
  justify-content: center;
}
.release .r-marker .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--line-2);
  transition: all .2s;
}
.release.past .r-marker .dot {
  background: var(--ink-4);
  border-color: var(--ink-4);
}
.release.today-adjacent .r-marker .dot {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(212,163,74,0.15);
}
.release:hover .r-marker .dot {
  border-color: var(--amber);
  transform: scale(1.3);
}
.release.open .r-marker .dot {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(212,163,74,0.18);
}

.release .r-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 24px;
  width: 28px;
  height: 1px;
  background: var(--line);
}

/* The card */
.release .r-card {
  padding-left: 20px;
}
.r-card .r-body {
  position: relative;
  padding: 14px 18px 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
}
.r-card .r-body:hover {
  border-color: var(--line-2);
  background: var(--bg-3);
  transform: translateX(4px);
}
.release.open .r-card .r-body {
  border-color: var(--amber-dim);
  background: var(--bg-3);
  transform: translateX(4px);
}

/* TCG logo/image thumb (placeholder) */
.r-body .r-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.r-body:hover .r-thumb { transform: scale(1.04); }
.r-body .r-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--tcg-color) 0%, transparent 55%);
  opacity: 0.22;
}
.r-body .r-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0 8px,
      rgba(255,255,255,0.03) 8px 9px);
}
/* When a cover image is bound, keep the soft TCG gradient as a backdrop
   (most cover images are wide logos with transparent backgrounds, so
   contain-fit them inside small padding rather than crop). The diagonal
   stripe overlay competes with the artwork — hide just that. */
.r-body .r-thumb.has-cover::after { display: none; }
.r-body .r-thumb.has-cover img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  z-index: 1;
}
.r-body .r-thumb.has-cover .chip {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 9px;
  padding: 2px 5px;
  z-index: 2;
}
.r-body .r-thumb .chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--tcg-color);
  background: rgba(0,0,0,0.5);
  padding: 3px 7px;
  border-radius: 4px;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.r-body .r-meta { min-width: 0; }
.r-body .r-meta .r-tcg {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--tcg-color);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.r-body .r-meta .r-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r-body .r-meta .r-sub {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.r-body .r-meta .r-sub .dot { color: var(--ink-4); }

.r-body .r-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}
.r-body .r-right .r-kind {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.r-body .r-right .r-kind.special { color: var(--amber); border-color: var(--amber-dim); }
.r-body .r-right .r-kind.starter { color: var(--blue); border-color: rgba(90,159,212,0.3); }
.r-body .r-right .r-kind.reprint { color: #b46cf3; border-color: rgba(180,108,243,0.35); background: rgba(180,108,243,0.08); }
.r-body .r-right .r-price {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.release .chev {
  font-family: var(--mono);
  color: var(--ink-4);
  transition: transform .25s;
  margin-left: 8px;
}
.release.open .chev { transform: rotate(90deg); color: var(--amber); }

/* Expanded body */
.r-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s cubic-bezier(.2,.8,.2,1);
}
.release.open .r-expand { grid-template-rows: 1fr; }
.r-expand > div { overflow: hidden; }
.r-expand-inner {
  padding: 18px 20px 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 28px;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}
.r-expand-inner .big-thumb {
  aspect-ratio: 3/4;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.r-expand-inner .big-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, var(--tcg-color) 0%, transparent 60%),
    radial-gradient(circle at 70% 80%, var(--tcg-accent, var(--tcg-color)) 0%, transparent 50%);
  opacity: 0.28;
}
/* Cover image — fit inside the tile, keeping the soft TCG gradient as a
   backdrop. Logos and box art rarely fill a 3:4 aspect cleanly, so contain
   beats cover here. */
.r-expand-inner .big-thumb.has-cover img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  z-index: 1;
}
.r-expand-inner .big-thumb.has-cover .code {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  padding: 3px 7px;
  z-index: 2;
}
.r-expand-inner .big-thumb .code {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--tcg-color);
  position: relative;
  z-index: 2;
  padding: 5px 10px;
  border: 1px solid var(--tcg-color);
  border-radius: 5px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.r-expand-inner .r-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.r-details .r-desc {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 560px;
}
.r-details .r-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.r-details .r-specs .spec {
  background: var(--bg-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.r-details .r-specs .spec .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.r-details .r-specs .spec .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.r-details .r-specs .spec .v.amber { color: var(--amber); }

.r-details .r-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); background: var(--bg-3); }
.btn.primary {
  background: var(--amber);
  color: #1a1508;
  border-color: var(--amber);
  font-weight: 600;
}
.btn.primary:hover { background: var(--amber-2); border-color: var(--amber-2); }
.btn .arrow {
  font-family: var(--mono);
  display: inline-block;
  transition: transform .2s;
}
.btn:hover .arrow { transform: translateX(3px); }
.btn .jp {
  font-family: var(--mono);
  font-size: 10px;
  color: currentColor;
  opacity: 0.55;
  margin-right: 4px;
  letter-spacing: 0.1em;
}

/* ───────── Today marker ───────── */
.today-marker {
  position: relative;
  display: grid;
  grid-template-columns: 140px 40px 1fr;
  align-items: center;
  margin: 28px 0 10px;
  z-index: 3;
}
.today-marker .t-label {
  text-align: right;
  padding-right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--amber);
  text-transform: uppercase;
}
.today-marker .t-label .jp {
  font-size: 10px;
  color: var(--amber-dim);
  letter-spacing: 0.15em;
  display: block;
  margin-top: 2px;
}
.today-marker .t-pulse {
  justify-self: center;
  width: 16px;
  height: 16px;
  position: relative;
}
.today-marker .t-pulse::before,
.today-marker .t-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
}
.today-marker .t-pulse::before {
  width: 10px; height: 10px;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(212,163,74,0.2), 0 0 20px rgba(212,163,74,0.6);
  z-index: 2;
  inset: 3px;
}
.today-marker .t-pulse::after {
  width: 16px; height: 16px;
  border: 1px solid var(--amber);
  animation: pulseRing 2s cubic-bezier(.3,.9,.3,1) infinite;
  z-index: 1;
}
@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}
.today-marker .t-line {
  height: 1px;
  background: linear-gradient(to right,
    var(--amber) 0%,
    rgba(212,163,74,0.4) 40%,
    transparent 100%);
  margin-left: 20px;
  position: relative;
}
.today-marker .t-line::after {
  content: attr(data-date);
  position: absolute;
  left: 0;
  top: -22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--amber-dim);
  text-transform: uppercase;
}

/* ───────── Density variants ───────── */
body[data-density="compact"] .month { padding: 16px 0 20px; }
body[data-density="compact"] .release { margin-bottom: 8px; }
body[data-density="compact"] .r-body { padding: 10px 14px; grid-template-columns: 48px 1fr auto; gap: 14px; }
body[data-density="compact"] .r-body .r-thumb { width: 48px; height: 48px; }
body[data-density="compact"] .r-body .r-meta .r-title { font-size: 15px; }
body[data-density="compact"] .month-head .m-label h2 { font-size: 26px; }

body[data-density="comfy"] .month { padding: 48px 0 80px; }
body[data-density="comfy"] .release { margin-bottom: 32px; }
body[data-density="comfy"] .r-body { padding: 20px 24px; grid-template-columns: 80px 1fr auto; gap: 22px; }
body[data-density="comfy"] .r-body .r-thumb { width: 80px; height: 80px; }
body[data-density="comfy"] .r-body .r-meta .r-title { font-size: 19px; }
body[data-density="comfy"] .month-head .m-label h2 { font-size: 40px; }

/* ───────── Layout variants ───────── */
/* ───────── Alternating layout ─────────
   Center spine at 50%. Each row is a 3-col grid: [card-or-date | spine | card-or-date].
   Odd rows: card LEFT, date RIGHT. Even rows: date LEFT, card RIGHT. */
body[data-layout="alternating"] .timeline::before { left: 50%; }

body[data-layout="alternating"] .month-head {
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
}
body[data-layout="alternating"] .month-head > * { min-width: 0; }
body[data-layout="alternating"] .month-head .m-num {
  text-align: right;
  padding-right: 28px;
  padding-left: 0;
}
body[data-layout="alternating"] .month-head .m-label {
  padding-left: 28px;
}

body[data-layout="alternating"] .release {
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  column-gap: 0;
}
body[data-layout="alternating"] .release > * { min-width: 0; }
body[data-layout="alternating"] .release .r-marker {
  grid-column: 2;
  grid-row: 1;
}
body[data-layout="alternating"] .release .r-marker::before { display: none; }

/* date column gets compact treatment in alt */
body[data-layout="alternating"] .release .r-date {
  padding-top: 16px;
  white-space: nowrap;
}
body[data-layout="alternating"] .release .r-date .day { font-size: 18px; }
body[data-layout="alternating"] .release .r-date .weekday { font-size: 9px; }

/* Odd-of-type (1st, 3rd…) → card LEFT, date RIGHT */
body[data-layout="alternating"] .release:nth-of-type(odd) .r-card {
  grid-column: 1; grid-row: 1;
  padding-right: 28px; padding-left: 0;
}
body[data-layout="alternating"] .release:nth-of-type(odd) .r-date {
  grid-column: 3; grid-row: 1;
  text-align: left;
  padding-left: 28px; padding-right: 0;
}
body[data-layout="alternating"] .release:nth-of-type(odd) .r-body:hover,
body[data-layout="alternating"] .release:nth-of-type(odd).open .r-body {
  transform: translateX(-4px);
}

/* Even-of-type → date LEFT, card RIGHT */
body[data-layout="alternating"] .release:nth-of-type(even) .r-date {
  grid-column: 1; grid-row: 1;
  text-align: right;
  padding-right: 28px; padding-left: 0;
}
body[data-layout="alternating"] .release:nth-of-type(even) .r-card {
  grid-column: 3; grid-row: 1;
  padding-left: 28px; padding-right: 0;
}

/* Stack the card vertically in alt — half-column widths are too narrow for the
   horizontal 3-col layout. Thumb becomes a wide banner; meta below; right rail
   converted to a horizontal footer with a dashed divider. */
body[data-layout="alternating"] .r-card .r-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px;
}
body[data-layout="alternating"] .r-card .r-body > * { min-width: 0; }
body[data-layout="alternating"] .r-body .r-thumb {
  width: 100%;
  height: 88px;
  border-radius: 6px;
}
body[data-layout="alternating"] .r-body .r-meta { width: 100%; }
body[data-layout="alternating"] .r-body .r-meta .r-title {
  font-size: 15px;
  white-space: normal;
  line-height: 1.25;
}
body[data-layout="alternating"] .r-body .r-meta .r-sub {
  font-size: 10px;
  flex-wrap: wrap;
}
body[data-layout="alternating"] .r-body .r-right {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  gap: 8px;
}
body[data-layout="alternating"] .r-body .r-right .chev { display: none; }
body[data-layout="alternating"] .r-body .r-right .r-kind { font-size: 9px; }

/* expanded section spans both halves (across the spine) when open */
body[data-layout="alternating"] .release.open .r-card {
  grid-column: 1 / -1 !important;
  padding: 0 28px !important;
}
body[data-layout="alternating"] .release.open .r-date { display: none; }

/* today marker spans full width */
body[data-layout="alternating"] .today-marker {
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
}
body[data-layout="alternating"] .today-marker .t-label {
  padding-right: 28px;
}
body[data-layout="alternating"] .today-marker .t-line {
  margin-left: 28px;
}

/* Left-axis: all items on right of the line */
body[data-layout="left-axis"] .timeline::before { left: 20px; }
body[data-layout="left-axis"] .month-head { grid-template-columns: 20px 40px 1fr; }
body[data-layout="left-axis"] .month-head .m-num { display: none; }
body[data-layout="left-axis"] .release { grid-template-columns: 20px 40px 1fr; }
body[data-layout="left-axis"] .release .r-date {
  padding-right: 0;
  text-align: center;
  padding: 14px 0 0;
}
body[data-layout="left-axis"] .release .r-date .day {
  font-size: 13px;
  color: var(--ink-3);
}
body[data-layout="left-axis"] .release .r-date .weekday { display: none; }
body[data-layout="left-axis"] .release .r-date .countdown { display: none; }
body[data-layout="left-axis"] .release .r-card .r-body {
  display: grid;
  grid-template-columns: 48px 70px 1fr auto;
  gap: 16px;
}
body[data-layout="left-axis"] .release .r-card .r-body::before {
  content: attr(data-fulldate);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ───────── Tablet (portrait) ───────── */
@media (max-width: 1024px) and (min-width: 881px) {
  .nav-rail { display: none; }
  .page { padding-left: 0; }
  .calendar-shell { grid-template-columns: 240px 1fr; }
  .tcg-rail { padding: 18px 12px 24px; }
  .timeline-main { padding: 32px 28px 120px; }
  .release { grid-template-columns: 110px 36px 1fr; }
  .month-head { grid-template-columns: 110px 36px 1fr; }
  .timeline::before { left: 128px !important; }
  body[data-layout="left-axis"] .timeline::before { left: 20px !important; }
  .meta-bar { gap: 28px; }
  .meta-bar .stat .num { font-size: 19px; }
  .r-expand-inner { grid-template-columns: 220px 1fr 200px; }
}

/* ───────── Mobile ───────── */
@media (max-width: 880px) {
  /* Lock horizontal flow */
  html, body { overflow-x: hidden; max-width: 100vw; }
  .app-shell { max-width: 100vw; overflow-x: hidden; }

  /* Header */
  .app-header { padding: 0 14px; gap: 10px; height: 52px; }
  .app-header nav { display: none; }
  .app-header .jp-label { display: none; }
  .app-header .hd-right .chip:not(.primary) { display: none; }
  .app-header .brand-mark { font-size: 14px; }

  /* Hide left nav rail */
  .nav-rail { display: none !important; }
  .page { padding-left: 0; padding-top: 52px; }

  /* Stack the calendar shell */
  .calendar-shell { grid-template-columns: 1fr; }

  /* TCG rail → horizontal chip strip */
  .tcg-rail {
    position: sticky;
    top: 52px;
    height: auto;
    width: 100vw;
    max-width: 100vw;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 0 8px;
    z-index: 30;
    background: var(--bg);
  }
  .tcg-rail .rail-label { display: none; }
  .tcg-rail .rail-actions {
    padding: 0 14px 8px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 8px;
    gap: 6px;
  }
  .tcg-rail .rail-actions button {
    padding: 6px 10px;
    font-size: 10px;
  }
  .tcg-rail ul {
    display: flex;
    flex-direction: row !important;
    gap: 6px;
    padding: 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    margin: 0;
    list-style: none;
  }
  .tcg-rail ul::-webkit-scrollbar { display: none; }
  .tcg-rail li { flex-shrink: 0; margin: 0; }
  .tcg-rail .tcg-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-1);
    width: auto;
    text-align: left;
  }
  .tcg-rail .tcg-btn:hover { background: var(--bg-2); }
  .tcg-rail .tcg-btn .chip { width: 22px; height: 22px; font-size: 8px; flex-shrink: 0; }
  .tcg-rail .tcg-btn .name {
    font-size: 12px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    flex-shrink: 0;
  }
  .tcg-rail .tcg-btn .count { display: none; }
  .tcg-rail .tcg-btn .arrow { display: none; }
  .tcg-rail .tcg-btn.solo {
    border-color: var(--amber);
    background: rgba(212,163,74,0.10);
  }

  /* Main content */
  .timeline-main { padding: 22px 16px 120px; max-width: 100%; }
  .page-title { gap: 6px; }
  .page-title .crumb { font-size: 11px; }
  .page-title h1 { font-size: 28px; line-height: 1.05; }
  .page-title .lede { font-size: 13.5px; max-width: 100%; }

  /* Hero meta-bar — compact, scrollable */
  .meta-bar {
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 0 18px;
    margin-bottom: 22px;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .meta-bar::-webkit-scrollbar { display: none; }
  .meta-bar .stat { flex-shrink: 0; min-width: max-content; }
  .meta-bar .stat .num { font-size: 18px; }
  .meta-bar .stat .lbl { font-size: 9px; }

  /* Spine: align to a 24px gutter */
  .timeline::before { left: 23px !important; right: auto !important; }
  .timeline::after { display: none; }

  /* Month header */
  .month-head {
    grid-template-columns: 0 48px 1fr !important;
    top: 52px;
    padding: 18px 0 12px;
    margin-top: 14px;
  }
  .month-head .m-num { display: none; }
  .month-head .m-spine .m-dot { left: 23px !important; transform: translateX(-50%); }
  .month-head .m-label { padding-left: 4px; }
  .month-head .m-label h2 { font-size: 22px; }
  .month-head .m-label .count { font-size: 10px; }
  .month-head .m-jp { font-size: 11px; }

  /* Release rows — single layout for ALL data-layout values */
  .release {
    grid-template-columns: 0 48px 1fr !important;
    margin-bottom: 12px;
  }
  .release .r-date { display: none !important; }
  .release .r-marker {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: center;
  }
  .release .r-card {
    grid-column: 3 !important;
    grid-row: 1 !important;
    padding: 0 4px 0 8px !important;
  }
  .release .r-card .r-body {
    grid-template-columns: 48px 1fr !important;
    gap: 12px;
    padding: 12px 12px;
    align-items: center;
  }
  .r-body .r-thumb { width: 48px; height: 48px; flex-shrink: 0; }
  .r-body .r-thumb .chip { width: 22px; height: 22px; font-size: 8px; }
  .r-body .r-meta { min-width: 0; }
  .r-body .r-meta .r-title {
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .r-body .r-meta .r-sub { font-size: 10.5px; gap: 6px; }
  .r-body .r-right { display: none !important; }

  /* Inject a small date chip on the card edge */
  .r-card .r-body { position: relative; }
  .release .r-card .r-body::before {
    content: attr(data-daynum) " " attr(data-monshort);
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--bg);
    padding: 1px 7px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--ink-3);
    text-transform: uppercase;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  /* Hover/active reset on touch */
  .release .r-body:hover { transform: none !important; }

  /* Expand panel — single column */
  .r-expand-inner {
    grid-template-columns: 1fr !important;
    gap: 14px;
    padding: 14px 12px 4px;
  }
  .r-expand-inner .big-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
  }
  .r-expand-inner .r-details .r-specs {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
  }
  .r-expand-inner .r-details .r-specs .spec .v { font-size: 13px; }
  .r-expand-inner .r-actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .r-expand-inner .r-actions .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }
  .r-expand-inner .r-actions .btn.primary {
    flex: 1 1 100%;
  }

  /* Today marker */
  .today-marker {
    grid-template-columns: 0 48px 1fr !important;
    margin: 14px 0;
  }
  .today-marker .t-label {
    display: block;
    grid-column: 3;
    padding-left: 4px;
    text-align: left;
  }
  .today-marker .t-label .lbl-en { font-size: 10px; }
  .today-marker .t-label .lbl-jp { font-size: 9px; }
  .today-marker .t-line {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    margin-left: 0;
  }
  .today-marker .t-line::after { display: none; }
  .today-marker .t-dot {
    left: 23px !important;
    transform: translate(-50%, -50%);
  }

  /* Override alternating + left-axis layouts on mobile so they collapse to the same view */
  body[data-layout="alternating"] .timeline::before,
  body[data-layout="left-axis"] .timeline::before { left: 23px !important; right: auto !important; }
  body[data-layout="alternating"] .month-head,
  body[data-layout="left-axis"] .month-head { grid-template-columns: 0 48px 1fr !important; }
  body[data-layout="alternating"] .release,
  body[data-layout="left-axis"] .release { grid-template-columns: 0 48px 1fr !important; }
  body[data-layout="alternating"] .release:nth-of-type(odd) .r-card,
  body[data-layout="alternating"] .release:nth-of-type(even) .r-card,
  body[data-layout="left-axis"] .release .r-card {
    grid-column: 3 !important;
    grid-row: 1 !important;
    padding: 0 4px 0 8px !important;
  }
  body[data-layout="alternating"] .release:nth-of-type(odd) .r-marker,
  body[data-layout="alternating"] .release:nth-of-type(even) .r-marker {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  body[data-layout="alternating"] .release:nth-of-type(odd) .r-body:hover,
  body[data-layout="alternating"] .release:nth-of-type(odd).open .r-body,
  body[data-layout="alternating"] .release:nth-of-type(even) .r-body:hover,
  body[data-layout="alternating"] .release:nth-of-type(even).open .r-body {
    transform: none !important;
  }

  /* Tweaks panel — bottom sheet on mobile */
  .twk-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 14px 14px 0 0 !important;
    border-bottom: 0 !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Keep page title from clipping */
  .page-title h1 .jp { display: block; font-size: 14px; margin-top: 4px; }
}

/* ───────── Tiny phones (≤360px) ───────── */
@media (max-width: 380px) {
  .timeline-main { padding: 18px 12px 120px; }
  .release { grid-template-columns: 0 40px 1fr !important; }
  .month-head { grid-template-columns: 0 40px 1fr !important; }
  .timeline::before { left: 19px !important; }
  body[data-layout="alternating"] .timeline::before,
  body[data-layout="left-axis"] .timeline::before { left: 19px !important; }
  .month-head .m-spine .m-dot { left: 19px !important; }
  .today-marker .t-dot { left: 19px !important; }
  .r-body .r-thumb { width: 42px; height: 42px; }
  .release .r-card .r-body {
    grid-template-columns: 42px 1fr !important;
    gap: 10px;
    padding: 10px 10px;
  }
  .r-body .r-meta .r-title { font-size: 13px; }
  .meta-bar .stat .num { font-size: 16px; }
  .page-title h1 { font-size: 24px; }
}
