:root {
  --ink: #0a0a0c;
  --paper: #f1ead9;
  --paper-d: #d8cfb8;
  --amber: #d4a44b;
  --amber-d: #a67d2f;
  --red: #b8262e;
  --green: #2c8a4e;
  --muted: #8b8674;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--ink); color: var(--paper);
  font-family: 'Playfair Display', Georgia, serif;
}
a { color: inherit; text-decoration: none; }

/* HEADER */
.ch-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid rgba(241,234,217,0.1);
  position: relative; z-index: 5;
}
.ch-logo { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.18em; font-size: 22px; color: var(--paper); }
.ch-nav { display: flex; gap: 22px; }
.ch-nav a { color: rgba(241,234,217,0.55); font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.18em; font-size: 14px; padding: 4px 2px; border-bottom: 2px solid transparent;
  transition: 0.15s; }
.ch-nav a:hover { color: var(--paper); }
.ch-nav a.active { color: var(--amber); border-color: var(--amber); }
.ch-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--amber);
  letter-spacing: 0.08em; }

/* CURTAIN */
.ch-curtain {
  position: relative; min-height: calc(100vh - 90px); overflow: hidden;
  background:
    radial-gradient(900px 600px at 50% 30%, rgba(212,164,75,0.12), transparent 70%),
    radial-gradient(1100px 700px at 50% 100%, rgba(184,38,46,0.15), transparent 70%),
    var(--ink);
  display: grid; place-items: center; padding: 50px 24px 80px;
}
.curtain-left, .curtain-right {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.45) 0px, rgba(0,0,0,0.15) 20px, rgba(0,0,0,0.45) 40px),
    linear-gradient(180deg, #5b0e15 0%, #2c0508 100%);
  z-index: 1; pointer-events: none;
  transition: transform 1.6s cubic-bezier(.6,.05,.2,1);
}
.curtain-left { left: 0; transform-origin: left center; transform: translateX(-100%); }
.curtain-right { right: 0; transform-origin: right center; transform: translateX(100%); }
.ch-curtain.closing .curtain-left { transform: translateX(0); }
.ch-curtain.closing .curtain-right { transform: translateX(0); }

