/* ============================================================
   The Tournament of Chaps — landing page styles
   Aesthetic: a Victorian betting-house broadsheet. Paper, ink,
   engraved type, one slash of yellow.
   ============================================================ */
:root {
  --paper: #f3ecdd;
  --paper2: #ece3cf;
  --ink: #211c15;
  --ink2: #5b5346;
  --gold: #f2c230;
  --rule: #c9bda3;
  --red: #a8392e;
  --green: #3e6b35;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- masthead / hero ---------- */
.masthead-wrap {
  border-bottom: 3px double var(--ink);
  padding: 34px 0 26px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(242, 194, 48, .30), transparent 60%),
    var(--paper);
}
.crest {
  width: clamp(120px, 22vw, 200px);
  height: auto;
  margin: 0 auto 6px;
  display: block;
}
.logotype {
  width: min(640px, 88%);
  height: auto;
  margin: 4px auto 0;
  display: block;
}
.coming-soon {
  font-family: "Graduate", Georgia, serif;
  letter-spacing: 6px;
  font-size: clamp(15px, 3.2vw, 22px);
  color: var(--red);
  margin: 18px 0 4px;
  text-transform: uppercase;
}
.dek {
  font-style: italic;
  color: var(--ink2);
  margin: 10px auto 0;
  max-width: 620px;
}
.est {
  font-family: "Graduate", serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--ink2);
  margin-top: 12px;
}

/* ---------- sections ---------- */
section { padding: 34px 0 8px; }
h2.sec {
  font-family: "Graduate", Georgia, serif;
  font-size: 20px;
  letter-spacing: 3px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
h2.sec small {
  font-family: Georgia, serif;
  letter-spacing: 0;
  font-weight: 400;
  font-style: italic;
  font-size: 13px;
  color: var(--ink2);
}

/* ---------- latest dispatch ---------- */
.latest {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  background: var(--paper2);
  border: 1px solid var(--rule);
  padding: 22px;
  margin-top: 18px;
}
.latest .art {
  background: repeating-linear-gradient(45deg, #e2d7bd, #e2d7bd 10px, #ddd1b4 10px, #ddd1b4 20px);
  border: 1px solid var(--rule);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  font-style: italic;
  text-align: center;
  padding: 14px;
}
.latest h3 { font-family: "Bevan", serif; font-size: 26px; margin: 0 0 4px; line-height: 1.15; }
.kicker { font-family: "Graduate", serif; font-size: 11px; letter-spacing: 3px; color: var(--red); }
.latest p { margin: .6em 0; }
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--gold);
  font-family: "Graduate", serif;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 10px 18px;
  text-decoration: none;
  margin-top: 8px;
}
.btn:hover { background: var(--red); color: #fff; }

/* ---------- editions grid ---------- */
.eds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.ed {
  border: 1px solid var(--rule);
  background: #ffffff88;
  padding: 14px 14px 12px;
  position: relative;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ed .no { font-family: "Bevan", serif; font-size: 13px; color: var(--red); }
.ed h4 { margin: 2px 0 4px; font-size: 16.5px; line-height: 1.25; }
.ed .covers { font-size: 12.5px; color: var(--ink2); font-style: italic; }
.ed a { color: var(--ink); text-decoration: none; }
.ed a:hover { color: var(--red); }
.ed.forthcoming { opacity: .62; background: transparent; }
.ed.forthcoming h4 { color: var(--ink2); }
.stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: "Graduate", serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 3px 7px;
  border: 1.5px solid currentColor;
  transform: rotate(6deg);
}
.stamp.pub { color: var(--green); }
.stamp.next { color: var(--red); }
.stamp.soon { color: var(--ink2); border-style: dashed; }

/* ============================================================
   THE LEDGER — Rive mockup
   ============================================================ */
.ledger-app {
  margin-top: 18px;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(168, 57, 46, .05) 27px, rgba(168, 57, 46, .05) 28px),
    var(--paper2);
  padding: 18px 18px 14px;
  box-shadow: inset 0 0 0 4px var(--paper2), inset 0 0 0 5px var(--rule);
}

.ledger-head {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
}
.wax-seal { flex: 0 0 auto; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .2)); }
.ledger-head-figures { display: flex; flex-direction: column; line-height: 1.2; }
.pot-label { font-family: "Graduate", serif; font-size: 10px; letter-spacing: 3px; color: var(--ink2); }
.pot-value { font-family: "Bevan", serif; font-size: 30px; color: var(--ink); font-variant-numeric: tabular-nums; }
.per-share { font-size: 12px; font-style: italic; color: var(--ink2); }
.ledger-status {
  margin-left: auto;
  font-family: "Graduate", serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink2);
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink2);
  box-shadow: 0 0 0 0 rgba(62, 107, 53, .6);
}
.live-dot.is-live { background: var(--green); animation: pulse 2.4s ease-out infinite; }
.live-dot.is-stale { background: var(--red); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 107, 53, .55); }
  70% { box-shadow: 0 0 0 8px rgba(62, 107, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 107, 53, 0); }
}

