@import url("/fonts.css");
:root {
  --bg: #faf7ef;
  --paper: #fffdf7;
  --ink: #292a25;
  --muted: #66685e;
  --line: #dddcd1;
  --accent: #754bce;
  --soft: #eee7fb;
  --display: ui-rounded, "Avenir Next", "Segoe UI", sans-serif;
  font-family:
    "Denny Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button,
.button {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  min-height: 44px;
  padding: 12px 20px;
  font-weight: 650;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition:
    transform 0.15s,
    background 0.15s;
}
button:hover:not(:disabled),
.button:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
  text-decoration: none;
}
button.secondary,
.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.quiet {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.85rem;
}
input,
textarea,
select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  margin-bottom: 9px;
}
textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.9;
}
select {
  min-height: 44px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--paper);
  padding: 15px;
}
.skip:focus {
  top: 10px;
}
.topbar {
  max-width: 1440px;
  margin: auto;
  padding: 24px 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.5rem;
  letter-spacing: -1px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.88rem;
  font-weight: 600;
}
.locale {
  background: transparent;
  max-width: 140px;
  font-size: 0.8rem;
  border: 0;
}
.hero {
  max-width: 1320px;
  margin: auto;
  padding: 64px 4% 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  font-weight: 750;
  color: var(--accent);
  margin: 0 0 22px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
  margin: 0;
  white-space: pre-line;
}
.hero .intro {
  max-width: 340px;
  line-height: 1.75;
  font-size: 0.95rem;
  color: var(--muted);
}
.hero .intro p {
  margin: 0 0 16px;
}
.badge {
  font-size: 0.73rem;
  display: flex;
  gap: 8px;
  align-items: center;
}
.badge:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #488567;
}
.container {
  max-width: 1320px;
  margin: auto;
  padding: 0 4%;
}
.app {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 40px #292a2506;
}
.app-top {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}
.app-top h2 {
  margin: 0;
  font-size: 0.95rem;
}
.small {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.65;
}
.pill {
  display: inline-flex;
  background: var(--soft);
  color: var(--accent);
  border-radius: 30px;
  font-size: 0.7rem;
  padding: 7px 12px;
  font-weight: 650;
}
.workspace {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
}
.stage {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(#c8c3b329 0.8px, transparent 0.8px);
  background-size: 12px 12px;
  min-width: 0;
}
.editor {
  padding: 28px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor textarea {
  min-height: 210px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row label {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.row input[type="number"] {
  width: 70px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.actions button {
  flex: 1;
  font-size: 0.78rem;
  padding: 10px 12px;
  white-space: normal;
}
.wheel-wrap {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  filter: drop-shadow(0 10px 16px #4d3d2920);
  margin-bottom: 15px;
}
.wheel-wrap canvas {
  width: 100%;
  height: 100%;
  transition: transform 3.6s cubic-bezier(0.12, 0.7, 0.1, 1);
}
.wheel-wrap:before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 13px);
  width: 26px;
  height: 35px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 2;
}
.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 63px;
  height: 63px;
  border: 6px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
}
.spin-button {
  min-width: 220px;
  border-radius: 50px;
  font-size: 1rem;
  background: var(--ink);
  box-shadow: 0 4px 0 #0002;
}
.result-box {
  margin: 18px 0 0;
  background: var(--soft);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  width: 100%;
}
.result-box strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.result-box h2 {
  font-size: 1.25rem;
}
.app-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 26px;
}
.status {
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 24px;
  margin: 12px 0;
}
.share-note {
  margin: 8px 0 0;
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.6;
}
#share-fallback {
  width: 100%;
  margin-top: 12px;
}
.subsection {
  padding: 42px 0 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.section-title h2 {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  margin: 0;
}
.section-title span {
  font-size: 0.72rem;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px;
  min-height: 160px;
  background: var(--paper);
  transition: transform 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  text-decoration: none;
  border-color: var(--accent);
}
.card-icon {
  width: 34px;
  height: 34px;
  background: var(--soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.card h3 {
  font-size: 0.9rem;
  margin: 0 0 9px;
}
.card p {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.how-number {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: -0.07em;
}
.how h3 {
  font-size: 1rem;
}
.how p,
.article p {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--muted);
}
.history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history li {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 13px;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.team-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--paper);
}
.team-card h3 {
  margin: 0;
  color: var(--accent);
}
.team-card li {
  padding: 4px;
  overflow-wrap: anywhere;
}
.sponsor {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin: 48px 0 0;
}
.sponsor p {
  margin: 5px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.sponsor strong {
  font-size: 0.9rem;
}
.sponsor a {
  font-size: 0.8rem;
  border-bottom: 1px solid;
}
.site-footer {
  max-width: 1320px;
  margin: 60px auto 0;
  padding: 30px 4%;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}
.site-footer nav {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.consent {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 520px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 60px #0003;
  z-index: 10;
  font-size: 0.85rem;
  line-height: 1.7;
}
.consent .actions {
  margin-top: 15px;
}
.article {
  max-width: 800px;
  padding: 40px 0;
}
.article h2 {
  margin-top: 30px;
}
.type {
  --bg: #f3f5f1;
  --paper: #fcfdf9;
  --accent: #226b58;
  --soft: #e0eee4;
  --display: Georgia, "Times New Roman", serif;
}
.type .hero h1 {
  font-weight: 400;
  letter-spacing: -0.045em;
}
.type .brand-mark {
  border-radius: 8px;
}
.type-work {
  padding: 30px 5%;
}
.metrics {
  display: flex;
  align-items: center;
  gap: 44px;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.metric b {
  display: block;
  font:
    500 2rem ui-monospace,
    monospace;
  color: var(--accent);
  margin-bottom: 3px;
}
.metric span {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.duration-control {
  margin-left: auto;
}
.duration-control label {
  font-size: 0.7rem;
}
.passage {
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: clamp(1.2rem, 2.3vw, 1.75rem);
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: #70786f;
  max-height: 168px;
  overflow: auto;
  position: relative;
  white-space: pre-wrap;
  margin-bottom: 24px;
  scroll-behavior: smooth;
}
.passage .correct {
  color: var(--accent);
}
.passage .incorrect {
  background: #fee5df;
  color: #ac3525;
  text-decoration: underline;
}
.passage .caret {
  border-left: 2px solid var(--accent);
}
#typing {
  min-height: 100px;
  line-height: 1.6;
  font-size: 1.05rem;
  background: transparent;
}
.type .history {
  display: block;
}
.type .history li {
  border-radius: 0;
  border-width: 0 0 1px;
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.records {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.record {
  background: var(--soft);
  padding: 20px;
  border-radius: 14px;
}
.record span {
  font-size: 0.75rem;
}
.record b {
  font-size: 1.5rem;
  display: block;
  margin-top: 10px;
  font-family: ui-monospace, monospace;
}
details {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 5px 0;
}
details textarea {
  margin: 16px 0;
}
.bracket {
  --bg: #f1f2f6;
  --paper: #fff;
  --ink: #20263c;
  --muted: #646b7f;
  --accent: #3652c7;
  --soft: #e7ebfc;
}
.bracket .brand-mark {
  border-radius: 7px;
  background: #3652c7;
}
.bracket .hero h1 {
  font-weight: 850;
}
.tournament-controls {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.tournament-controls textarea {
  min-height: 140px;
  max-height: 230px;
}
.tournament-settings {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.board {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 28px;
  align-items: stretch;
  scrollbar-color: var(--accent) var(--soft);
}
.round {
  min-width: 245px;
  flex: 1;
}
.round h3 {
  font-size: 0.8rem;
  margin: 0 0 22px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.round-dot {
  background: var(--soft);
  color: var(--accent);
  border-radius: 50%;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}
.matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 20px;
  height: calc(100% - 50px);
}
.match {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
  box-shadow: 0 2px 4px #19243e04;
}
.match-top {
  padding: 8px 13px;
  background: #f7f8fc;
  color: var(--muted);
  font:
    500 0.6rem ui-monospace,
    monospace;
  letter-spacing: 0.06em;
}
.player {
  padding: 9px 13px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 48px;
}
.player + .player {
  border-top: 1px solid #edf0f5;
}
.player span {
  max-width: 160px;
  overflow-wrap: anywhere;
}
.player input {
  width: 54px;
  padding: 7px;
  text-align: center;
  background: #f6f7fc;
  border: 0;
  appearance: textfield;
  min-height: 34px;
}
.player.won {
  color: var(--accent);
  font-weight: 750;
  background: #f4f6ff;
}
.score-save {
  width: 100%;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.68rem;
  padding: 7px;
  min-height: 36px;
  border-top: 1px solid var(--line);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
}
thead th {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
}
caption {
  text-align: left;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 10px 0;
}
.champion {
  background: var(--ink);
  color: #fff;
  padding: 28px;
  border-radius: 14px;
  text-align: center;
  margin: 20px;
}
.champion span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.champion strong {
  display: block;
  font-size: 2rem;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.notice {
  background: var(--soft);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.8rem;
  line-height: 1.7;
}
.tiny-link {
  font-size: 0.8rem;
  text-decoration: underline;
}
.stats-inline {
  display: flex;
  gap: 18px;
  font-size: 0.7rem;
  color: var(--muted);
}
.stats-inline b {
  font-size: 1rem;
  color: var(--ink);
}
@media (min-width: 1200px) {
  .hero {
    padding-top: 68px;
  }
  .stage {
    padding: 30px 50px;
  }
  .type-work {
    padding: 36px 6%;
  }
}
@media (max-width: 800px) {
  .topbar {
    padding: 18px 5%;
    gap: 12px;
  }
  .topbar nav {
    gap: 12px;
  }
  .topbar nav a {
    display: none;
  }
  .brand {
    font-size: 1.2rem;
  }
  .hero {
    padding: 38px 5% 26px;
    display: block;
  }
  .hero .intro {
    max-width: 100%;
    margin-top: 20px;
  }
  .hero h1 {
    font-size: clamp(2.6rem, 8vw, 4rem);
  }
  .hero .intro p {
    font-size: 0.88rem;
  }
  .container {
    padding: 0 5%;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .editor {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 22px;
  }
  .editor textarea {
    min-height: 150px;
  }
  .stage {
    padding: 24px;
  }
  .wheel-wrap {
    max-width: 330px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .how {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .how-number {
    font-size: 1.6rem;
  }
  .how h3 {
    margin: 10px 0;
  }
  .how p {
    margin: 5px 0;
  }
  .metrics {
    gap: 20px;
    flex-wrap: wrap;
  }
  .metric b {
    font-size: 1.6rem;
  }
  .duration-control {
    margin-left: 0;
  }
  .type-work {
    padding: 24px 20px;
  }
  .tournament-controls {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .tournament-settings {
    gap: 12px;
  }
  .site-footer {
    display: block;
    padding: 24px 5%;
  }
  .site-footer nav {
    margin-top: 20px;
    gap: 15px;
  }
  .sponsor {
    align-items: flex-start;
    gap: 15px;
  }
  .sponsor > span {
    display: none;
  }
  .app-top {
    padding: 16px 20px;
    flex-wrap: wrap;
  }
  .app-bottom {
    padding: 16px 20px;
  }
  .consent {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 18px;
  }
  .section-title h2 {
    font-size: 1.3rem;
  }
  .card {
    padding: 18px;
    min-height: 170px;
  }
  .card p {
    font-size: 0.76rem;
  }
  .records {
    gap: 12px;
  }
  .record {
    padding: 16px;
  }
  .record b {
    font-size: 1.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .topbar,
  .site-footer,
  .hero .intro,
  .sponsor,
  .consent,
  .app-bottom,
  .subsection,
  .tournament-controls,
  button,
  .share-note,
  .status,
  .type .records,
  details {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .hero {
    padding: 0 0 20px;
  }
  .hero h1 {
    font-size: 25pt;
  }
  .hero .eyebrow {
    display: none;
  }
  .container {
    padding: 0;
  }
  .app {
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .board {
    overflow: visible;
    flex-wrap: wrap;
    padding: 0;
  }
  .round {
    min-width: 210px;
  }
  .match {
    break-inside: avoid;
  }
  .matches {
    height: auto;
  }
  .player input {
    border: 0;
  }
  .app-top {
    border: 0;
    padding: 10px 0;
  }
  .workspace {
    display: block;
  }
  .stage {
    background: none;
  }
  .editor {
    border: 0;
  }
  .editor textarea {
    border: 0;
  }
  .team-grid {
    display: grid;
  }
  .champion {
    color: black;
    background: #eee;
  }
  .table-wrap {
    overflow: visible;
  }
  .type-work {
    padding: 0;
  }
  .passage {
    max-height: none;
    font-size: 12pt;
  }
  .type #typing {
    display: none;
  }
}

@media (min-width: 801px) {
  .hero {
    padding-top: 40px;
    padding-bottom: 28px;
  }
  .hero h1 {
    font-size: clamp(2.5rem, 4.6vw, 4.3rem);
  }
  .wheel-wrap {
    max-width: 350px;
  }
  .editor textarea {
    min-height: 170px;
  }
  .stage {
    padding: 24px;
  }
}