.ch-stage {
  position: relative; z-index: 2; text-align: center; max-width: 760px;
}
.ch-spotlight {
  position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 700px;
  background: radial-gradient(closest-side at 50% 0%, rgba(241,234,217,0.16), transparent 70%);
  pointer-events: none; z-index: -1;
}
.ch-presents {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.4em;
  color: var(--amber); margin: 0 0 14px;
}
.ch-title {
  font-family: 'Playfair Display', serif; font-weight: 900;
  font-size: clamp(56px, 11vw, 132px); line-height: 0.92;
  margin: 0; letter-spacing: -0.02em; color: var(--paper);
}
.ch-title .amber {
  color: var(--amber); font-style: italic;
  background: linear-gradient(180deg, #f3d488 0%, #b07b22 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ch-tag {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 19px;
  color: rgba(241,234,217,0.7); margin: 16px 0 36px;
}

/* DIAL */
.dial-wrap { display: inline-flex; flex-direction: column; align-items: center; margin: 8px 0 36px; }
.dial { width: 240px; height: 240px; }
.dial-rim { fill: none; stroke: var(--amber); stroke-width: 3; }
.dial-bg { fill: rgba(241,234,217,0.04); stroke: rgba(241,234,217,0.18); stroke-width: 1; }
.dial-hand {
  stroke: var(--red); stroke-width: 3; stroke-linecap: round;
  transform-origin: 0 0;
  transition: transform 1.6s cubic-bezier(.18,1.05,.28,1);
  filter: drop-shadow(0 0 6px rgba(184,38,46,0.7));
}
.dial.spinning .dial-hand { transition: none; }
.dial-hub { fill: var(--amber); stroke: var(--ink); stroke-width: 2; }
#dialTicks line { stroke: rgba(241,234,217,0.55); stroke-width: 1; }
#dialTicks line.major { stroke: var(--paper); stroke-width: 2; }
#dialNumbers text { fill: var(--paper); font-family: 'Bebas Neue', sans-serif; font-size: 12px; letter-spacing: 0.1em; }
.dial-caption { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.dial-time {
  font-family: 'JetBrains Mono', monospace; font-size: 28px; color: var(--amber); font-weight: 700;
  letter-spacing: 0.02em;
}
.dial-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: rgba(241,234,217,0.5); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 4px; }

.ch-cta {
  position: relative; display: inline-block;
  background: linear-gradient(180deg, var(--paper), var(--paper-d));
  color: var(--ink); border: none; padding: 18px 44px;
  font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 0.28em;
  cursor: pointer; border-radius: 0;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  transition: 0.15s;
}
.ch-cta::before, .ch-cta::after {
  content: ""; position: absolute; top: -6px; bottom: -6px; width: 12px;
  border: 2px solid var(--amber);
}
.ch-cta::before { left: -12px; border-right: none; }
.ch-cta::after { right: -12px; border-left: none; }
.ch-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
.ch-cta.dark { background: var(--ink); color: var(--paper); border: 1px solid rgba(241,234,217,0.3); }
.ch-cta.gold { background: linear-gradient(180deg, var(--amber), var(--amber-d)); color: var(--ink); }
.ch-cta.dark::before, .ch-cta.dark::after, .ch-cta.gold::before, .ch-cta.gold::after { border-color: var(--paper); }
.ch-cta.spinning { background: #555; color: #aaa; cursor: not-allowed; box-shadow: none; }

.ch-hint {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 14px;
  color: rgba(241,234,217,0.45); margin-top: 24px;
}

/* POSTER */
.hidden { display: none !important; }
.ch-poster-wrap {
  background: var(--paper); color: var(--ink); padding: 50px 24px 80px;
  position: relative; min-height: calc(100vh - 90px);
  background-image:
    radial-gradient(1500px 800px at 50% 100%, rgba(184,38,46,0.05), transparent 70%);
}
.ch-poster-wrap::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid var(--amber-d); pointer-events: none;
}
.ch-poster-wrap::after {
  content: ""; position: absolute; inset: 18px; border: 1px solid rgba(166,125,47,0.4); pointer-events: none;
}
.poster-close {
  background: none; border: none; color: var(--ink); cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.1em;
  position: relative; z-index: 2; padding: 4px 8px;
  text-decoration: underline; text-underline-offset: 4px;
}
.poster { max-width: 780px; margin: 30px auto 0; position: relative; z-index: 2; }

.poster-hero {
  border-top: 3px double var(--ink); border-bottom: 3px double var(--ink);
  padding: 24px 0 28px; text-align: center;
}
.poster-meta { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.2em; font-size: 14px;
  color: var(--amber-d); margin-bottom: 14px; }
.pm-sep { margin: 0 4px; color: var(--muted); }
.pm-cat { color: var(--red); font-weight: 700; }
.pm-sev { color: var(--ink); }
.pm-prob { color: var(--muted); }

.poster-headline {
  font-family: 'Playfair Display', serif; font-weight: 900;
  font-size: clamp(36px, 6vw, 60px); line-height: 1.02;
  margin: 0 0 14px; letter-spacing: -0.015em;
}
.poster-tagline {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(18px, 2.3vw, 22px); color: var(--red);
  margin: 0 0 12px;
}
.poster-event {
  font-size: 16px; color: var(--ink); opacity: 0.78; margin: 0; line-height: 1.55;
  max-width: 580px; margin: 0 auto;
}

.poster-section { margin-top: 38px; }
.poster-section.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 700px) { .poster-section.twin { grid-template-columns: 1fr; } }
.section-mark {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.18em; font-size: 16px;
  color: var(--red); margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.15);
}
.section-mark.loser { color: var(--ink); }