/* ---------- the rope of pennants ---------- */
.rope-wrap { position: relative; height: 132px; margin: 22px 0 8px; }
.rope-line {
  position: absolute; top: 16px; left: 1%; right: 1%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--ink2) 6%, var(--ink2) 94%, transparent);
  border-radius: 2px;
}
.rope { position: absolute; inset: 0; }
.pennant {
  position: absolute;
  top: 18px;
  width: 52px;
  transform: translateX(-50%);
  transition: left .9s cubic-bezier(.5, 0, .2, 1);
  transform-origin: top center;
  animation: sway 4.5s ease-in-out infinite;
  will-change: transform, left;
}
/* stagger the cloth-sway so the rope feels alive, not metronomic */
.pennant:nth-child(2n) { animation-delay: -1.2s; animation-duration: 5.1s; }
.pennant:nth-child(3n) { animation-delay: -.6s; animation-duration: 4.1s; }
@keyframes sway {
  0%, 100% { transform: translateX(-50%) rotate(-2.5deg); }
  50% { transform: translateX(-50%) rotate(2.5deg); }
}
.pennant .flag {
  width: 52px; height: 64px;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink);
  box-shadow: 1px 2px 3px rgba(0, 0, 0, .18);
  color: #fff;
  font-family: "Graduate", serif;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}
.pennant .name {
  display: block; text-align: center; margin-top: 4px;
  font-size: 10.5px; color: var(--ink); white-space: nowrap;
}
.pennant .rankno {
  display: block; text-align: center;
  font-family: "Bevan", serif; font-size: 11px; color: var(--ink2);
}

/* ---------- captain & scrub + mustache ---------- */
.capscrub {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 4px;
  margin-top: 6px;
}
.capscrub-tag {
  display: block;
  font-family: "Graduate", serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--ink2);
  margin-bottom: 2px;
}
.capscrub .cap, .capscrub .scrub { font-family: "Bevan", serif; font-size: 15px; }
.capscrub .scrub { text-align: right; }
.capscrub .cap [data-captain] { color: var(--green); }
.capscrub .scrub [data-scrub] { color: var(--red); }
.mustache { text-align: center; }
.mustache-dial { width: 150px; height: auto; }
.mustache-needle, [data-mustache-needle] { transition: transform 1s cubic-bezier(.5, 0, .2, 1); }
[data-mustache-arc] { transition: stroke-dashoffset 1s cubic-bezier(.5, 0, .2, 1); }
.mustache-scale {
  display: flex; justify-content: space-between;
  font-family: "Graduate", serif; font-size: 8px; letter-spacing: 1px; color: var(--ink2);
  margin-top: -6px;
}

/* ---------- the table ---------- */
table.ledger { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14.5px; }
table.ledger th {
  font-family: "Graduate", serif; font-size: 10.5px; letter-spacing: 1.5px;
  text-align: left; border-bottom: 2px solid var(--ink); padding: 6px 8px;
}
table.ledger td { border-bottom: 1px solid var(--rule); padding: 6px 8px; }
table.ledger tbody tr:nth-child(odd) td { background: #ffffff33; }
table.ledger tbody tr { transition: background .3s ease; }
table.ledger tbody tr.row-hot td { background: rgba(242, 194, 48, .22); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-loading { text-align: center; font-style: italic; color: var(--ink2); padding: 18px; }
.chipdot {
  display: inline-block; width: 11px; height: 11px;
  border: 1px solid var(--ink); margin-right: 8px;
  transform: rotate(45deg); vertical-align: middle;
}
.delta { font-family: "Bevan", serif; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.same { color: var(--ink2); }

/* ---------- bonus stamps ---------- */
.bonus-stamp {
  display: inline-block;
  font-family: "Graduate", serif;
  font-size: 8.5px;
  letter-spacing: 1px;
  padding: 1px 5px;
  margin-left: 5px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(-5deg);
  color: var(--red);
  animation: stampIn .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.bonus-stamp.upset { color: var(--red); }
.bonus-stamp.destruction { color: #8a2b2b; }
.bonus-stamp.comeback { color: var(--green); }
@keyframes stampIn {
  0% { transform: rotate(-5deg) scale(2.4); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-5deg) scale(1); opacity: 1; }
}

.rive-note {
  font-size: 12px; color: var(--ink2); font-style: italic;
  margin-top: 12px; text-align: center;
}

/* ---------- footer ---------- */
footer {
  margin-top: 48px;
  border-top: 3px double var(--ink);
  padding: 22px 0 34px;
  font-size: 13px;
  color: var(--ink2);
  text-align: center;
  background: var(--paper2);
}
footer .cols { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { color: var(--red); }
.motto { font-family: "Graduate", serif; letter-spacing: 3px; font-size: 11px; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .latest { grid-template-columns: 1fr; }
  .capscrub { grid-template-columns: 1fr; text-align: center; }
  .capscrub .scrub { text-align: center; }
  .pennant .name { font-size: 9px; }
}

/* ---------- respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pennant { animation: none; }
  .live-dot.is-live { animation: none; }
  .bonus-stamp { animation: none; }
  .pennant, [data-mustache-needle], [data-mustache-arc] { transition: none; }
}
