.tp-page {
  --tp-paper: #fffdfc;
  --tp-ink: #2f2134;
  --tp-muted: #645368;
  --tp-accent: #7a365e;
  --tp-accent-ink: #fff;
  --tp-line: #e6d5e1;
  --tp-rose: #faeaf3;
  --tp-lilac: #f0ebfa;
  --tp-mint: #e5f4ed;
  --tp-sun: #fbf3da;
  color: var(--tp-ink);
}
@media (prefers-color-scheme: dark) {
  .tp-page {
    --tp-paper: #28212d;
    --tp-ink: #f6ebf4;
    --tp-muted: #d5bfd2;
    --tp-accent: #f6beda;
    --tp-accent-ink: #42263c;
    --tp-line: #594859;
    --tp-rose: #472d3e;
    --tp-lilac: #372e4c;
    --tp-mint: #244035;
    --tp-sun: #473b28;
  }
  .modern-subpage #content.tp-page {
    background: var(--tp-paper);
    color: var(--tp-ink);
  }
}
.tp-page :is(h2,h3,strong) { color: var(--tp-ink); }
.tp-page h2 { font-size: clamp(1.28rem, 2.8vw, 1.85rem); font-weight: 760; line-height: 1.25; margin: 0 0 .65rem; }
.tp-page h3 { font-size: 1.08rem; font-weight: 700; margin: 0 0 .5rem; line-height: 1.45; }
.tp-page p { margin: 0 0 .75rem; }
.tp-page [hidden] { display: none !important; }
.tp-page :is(section, article)[id] { scroll-margin-top: 6rem; }
.tp-page fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.tp-jump, .tp-actions, .tp-checks, .tp-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.tp-heading { justify-content: space-between; align-items: flex-start; }
.tp-heading > div { min-width: 0; }
.tp-jump { margin-top: 1.35rem; }
.tp-actions { margin-top: .8rem; }
.tp-panel {
  border-radius: 18px;
  border: 1px solid var(--tp-line);
  background: var(--tp-paper);
  margin: 1.15rem 0;
  padding: clamp(.95rem, 3.1vw, 1.85rem);
  min-width: 0;
}
.tp-daily { background: var(--tp-rose); }
.tp-daily .tp-meta { margin-bottom: 0; }
.tp-page :is(button, .tp-jump a, .tp-actions a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: .55rem .8rem;
  border: 1px solid var(--tp-line);
  border-radius: 9px;
  background: var(--tp-paper);
  color: var(--tp-accent);
  text-decoration: none;
  font: inherit;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: normal;
  box-shadow: none;
  white-space: normal;
  cursor: pointer;
}
.tp-page :is(button:hover, .tp-jump a:hover, .tp-actions a:hover) { border-color: var(--tp-accent); background: var(--tp-lilac); }
.tp-page :is(button, a, input, select, summary):focus-visible { outline: 3px solid var(--tp-accent); outline-offset: 3px; }
.tp-page :is(button:disabled, select:disabled) { opacity: .63; cursor: default; }
.tp-page button.tp-primary { background: var(--tp-accent); border-color: var(--tp-accent); color: var(--tp-accent-ink); }
.tp-page button.tp-primary:hover:not(:disabled) { background: var(--tp-accent); box-shadow: 0 0 0 3px var(--tp-line); }
.tp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.tp-options { margin: .8rem 0; }
.tp-page label, .tp-page select { display: block; min-width: 0; }
.tp-page label { font-weight: 650; margin: 0; }
.tp-page :is(input:not([type="checkbox"]), select, textarea) {
  max-width: 100%;
  min-height: 44px;
  padding: .5rem .7rem;
  border: 1px solid var(--tp-line);
  border-radius: 9px;
  color: var(--tp-ink);
  background-color: var(--tp-paper);
  font: inherit;
  margin-top: .2rem;
}
.tp-page .tp-checks label { font-weight: 500; padding: .45rem .52rem; border: 1px solid var(--tp-line); border-radius: 8px; }
.tp-page input[type="checkbox"] { appearance: auto; width: 1em; height: 1em; accent-color: var(--tp-accent); }
.tp-page .tp-meta { color: var(--tp-muted); font-size: .93rem; }
.tp-page .tp-kicker { color: var(--tp-accent); font-weight: 750; }
.tp-page .tp-setup-more { margin: .8rem 0; padding: .65rem .8rem; background: var(--tp-lilac); border-radius: 10px; }
.tp-page details :is(ul,ol,p) { margin-top: .55rem; }
.tp-page summary { cursor: pointer; font-weight: 680; line-height: 1.55; }
.tp-page progress { display: block; width: 100%; accent-color: var(--tp-accent); margin-bottom: .7rem; }
.tp-puzzle { background: var(--tp-lilac); border-radius: 14px; padding: clamp(.9rem, 2.7vw, 1.55rem); margin: .8rem 0; }
.tp-puzzle h2 { overflow-wrap: anywhere; }
.tp-puzzle #tp-hint:empty { margin: 0; }
.tp-page #tp-choices button, .tp-page #tp-person-choices button { justify-content: flex-start; text-align: left; min-height: 54px; overflow-wrap: anywhere; }
.tp-page #tp-clock { color: var(--tp-accent); background: var(--tp-sun); font-variant-numeric: tabular-nums; padding: .35rem .65rem; border-radius: 8px; }
.tp-page .tp-input input { flex: 1 1 10rem; }
.tp-feedback { margin-top: 1rem; background: var(--tp-sun); border-inline-start: 4px solid var(--tp-accent); padding: .9rem; border-radius: 8px; }
.tp-feedback[data-state="correct"] { background: var(--tp-mint); }
.tp-stats { margin: .8rem 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
.tp-stats > div, .tp-entry { padding: .8rem; border: 1px solid var(--tp-line); border-radius: 11px; }
.tp-stats dt { color: var(--tp-muted); font-size: .9rem; }
.tp-stats dd { color: var(--tp-ink); font-weight: 700; margin: 0; }
.tp-tiles { margin: .8rem 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-tiles h3 { overflow-wrap: anywhere; }
.tp-entry p { color: var(--tp-muted); }
.tp-page dialog {
  width: min(640px, calc(100vw - 1.5rem));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid var(--tp-line);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  background: var(--tp-paper);
  color: var(--tp-ink);
}
.tp-page dialog::backdrop { background: #1a0e1fb0; }
.tp-page dialog :is(form, p, dl) { margin-bottom: .65rem; }
.tp-page dialog dt { font-weight: 700; }
.tp-page dialog dd { margin-left: 0; color: var(--tp-muted); }
.tp-page dialog .tp-heading button { min-width: 60px; }
.tp-page dialog #tp-detail-body button { margin: .2rem .25rem .2rem 0; }
.tp-page .tp-badges { list-style: none; padding: 0; margin: .5rem 0; }
.tp-page .tp-badges li { padding: .25rem .6rem; background: var(--tp-sun); border-radius: 10px; }
.tp-page .tp-errors > li { margin: .7rem 0; padding-bottom: .6rem; border-bottom: 1px solid var(--tp-line); }
.tp-page .tp-bracket button {
  min-height: 106px;
  flex-direction: column;
  gap: .3rem;
  width: 100%;
  background: var(--tp-rose);
  font-size: 1.08rem;
}
.tp-page .tp-bracket button:nth-child(2) { background: var(--tp-lilac); }
.tp-page .tp-bracket small { font-size: .78rem; color: var(--tp-muted); }
.tp-page #tp-winner, .tp-page #tp-person-title { padding: .8rem; border-radius: 9px; background: var(--tp-mint); }
.tp-page .tp-roster { display: flex; flex-wrap: wrap; gap: .25rem .8rem; list-style: none; padding: 0; }
.tp-page .tp-roster li { padding: 0; }
.tp-guide > details { border-bottom: 1px solid var(--tp-line); padding: .55rem 0; }
.tp-guide > details + .tp-meta { margin-top: .8rem; }
.tp-page :is(#tp-visual,#tp-hint-image, #tp-feedback-body, #tp-choices) img { max-width: 100%; width: auto; height: auto; max-height: 180px; object-fit: contain; }
.tp-page .tp-picture-option { flex-direction: column; gap: .3rem; }
.tp-page a:not(.tp-jump a, .tp-actions a) { color: var(--tp-accent); }
@media (max-width: 600px) {
  .tp-tiles, .tp-season-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tp-page #tp-person-choices { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tp-season-grid { grid-template-columns: 1fr; }
  .tp-page .tp-jump a { font-size: .84rem; padding-inline: .55rem; }
  .tp-heading > .tp-primary { width: 100%; }
  .tp-page #tp-choices:not(:has(.tp-picture-option)) { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-page *, .tp-page *::before, .tp-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
