/* tikibeen1 | the war table, 2026-11-04. The canvas fills the pinned screen; the title, the week
   card (a paper dispatch) and the week ruler sit over it. .tr-live = pinned and scrubbed,
   .tr-still = reduced motion (one frame, then the list), .tr-flat = no WebGL (the list only). */
.table-room { position: relative; z-index: 1; background: #04060D; color: #F1ECE0; overflow: hidden; }
.tr-stage { position: absolute; inset: 0; z-index: 0; }
.tr-canvas { display: block; }
.tr-live { height: 100vh; height: 100svh; }

/* the title, only while the table is still in the wide shot */
.tr-head { position: relative; z-index: 2; }
.tr-live .tr-head { position: absolute; left: 5vw; top: calc(var(--bar-h) + 5vh); max-width: min(780px, 60vw); pointer-events: none; transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.tr-head a { pointer-events: auto; }
.tr-head .h2 { margin: 0; font-size: clamp(40px, 5.4vw, 92px); line-height: 0.92; color: #F1ECE0; }
.tr-head .his-words p { font-size: clamp(20px, 2.1vw, 30px); }
.tr-head .his-words cite { color: #BCC2D8; }
.tr-live:not([data-seg="intro"]) .tr-head { opacity: 0; transform: translate3d(0, -22px, 0); }
.tr-hint { margin: 28px 0 0; font-family: var(--display); font-weight: 850; font-variation-settings: "wdth" 112; letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px; line-height: 1; color: #0E1531; background: #FFC72C; display: inline-block; padding: 9px 14px 7px; clip-path: var(--slant); }
.tr-still .tr-hint, .tr-flat .tr-hint { display: none; }

/* the dispatch: one paper card for the week on the table */
.table-room .tr-cards { list-style: none; margin: 0; padding: 0; background: none; gap: 0; position: relative; z-index: 3; }
.tr-cards .wk { --ground: #F4F0E6; --ground-2: #EAE4D4; --ink: #0E1531; --ink-dim: #545B73; color: #0E1531; background: #F4F0E6; border-top: 0; padding: 4px 18px 14px;
  box-shadow: inset 0 5px 0 #0E1531, 9px 9px 0 #FFC72C, 9px 9px 0 2px #0E1531, 0 30px 50px -10px rgba(0, 0, 0, 0.7); }
.tr-cards .wk.is-on { box-shadow: inset 0 5px 0 #0E1531, 9px 9px 0 #FFC72C, 9px 9px 0 2px #0E1531, 0 30px 50px -10px rgba(0, 0, 0, 0.7); }
.tr-cards .wk-num { margin-left: -18px; }
.tr-cards a { color: #0E1531; text-decoration-color: #D63A1C; text-decoration-thickness: 2px; }
.tr-cards .wk.is-on .wk-num { background: #FFC72C; }
.tr-cards .wk-natty .wk-num { background: #E4C140; }
.tr-live .tr-cards { position: absolute; right: 3vw; top: calc(var(--bar-h) + 26px); width: min(410px, 34vw); display: grid; }
.tr-live .tr-cards .wk { grid-area: 1 / 1; align-self: start; opacity: 0; visibility: hidden; transform: translate3d(36px, 0, 0) rotate(2deg);
  transition: opacity 0.3s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.55s; }
.tr-live .tr-cards .wk.is-on { opacity: 1; visibility: visible; transform: rotate(-1.2deg); transition-delay: 0s; }
.tr-live .tr-cards .skel-card { display: none; }

/* the foot: piece legend on the left, the week ruler on the right */
.tr-foot { position: relative; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px var(--gutter); }
.tr-live .tr-foot { position: absolute; left: 0; right: 0; bottom: 20px; padding: 0 3vw; pointer-events: none; }
.tr-legend { background: #0E1531; padding: 9px 12px; box-shadow: 5px 5px 0 #03050F; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; font-weight: 700; color: #DCD3BE; }
.tr-legend span { display: flex; align-items: center; gap: 7px; }
.pc { width: 13px; height: 13px; box-shadow: 0 0 0 2px #1E120A, 2px 2px 0 2px #000; }
.pc-f { background: #F1ECE0; }
.pc-s { background: #FFC72C; }
.pc-p { background: #D63A1C; }
.tr-ruler { display: flex; gap: 3px; padding: 5px; background: #0E1531; box-shadow: 0 0 0 2px #FFC72C, 6px 6px 0 2px #D63A1C, 0 20px 40px rgba(0, 0, 0, 0.6); pointer-events: auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tr-ruler::-webkit-scrollbar { display: none; }
.tr-tick { flex: none; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: #BCC2D8; cursor: pointer;
  font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 100; font-size: 16px; line-height: 1; text-transform: uppercase; }
.tr-tick.is-next { color: #FFC72C; }
.tr-tick.is-natty { color: #E4C140; }
.tr-tick.is-on { background: #FFC72C; color: #0E1531; }
.tr-tick.is-natty.is-on { background: #E4C140; }
.tr-tick:focus-visible { outline: 2px solid #FFC72C; outline-offset: 2px; }
.tr-still .tr-ruler, .tr-flat .tr-ruler { display: none; }

/* reduced motion and no WebGL: the title, one frame of the whole table, then every week as a list */
.tr-still, .tr-flat { display: flex; flex-direction: column; padding-bottom: 60px; }
.tr-still .tr-head, .tr-flat .tr-head { order: -2; padding: calc(var(--bar-h) + 48px) var(--gutter) 28px; max-width: 900px; }
.tr-still .tr-stage { position: relative; order: -1; }
.tr-flat .tr-stage { display: none; }
.tr-still .tr-cards, .tr-flat .tr-cards { display: grid; gap: 34px 28px; padding: 34px var(--gutter) 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.tr-still .tr-foot, .tr-flat .tr-foot { order: -1; }

@media (max-width: 899px) {
  .tr-live .tr-head { left: var(--gutter); right: var(--gutter); top: calc(var(--bar-h) + 22px); max-width: none; }
  .tr-head .h2 { font-size: clamp(34px, 10vw, 52px); }
  .tr-head .his-words { margin-top: 16px; }
  .tr-head .his-words p { font-size: 19px; }
  .tr-head .his-words p::before { font-size: 64px; }
  .tr-hint { margin-top: 18px; font-size: 13px; }
  .tr-live .tr-cards { left: 12px; right: 12px; top: auto; bottom: 74px; width: auto; }
  .tr-live .tr-cards .wk { max-height: 40svh; overflow-y: auto; transform: translate3d(0, 30px, 0); padding: 2px 14px 10px; }
  .tr-live .tr-cards .wk.is-on { transform: rotate(-0.6deg); }
  .tr-cards .wk-num { margin-left: -14px; font-size: 30px; }
  .tr-live .tr-foot { bottom: 12px; padding: 0 12px; justify-content: center; }
  .tr-live .tr-legend { display: none; }
  .tr-tick { min-width: 30px; height: 32px; padding: 0 5px; font-size: 14px; }
}

/* v2: the room closes in at the edges, a tag over a tapped piece, a compact dispatch on phones */
.tr-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 22vmin 6vmin rgba(2, 3, 8, 0.82); }
.tr-tag { position: absolute; left: 0; top: 0; z-index: 4; width: max-content; max-width: min(300px, 80vw); padding: 12px 14px 12px; background: #F4F0E6; color: #0E1531;
  box-shadow: inset 0 4px 0 #0E1531, 6px 6px 0 #FFC72C, 6px 6px 0 2px #0E1531, 0 24px 40px -8px rgba(0, 0, 0, 0.7); display: grid; gap: 4px; pointer-events: auto; margin-top: -12px; }
.tr-tag[hidden] { display: none; }
.tr-tag b { font-family: Newsreader, Georgia, serif; font-size: 18px; line-height: 1.15; font-weight: 700; }
.tr-tag span { font-size: 14px; line-height: 1.3; color: #545B73; font-weight: 600; }
.tr-tag em { font-style: normal; justify-self: start; font-family: var(--display); font-weight: 850; font-variation-settings: "wdth" 112; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; background: #0E1531; color: #FFC72C; padding: 5px 8px 4px; clip-path: var(--slant); }
.tr-tag a { font-size: 14px; font-weight: 700; color: #0E1531; text-decoration-color: #D63A1C; text-decoration-thickness: 2px; padding-block: 6px; }
.tr-stage.is-piece { cursor: pointer; }
@media (max-width: 899px) {
  .tr-live .tr-cards .wk { max-height: 30svh; }
  .tr-live .tr-cards .g-where { display: none; }
  .tr-live .tr-cards .g { padding-block: 6px; }
  .tr-live .tr-cards .g-match { font-size: 16px; }
  .tr-live .tr-ruler { scroll-behavior: smooth; }
}