/* BARS (asset visualization centered on zero) */
.bars { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.bar-row {
  display: grid; grid-template-columns: 1.5fr 2fr 0.7fr; gap: 12px; align-items: center;
  font-size: 14px;
}
.bar-row .bar-name { font-weight: 700; line-height: 1.25; }
.bar-row .bar-name .reason { display: block; font-weight: 400; font-style: italic; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bar-track {
  position: relative; height: 22px; background: rgba(0,0,0,0.05);
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
}
.bar-track::before {
  content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px;
  background: var(--ink);
}
.bar-fill {
  position: absolute; top: 0; bottom: 0;
  background: var(--bar-color); transition: width 0.7s cubic-bezier(.2,.8,.2,1);
}
.bar-fill.up { left: 50%; background: var(--green); }
.bar-fill.down { right: 50%; background: var(--red); }
.bar-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.bar-value.up { color: var(--green); } .bar-value.down { color: var(--red); }

.indices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 700px) { .indices { grid-template-columns: 1fr 1fr; } }
.ix { border: 1px solid rgba(0,0,0,0.2); padding: 12px 10px; text-align: center; background: rgba(0,0,0,0.02); }
.ix span { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.15em; font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.ix b { font-family: 'JetBrains Mono', monospace; font-size: 17px; }
.ix b.up { color: var(--green); } .ix b.down { color: var(--red); }

.win-list, .los-list {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px;
  line-height: 1.6; margin: 0;
}
.win-list { color: var(--green); }
.los-list { color: var(--red); }

.poster-trade {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; line-height: 1.6;
  background: var(--ink); color: var(--paper); padding: 18px 20px; margin: 0;
}
.poster-trade::before { content: "▸ "; color: var(--amber); }
.poster-history {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px;
  line-height: 1.65; color: var(--ink); margin: 0;
  padding: 14px 0 14px 18px; border-left: 3px solid var(--amber-d);
}

.poster-foot {
  margin-top: 38px; padding-top: 22px; border-top: 3px double var(--ink);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px;
}
@media (max-width: 700px) { .poster-foot { grid-template-columns: 1fr; } }
.poster-foot div span {
  display: block; font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.18em;
  font-size: 12px; color: var(--muted); margin-bottom: 4px;
}
.poster-foot div b { font-family: 'Playfair Display', serif; font-size: 15px; color: var(--ink); font-weight: 600; }

.poster-cta { margin-top: 44px; display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal {
  background: var(--paper); color: var(--ink); padding: 36px 28px 26px;
  max-width: 460px; width: 100%; position: relative;
  border: 2px solid var(--amber); border-radius: 0;
  box-shadow: 0 30px 70px rgba(0,0,0,0.7);
  font-family: 'Playfair Display', serif;
}
.modal::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(166,125,47,0.4); pointer-events: none; }
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--ink); font-size: 24px; cursor: pointer; z-index: 1; }
.modal h2 { font-family: 'Playfair Display', serif; font-weight: 900; font-size: 28px; margin: 0 0 8px; letter-spacing: -0.01em; }
.modal p { margin: 0 0 18px; font-size: 15px; color: var(--ink); opacity: 0.8; }
#subForm { display: flex; gap: 8px; }
#subForm input {
  flex: 1; padding: 12px 14px; background: rgba(0,0,0,0.04); border: 1px solid var(--ink);
  color: var(--ink); font: inherit; font-size: 15px; border-radius: 0;
}
#subForm input:focus { outline: none; border-color: var(--amber); background: #fff; }
#subForm button {
  padding: 12px 22px; background: var(--ink); color: var(--paper); border: none;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.1em; font-size: 14px; cursor: pointer; border-radius: 0;
}
.modal-msg { margin-top: 12px; font-size: 14px; color: var(--green); min-height: 18px; }
.modal-msg.err { color: var(--red); }
.modal-skip { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; margin-top: 14px; text-decoration: underline; padding: 4px;
  font-family: 'Playfair Display', serif; font-style: italic; }
