:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #201f1b;
  background: #f6f1e7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --bg: #f6f1e7;
  --paper: #fffaf0;
  --paper-soft: #fff6df;
  --paper-strong: #fffdf7;
  --ink: #201f1b;
  --muted: #6f6a60;
  --line: #c7b794;
  --line-soft: #ded3be;
  --danger: #d94e36;
  --teal: #1d8b7b;
  --gold: #cf9825;
  --shadow: 0 18px 50px rgba(65, 50, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  overflow-x: hidden;
}

#root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper-strong);
  outline: none;
}

input::placeholder {
  color: #8a8275;
}

input:focus,
select:focus {
  border-color: var(--mode-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode-accent), transparent 78%);
}

label {
  display: grid;
  gap: 8px;
}

.setup-field {
  display: grid;
  gap: 8px;
}

label span,
.setup-field > span,
.step-label,
.turn-kicker,
.now-playing span,
.standings-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.app-shell {
  width: min(1540px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 44px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1160px) 160px;
  gap: 24px;
  align-items: start;
}

.app-content {
  grid-column: 2;
  min-width: 0;
  width: 100%;
}

.ad-placement {
  min-width: 0;
}

.ad-unit {
  width: 100%;
}

.ad-unit[data-ad-status="unfilled"] {
  display: none !important;
}

.app-ad-rail {
  grid-row: 1;
  width: 160px;
  min-height: 600px;
  margin-top: 96px;
}

.app-ad-rail-left {
  grid-column: 1;
}

.app-ad-rail-right {
  grid-column: 3;
}

.app-ad-rail .ad-unit,
.app-ad-rail .ad-placeholder {
  width: 160px;
  min-height: 600px;
}

.app-ad-banner {
  width: 100%;
}

.app-ad-banner-bottom {
  margin-top: 30px;
}

.app-ad-banner-mobile-top {
  margin: 0 0 16px;
}

.app-ad-banner .ad-unit,
.app-ad-banner .ad-placeholder {
  width: 100%;
  min-height: 92px;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  border: 2px dashed var(--line-soft);
  border-radius: 8px;
  color: #8a8275;
  background: rgba(255, 250, 240, 0.64);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-shell {
  --mode-accent: var(--teal);
  width: min(1160px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  min-width: 0;
  overflow: visible;
  padding: 24px 0 56px;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 20px;
}

.landing-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 950;
}

.landing-brand-mark {
  width: 52px;
  height: 52px;
  display: block;
  padding: 3px;
  border-radius: 8px;
  background: var(--ink);
  object-fit: contain;
  object-position: center;
  box-shadow: 5px 5px 0 var(--danger);
}

.landing-header-nav {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.landing-header-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper-strong);
  font-weight: 950;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.16);
}

.landing-nav-cta {
  min-height: 46px;
  color: var(--paper);
  text-decoration: none;
}

.site-nav-link.active {
  background: var(--paper-soft);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.7fr);
  gap: 22px;
  align-items: start;
  margin-top: 42px;
  padding: 22px 0 0;
  border-top: 2px solid var(--ink);
}

.site-footer-brand {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.site-footer-logo {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
}

.site-footer-logo img {
  width: 44px;
  height: 44px;
  display: block;
  padding: 3px;
  border-radius: 8px;
  background: var(--ink);
  object-fit: contain;
  box-shadow: 4px 4px 0 var(--danger);
}

.site-footer-brand p,
.site-footer-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.site-footer-links,
.site-footer-languages {
  min-width: 0;
  display: flex;
  gap: 10px 14px;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer-language-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.14);
  text-decoration: none;
}

.site-footer-language-link.active {
  background: var(--paper-soft);
}

.site-footer-language-link small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.site-footer-links a,
.site-footer-languages a,
.site-footer-meta a {
  color: var(--ink);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-footer-meta {
  grid-column: 1 / -1;
  padding-top: 4px;
  font-size: 0.92rem;
}

.info-shell {
  width: min(980px, calc(100% - 28px));
  max-width: calc(100% - 28px);
}

.info-page {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 24px;
}

.info-hero {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--paper-strong), var(--paper-soft));
  box-shadow: 6px 6px 0 var(--teal);
}

.info-hero h1 {
  max-width: 800px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 6vw, 4.15rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.info-hero p {
  min-width: 0;
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.info-hero time {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.info-copy {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 18px;
}

.info-copy-section {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.info-copy-section h2 {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.info-copy-section p {
  min-width: 0;
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.info-copy-section a {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.app-header {
  display: grid;
  grid-template-areas:
    "brand title language"
    "actions actions actions";
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: center;
  margin-bottom: 24px;
}

.app-header.play-header {
  margin-bottom: 14px;
}

@media (min-width: 981px) {
  .app-header.play-header {
    grid-template-areas: "brand title language";
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 6px;
  }

  .app-header.play-header .brand-button {
    width: 62px;
    height: 62px;
  }

  .app-header.play-header .header-play-title {
    width: 100%;
    text-align: left;
  }

  .app-header.play-header .play-title span {
    font-size: 0.78rem;
  }

  .app-header.play-header .play-title h2 {
    max-width: 760px;
    font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  }

  .app-header.play-header .play-title p {
    font-size: 0.92rem;
  }
}

.app-header.utility-header {
  margin-bottom: 12px;
}

.header-title {
  grid-area: title;
  min-width: 0;
  justify-self: start;
  text-align: left;
}

.header-play-title {
  width: min(620px, 100%);
}

.utility-title h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.brand-button {
  grid-area: brand;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--danger);
  overflow: hidden;
  padding: 3px;
  text-decoration: none;
}

.brand-icon {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 6px;
  object-fit: cover;
  object-position: left center;
}

.app-header h1,
.screen-heading h2,
.now-playing h2,
.play-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.app-header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.header-language {
  grid-area: language;
  justify-self: end;
}

.header-context-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.language-picker {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
}

.language-button {
  min-width: 88px;
}

.static-language-picker > summary {
  cursor: pointer;
  list-style: none;
}

.static-language-picker > summary::-webkit-details-marker {
  display: none;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow:
    4px 4px 0 rgba(32, 31, 27, 0.18),
    0 16px 40px rgba(32, 31, 27, 0.18);
}

.language-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
  text-decoration: none;
  text-align: left;
}

.language-option small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.language-option:hover,
.language-option:focus-visible,
.language-option.active {
  border-color: var(--ink);
  background: var(--paper-soft);
}

.gameplay-shell {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), white 20%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 250, 240, 0.98), transparent 42%),
    rgba(255, 250, 240, 0.92);
  box-shadow:
    0 26px 80px rgba(65, 50, 24, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: rise-in 220ms ease both;
}

.gameplay-header {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 26px 32px 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), white 22%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 250, 240, 0.1)),
    rgba(255, 250, 240, 0.82);
}

.gameplay-brand-button {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  padding: 0;
  background: var(--ink);
  box-shadow:
    0 8px 18px rgba(32, 31, 27, 0.18),
    0 4px 0 var(--danger);
  text-decoration: none;
}

.gameplay-brand-icon {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 11px;
  object-fit: cover;
  object-position: left center;
}

.gameplay-header-title {
  min-width: 0;
}

.gameplay-header-title span {
  display: block;
  color: var(--mode-accent);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.gameplay-header-title h1 {
  margin: 8px 0 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.gameplay-header-title p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.gameplay-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.gameplay-header .language-button,
.gameplay-header-button {
  min-height: 46px;
  border-color: color-mix(in srgb, var(--line), var(--ink) 12%);
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 6px 18px rgba(65, 50, 24, 0.1);
}

.gameplay-content {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.wizard-screen {
  display: grid;
  gap: 24px;
  animation: rise-in 220ms ease both;
}

.landing-screen {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 28px;
}

.landing-hero {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(330px, 0.92fr);
  gap: 34px;
  align-items: center;
  min-height: 440px;
  padding: 6px 0 18px;
}

.landing-hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 18px;
  align-content: center;
}

.landing-hero h1 {
  max-width: 680px;
  margin: 0;
  color: var(--ink);
  font-size: 3.85rem;
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.landing-hero-copy > p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.landing-actions {
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}

.landing-cta {
  min-width: 206px;
  min-height: 54px;
  color: var(--paper);
  font-size: 1rem;
  text-decoration: none;
}

.landing-secondary-link {
  min-height: 54px;
  color: var(--ink);
  text-decoration: none;
}

.landing-section-cta {
  width: fit-content;
  min-height: 50px;
  justify-self: center;
  color: var(--paper);
  text-decoration: none;
}

.landing-hero-media {
  min-width: 0;
  width: min(100%, 568px);
  max-width: 100%;
  padding-right: 8px;
  padding-bottom: 8px;
  justify-self: end;
}

.landing-hero-media img {
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 430px;
  display: block;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
  box-shadow:
    7px 7px 0 var(--teal),
    0 26px 70px rgba(32, 31, 27, 0.18);
}

.landing-feature-band {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 8px 0 2px;
}

.landing-feature {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.14);
}

.landing-feature-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--teal);
  box-shadow: 3px 3px 0 var(--gold);
}

.landing-feature h2 {
  min-width: 0;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.05;
}

.landing-feature p {
  min-width: 0;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.landing-content-section {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 16px;
  padding: 16px 0 2px;
  overflow: visible;
}

.landing-section-heading {
  max-width: 760px;
  display: grid;
  gap: 8px;
}

.landing-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.landing-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.landing-step-list {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-step-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 15px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.13);
}

.landing-step-item > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 3px 3px 0 var(--gold);
}

.landing-step-item h3,
.landing-tool-card h3,
.landing-tournament-item h3,
.landing-mode-card h3,
.landing-use-item h3,
.landing-mode-group-heading h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.05;
}

.landing-step-item p,
.landing-tool-card p,
.landing-tournament-item p,
.landing-mode-card p,
.landing-use-item p {
  min-width: 0;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.landing-tools-grid {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-tool-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), rgba(255, 246, 223, 0.92));
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.12);
}

.landing-tool-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--teal);
}

.landing-tournament-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), color-mix(in srgb, var(--danger), var(--paper) 86%));
  box-shadow:
    6px 6px 0 var(--danger),
    0 18px 42px rgba(32, 31, 27, 0.09);
}

.landing-tournament-panel .landing-section-heading {
  max-width: 560px;
}

.landing-tournament-cta {
  width: fit-content;
  min-height: 50px;
  margin-top: 4px;
  color: var(--paper);
  text-decoration: none;
}

.landing-tournament-list {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.landing-tournament-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 14px;
  border: 2px solid color-mix(in srgb, var(--ink), var(--danger) 18%);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
}

.landing-tournament-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--danger);
  box-shadow: 3px 3px 0 var(--gold);
}

.landing-featured-modes-section {
  gap: 18px;
}

.landing-featured-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.landing-featured-mode-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), color-mix(in srgb, var(--mode-card-accent), var(--paper) 88%));
  box-shadow: 5px 5px 0 var(--mode-card-accent);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.landing-featured-mode-card:hover,
.landing-featured-mode-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--mode-card-accent);
}

.landing-featured-mode-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mode-card-accent), var(--paper) 35%);
  outline-offset: 3px;
}

.landing-featured-mode-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--mode-card-accent);
  box-shadow: 3px 3px 0 var(--ink);
}

.landing-featured-mode-card h3 {
  margin: 3px 0 8px;
  font-size: 1.32rem;
  line-height: 1.08;
}

.landing-featured-mode-card p {
  margin: 0;
  color: var(--muted);
}

.landing-featured-mode-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--mode-card-accent);
}

.landing-mode-groups {
  display: grid;
  gap: 24px;
}

.landing-mode-group {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.landing-mode-group-heading {
  max-width: 760px;
  display: grid;
  gap: 5px;
}

.landing-mode-group-heading h3 {
  font-size: 1.32rem;
}

.landing-mode-group-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.landing-mode-grid {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding: 0 14px 14px 0;
  overflow: visible;
}

.landing-mode-grid.single {
  max-width: 390px;
}

.landing-mode-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  min-height: 128px;
  padding: 16px 46px 16px 15px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--mode-card-accent), var(--paper) 78%),
      rgba(255, 250, 240, 0.96) 54%
    );
  box-shadow:
    7px 7px 0 var(--mode-card-accent),
    0 16px 34px rgba(32, 31, 27, 0.08);
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.landing-mode-card::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 17px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  opacity: 0.55;
  transform: rotate(-45deg);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.landing-mode-card:hover,
.landing-mode-card:focus-visible {
  transform: translate(-2px, -2px);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--mode-card-accent), var(--paper) 68%),
      rgba(255, 250, 240, 0.98) 58%
    );
  box-shadow:
    10px 10px 0 var(--mode-card-accent),
    0 20px 38px rgba(32, 31, 27, 0.11);
}

.landing-mode-card:hover::after,
.landing-mode-card:focus-visible::after {
  opacity: 0.9;
  transform: translate(2px, -2px) rotate(-45deg);
}

.landing-mode-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mode-card-accent), transparent 50%);
  outline-offset: 4px;
}

.landing-mode-card:active {
  transform: translate(3px, 3px);
  box-shadow:
    3px 3px 0 var(--mode-card-accent),
    0 8px 18px rgba(32, 31, 27, 0.08);
}

.landing-mode-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--mode-card-accent);
  transition: transform 160ms ease;
}

.landing-mode-card:hover .landing-mode-icon,
.landing-mode-card:focus-visible .landing-mode-icon {
  transform: rotate(-2deg);
}

.landing-use-list {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.landing-use-item {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.11);
}

.landing-use-item > svg {
  color: var(--teal);
}

.landing-guides-section {
  gap: 18px;
}

.landing-guide-grid {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.landing-guide-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.98), color-mix(in srgb, var(--teal), var(--paper) 88%));
  box-shadow: 5px 5px 0 var(--teal);
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.landing-guide-card:hover,
.landing-guide-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--teal);
}

.landing-guide-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal), transparent 50%);
  outline-offset: 3px;
}

.landing-guide-card h3 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.08;
}

.landing-guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.landing-guide-card small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.landing-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 950;
}

.landing-guides-all-link {
  width: fit-content;
  justify-self: center;
  min-height: 50px;
  color: var(--ink);
  text-decoration: none;
}

.landing-faq {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.landing-faq-heading {
  justify-self: start;
}

.faq-list {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 10px;
}

.faq-item {
  min-width: 0;
  max-width: 100%;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.11);
}

.faq-item summary {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 950;
  line-height: 1.2;
  list-style: none;
  overflow-wrap: anywhere;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: block;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  background:
    linear-gradient(currentColor, currentColor) center / 12px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 12px no-repeat,
    var(--paper-strong);
}

.faq-item[open] summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 12px 2px no-repeat,
    var(--paper-strong);
}

.faq-item p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.screen-heading {
  display: grid;
  gap: 8px;
}

.screen-heading.with-action {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.screen-heading h2 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 0.92;
}

.landing-session-stack {
  display: grid;
  gap: 16px;
}

.session-section {
  display: grid;
  gap: 10px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  line-height: 1;
}

.session-card-list {
  display: grid;
  gap: 10px;
}

.session-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--card-accent), transparent 12%);
}

.session-card.clickable {
  cursor: pointer;
}

.session-card.clickable:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--card-accent), transparent 12%);
}

.session-card.clickable:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--card-accent), transparent 45%);
  outline-offset: 3px;
}

.session-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.session-card-main.has-winner {
  grid-template-columns: 54px minmax(0, 1fr) 54px;
}

.session-mode-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--card-accent);
}

.session-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.session-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.2rem;
  line-height: 1.05;
}

.session-card-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-card-meta p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-winner-chip {
  flex: 0 1 auto;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--paper-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.session-winner-chip svg {
  flex: 0 0 auto;
  color: var(--card-accent);
}

.session-winner-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-winner-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--player-color);
  box-shadow: 3px 3px 0 var(--card-accent);
  overflow: hidden;
}

.session-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.new-session-card {
  min-height: 94px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  text-align: left;
}

.new-session-card .choice-icon {
  width: 58px;
  height: 58px;
  box-shadow: 4px 4px 0 var(--mode-accent);
}

.new-session-card strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1;
}

.new-session-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.quick-tools-home-section {
  gap: 8px;
}

.quick-tools-home-card {
  --mode-accent: #546fb2;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mode-section-stack {
  display: grid;
  gap: 24px;
}

.mode-picker-section {
  display: grid;
  gap: 10px;
}

.mode-picker-heading {
  display: grid;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}

.mode-picker-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.mode-picker-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.42;
}

.create-custom-mode-row {
  display: flex;
  justify-content: center;
}

.create-custom-mode-button {
  width: min(100%, 380px);
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--card-accent), transparent 12%);
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.create-custom-mode-button:hover {
  transform: translate(-1px, -1px);
  background: color-mix(in srgb, var(--paper-soft), var(--card-accent) 8%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--card-accent), transparent 4%);
}

.create-custom-mode-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--card-accent), white 20%);
  outline-offset: 3px;
}

.create-custom-mode-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: color-mix(in srgb, var(--card-accent), var(--ink) 24%);
}

.create-custom-mode-copy {
  min-width: 0;
}

.create-custom-mode-copy strong,
.create-custom-mode-copy small {
  display: block;
}

.create-custom-mode-copy strong {
  font-size: 1rem;
  line-height: 1.05;
}

.create-custom-mode-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.custom-mode-share-panel {
  width: min(100%, 760px);
  display: grid;
  gap: 9px;
  justify-self: center;
  margin: 0 auto;
}

.custom-mode-import-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.custom-mode-import-form .secondary-button {
  min-height: 50px;
  white-space: nowrap;
}

.custom-mode-share-notice,
.custom-mode-import-notice {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.35;
}

.custom-mode-share-notice.success,
.custom-mode-import-notice.success {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal), var(--paper-strong) 88%);
}

.custom-mode-share-notice.warning,
.custom-mode-import-notice.warning {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold), var(--paper-strong) 86%);
}

.custom-mode-share-notice.error,
.custom-mode-import-notice.error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger), var(--paper-strong) 88%);
}

.custom-mode-share-notice input {
  min-height: 42px;
  font-size: 0.8rem;
  font-weight: 700;
}

.choice-card {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.choice-card:hover {
  transform: translate(-1px, -1px);
  border-color: var(--ink);
  background: var(--paper-soft);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--card-accent, var(--mode-accent)), transparent 12%);
}

.mode-choice {
  min-height: 206px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 16px 14px;
  align-items: start;
  padding: 22px;
  text-align: left;
}

.mode-choice::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 6px 0 0 6px;
  background: var(--card-accent);
}

.choice-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--card-accent);
}

.mode-choice strong,
.player-choice strong,
.add-player-card strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.05;
}

.mode-choice small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.mode-choice p {
  grid-column: 1 / -1;
  align-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.42;
}

.saved-custom-mode-choice {
  min-height: 206px;
  overflow: hidden;
}

.saved-custom-mode-choice::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 6px 0 0 6px;
  background: var(--card-accent);
}

.saved-custom-mode-main {
  width: 100%;
  min-height: 206px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 16px 14px;
  align-items: start;
  border: 0;
  padding: 22px 68px 22px 22px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.saved-custom-mode-main strong,
.saved-custom-mode-main small {
  display: block;
}

.saved-custom-mode-main strong {
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  line-height: 1.05;
}

.saved-custom-mode-main small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.saved-custom-mode-main p {
  grid-column: 1 / -1;
  align-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.42;
}

.saved-custom-mode-arrow {
  grid-column: 1 / -1;
  display: flex;
}

.saved-custom-mode-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.saved-custom-mode-action {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper-strong);
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.saved-custom-mode-action:hover,
.saved-custom-mode-action:focus-visible {
  transform: translate(-1px, -1px);
  border-color: var(--card-accent);
  color: var(--ink);
  background: var(--paper-soft);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.14);
}

.saved-custom-mode-action.danger:hover,
.saved-custom-mode-action.danger:focus-visible {
  border-color: var(--danger);
  color: var(--danger);
}

.small-button,
.back-button,
.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.16);
  font-size: 0.94rem;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.small-button:hover,
.back-button:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(32, 31, 27, 0.2);
}

.small-button.danger {
  color: #9f2e21;
}

.primary-button {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--mode-accent, var(--teal));
}

.primary-button.wide {
  min-width: 190px;
}

.back-button {
  width: fit-content;
}

.player-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.player-choice,
.add-player-card {
  min-height: 150px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
}

.player-empty {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 8px;
  grid-column: span 3;
  padding: 20px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.72);
}

.player-empty svg {
  color: var(--mode-accent);
}

.player-empty strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.player-empty p {
  max-width: 360px;
  margin: 0;
  line-height: 1.4;
}

.player-manager-empty {
  grid-column: auto;
  min-height: 210px;
}

.player-manager-list {
  display: grid;
  gap: 12px;
}

.player-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.58fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.player-profile-editor {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.player-profile-editor.compact {
  grid-template-columns: minmax(300px, 460px);
  justify-content: start;
}

.player-profile-editor.expanded {
  grid-template-columns: minmax(300px, 0.88fr) minmax(420px, 1.22fr);
}

.player-identity-panel,
.avatar-workbench,
.player-admin-panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.player-identity-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.player-manager-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--player-color);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.16);
  overflow: hidden;
}

.player-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.player-editor-fields input {
  min-height: 42px;
}

.player-editor-fields .small-button {
  width: 100%;
}

.avatar-toggle-button {
  justify-content: center;
}

.avatar-toggle-chevron {
  transition: transform 160ms ease;
}

.avatar-toggle-button.open .avatar-toggle-chevron {
  transform: rotate(180deg);
}

.avatar-workbench {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.editor-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.editor-section-title span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.editor-section-title.compact {
  margin-bottom: 0;
}

.avatar-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.avatar-option-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.76);
}

.avatar-option-group > span {
  font-size: 0.68rem;
}

.avatar-stepper {
  display: grid;
  grid-template-columns: 38px minmax(78px, 1fr) 38px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.avatar-stepper-button,
.avatar-current-preview {
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 2px 2px 0 rgba(32, 31, 27, 0.08);
}

.avatar-stepper-button {
  color: var(--ink);
  padding: 0;
}

.avatar-stepper-button:hover {
  border-color: var(--ink);
}

.avatar-current-preview {
  padding: 3px;
  border-color: var(--ink);
  background: var(--paper-soft);
  box-shadow:
    inset 0 0 0 2px var(--paper),
    3px 3px 0 rgba(32, 31, 27, 0.14);
}

.avatar-part-preview {
  width: 100%;
  max-width: 54px;
  height: 38px;
  display: block;
}

.avatar-palette-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 246, 223, 0.62);
}

.palette-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 38px;
}

.color-swatches {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 2px 2px 0 rgba(32, 31, 27, 0.16);
}

.color-swatch.active {
  outline: 3px solid var(--paper);
  box-shadow:
    0 0 0 5px var(--ink),
    3px 3px 0 rgba(32, 31, 27, 0.16);
}

.player-admin-panel {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 14px;
}

.stats-toggle {
  width: 100%;
  justify-content: center;
}

.stats-toggle svg {
  transition: transform 160ms ease;
}

.stats-toggle.open svg {
  transform: rotate(180deg);
}

.player-manager-stats {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 246, 223, 0.58);
  animation: rules-drop 160ms ease both;
}

.player-manager-stats span,
.player-manager-stats small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.player-manager-stats strong {
  font-size: 1rem;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.player-stats-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.player-stats-grid small,
.player-stats-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-manager-stats .small-button {
  width: 100%;
}

.player-manager-actions {
  display: grid;
  gap: 8px;
}

.player-manager-actions .small-button {
  width: 100%;
}

.player-choice.selected {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper-soft) 82%);
  box-shadow: 5px 5px 0 var(--player-color);
}

.player-avatar,
.big-avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--player-color);
  overflow: hidden;
}

.player-avatar {
  width: 58px;
  height: 58px;
}

.avatar-face {
  width: 100%;
  height: 100%;
  display: block;
}

.check-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
}

.add-player-card {
  color: var(--muted);
  border-style: dashed;
  background: rgba(255, 250, 240, 0.86);
}

.participant-mode-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
}

.participant-mode-panel > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.participant-mode-switch {
  width: min(420px, 100%);
}

.participant-mode-switch .segmented-option {
  grid-template-columns: auto auto;
  gap: 8px;
}

.team-selection {
  display: grid;
  gap: 14px;
}

.team-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.team-selection-toolbar > div {
  display: grid;
  gap: 4px;
}

.team-selection-toolbar strong {
  font-size: 1.15rem;
}

.team-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.team-bucket {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color, var(--mode-accent)), var(--paper) 82%), var(--paper-strong) 70%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--team-color, var(--mode-accent)), transparent 28%);
}

.available-player-bucket {
  --team-color: var(--line);
  border-style: dashed;
  background: rgba(255, 250, 240, 0.78);
}

.team-bucket-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.team-bucket-heading > div,
.team-name-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.team-name-field {
  width: 100%;
}

.team-name-field span,
.team-bucket-meta,
.team-bucket-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.team-name-field input {
  min-width: 0;
  min-height: 40px;
  font-size: 1rem;
  font-weight: 950;
}

.team-bucket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-bucket-meta .small-button {
  min-height: 34px;
}

.team-bucket-hint {
  margin: 0;
  line-height: 1.35;
}

.team-member-list {
  display: grid;
  gap: 8px;
}

.team-player-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: grab;
}

.team-player-chip:active {
  cursor: grabbing;
}

.team-player-chip.drag-disabled {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  cursor: default;
}

.team-player-chip > svg {
  color: var(--muted);
}

.team-player-chip .mini-avatar {
  width: 34px;
  height: 34px;
}

.team-player-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.team-player-chip .icon-button {
  width: 30px;
  height: 30px;
}

.team-empty {
  min-height: 74px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
  background: rgba(255, 253, 247, 0.68);
}

.team-player-picker-modal {
  container-type: inline-size;
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    6px 6px 0 var(--mode-accent, var(--teal)),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.team-player-picker-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.team-player-picker-heading > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.team-player-picker-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.team-player-picker-heading p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.team-player-picker-list {
  display: grid;
  gap: 8px;
}

.team-player-picker-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  text-align: left;
}

.team-player-picker-option:hover,
.team-player-picker-option:focus-visible {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper-soft) 86%);
  box-shadow: 3px 3px 0 var(--player-color);
}

.team-player-picker-option .mini-avatar {
  width: 44px;
  height: 44px;
}

.team-player-picker-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-player-picker-option > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-picker-empty {
  min-height: 110px;
}

.team-picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  padding-top: 2px;
}

.team-picker-actions .primary-button,
.team-picker-actions .secondary-button {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  height: 100%;
  padding: 8px 12px;
  line-height: 1.08;
  white-space: normal;
}

.team-picker-actions .primary-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: center;
  text-align: center;
}

.team-picker-actions .primary-button svg {
  justify-self: end;
}

.team-avatar-face {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  background: var(--player-color);
}

.team-avatar-member {
  min-width: 0;
  min-height: 0;
  display: block;
  border: 1px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  background: var(--player-color);
}

.team-avatar-member .avatar-face {
  border-radius: 0;
}

.team-avatar-face.team-size-1 {
  grid-template-columns: minmax(0, 1fr);
}

.team-avatar-face.team-size-1 .team-avatar-member {
  border-width: 0;
}

.team-avatar-empty {
  display: grid;
  place-items: center;
  color: var(--paper);
  font-size: 0.72em;
  font-weight: 950;
}

.quick-add-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.quick-add-actions .primary-button,
.quick-add-actions .secondary-button {
  min-width: 118px;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 6px;
}

.wizard-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.setup-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
}

.selected-mode-card,
.setup-form,
.current-turn-card,
.standings-panel,
.history-drawer {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.selected-mode-card {
  min-height: 250px;
  display: grid;
  align-self: start;
  align-content: end;
  gap: 16px;
  padding: 22px;
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--mode-accent);
}

.selected-mode-card svg {
  width: 70px;
  height: 70px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--mode-accent);
}

.selected-mode-card strong {
  display: block;
  font-size: 1.5rem;
}

.selected-mode-card p,
.quiet-details p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.setup-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

@media (min-width: 681px) {
  .custom-mode-builder-screen {
    gap: 18px;
  }

  .custom-mode-builder-screen .screen-heading.with-action {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
  }

  .custom-mode-builder-screen .screen-heading.with-action > div {
    grid-column: 1;
    grid-row: 1;
  }

  .custom-mode-builder-screen .screen-heading.with-action .back-button {
    grid-column: 2;
    grid-row: 1;
    margin-top: 7px;
  }

  .custom-mode-builder-screen .screen-heading h2 {
    max-width: 680px;
    font-size: clamp(2.8rem, 4.2vw, 4.15rem);
    line-height: 0.94;
  }
}

.large-field input {
  min-height: 58px;
  font-size: 1.05rem;
  font-weight: 800;
}

.large-field.invalid input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.game-suggestions {
  display: grid;
  gap: 8px;
  margin-top: -4px;
}

.game-suggestions > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-suggestions > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.game-suggestion-chip {
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper-strong);
  overflow: hidden;
}

.game-suggestion-chip:hover,
.game-suggestion-chip:focus-within {
  border-color: var(--ink);
}

.game-suggestion {
  min-width: 0;
  max-width: 220px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px 0 0 999px;
  padding: 0 10px 0 12px;
  color: var(--ink);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-suggestion:hover,
.game-suggestion:focus-visible,
.game-suggestion-delete:hover,
.game-suggestion-delete:focus-visible {
  background: var(--paper-soft);
}

.game-suggestion-delete {
  width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 999px 999px 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.game-suggestion-delete:hover,
.game-suggestion-delete:focus-visible {
  color: var(--danger);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.setup-field-raceFormat,
.setup-field-roundMode,
.setup-field-speedrunFormat,
.setup-field-winnerRule,
.setup-field-winCondition,
.setup-field-defaultBestOf,
.setup-field-counterTypes {
  grid-column: 1 / -1;
}

.counter-types-builder {
  display: grid;
  gap: 10px;
}

.counter-type-list {
  display: grid;
  gap: 8px;
}

.counter-type-row {
  --counter-type-control-height: 50px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(92px, 0.34fr) minmax(92px, 0.34fr) 42px;
  gap: 8px;
  align-items: end;
}

.counter-type-row > input {
  height: var(--counter-type-control-height);
  min-height: var(--counter-type-control-height);
}

.counter-type-number-field {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.counter-type-number-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.counter-type-number-field input {
  height: var(--counter-type-control-height);
  min-height: var(--counter-type-control-height);
  padding: 0 8px;
  text-align: center;
  font-weight: 900;
}

.counter-type-row .icon-button.compact {
  height: var(--counter-type-control-height);
  min-height: var(--counter-type-control-height);
  align-self: end;
}

.counter-type-add {
  width: fit-content;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.segmented-option {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
}

.segmented-option.active {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--mode-accent);
}

.segmented-option:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.custom-objective-type-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-objective-type-control .segmented-option,
.score-direction-control .segmented-option {
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.05;
  white-space: nowrap;
}

.setup-subsection-heading {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.setup-subsection-heading > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.setup-subsection-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.toggle-switch {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--paper-strong);
  font-weight: 950;
}

.setup-field .toggle-switch {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  justify-content: stretch;
  padding: 10px 12px;
  text-align: left;
}

.setup-field-penalties,
.setup-field-comboTieBreaker,
.setup-field-continuesPenalty,
.setup-field-specialRoundBestOf {
  grid-column: 1 / -1;
}

.toggle-label {
  min-width: 0;
  margin-right: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.toggle-switch.active .toggle-label {
  color: var(--ink);
}

.toggle-switch.active {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
}

.toggle-track {
  width: 48px;
  height: 26px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: var(--paper);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-switch.active .toggle-track {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--mode-accent), var(--paper) 76%);
}

.toggle-switch.active .toggle-thumb {
  transform: translateX(20px);
  background: var(--mode-accent);
}

.toggle-state {
  min-width: 0;
  white-space: nowrap;
}

.setup-scoring-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.setup-scoring-section > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.setup-scoring-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.custom-session-objectives {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.custom-session-objective-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 9px;
}

.custom-session-objective-toggle {
  min-height: 66px;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
}

.custom-session-objective-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  margin-right: auto;
}

.custom-session-objective-copy strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.custom-session-objective-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
}

.custom-session-objective-toggle .toggle-state {
  font-size: 0.86rem;
}

.round-complete-note {
  margin: 0;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper-strong);
  font-weight: 850;
  line-height: 1.35;
}

.hotseat-timer-panel {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--paper-strong);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--mode-accent), transparent 48%);
}

.hotseat-timer-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.hotseat-timer-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 5.6rem;
  line-height: 0.9;
  letter-spacing: 0;
}

.hotseat-timer-panel svg {
  color: var(--mode-accent);
}

.hotseat-timer-panel p {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: #9f2e21;
  font-weight: 900;
}

.hotseat-timer-panel .hotseat-death-count {
  color: var(--muted);
}

.hotseat-timer-panel.alert {
  animation: hotseat-alert-flash 520ms steps(2, end) infinite;
}

.hotseat-timer-panel.expired {
  border-color: var(--danger);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--danger), transparent 42%);
}

.turn-taker-timer.paused {
  border-color: var(--mode-accent);
  animation: none;
}

.turn-taker-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.turn-taker-actions .primary-button,
.turn-taker-actions .secondary-button {
  min-width: 0;
  min-height: 58px;
}

.turn-order-row.active {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--mode-accent), transparent 42%);
}

.standing-row.turn-order-row {
  grid-template-columns: 30px 42px minmax(0, 1fr) minmax(46px, max-content);
  padding-right: 14px;
}

.turn-order-row.active small {
  color: var(--mode-accent);
  font-weight: 950;
}

@keyframes hotseat-alert-flash {
  0%,
  100% {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger), var(--paper-strong) 76%);
    box-shadow: 4px 4px 0 color-mix(in srgb, var(--danger), transparent 38%);
  }

  50% {
    border-color: var(--line);
    background: var(--paper-strong);
    box-shadow: 4px 4px 0 color-mix(in srgb, var(--mode-accent), transparent 48%);
  }
}

.quiet-details {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--paper-strong);
}

.quiet-details summary,
.history-heading {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 900;
  list-style: none;
}

.quiet-details summary {
  cursor: pointer;
}

.quiet-details summary::-webkit-details-marker {
  display: none;
}

.quiet-details p {
  padding: 0 14px 14px;
}

.quiet-details-content {
  padding: 0 14px 14px;
}

.extra-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-challenge-builder {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.custom-challenge-builder.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.custom-challenge-heading,
.custom-tracker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-challenge-heading h3,
.custom-tracker-heading h3 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  line-height: 1.05;
}

.custom-template-list {
  display: grid;
  gap: 8px;
}

.custom-template-list > span,
.custom-objective-list > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-template-list > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.custom-template-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.custom-template-chip > button:first-child {
  min-width: 0;
  min-height: 54px;
  display: grid;
  justify-items: start;
  gap: 3px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
}

.custom-template-chip strong,
.custom-template-chip small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-template-chip small {
  color: var(--muted);
  font-weight: 900;
}

.icon-button.compact {
  width: 42px;
  height: auto;
  min-height: 42px;
}

.custom-limit-input {
  min-width: 0;
  width: 100%;
}

.custom-limit-input input {
  min-height: 46px;
  text-align: center;
  font-weight: 900;
}

.custom-limit-input .number-stepper-buttons {
  top: 4px;
  right: 4px;
  bottom: 4px;
  gap: 2px;
}

.custom-add-section {
  display: grid;
  gap: 10px;
  border-top: 2px solid var(--line);
  padding-top: 12px;
}

.custom-add-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.custom-objective-add {
  --custom-add-control-height: 54px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) minmax(110px, 0.42fr) auto;
  grid-template-areas: "name type extra add";
  gap: 10px;
  align-items: end;
}

.custom-objective-add.without-limit {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) auto;
  grid-template-areas: "name type add";
}

.custom-objective-add.with-extra-control {
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr);
  grid-template-areas:
    "name type"
    "extra add";
}

.custom-add-name-field {
  grid-area: name;
}

.custom-add-type-field {
  grid-area: type;
}

.custom-add-extra-field {
  grid-area: extra;
}

.custom-objective-add input,
.custom-objective-add .segmented-control,
.custom-add-objective {
  height: var(--custom-add-control-height);
  min-height: var(--custom-add-control-height);
}

.custom-objective-add .segmented-option {
  min-height: calc(var(--custom-add-control-height) - 14px);
}

.custom-add-objective {
  grid-area: add;
  justify-self: end;
  white-space: nowrap;
}

.custom-objective-list {
  display: grid;
  gap: 9px;
}

.custom-objective-row {
  --custom-row-control-height: 50px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.32fr) var(--custom-row-control-height);
  grid-template-areas: "name limit remove";
  gap: 9px;
  align-items: end;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.custom-objective-row.with-score-direction {
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.5fr) var(--custom-row-control-height);
}

.custom-objective-name-field {
  grid-area: name;
}

.custom-objective-limit-field,
.custom-objective-kind,
.custom-objective-direction-field {
  grid-area: limit;
}

.custom-objective-row input,
.custom-objective-kind strong,
.custom-objective-direction-field .segmented-control,
.custom-objective-remove {
  height: var(--custom-row-control-height);
  min-height: var(--custom-row-control-height);
}

.custom-objective-remove {
  grid-area: remove;
  width: var(--custom-row-control-height);
  align-self: end;
}

.custom-objective-kind {
  display: grid;
  gap: 8px;
}

.custom-objective-kind > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.custom-objective-kind strong {
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--paper);
}

.custom-objective-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.custom-challenge-save-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.bingo-objectives-section {
  display: grid;
  gap: 10px;
  border-top: 2px solid var(--line);
  padding-top: 12px;
}

.bingo-objective-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bingo-objective-grid-5 {
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  gap: 7px;
}

.bingo-objective-cell {
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.bingo-objective-cell span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.bingo-objective-cell input {
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.15;
}

.bingo-objective-grid-5 .bingo-objective-cell {
  padding: 7px;
}

.bingo-objective-grid-5 .bingo-objective-cell input {
  min-height: 58px;
  font-size: 0.82rem;
}

.start-actions {
  justify-content: flex-end;
}

.start-error {
  margin-right: auto;
}

.start-button {
  min-height: 58px;
  font-size: 1.05rem;
}

.play-screen {
  display: grid;
  gap: 16px;
  animation: rise-in 220ms ease both;
}

.play-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.play-topbar.session-actions-bar {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
}

.play-title {
  min-width: 0;
  text-align: center;
}

.play-title span {
  color: var(--mode-accent);
  font-weight: 950;
  text-transform: uppercase;
}

.play-title h2 {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.2rem, 3vw, 2rem);
}

.play-title p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.simple-tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.play-side-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.current-turn-card {
  min-height: 610px;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.turn-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.turn-kicker span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--paper-strong);
}

.now-playing {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin: 0 -2px;
  padding: 22px;
  border-radius: 8px;
  color: var(--paper);
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 250, 240, 0.16), transparent 28%),
    linear-gradient(135deg, #201f1b, #453727);
}

.now-playing span {
  color: rgba(255, 250, 240, 0.72);
}

.big-avatar {
  width: 120px;
  height: 120px;
  border-color: var(--paper);
  box-shadow: 5px 5px 0 rgba(255, 250, 240, 0.18);
  font-size: 4rem;
}

.now-playing h2 {
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: clamp(3.6rem, 10vw, 8rem);
  line-height: 0.9;
}

.session-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.play-session-meta {
  display: grid;
  justify-items: stretch;
  gap: 8px;
}

.play-session-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rules-toggle svg {
  transition: transform 160ms ease;
}

.rules-toggle.open svg {
  transform: rotate(180deg);
}

.play-rules {
  max-width: 100%;
  justify-content: center;
  animation: rules-drop 160ms ease both;
}

.session-chips span {
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--paper-strong);
  font-size: 0.84rem;
  font-weight: 850;
}

.score-entry {
  --metric-control-height: calc(0.66rem + 5px + 46px + 16px + 4px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.metric-field {
  min-width: 0;
}

.metric-field.wide {
  grid-column: span 2;
}

.metric-field.compact {
  grid-column: span 1;
}

.metric-field.invalid input,
.metric-field.invalid select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.metric-field.invalid .metric-toggle,
.metric-field.invalid .progress-control {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.metric-field.invalid .progress-slider {
  box-shadow: none;
}

.duration-picker {
  min-height: var(--metric-control-height);
  display: grid;
  grid-template-columns: minmax(68px, 1fr) auto minmax(68px, 1fr) auto minmax(78px, 1fr);
  gap: 6px;
  align-items: end;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.duration-picker.invalid,
.metric-field.invalid .duration-picker {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.duration-part {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.duration-part > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.duration-number {
  position: relative;
  min-width: 0;
}

.duration-number input {
  min-height: 46px;
  padding: 0 38px 0 9px;
  text-align: center;
  font-weight: 900;
}

.duration-picker .number-stepper-buttons {
  top: 4px;
  right: 4px;
  bottom: 4px;
  gap: 2px;
}

.duration-picker .number-stepper-button {
  width: 30px;
}

.duration-separator {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.number-input-wrap {
  position: relative;
  min-width: 0;
}

.number-input-wrap input {
  padding-right: 48px;
}

.metric-penalty .number-input-wrap {
  min-height: var(--metric-control-height);
  display: grid;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 8px;
}

.metric-penalty .number-input-wrap:focus-within {
  border-color: var(--mode-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode-accent), transparent 78%);
}

.metric-penalty .number-input-wrap input {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 6px;
  padding: 0 44px 0 12px;
  background: transparent;
  box-shadow: none;
  font-weight: 900;
  text-align: center;
}

.metric-penalty.invalid .number-input-wrap {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 78%);
}

.number-stepper-buttons {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
}

.number-stepper-button {
  width: 34px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 0;
  touch-action: none;
  user-select: none;
}

.number-stepper-button svg {
  display: block;
}

.number-stepper-button:hover {
  border-color: var(--ink);
  background: var(--paper-soft);
}

.metric-toggle {
  width: 100%;
  justify-content: center;
}

.metric-toggle .toggle-state {
  min-width: 28px;
  text-align: left;
  font-weight: 950;
}

.progress-control {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  background: var(--paper-strong);
}

.progress-slider {
  min-height: 24px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--mode-accent);
  -webkit-appearance: none;
  appearance: none;
}

.progress-slider:focus {
  border-color: transparent;
  box-shadow: none;
}

.progress-slider:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mode-accent), transparent 78%);
  outline-offset: 4px;
}

.koth-panel {
  display: grid;
  gap: 18px;
}

.koth-match-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 16px;
}

.koth-queue-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.koth-match-heading > svg,
.koth-queue-heading > svg {
  color: var(--mode-accent);
}

.koth-match-heading > div {
  min-width: 0;
}

.koth-match-heading strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.05;
}

.koth-combo-meter {
  --combo-scale: 1;
  position: relative;
  isolation: isolate;
  width: min(160px, 100%);
  min-width: 126px;
  display: grid;
  justify-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 14px 9px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), color-mix(in srgb, var(--mode-accent), var(--paper) 80%));
  box-shadow:
    4px 4px 0 rgba(32, 31, 27, 0.16),
    0 12px 24px rgba(65, 50, 24, 0.12);
  transform: rotate(-2deg) scale(var(--combo-scale));
  transform-origin: center;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.koth-combo-meter::before,
.koth-combo-meter::after,
.koth-combo-flame {
  content: "";
  position: absolute;
  z-index: -1;
  opacity: 0;
  clip-path: polygon(50% 0, 63% 24%, 86% 16%, 76% 43%, 100% 57%, 70% 63%, 82% 100%, 50% 78%, 18% 100%, 30% 63%, 0 57%, 24% 43%, 14% 16%, 37% 24%);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.koth-combo-meter::before {
  right: -10px;
  bottom: -9px;
  width: 36px;
  height: 43px;
  background: linear-gradient(180deg, #ffd15a, #f15b2a 58%, #a91d1d);
  transform: rotate(15deg) scale(0.76);
}

.koth-combo-meter::after {
  left: -8px;
  top: -7px;
  width: 29px;
  height: 35px;
  background: linear-gradient(180deg, #ffe9a8, #ff8f2c 62%, #d93124);
  transform: rotate(-20deg) scale(0.64);
}

.koth-combo-flame {
  right: 12px;
  top: -13px;
  width: 28px;
  height: 34px;
  background: linear-gradient(180deg, #fff0a8, #ff9d2e 58%, #c82924);
  transform: rotate(4deg) scale(0.68);
}

.koth-combo-value {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(1.65rem, 3.8vw, 2.45rem);
  font-weight: 950;
  line-height: 0.86;
  text-shadow:
    2px 2px 0 var(--paper),
    4px 4px 0 rgba(32, 31, 27, 0.2);
  white-space: nowrap;
}

.koth-combo-x {
  margin-right: 2px;
  font-size: 0.52em;
  vertical-align: 0.42em;
}

.koth-combo-label {
  margin-top: 5px;
  border: 1px solid rgba(11, 87, 96, 0.24);
  border-radius: 999px;
  padding: 2px 8px 3px;
  color: #0b5760;
  background: rgba(230, 252, 248, 0.92);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 253, 247, 0.72);
  text-transform: uppercase;
}

.koth-combo-meter.combo-spark {
  background: linear-gradient(135deg, #fff7cf, #ffd66b 58%, #ffb347);
}

.koth-combo-meter.combo-hot {
  color: #1e130f;
  background: linear-gradient(135deg, #fff2a6, #ffb33d 44%, #f15b2a);
  box-shadow:
    5px 5px 0 rgba(32, 31, 27, 0.18),
    0 0 22px rgba(255, 145, 43, 0.38);
}

.koth-combo-meter.combo-fire,
.koth-combo-meter.combo-inferno {
  border-color: #3a160d;
  color: #1b0e08;
  background: linear-gradient(135deg, #fff3ac, #ff982a 36%, #e33b24 74%, #7f1614);
  box-shadow:
    6px 6px 0 rgba(58, 22, 13, 0.28),
    0 0 28px rgba(255, 101, 36, 0.52);
}

.koth-combo-meter.combo-fire::before,
.koth-combo-meter.combo-fire::after,
.koth-combo-meter.combo-fire .koth-combo-flame {
  opacity: 0.92;
  transform: rotate(10deg) scale(1);
  animation: koth-flame-flicker 680ms ease-in-out infinite alternate;
}

.koth-combo-meter.combo-fire::after {
  transform: rotate(-18deg) scale(0.84);
  animation-name: koth-flame-flicker-left;
  animation-duration: 820ms;
}

.koth-combo-meter.combo-inferno {
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.66), transparent 20%),
    linear-gradient(135deg, #fff6b7, #ffbd2e 28%, #ff4b24 58%, #531010);
  box-shadow:
    7px 7px 0 rgba(58, 22, 13, 0.32),
    0 0 40px rgba(255, 73, 32, 0.68);
}

.koth-combo-meter.combo-inferno::before,
.koth-combo-meter.combo-inferno::after,
.koth-combo-meter.combo-inferno .koth-combo-flame {
  opacity: 1;
  animation: koth-inferno-flicker 520ms ease-in-out infinite alternate;
}

.koth-combo-meter.combo-inferno::before {
  transform: rotate(16deg) scale(1.22);
}

.koth-combo-meter.combo-inferno::after {
  transform: rotate(-22deg) scale(1.06);
  animation-name: koth-inferno-flicker-left;
  animation-duration: 610ms;
}

.koth-combo-meter.combo-inferno .koth-combo-flame {
  transform: rotate(2deg) scale(1.18);
  animation-name: koth-inferno-flicker-center;
  animation-duration: 460ms;
}

.koth-match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.koth-player-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 230px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player-color), var(--paper) 78%), var(--paper-strong) 68%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--player-color), transparent 20%);
}

.koth-player-card.has-combo {
  grid-template-rows: auto minmax(92px, auto) minmax(0, auto) auto;
  border-color: color-mix(in srgb, var(--player-color), var(--ink) 34%);
  box-shadow:
    5px 5px 0 color-mix(in srgb, var(--player-color), transparent 10%),
    0 0 28px color-mix(in srgb, var(--player-color), transparent 72%);
}

.koth-player-combo-slot {
  min-height: 92px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px 2px;
}

.koth-player-combo-slot .koth-combo-meter {
  margin: 0 auto;
  transform-origin: center;
}

.koth-player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.koth-player-heading > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.koth-player-card .mini-avatar {
  width: 54px;
  height: 54px;
}

.koth-player-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 5vw, 3.2rem);
  line-height: 0.95;
}

.koth-win-button {
  width: 100%;
  min-height: 56px;
}

.koth-versus {
  align-self: center;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.koth-queue-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
}

.koth-queue-heading span {
  color: var(--ink);
  font-weight: 950;
}

.koth-queue-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.koth-queue-player {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.koth-queue-player .mini-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.koth-queue-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.tournament-card {
  min-height: 0;
}

.tournament-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.tournament-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.tournament-heading-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--mode-accent);
}

.tournament-heading strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.03;
}

.tournament-ready-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper-strong);
  font-weight: 950;
}

.tournament-ready-strip svg {
  color: var(--mode-accent);
}

.round-robin-standings-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr));
  gap: 8px;
}

.round-robin-standing-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--player-color), var(--paper-strong) 86%);
  font-weight: 950;
}

.round-robin-standing-chip span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 0.76rem;
}

.round-robin-standing-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-robin-standing-chip small {
  color: var(--muted);
  font-weight: 950;
}

.tournament-champion-banner {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player-color), var(--paper) 72%), var(--paper-strong) 70%);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--player-color), transparent 20%);
}

.tournament-champion-banner .big-avatar {
  width: 96px;
  height: 96px;
}

.tournament-champion-banner span:not(.big-avatar) {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tournament-champion-banner strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 0.92;
}

.tournament-bracket {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  overflow-x: visible;
  padding: 2px 4px 12px 0;
}

.tournament-round {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.tournament-round-heading {
  min-height: 34px;
  display: flex;
  align-items: center;
}

.tournament-round h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.tournament-match-list {
  display: grid;
  gap: 10px;
}

.tournament-match-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--paper-strong);
}

.tournament-match-card.ready {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--mode-accent), transparent 24%);
}

.tournament-match-card.complete {
  border-color: color-mix(in srgb, var(--match-accent), var(--ink) 40%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--match-accent), var(--paper) 86%), var(--paper-strong));
}

.tournament-match-card.waiting {
  background: rgba(255, 253, 247, 0.62);
}

.tournament-match-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tournament-match-meta span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tournament-match-meta strong {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--paper);
  font-size: 0.76rem;
  font-weight: 950;
}

.tournament-match-players {
  display: grid;
  gap: 8px;
}

.tournament-participant-row {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 2px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 250, 240, 0.74);
}

.tournament-participant-row.winner {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper) 82%);
}

.tournament-participant-row.empty {
  opacity: 0.72;
}

.tournament-participant-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tournament-participant-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.tournament-participant-copy small {
  color: var(--muted);
  font-weight: 900;
}

.tournament-game-win-button {
  min-width: 74px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.tournament-match-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.3;
}

.bingo-card {
  min-width: 0;
}

.bingo-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.bingo-claimant-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-strong);
}

.bingo-current-claimant {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.bingo-current-claimant .mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.bingo-current-claimant span:not(.mini-avatar) {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bingo-current-claimant strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 1.24rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bingo-claimant-list {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.bingo-claimant-chip {
  min-width: 132px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bingo-claimant-chip.active {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper) 78%);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--player-color), transparent 30%);
}

.bingo-claimant-chip .mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.bingo-claimant-chip strong,
.bingo-claimant-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bingo-claimant-chip strong {
  font-size: 0.9rem;
  line-height: 1.05;
}

.bingo-claimant-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.bingo-board {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--bingo-size), minmax(0, 1fr));
  gap: 8px;
}

.bingo-square {
  position: relative;
  min-width: 0;
  min-height: 124px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--paper-strong);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bingo-square:hover:not(:disabled),
.bingo-square:focus-visible:not(:disabled) {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--mode-accent), transparent 30%);
}

.bingo-square:disabled {
  cursor: default;
}

.bingo-square.claimed {
  border-color: color-mix(in srgb, var(--player-color), var(--ink) 42%);
  background: color-mix(in srgb, var(--player-color), var(--paper) 84%);
}

.bingo-square.owned-by-current {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--player-color), transparent 24%);
}

.bingo-square-number {
  justify-self: start;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1.2;
}

.bingo-square strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 950;
  line-height: 1.08;
}

.bingo-square small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.bingo-board-5 {
  gap: 6px;
}

.bingo-board-5 .bingo-square {
  min-height: 104px;
  gap: 5px;
  padding: 7px;
}

.bingo-board-5 .bingo-square strong {
  font-size: 0.68rem;
}

.bingo-board-5 .bingo-square-number,
.bingo-board-5 .bingo-square small {
  font-size: 0.6rem;
}

.bingo-square-owner {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.05;
}

.bingo-square-owner .mini-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
}

.bingo-square-owner span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bingo-steal-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 5px;
  background: var(--paper);
  color: var(--mode-accent);
  font-size: 0.56rem;
  font-weight: 950;
  text-transform: uppercase;
}

.progress-slider::-webkit-slider-runnable-track {
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.progress-slider::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  margin-top: -9px;
  background: var(--mode-accent);
  -webkit-appearance: none;
}

.progress-slider::-moz-range-track {
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.progress-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--mode-accent);
}

.progress-number-input {
  min-height: 38px;
  padding: 0 8px;
  text-align: center;
  font-weight: 900;
}

.field-error {
  color: #9f2e21;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}

.custom-challenge-tracker {
  display: grid;
  gap: 14px;
}

.custom-tracker-heading {
  padding-bottom: 2px;
}

.custom-objective-track-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.custom-objective-track-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.custom-objective-track-card.failed {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger), var(--paper-strong) 84%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--danger), transparent 45%);
}

.custom-objective-track-title {
  display: grid;
  min-width: 0;
}

.custom-objective-track-title strong {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
  line-height: 1.08;
}

.custom-objective-track-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-counter-control {
  display: grid;
  grid-template-columns: minmax(50px, 0.72fr) minmax(82px, 1fr) minmax(50px, 0.72fr);
  gap: 8px;
  align-items: stretch;
}

.custom-counter-button {
  min-width: 0;
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.14);
}

.custom-counter-button.primary {
  color: var(--paper);
  background: var(--mode-accent);
}

.custom-counter-value {
  min-width: 82px;
  min-height: 74px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: 5px 4px 7px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.custom-counter-value strong {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 0.9;
}

.custom-counter-value span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.custom-fail-toggle {
  min-height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1.05rem;
  font-weight: 950;
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.14);
}

.custom-fail-toggle.failed {
  color: var(--paper);
  background: var(--danger);
}

.custom-tracker-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.custom-tracker-actions .primary-button,
.custom-tracker-actions .secondary-button {
  min-height: 58px;
  font-size: 1.02rem;
}

.danger-text {
  color: #9f2e21;
}

.custom-failure-backdrop {
  z-index: 30;
}

.custom-failure-modal {
  box-shadow:
    6px 6px 0 var(--danger),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.play-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.quick-counter-board {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--mode-accent), transparent 22%);
}

.quick-counter-heading h3 {
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 4rem;
  line-height: 0.92;
}

.quick-counter-heading > div {
  min-width: 0;
  flex: 1 1 320px;
}

.quick-counter-heading .secondary-button {
  flex: 0 0 auto;
}

.table-tools-panel {
  display: grid;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--line), white 16%);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.72);
}

.table-tools-panel[open],
.standalone-table-tools {
  padding: 12px;
}

.table-tools-heading {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 0 2px;
  cursor: pointer;
  list-style: none;
}

.table-tools-heading::-webkit-details-marker {
  display: none;
}

.table-tools-heading svg {
  flex: 0 0 auto;
  color: var(--mode-accent);
  transition: transform 160ms ease;
}

.table-tools-panel[open] .table-tools-heading svg {
  transform: rotate(180deg);
}

.standalone-table-tools .table-tools-heading {
  cursor: default;
}

.quick-tools-screen .screen-heading p {
  max-width: 580px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.quick-tools-heading {
  gap: 12px;
}

.quick-tools-heading .back-button {
  width: fit-content;
  justify-self: start;
}

.quick-tools-random-pool-control {
  min-height: 60px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.quick-tools-random-pool-control .table-tool-action {
  min-height: 42px;
}

.quick-tools-random-pool-control span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.quick-tools-player-modal {
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  display: grid;
  gap: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    6px 6px 0 var(--mode-accent),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.quick-tools-player-modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.quick-tools-player-modal-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  line-height: 0.92;
}

.quick-tools-player-picker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-tools-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.quick-tools-player-choice {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper-strong);
  text-align: left;
}

.quick-tools-player-choice.selected {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper-soft) 84%);
  box-shadow: 3px 3px 0 var(--player-color);
}

.quick-tools-player-choice strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-tools-player-choice > span:last-child {
  display: grid;
  place-items: center;
  color: var(--mode-accent);
}

.quick-tools-player-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.quick-tools-player-modal > .primary-button {
  justify-self: end;
}

.quick-tools-screen .standalone-table-tools {
  padding: clamp(14px, 2.5vw, 20px);
}

.table-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.table-tool-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(60px, auto) 1fr auto;
  gap: 10px;
  align-content: stretch;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper-strong);
}

.juicy-tool-card {
  position: relative;
  overflow: hidden;
  gap: 12px;
  border-color: color-mix(in srgb, var(--line), var(--mode-accent) 18%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), transparent 38%),
    linear-gradient(180deg, var(--paper-strong), color-mix(in srgb, var(--paper-soft), var(--mode-accent) 6%));
  box-shadow:
    0 10px 26px rgba(65, 50, 24, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.54) inset;
}

.juicy-tool-card::after {
  content: "";
  position: absolute;
  inset: -30% -70%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.46) 48%, transparent 58%);
  opacity: 0;
  transform: translateX(-36%);
}

.juicy-tool-card:has(.tool-animation-bucket.has-result)::after {
  animation: tool-card-shine 820ms ease-out both;
}

.juicy-tool-card > * {
  position: relative;
  z-index: 2;
}

.table-tool-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mode-accent);
}

.table-tool-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-tool-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.table-tool-controls-spacer {
  min-height: 60px;
  visibility: hidden;
}

.coin-tool-card .table-tool-controls-spacer {
  display: none;
}

.coin-tool-card .tool-animation-bucket {
  grid-row: 2 / 4;
}

.table-tool-controls label {
  gap: 5px;
}

.table-tool-controls span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.table-tool-controls select {
  min-height: 42px;
  padding-inline: 10px;
  font-weight: 900;
}

.table-tool-action {
  min-width: 0;
  min-height: 46px;
  width: 100%;
}

.tool-animation-bucket {
  min-width: 0;
  min-height: 136px;
  height: 100%;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--line), var(--ink) 8%);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 250, 240, 0.38)),
    color-mix(in srgb, var(--paper-soft), var(--mode-accent) 7%);
  box-shadow:
    0 6px 0 rgba(32, 31, 27, 0.08) inset,
    0 -1px 0 rgba(255, 255, 255, 0.8) inset;
}

.tool-animation-bucket.empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 250, 240, 0.2)),
    var(--paper-soft);
}

.dice-bucket {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.dice-tray {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.die-face {
  --die-delay: 0ms;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(145deg, #ffffff, #f2dfb7 86%);
  box-shadow:
    4px 4px 0 color-mix(in srgb, var(--mode-accent), rgba(32, 31, 27, 0.22) 46%),
    0 0 0 2px rgba(255, 255, 255, 0.72) inset;
  font-size: 0.9rem;
  font-weight: 950;
  transform-origin: 50% 50%;
  animation: dice-tumble 520ms cubic-bezier(0.16, 1.45, 0.28, 1) var(--die-delay) both;
}

.dice-bucket.rolling .die-face {
  animation: dice-fast-spin 310ms linear var(--die-delay) infinite;
}

.dice-bucket.rolling .die-pip.active,
.dice-bucket.rolling .number-face strong {
  animation: dice-symbol-flash 124ms steps(2, end) infinite;
}

.die-face.idle {
  opacity: 0.58;
  animation: dice-idle-wobble 1600ms ease-in-out infinite;
}

.pip-face {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 7px;
}

.die-pip {
  width: 7px;
  height: 7px;
  place-self: center;
  border-radius: 50%;
  background: transparent;
}

.die-pip.active {
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(32, 31, 27, 0.08);
}

.number-face strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dice-count-5 .dice-tray {
  gap: 6px;
}

.dice-count-5 .die-face {
  width: 40px;
  height: 40px;
  box-shadow:
    3px 3px 0 color-mix(in srgb, var(--mode-accent), rgba(32, 31, 27, 0.22) 46%),
    0 0 0 2px rgba(255, 255, 255, 0.72) inset;
}

.dice-count-6 {
  gap: 8px;
}

.dice-count-6 .dice-tray {
  gap: 5px;
}

.dice-count-6 .die-face {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  box-shadow:
    3px 3px 0 color-mix(in srgb, var(--mode-accent), rgba(32, 31, 27, 0.22) 46%),
    0 0 0 2px rgba(255, 255, 255, 0.72) inset;
}

.dice-count-5 .pip-face,
.dice-count-6 .pip-face {
  padding: 5px;
}

.dice-count-5 .die-pip,
.dice-count-6 .die-pip {
  width: 6px;
  height: 6px;
}

.dice-count-6 .dice-total-burst {
  min-width: 52px;
}

.dice-total-burst {
  min-width: 58px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--paper);
  background: var(--mode-accent);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.18);
  font-size: 1rem;
  font-weight: 950;
}

.dice-bucket.has-result .dice-total-burst {
  animation: result-pop 560ms cubic-bezier(0.2, 1.45, 0.3, 1) both;
}

.coin-bucket {
  grid-template-columns: 1fr;
  justify-items: center;
}

.coin-flight-path {
  width: 82px;
  height: 82px;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 720px;
}

.coin-disc {
  width: 74px;
  height: 74px;
  position: relative;
  transform-style: preserve-3d;
  border-radius: 50%;
  filter: drop-shadow(5px 8px 0 rgba(32, 31, 27, 0.16));
}

.coin-bucket.empty .coin-disc {
  opacity: 0.64;
  transform: rotateY(-18deg) rotateZ(-8deg);
}

.coin-bucket.has-result .coin-disc.heads {
  animation: coin-flip-heads var(--coin-reveal-delay, 980ms) cubic-bezier(0.18, 1.22, 0.32, 1) both;
}

.coin-bucket.has-result .coin-disc.tails {
  animation: coin-flip-tails var(--coin-reveal-delay, 980ms) cubic-bezier(0.18, 1.22, 0.32, 1) both;
}

.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 3px solid #8f6220;
  border-radius: 50%;
  color: #4f330d;
  background:
    linear-gradient(145deg, #fff4b8, #d39a2b 68%, #ad721c);
  backface-visibility: hidden;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.28) inset,
    0 0 0 10px rgba(112, 68, 11, 0.14) inset;
}

.coin-face-tails {
  transform: rotateY(180deg);
  background:
    linear-gradient(145deg, #fff0a2, #c78025 68%, #8c5615);
}

.coin-readable-label {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: #4f330d;
  font-size: 0.62rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 244, 184, 0.72);
  pointer-events: none;
}

.coin-bucket.empty .coin-readable-label {
  opacity: 0;
}

.coin-bucket.has-result .coin-readable-label {
  animation: coin-label-pop 220ms ease-out var(--coin-reveal-delay, 980ms) both;
}

.player-reel-bucket {
  gap: 8px;
}

.player-reel-window {
  min-width: 0;
  height: 56px;
  position: relative;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--ink), var(--mode-accent) 16%);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.18), transparent 12%, transparent 88%, rgba(32, 31, 27, 0.18)),
    rgba(255, 255, 255, 0.45);
}

.player-reel-marker {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 2;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent 0, var(--danger) 24%, var(--danger) 76%, transparent 100%);
  box-shadow: 0 0 0 2px rgba(255, 250, 240, 0.75);
}

.player-reel-track {
  height: 100%;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.player-reel-bucket.has-result .player-reel-track {
  animation: player-reel-spin var(--player-reel-duration, 1080ms) cubic-bezier(0.14, 0.78, 0.15, 1) both;
}

.player-reel-avatar,
.player-reel-placeholder {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--player-color, var(--mode-accent));
  box-shadow: 2px 2px 0 rgba(32, 31, 27, 0.18);
  overflow: hidden;
}

.player-reel-placeholder {
  color: var(--muted);
  background: var(--paper-strong);
}

.player-reel-winner {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--player-color), var(--paper-strong) 72%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--player-color), rgba(32, 31, 27, 0.22) 32%);
}

.player-reel-bucket.is-spinning .player-reel-winner {
  animation: winner-live-pulse 180ms ease-in-out infinite alternate;
}

.player-reel-bucket.is-settled.has-result .player-reel-winner {
  animation: winner-slam 520ms cubic-bezier(0.16, 1.45, 0.28, 1) both;
}

.player-reel-winner strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-reel-winner .mini-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.player-reel-winner .pending-avatar {
  color: var(--mode-accent);
  background: var(--paper-strong);
}

.quick-counter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-counter-meta span {
  max-width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--paper-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.quick-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  align-items: start;
}

.quick-counter-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.quick-counter-card.target-reached {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--player-color);
}

.quick-counter-player {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.quick-counter-player strong {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
  line-height: 1.05;
}

.quick-counter-value {
  min-width: 0;
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background:
    radial-gradient(circle at 78% 24%, rgba(255, 250, 240, 0.18), transparent 30%),
    linear-gradient(135deg, var(--player-color), color-mix(in srgb, var(--player-color), #201f1b 46%));
}

.quick-counter-value-button {
  width: 100%;
  padding: 0;
  text-align: center;
}

.quick-counter-value-button:hover,
.quick-counter-value-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(32, 31, 27, 0.14);
}

.quick-counter-value-editor {
  padding: 10px;
}

.quick-counter-value-editor:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper), transparent 62%);
}

.quick-counter-value-editor input {
  width: min(100%, 210px);
  min-height: 68px;
  border-color: rgba(255, 250, 240, 0.78);
  color: var(--ink);
  background: rgba(255, 250, 240, 0.92);
  font-size: clamp(2.8rem, 10vw, 4.8rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.quick-counter-value-editor.compact input {
  min-height: 54px;
  font-size: 2.6rem;
}

.quick-counter-value strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(4rem, 15vw, 7rem);
  line-height: 0.82;
}

.quick-counter-value span {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: rgba(255, 250, 240, 0.78);
  font-size: 0.85rem;
  font-weight: 950;
  text-transform: uppercase;
}

.quick-counter-list {
  display: grid;
  gap: 10px;
}

.quick-counter-counter {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, 0.65fr);
  gap: 8px;
  align-items: stretch;
}

.quick-counter-value.compact {
  min-height: 96px;
  padding: 8px 6px;
}

.quick-counter-value.compact strong {
  font-size: 3.8rem;
}

.quick-counter-actions {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-counter-actions.compact {
  grid-template-columns: 1fr;
}

.quick-counter-step {
  min-width: 0;
  width: 100%;
  min-height: 58px;
  padding-inline: 10px;
}

.quick-counter-actions.compact .quick-counter-step {
  min-height: 44px;
  padding: 0;
  box-shadow: none;
}

.quick-counter-actions.compact .quick-counter-step:hover {
  transform: none;
  box-shadow: none;
}

.finish-session-button {
  width: min(100%, 420px);
  min-height: 58px;
  justify-self: end;
  font-size: 1.05rem;
}

.record-button {
  min-height: 64px;
  font-size: 1.1rem;
}

.hotseat-death-button {
  background: #9f2e21;
}

.hotseat-death-button:hover {
  background: #812219;
}

.speedrun-level-button {
  min-height: 76px;
  font-size: 1.35rem;
}

.secondary-button {
  min-width: 116px;
}

.gameplay-shell .play-screen {
  gap: 18px;
  animation: none;
}

.gameplay-shell .play-rules {
  max-width: none;
  justify-content: flex-start;
  padding: 0 2px;
}

.gameplay-shell .play-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.gameplay-shell .play-side-panel {
  gap: 16px;
  align-content: start;
}

.gameplay-shell .current-turn-card,
.gameplay-shell .standings-panel,
.gameplay-shell .history-drawer,
.gameplay-shell .quick-counter-board {
  border: 1px solid color-mix(in srgb, var(--line), white 16%);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow:
    0 12px 32px rgba(65, 50, 24, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset;
}

.gameplay-shell .current-turn-card {
  min-height: 0;
  gap: 18px;
  padding: 24px;
}

.gameplay-shell .turn-kicker {
  align-items: center;
}

.gameplay-shell .turn-kicker span {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line), white 10%);
  border-radius: 9px;
  padding: 0 15px;
  color: var(--mode-accent);
  background: rgba(255, 250, 240, 0.78);
  box-shadow: 0 6px 16px rgba(65, 50, 24, 0.08);
  font-size: 0.78rem;
}

.gameplay-shell .now-playing {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 22px;
  min-height: 154px;
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  box-shadow:
    0 14px 34px rgba(32, 31, 27, 0.14),
    0 0 0 1px rgba(255, 250, 240, 0.08) inset;
}

.gameplay-shell .big-avatar {
  width: 112px;
  height: 112px;
  border-color: rgba(255, 250, 240, 0.84);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.12);
}

.gameplay-shell .now-playing span {
  color: var(--mode-accent);
  font-size: 0.86rem;
}

.gameplay-shell .now-playing h2 {
  font-size: clamp(3.25rem, 6vw, 5.1rem);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.gameplay-shell .score-entry {
  gap: 12px;
}

.gameplay-shell .score-entry.single-metric {
  grid-template-columns: minmax(0, 1fr);
}

.gameplay-shell .score-entry.single-metric .metric-field {
  gap: 10px;
}

.gameplay-shell .score-entry.single-metric .metric-field > span {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
  text-transform: none;
}

.gameplay-shell .score-entry.single-metric .number-input-wrap input {
  min-height: 118px;
  border-color: var(--mode-accent);
  border-radius: 14px;
  padding: 0 112px 0 22px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mode-accent), white 62%) inset,
    0 8px 26px rgba(65, 50, 24, 0.08);
  color: var(--ink);
  font-size: clamp(3.8rem, 7.2vw, 5.6rem);
  font-weight: 750;
  line-height: 1;
}

.gameplay-shell .score-entry.single-metric .number-stepper-buttons {
  top: 0;
  right: 0;
  bottom: 0;
  width: 84px;
  gap: 0;
}

.gameplay-shell .score-entry.single-metric .number-stepper-button {
  width: 84px;
  border-color: color-mix(in srgb, var(--line), var(--ink) 8%);
  border-radius: 0;
  background: rgba(255, 250, 240, 0.9);
}

.gameplay-shell .score-entry.single-metric .number-stepper-button:first-child {
  border-top-right-radius: 14px;
}

.gameplay-shell .score-entry.single-metric .number-stepper-button:last-child {
  border-bottom-right-radius: 14px;
  border-top-width: 0;
}

.gameplay-shell .score-entry.single-metric .number-stepper-button svg {
  width: 34px;
  height: 34px;
}

.player-stats-panel {
  display: grid;
  gap: 12px;
  border-top: 2px dashed color-mix(in srgb, var(--line), white 12%);
  padding-top: 18px;
}

.player-stats-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.player-stats-heading svg {
  color: var(--muted);
}

.player-stats-heading strong {
  font-size: 1.08rem;
}

.gameplay-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gameplay-stat-tile {
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--line), white 14%);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.68);
}

.gameplay-stat-tile.summary-stat-tile {
  grid-column: 1 / -1;
  align-items: start;
}

.gameplay-stat-tile.summary-stat-tile svg {
  margin-top: 8px;
}

.gameplay-stat-tile svg {
  justify-self: center;
}

.gameplay-stat-tile svg.gold {
  color: var(--mode-accent);
}

.gameplay-stat-tile svg.blue {
  color: #4f79d8;
}

.gameplay-stat-tile svg.ink {
  color: var(--muted);
}

.gameplay-stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.2;
}

.gameplay-stat-tile strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.08;
}

.gameplay-stat-tile:last-child strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gameplay-stat-tile.summary-stat-tile:last-child strong,
.summary-stat-value strong {
  display: block;
  overflow: visible;
  font-size: 1.04rem;
  line-height: 1.16;
  -webkit-line-clamp: unset;
}

.summary-stat-value {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.summary-stat-value ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.summary-stat-value li {
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.gameplay-shell .play-actions {
  gap: 14px;
}

.gameplay-shell .record-button,
.gameplay-shell .finish-session-button {
  min-height: 68px;
  border-radius: 10px;
  box-shadow:
    0 3px 0 color-mix(in srgb, var(--mode-accent), var(--ink) 30%),
    0 14px 24px rgba(65, 50, 24, 0.12);
  font-size: 1.1rem;
}

.gameplay-shell .play-actions .secondary-button {
  min-width: 160px;
  min-height: 68px;
  border-color: color-mix(in srgb, var(--line), var(--ink) 18%);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 10px 24px rgba(65, 50, 24, 0.08);
  font-size: 1.05rem;
}

.gameplay-shell .finish-session-button {
  width: 100%;
  min-height: 62px;
}

.standings-panel {
  padding: 16px;
}

.standings-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.standings-heading svg {
  color: var(--mode-accent);
}

.standings-heading-copy {
  min-width: 0;
}

.standings-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 1.15rem;
}

.standings-count-label {
  align-self: end;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.standings-list {
  display: grid;
  gap: 10px;
}

.standings-body {
  min-width: 0;
}

.standing-row {
  display: grid;
  grid-template-columns: 30px 42px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.standing-row.expandable-summary-row,
.history-row.expandable-summary-row {
  display: block;
  min-height: 0;
}

.standing-row-main,
.history-row-main {
  display: grid;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.standing-row-main::-webkit-details-marker,
.history-row-main::-webkit-details-marker {
  display: none;
}

.standing-row-main {
  grid-template-columns: 30px 42px minmax(0, 1fr) 28px 22px;
  gap: 10px;
}

.history-row-main {
  grid-template-columns: 42px minmax(0, 1fr) minmax(92px, auto) 22px;
  gap: 10px;
}

.standing-row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rank {
  color: var(--muted);
  font-weight: 950;
}

.mini-avatar {
  width: 42px;
  height: 42px;
}

.standing-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.standing-row p,
.summary-preview {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.summary-preview {
  min-width: 0;
  display: block;
  margin: 0;
}

.standing-row small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 950;
  text-align: right;
}

.summary-chevron {
  justify-self: end;
  color: var(--muted);
  transition: transform 160ms ease;
}

.expandable-summary-row[open] > summary .summary-chevron {
  transform: rotate(180deg);
}

.summary-part-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0 82px;
  padding: 10px 0 0;
  border-top: 1px dashed color-mix(in srgb, var(--line), transparent 20%);
  color: var(--muted);
  list-style: none;
}

.summary-part-list li {
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.history-drawer {
  --history-drawer-max-height: clamp(320px, 52vh, 540px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: var(--history-drawer-max-height);
  overflow: hidden;
  box-shadow: none;
}

.history-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.history-body {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.history-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.history-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.history-row strong {
  overflow-wrap: anywhere;
}

.history-row span,
.history-row p,
.empty-history {
  color: var(--muted);
}

.history-row span {
  font-size: 0.9rem;
}

.history-row p,
.empty-history {
  margin: 0;
}

.history-row p {
  justify-self: end;
  text-align: right;
}

.history-row .summary-preview {
  justify-self: end;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.history-row .summary-part-list {
  margin-left: 52px;
}

.empty-history {
  padding: 0 14px 14px;
}

.gameplay-shell .standings-panel,
.gameplay-shell .history-drawer {
  padding: 18px;
}

.gameplay-shell .history-drawer {
  --history-drawer-max-height: clamp(240px, 29vh, 280px);
}

.gameplay-shell .history-heading {
  min-height: 30px;
  padding: 0 0 14px;
  color: var(--ink);
  font-size: 1.1rem;
}

.gameplay-shell .history-list {
  gap: 8px;
  padding: 0 8px 0 0;
}

.gameplay-shell .standing-row,
.gameplay-shell .history-row {
  border: 1px solid color-mix(in srgb, var(--line), white 12%);
  border-radius: 9px;
  background: rgba(255, 253, 247, 0.68);
}

.gameplay-shell .standing-row {
  min-height: 66px;
}

.gameplay-shell .standing-row small {
  color: var(--ink);
}

.gameplay-shell .history-row p {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 981px) {
  .player-manager-row:has(.player-profile-editor.compact) {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
  }

  .player-manager-row:has(.player-profile-editor.compact) .player-profile-editor.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-manager-row:has(.player-profile-editor.compact) .player-editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-manager-row:has(.player-profile-editor.compact) .player-editor-fields label {
    grid-column: 1 / -1;
  }

  .player-manager-row:has(.player-profile-editor.compact) .player-admin-panel {
    align-self: stretch;
    align-content: center;
  }

  .player-manager-row:has(.player-profile-editor.expanded) {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-profile-editor.expanded {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-editor-fields label {
    grid-column: 1 / -1;
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-admin-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: start;
    align-content: start;
  }

  .player-manager-row:has(.player-profile-editor.expanded) .stats-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-manager-stats {
    grid-column: 1 / -1;
  }

  .player-manager-row:has(.player-profile-editor.expanded) .player-manager-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .play-screen {
    gap: 14px;
  }

  .play-topbar.session-actions-bar {
    justify-items: end;
    margin-top: -2px;
  }

  .play-session-meta {
    width: 100%;
    justify-items: end;
  }

  .play-session-actions {
    justify-content: flex-end;
  }

  .play-rules {
    max-width: 760px;
    justify-content: flex-end;
  }

  .play-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.72fr);
    gap: 18px;
    align-items: start;
  }

  .play-side-panel {
    height: auto;
    grid-template-rows: auto auto;
    align-content: start;
  }

  .custom-challenge-play-layout {
    align-items: start;
  }

  .custom-challenge-play-layout .play-side-panel {
    min-height: 0;
    height: clamp(520px, calc(100vh - 150px), 760px);
    grid-template-rows: minmax(0, 0.95fr) minmax(0, 1.05fr);
    overflow: hidden;
  }

  .current-turn-card {
    min-height: 0;
    gap: 18px;
    padding: clamp(20px, 2.3vw, 28px);
  }

  .turn-kicker span {
    min-height: 32px;
  }

  .now-playing {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .big-avatar {
    width: 104px;
    height: 104px;
  }

  .now-playing h2 {
    font-size: clamp(3.4rem, 6.7vw, 6.2rem);
  }

  .current-turn-card .score-entry {
    --metric-control-height: calc(0.66rem + 5px + 58px + 16px + 4px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    padding-top: 4px;
  }

  .current-turn-card .metric-time {
    grid-column: span 2;
  }

  .current-turn-card .metric-penalty {
    min-width: min(100%, 180px);
  }

  .current-turn-card .metric-field {
    max-width: none;
  }

  .current-turn-card .metric-field input,
  .current-turn-card .metric-field select {
    min-height: 58px;
    font-size: 1.05rem;
  }

  .standings-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding: 18px;
    box-shadow: 5px 5px 0 color-mix(in srgb, var(--mode-accent), transparent 18%);
  }

  .standings-body {
    min-height: 0;
    overflow-y: auto;
    scrollbar-color: var(--line) transparent;
    scrollbar-width: thin;
  }

  .standings-list {
    padding-right: 8px;
    scrollbar-color: var(--line) transparent;
    scrollbar-width: thin;
  }

  .custom-challenge-play-layout .history-drawer {
    min-height: 0;
    max-height: 100%;
  }

  .custom-challenge-play-layout .history-row {
    min-height: 0;
    align-items: start;
  }

  .custom-challenge-play-layout .history-row p {
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .history-drawer {
    min-height: 0;
    height: 100%;
    box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.11);
  }

  .history-list {
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding-right: 14px;
  }

  .history-body {
    height: 100%;
    min-height: 0;
  }

  .empty-history {
    max-height: none;
  }

  .history-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
  }

  .gameplay-shell .play-screen {
    gap: 20px;
  }

  .gameplay-shell .play-rules {
    max-width: none;
    justify-content: flex-start;
  }

  .gameplay-shell .play-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.72fr);
    gap: 20px;
    align-items: stretch;
  }

  .gameplay-shell .play-side-panel {
    height: auto;
    grid-template-rows: auto auto auto;
    align-content: start;
  }

  .gameplay-shell .current-turn-card {
    height: 100%;
    align-self: stretch;
    align-content: space-between;
    gap: 18px;
    padding: 24px;
  }

  .gameplay-shell .turn-taker-layout {
    align-items: stretch;
  }

  .gameplay-shell .turn-taker-layout .turn-order-panel {
    align-self: stretch;
    height: auto;
  }

  .gameplay-shell .standings-panel,
  .gameplay-shell .history-drawer {
    height: auto;
    padding: 18px;
    box-shadow:
      0 12px 32px rgba(65, 50, 24, 0.1),
      0 0 0 1px rgba(255, 255, 255, 0.58) inset;
  }

  .gameplay-shell .history-drawer {
    max-height: var(--history-drawer-max-height);
  }

  .gameplay-shell .history-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .gameplay-shell .history-row p {
    justify-self: end;
    text-align: right;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  overscroll-behavior: contain;
  background: rgba(32, 31, 27, 0.34);
  backdrop-filter: blur(2px);
}

.confirm-modal {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    6px 6px 0 var(--danger),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.add-player-modal {
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  gap: 20px;
  align-content: start;
  overflow-y: auto;
  padding: 24px 22px 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    6px 6px 0 var(--mode-accent),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.add-player-modal:has(.player-profile-editor.expanded) {
  width: min(920px, 100%);
}

.add-player-modal:has(.player-profile-editor.expanded) .add-player-modal-heading,
.add-player-modal:has(.player-profile-editor.expanded) .quick-add-actions {
  width: 100%;
}

.add-player-modal-heading {
  width: min(640px, 100%);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  justify-self: center;
}

.add-player-modal h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.add-player-modal .quick-add-actions {
  width: min(640px, 100%);
  justify-self: center;
  padding-top: 4px;
}

.add-player-modal .player-profile-editor {
  width: min(640px, 100%);
  justify-self: center;
}

.add-player-modal .player-profile-editor.compact {
  grid-template-columns: minmax(0, 1fr);
}

.add-player-modal .player-profile-editor.expanded {
  width: 100%;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}

.add-player-modal .player-identity-panel {
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 18px;
}

.add-player-modal .player-manager-avatar {
  width: 112px;
  height: 112px;
}

.add-player-modal .player-profile-editor.expanded .player-identity-panel {
  align-self: start;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 14px;
  padding: 16px;
}

.add-player-modal .player-profile-editor.expanded .player-editor-fields {
  width: 100%;
}

.add-player-modal .player-profile-editor.expanded .avatar-workbench {
  padding: 14px;
}

.add-player-modal .player-profile-editor.expanded .avatar-editor {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.add-player-modal .player-profile-editor.expanded .avatar-option-group {
  padding: 9px;
}

.add-player-modal .player-profile-editor.expanded .avatar-stepper {
  grid-template-columns: 36px minmax(70px, 1fr) 36px;
  gap: 7px;
}

.add-player-modal .player-profile-editor.expanded .avatar-palette-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.add-player-modal .player-profile-editor.expanded .palette-row {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.past-session-modal {
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    6px 6px 0 var(--mode-accent),
    0 24px 80px rgba(32, 31, 27, 0.28);
}

.past-session-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.past-session-heading h2 {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.past-session-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.past-session-winner {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: 4px 4px 0 var(--mode-accent);
}

.past-session-winner-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--player-color);
  overflow: hidden;
}

.past-session-winner strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 0.95;
}

.past-session-history {
  display: grid;
  gap: 10px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading.compact h3 {
  color: var(--muted);
  font-size: 0.9rem;
}

.past-run-list {
  display: grid;
  gap: 8px;
}

.past-run-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.past-run-row strong {
  overflow-wrap: anywhere;
}

.past-run-row span,
.past-run-row p {
  color: var(--muted);
}

.past-run-row p {
  margin: 0;
  line-height: 1.25;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 3px 3px 0 rgba(32, 31, 27, 0.12);
}

.icon-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(32, 31, 27, 0.14);
}

.confirm-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--danger);
}

.confirm-modal h2 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 6vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.confirm-modal p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-action {
  background: var(--danger);
}

.celebration-backdrop {
  background: rgba(32, 31, 27, 0.42);
}

.celebration-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  justify-items: center;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 32px 22px 24px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 31, 27, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  box-shadow:
    7px 7px 0 var(--winner-color),
    0 24px 80px rgba(32, 31, 27, 0.3);
}

.celebration-cup {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--winner-color), transparent 74%),
    5px 5px 0 var(--winner-color);
  animation: cup-pop 520ms cubic-bezier(0.18, 0.9, 0.26, 1.25) both;
}

.celebration-modal h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(3rem, 10vw, 5.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.celebration-modal p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.celebration-modal .primary-button {
  margin-top: 8px;
  min-width: 150px;
}

.rematch-panel {
  width: min(100%, 440px);
  display: grid;
  gap: 10px;
  margin-top: 8px;
  text-align: left;
}

.rematch-heading {
  display: grid;
  gap: 2px;
  text-align: center;
}

.rematch-heading h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.rematch-action-list {
  display: grid;
  gap: 8px;
}

.rematch-action-button {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--paper-strong);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--winner-color), transparent 48%);
  cursor: pointer;
}

.rematch-action-button:hover,
.rematch-action-button:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--winner-color);
}

.rematch-action-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper);
  background: var(--winner-color);
}

.rematch-action-button span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rematch-action-button strong,
.rematch-action-button small {
  overflow-wrap: anywhere;
}

.rematch-action-button strong {
  font-size: 0.98rem;
  line-height: 1.05;
}

.rematch-action-button small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.fanfare-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fanfare-burst span {
  position: absolute;
  top: 54%;
  left: 50%;
  width: 12px;
  height: 24px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--winner-color);
  transform: translate(-50%, -50%) rotate(var(--start-rotate));
  animation: confetti-pop 900ms ease-out both;
}

.fanfare-burst span:nth-child(3n + 1) {
  background: var(--gold);
}

.fanfare-burst span:nth-child(3n + 2) {
  background: var(--teal);
}

.fanfare-burst span:nth-child(1) { --start-rotate: 8deg; --x: -20px; --y: -178px; --end-rotate: 240deg; }
.fanfare-burst span:nth-child(2) { --start-rotate: 32deg; --x: 78px; --y: -154px; --end-rotate: 310deg; }
.fanfare-burst span:nth-child(3) { --start-rotate: 56deg; --x: 142px; --y: -106px; --end-rotate: 390deg; }
.fanfare-burst span:nth-child(4) { --start-rotate: 80deg; --x: 188px; --y: -24px; --end-rotate: 470deg; }
.fanfare-burst span:nth-child(5) { --start-rotate: 104deg; --x: 166px; --y: 76px; --end-rotate: 260deg; }
.fanfare-burst span:nth-child(6) { --start-rotate: 128deg; --x: 102px; --y: 132px; --end-rotate: 340deg; }
.fanfare-burst span:nth-child(7) { --start-rotate: 152deg; --x: 26px; --y: 162px; --end-rotate: 420deg; }
.fanfare-burst span:nth-child(8) { --start-rotate: 176deg; --x: -58px; --y: 148px; --end-rotate: 280deg; }
.fanfare-burst span:nth-child(9) { --start-rotate: 200deg; --x: -136px; --y: 94px; --end-rotate: 360deg; }
.fanfare-burst span:nth-child(10) { --start-rotate: 224deg; --x: -184px; --y: 12px; --end-rotate: 430deg; }
.fanfare-burst span:nth-child(11) { --start-rotate: 248deg; --x: -154px; --y: -82px; --end-rotate: 315deg; }
.fanfare-burst span:nth-child(12) { --start-rotate: 272deg; --x: -94px; --y: -144px; --end-rotate: 405deg; }
.fanfare-burst span:nth-child(13) { --start-rotate: 296deg; --x: -14px; --y: -118px; --end-rotate: 510deg; }
.fanfare-burst span:nth-child(14) { --start-rotate: 320deg; --x: 118px; --y: 36px; --end-rotate: 380deg; }

@keyframes koth-flame-flicker {
  from {
    filter: saturate(1);
    opacity: 0.72;
    transform: rotate(8deg) translateY(2px) scale(0.92);
  }

  52% {
    opacity: 1;
    transform: rotate(16deg) translateY(-3px) scale(1.08);
  }

  to {
    filter: saturate(1.22);
    opacity: 0.84;
    transform: rotate(11deg) translateY(1px) scale(0.98);
  }
}

@keyframes koth-flame-flicker-left {
  from {
    opacity: 0.66;
    transform: rotate(-24deg) translateY(1px) scale(0.74);
  }

  48% {
    opacity: 0.96;
    transform: rotate(-14deg) translateY(-4px) scale(0.94);
  }

  to {
    opacity: 0.78;
    transform: rotate(-20deg) translateY(1px) scale(0.82);
  }
}

@keyframes koth-inferno-flicker {
  from {
    filter: saturate(1.08) brightness(1);
    transform: rotate(12deg) translateY(2px) scale(1.08);
  }

  45% {
    filter: saturate(1.42) brightness(1.12);
    transform: rotate(20deg) translateY(-5px) scale(1.3);
  }

  to {
    filter: saturate(1.22) brightness(1.04);
    transform: rotate(15deg) translateY(0) scale(1.16);
  }
}

@keyframes koth-inferno-flicker-left {
  from {
    transform: rotate(-28deg) translateY(2px) scale(0.96);
  }

  50% {
    transform: rotate(-16deg) translateY(-5px) scale(1.16);
  }

  to {
    transform: rotate(-23deg) translateY(0) scale(1.04);
  }
}

@keyframes koth-inferno-flicker-center {
  from {
    filter: brightness(1);
    transform: rotate(-2deg) translateY(2px) scale(1.08);
  }

  50% {
    filter: brightness(1.16);
    transform: rotate(6deg) translateY(-6px) scale(1.3);
  }

  to {
    filter: brightness(1.06);
    transform: rotate(1deg) translateY(0) scale(1.16);
  }
}

@keyframes cup-pop {
  from {
    opacity: 0;
    transform: scale(0.62) rotate(-8deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes confetti-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(var(--start-rotate));
  }

  45% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.88) rotate(var(--end-rotate));
  }
}

@keyframes tool-card-shine {
  0% {
    opacity: 0;
    transform: translateX(-36%);
  }

  28% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(36%);
  }
}

@keyframes dice-tumble {
  0% {
    opacity: 0.55;
    transform: translateY(-18px) rotate(-360deg) scale(0.78);
  }

  34% {
    opacity: 1;
    transform: translateY(7px) rotate(-36deg) scale(1.12);
  }

  62% {
    transform: translateY(-5px) rotate(18deg) scale(0.96);
  }

  82% {
    transform: translateY(2px) rotate(-7deg) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes dice-fast-spin {
  0% {
    transform: translateY(-7px) translateX(-2px) rotate(0deg) scale(0.9);
  }

  25% {
    transform: translateY(3px) translateX(3px) rotate(180deg) scale(1.06);
  }

  50% {
    transform: translateY(7px) translateX(0) rotate(360deg) scale(0.96);
  }

  75% {
    transform: translateY(-2px) translateX(-3px) rotate(540deg) scale(1.08);
  }

  100% {
    transform: translateY(-7px) translateX(-2px) rotate(720deg) scale(0.9);
  }
}

@keyframes dice-symbol-flash {
  0% {
    opacity: 0.45;
    transform: scale(0.82);
  }

  100% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes dice-idle-wobble {
  0%,
  100% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(5deg) translateY(-1px);
  }
}

@keyframes result-pop {
  0% {
    opacity: 0;
    transform: scale(0.62) rotate(-5deg);
  }

  58% {
    opacity: 1;
    transform: scale(1.14) rotate(3deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes coin-flip-heads {
  0% {
    transform: translateY(14px) rotateY(0deg) rotateZ(-8deg) scale(0.88);
  }

  46% {
    transform: translateY(-22px) rotateY(900deg) rotateZ(16deg) scale(1.08);
  }

  72% {
    transform: translateY(5px) rotateY(1260deg) rotateZ(-4deg) scale(0.98);
  }

  100% {
    transform: translateY(0) rotateY(1440deg) rotateZ(0) scale(1);
  }
}

@keyframes coin-flip-tails {
  0% {
    transform: translateY(14px) rotateY(0deg) rotateZ(-8deg) scale(0.88);
  }

  46% {
    transform: translateY(-22px) rotateY(900deg) rotateZ(16deg) scale(1.08);
  }

  72% {
    transform: translateY(5px) rotateY(1260deg) rotateZ(-4deg) scale(0.98);
  }

  100% {
    transform: translateY(0) rotateY(1620deg) rotateZ(0) scale(1);
  }
}

@keyframes coin-label-pop {
  0% {
    opacity: 0;
    transform: scale(0.76);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes player-reel-spin {
  0% {
    transform: translateX(0);
  }

  52% {
    transform: translateX(-330px);
  }

  76% {
    transform: translateX(-410px);
  }

  100% {
    transform: translateX(-372px);
  }
}

@keyframes winner-live-pulse {
  from {
    transform: translateY(0) scale(0.98);
  }

  to {
    transform: translateY(-1px) scale(1.01);
  }
}

@keyframes winner-slam {
  0% {
    opacity: 1;
    transform: translateY(7px) scale(0.92);
  }

  64% {
    opacity: 1;
    transform: translateY(-3px) scale(1.07);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .juicy-tool-card:has(.tool-animation-bucket.has-result)::after,
  .die-face,
  .dice-bucket.rolling .die-face,
  .dice-bucket.rolling .die-pip.active,
  .dice-bucket.rolling .number-face strong,
  .die-face.idle,
  .dice-bucket.has-result .dice-total-burst,
  .coin-bucket.has-result .coin-disc.heads,
  .coin-bucket.has-result .coin-disc.tails,
  .coin-bucket.has-result .coin-readable-label,
  .player-reel-bucket.has-result .player-reel-track,
  .player-reel-bucket.is-spinning .player-reel-winner,
  .player-reel-bucket.has-result .player-reel-winner {
    animation: none;
  }
}

@keyframes rules-drop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gameplay-shell .tournament-play-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.gameplay-shell .tournament-play-layout .current-turn-card {
  height: auto;
  align-content: start;
}

.gameplay-shell .tournament-play-layout .play-side-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  align-items: stretch;
}

.gameplay-shell .tournament-play-layout .finish-session-button {
  grid-column: 1 / -1;
}

.gameplay-shell .tournament-play-layout .history-drawer {
  --history-drawer-max-height: none;
  height: 100%;
  max-height: none;
}

@media (max-width: 1580px) {
  .app-shell {
    width: min(1160px, calc(100% - 28px));
    grid-template-columns: minmax(0, 1fr);
  }

  .app-content {
    grid-column: 1;
  }

  .app-ad-rail {
    display: none;
  }
}

@media (max-width: 980px) {
  .site-footer {
    grid-template-columns: 1fr;
  }

  .gameplay-header {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    padding: 22px;
  }

  .gameplay-brand-button {
    width: 72px;
    height: 72px;
  }

  .gameplay-header-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .gameplay-content {
    padding: 18px;
  }

  .quick-counter-heading h3 {
    font-size: 3.2rem;
  }

  .mode-grid,
  .player-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-layout,
  .play-layout,
  .player-manager-row {
    grid-template-columns: 1fr;
  }

  .player-admin-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .player-profile-editor.expanded {
    grid-template-columns: 1fr;
  }

  .add-player-modal .player-profile-editor.expanded {
    grid-template-columns: 1fr;
  }

  .add-player-modal .player-profile-editor.expanded .avatar-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .current-turn-card {
    min-height: auto;
  }

  .gameplay-shell .play-layout {
    grid-template-columns: 1fr;
  }

  .gameplay-shell .play-side-panel {
    grid-template-rows: auto;
  }

  .gameplay-shell .tournament-play-layout .play-side-panel {
    grid-template-columns: 1fr;
  }

  .gameplay-shell .tournament-play-layout .history-drawer {
    height: auto;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 22px;
  }

  .landing-hero-copy {
    max-width: 720px;
  }

  .landing-feature-band {
    grid-template-columns: 1fr;
  }

  .landing-step-list,
  .landing-tools-grid,
  .landing-tournament-panel,
  .landing-featured-mode-grid,
  .landing-mode-grid,
  .landing-use-list {
    grid-template-columns: 1fr 1fr;
  }

  .custom-objective-add.with-extra-control {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    grid-template-areas:
      "name type"
      "extra add";
  }

  .custom-objective-add.without-limit {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    grid-template-areas:
      "name type"
      "add add";
  }

  .custom-objective-add.with-extra-control .custom-add-objective,
  .custom-objective-add.without-limit .custom-add-objective {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    grid-template-columns: minmax(0, 1fr);
    padding-top: 16px;
  }

  .gameplay-shell {
    border-radius: 14px;
  }

  .gameplay-header {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 10px;
  }

  .gameplay-brand-button {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  .gameplay-brand-icon {
    border-radius: 8px;
  }

  .gameplay-header-title span {
    font-size: 0.68rem;
  }

  .gameplay-header-title h1 {
    margin-top: 3px;
    font-size: clamp(1.22rem, 6.8vw, 1.72rem);
  }

  .gameplay-header-title p {
    margin-top: 4px;
    font-size: 0.78rem;
  }

  .gameplay-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .gameplay-header .language-picker {
    width: 100%;
  }

  .gameplay-header .language-button,
  .gameplay-header-button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.86rem;
  }

  .gameplay-content {
    padding: 10px;
  }

  .app-ad-banner {
    margin-top: 0;
  }

  .app-ad-banner-mobile-top {
    margin-bottom: 8px;
  }

  .landing-shell {
    width: auto;
    max-width: none;
    margin: 0 18px;
    padding: 16px 0 40px;
  }

  .landing-header {
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }

  .landing-brand {
    min-width: 0;
    max-width: 100%;
    gap: 9px;
  }

  .landing-brand span {
    min-width: 0;
    overflow: visible;
    font-size: 1rem;
    text-overflow: clip;
    white-space: nowrap;
  }

  .landing-brand-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
  }

  .landing-header-nav {
    max-width: 100%;
    display: inline-flex;
    flex: 0 1 auto;
  }

  .landing-header-nav .landing-nav-cta {
    display: none;
  }

  .site-nav-link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .site-footer {
    margin-top: 30px;
    gap: 16px;
  }

  .site-footer-links,
  .site-footer-languages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .site-footer-links a,
  .site-footer-languages a {
    min-width: 0;
  }

  .info-hero {
    gap: 10px;
    padding: 16px;
    box-shadow: 4px 4px 0 var(--teal);
  }

  .info-hero h1 {
    font-size: clamp(2rem, 10vw, 2.25rem);
    line-height: 1;
  }

  .info-hero p,
  .info-copy-section p {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  .info-copy {
    gap: 14px;
  }

  .info-copy-section {
    padding: 14px 0;
  }

  .info-copy-section h2 {
    font-size: clamp(1.32rem, 7vw, 1.62rem);
    line-height: 1.08;
  }

  .app-header.play-header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .app-header.utility-header {
    margin-bottom: 10px;
  }

  .app-header {
    grid-template-areas:
      "brand title language"
      "actions actions actions";
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 8px 10px;
  }

  .header-title h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1;
  }

  .header-context-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .header-context-actions .small-button,
  .header-context-actions .back-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 12px;
  }

  .language-picker,
  .language-button {
    flex: 0 0 auto;
  }

  .brand-button {
    width: 50px;
    height: 50px;
  }

  .landing-screen {
    gap: 18px;
  }

  .landing-hero {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
    overflow: visible;
    padding-top: 0;
  }

  .landing-hero-copy,
  .landing-hero h1,
  .landing-hero-copy > p,
  .landing-actions,
  .landing-hero-media {
    width: 100%;
    max-width: 100%;
  }

  .landing-feature-band,
  .landing-content-section,
  .landing-tools-grid,
  .landing-tournament-panel,
  .landing-featured-mode-grid,
  .landing-step-list,
  .landing-mode-groups,
  .landing-mode-grid,
  .landing-use-list,
  .landing-guide-grid,
  .faq-list {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }

  .landing-hero h1 {
    font-size: 2.25rem;
    line-height: 0.96;
    text-wrap: balance;
  }

  .landing-hero-copy > p {
    font-size: 1rem;
    line-height: 1.46;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-cta,
  .landing-secondary-link,
  .landing-section-cta,
  .landing-guides-all-link {
    width: 100%;
    min-width: 0;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(32, 31, 27, 0.18);
  }

  .landing-feature,
  .landing-tool-card,
  .landing-tournament-panel,
  .landing-tournament-item,
  .landing-featured-mode-card,
  .landing-step-item,
  .landing-mode-card,
  .landing-use-item,
  .landing-guide-card,
  .faq-item {
    max-width: 100%;
    box-shadow: 0 3px 0 rgba(32, 31, 27, 0.12);
  }

  .landing-mode-card {
    box-shadow:
      0 5px 0 var(--mode-card-accent),
      0 12px 24px rgba(32, 31, 27, 0.08);
  }

  .landing-hero-media img {
    max-height: 360px;
    box-shadow:
      0 4px 0 var(--teal),
      0 16px 38px rgba(32, 31, 27, 0.14);
  }

  .landing-hero-media {
    width: 100%;
    padding-right: 0;
    justify-self: start;
  }

  .landing-feature {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .landing-feature-icon {
    width: 48px;
    height: 48px;
  }

  .landing-content-section {
    gap: 13px;
    padding-top: 10px;
  }

  .landing-section-heading h2 {
    font-size: 1.75rem;
    line-height: 1.02;
  }

  .landing-section-heading p {
    font-size: 0.98rem;
    line-height: 1.46;
  }

  .landing-step-list,
  .landing-tools-grid,
  .landing-tournament-panel,
  .landing-featured-mode-grid,
  .landing-mode-grid,
  .landing-use-list,
  .landing-guide-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .landing-step-item,
  .landing-tool-card,
  .landing-tournament-item,
  .landing-featured-mode-card,
  .landing-mode-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 13px;
  }

  .landing-mode-card {
    min-height: 0;
    padding-right: 38px;
  }

  .landing-mode-grid.single {
    max-width: 100%;
  }

  .landing-step-item > span,
  .landing-tool-icon,
  .landing-tournament-icon,
  .landing-featured-mode-icon,
  .landing-mode-icon {
    width: 42px;
    height: 42px;
  }

  .landing-tournament-panel {
    gap: 14px;
    padding: 14px;
    box-shadow:
      0 5px 0 var(--danger),
      0 12px 24px rgba(32, 31, 27, 0.08);
  }

  .landing-tournament-panel .landing-section-heading {
    max-width: 100%;
  }

  .landing-tournament-cta {
    width: 100%;
    justify-content: center;
  }

  .landing-use-item {
    padding: 13px;
  }

  .landing-guide-card {
    padding: 14px;
  }

  .landing-faq-heading h2 {
    max-width: 100%;
    font-size: 1.55rem;
    line-height: 1.06;
    text-wrap: balance;
  }

  .faq-item summary {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    padding: 0 12px;
    gap: 12px;
    font-size: 0.95rem;
  }

  .faq-item summary::after {
    align-self: center;
    justify-self: end;
  }

  .faq-item p {
    padding: 0 12px 14px;
  }

  .play-topbar,
  .wizard-actions,
  .play-actions,
  .simple-tool-layout {
    grid-template-columns: 1fr;
  }

  .play-screen {
    gap: 10px;
  }

  .play-topbar {
    gap: 8px;
  }

  .play-topbar .small-button {
    min-height: 40px;
  }

  .screen-heading.with-action {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
  }

  .quick-add-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .quick-add-actions .primary-button,
  .quick-add-actions .secondary-button {
    width: 100%;
    min-width: 0;
  }

  .add-player-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .team-player-picker-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .add-player-modal,
  .team-player-picker-modal,
  .add-player-modal-heading,
  .team-player-picker-heading,
  .add-player-modal .player-profile-editor,
  .add-player-modal .quick-add-actions,
  .team-picker-actions {
    width: 100%;
  }

  .team-player-picker-heading {
    align-items: start;
  }

  .team-player-picker-option {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .team-player-picker-option > span:last-child {
    grid-column: auto;
    justify-self: end;
    white-space: nowrap;
  }

  .team-picker-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-picker-actions .primary-button,
  .team-picker-actions .secondary-button {
    min-height: 58px;
  }

  @container (max-width: 315px) {
    .team-player-picker-modal .team-picker-actions {
      grid-template-columns: 1fr;
    }
  }

  .screen-heading h2 {
    max-width: 100%;
    overflow-wrap: normal;
    text-wrap: normal;
    font-size: clamp(1.85rem, 8.7vw, 2.35rem);
    line-height: 0.9;
  }

  .screen-heading.with-action h2 {
    font-size: clamp(1.65rem, 7.7vw, 2.2rem);
    line-height: 0.9;
    text-wrap: nowrap;
  }

  .custom-mode-builder-screen .screen-heading.with-action {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .custom-mode-builder-screen .screen-heading.with-action .back-button {
    justify-self: start;
  }

  .custom-mode-builder-screen .screen-heading.with-action h2 {
    overflow-wrap: normal;
    text-wrap: normal;
    white-space: normal;
  }

  .screen-heading.with-action .step-label {
    font-size: 0.68rem;
  }

  .mode-grid,
  .player-choice-grid,
  .team-board,
  .settings-grid,
  .custom-mode-import-form,
  .custom-objective-add,
  .custom-objective-row,
  .custom-objective-row.with-score-direction,
  .bingo-objective-grid,
  .bingo-objective-grid-5,
  .custom-objective-track-list,
  .player-profile-editor.compact,
  .player-profile-editor.expanded,
  .player-editor-fields {
    grid-template-columns: 1fr;
  }

  .participant-mode-panel,
  .team-selection-toolbar,
  .team-bucket-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .participant-mode-switch,
  .team-selection-toolbar .secondary-button,
  .team-bucket-meta .small-button {
    width: 100%;
  }

  .counter-type-row {
    grid-template-columns: 1fr;
  }

  .counter-type-row .icon-button {
    width: 100%;
  }

  .custom-challenge-heading,
  .custom-tracker-heading {
    align-items: stretch;
  }

  .custom-challenge-heading .small-button,
  .custom-tracker-heading .secondary-button,
  .custom-mode-import-form .secondary-button,
  .custom-challenge-save-row .small-button,
  .custom-tracker-actions .primary-button,
  .custom-tracker-actions .secondary-button,
  .custom-add-objective {
    width: 100%;
  }

  .custom-tracker-actions {
    grid-template-columns: 1fr;
  }

  .custom-objective-add.with-extra-control,
  .custom-objective-add.without-limit {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "name"
      "type"
      "extra"
      "add";
  }

  .custom-objective-add.without-limit {
    grid-template-areas:
      "name"
      "type"
      "add";
  }

  .custom-objective-add > label,
  .custom-objective-add .segmented-control,
  .custom-objective-add input,
  .custom-add-objective {
    min-width: 0;
    width: 100%;
    justify-self: stretch;
  }

  .custom-counter-control {
    grid-template-columns: minmax(54px, 0.75fr) minmax(86px, 1fr) minmax(54px, 0.75fr);
  }

  .custom-objective-row {
    grid-template-areas:
      "name"
      "limit"
      "remove";
  }

  .custom-objective-remove {
    width: 100%;
  }

  .custom-counter-button,
  .custom-counter-value,
  .custom-fail-toggle {
    min-height: 70px;
  }

  .quick-counter-board {
    gap: 12px;
    padding: 14px;
  }

  .table-tools-panel {
    padding: 10px;
  }

  .table-tools-grid {
    grid-template-columns: 1fr;
  }

  .table-tool-controls-spacer {
    display: none;
  }

  .quick-counter-grid {
    grid-template-columns: 1fr;
  }

  .quick-counter-heading .secondary-button {
    width: 100%;
  }

  .quick-counter-heading h3 {
    font-size: 2.4rem;
  }

  .quick-counter-counter {
    grid-template-columns: 1fr;
  }

  .quick-counter-actions.compact {
    grid-template-columns: 1fr 1fr;
  }

  .quick-counter-value {
    min-height: 112px;
  }

  .quick-counter-value.compact {
    min-height: 92px;
  }

  .quick-counter-value-editor input {
    font-size: 2.8rem;
  }

  .score-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-field.wide {
    grid-column: 1 / -1;
  }

  .metric-penalty {
    grid-column: 1 / -1;
  }

  .duration-picker {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .duration-separator {
    display: none;
  }

  .duration-part {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
  }

  .duration-part > span {
    font-size: 0.62rem;
  }

  .duration-number input {
    min-height: 44px;
    padding: 0 42px 0 12px;
    text-align: left;
    font-size: 1.15rem;
  }

  .duration-picker .number-stepper-buttons {
    top: 5px;
    right: 5px;
    bottom: 5px;
  }

  .duration-picker .number-stepper-button {
    width: 32px;
  }

  .mode-grid {
    gap: 9px;
  }

  .landing-session-stack {
    gap: 12px;
  }

  .session-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .session-card-main {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .session-card-main.has-winner {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .session-mode-icon,
  .session-winner-avatar {
    width: 44px;
    height: 44px;
  }

  .session-card-copy strong {
    font-size: 1.04rem;
  }

  .session-card-copy p {
    font-size: 0.9rem;
  }

  .session-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .session-winner-chip {
    min-height: 26px;
    font-size: 0.7rem;
  }

  .setup-screen {
    gap: 12px;
  }

  .setup-layout {
    gap: 12px;
  }

  .selected-mode-card {
    min-height: 92px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px;
    box-shadow: 4px 4px 0 var(--mode-accent);
  }

  .selected-mode-card svg {
    width: 48px;
    height: 48px;
    padding: 11px;
    box-shadow: 3px 3px 0 var(--mode-accent);
  }

  .selected-mode-card strong {
    font-size: 1.12rem;
    line-height: 1.05;
  }

  .selected-mode-card p {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .setup-form {
    gap: 12px;
    padding: 14px;
  }

  .setup-form label {
    gap: 6px;
  }

  .setup-form input {
    min-height: 46px;
  }

  .large-field input {
    min-height: 50px;
    font-size: 0.98rem;
  }

  .setup-field .toggle-switch {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .setup-field .toggle-switch .toggle-state {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .player-identity-panel,
  .avatar-editor,
  .avatar-option-group,
  .player-admin-panel {
    grid-template-columns: 1fr;
  }

  .player-manager-screen .player-manager-avatar {
    justify-self: center;
  }

  .add-player-modal .player-identity-panel {
    grid-template-columns: 1fr;
  }

  .add-player-modal .player-profile-editor.expanded .avatar-editor,
  .add-player-modal .player-profile-editor.expanded .avatar-palette-panel {
    grid-template-columns: 1fr;
  }

  .add-player-modal .player-manager-avatar {
    width: 96px;
    height: 96px;
    justify-self: center;
  }

  .past-session-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .past-session-winner {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 12px;
  }

  .past-session-winner-icon {
    width: 58px;
    height: 58px;
  }

  .past-run-row {
    grid-template-columns: 1fr auto;
  }

  .past-run-row p {
    grid-column: 1 / -1;
  }

  .avatar-palette-panel {
    align-items: start;
  }

  .palette-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .screen-heading.with-action .back-button {
    min-height: 42px;
    width: fit-content;
    padding: 0 12px;
  }

  .screen-heading.with-action .small-button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .player-empty {
    grid-column: auto;
  }

  .mode-choice {
    min-height: 112px;
    grid-template-columns: 46px minmax(0, 1fr) 20px;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    padding: 14px 14px 12px;
  }

  .mode-choice::before {
    width: 5px;
  }

  .choice-icon {
    width: 46px;
    height: 46px;
    box-shadow: 3px 3px 0 var(--card-accent);
  }

  .choice-icon svg {
    width: 23px;
    height: 23px;
  }

  .mode-choice strong {
    font-size: 1.02rem;
  }

  .mode-choice small {
    margin-top: 4px;
    font-size: 0.74rem;
  }

  .mode-choice p {
    grid-column: 2 / -1;
    align-self: start;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .mode-choice > svg {
    align-self: end;
    width: 17px;
    height: 17px;
  }

  .now-playing {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .big-avatar {
    width: 58px;
    height: 58px;
    box-shadow: 3px 3px 0 rgba(255, 250, 240, 0.18);
  }

  .now-playing h2 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .now-playing span {
    font-size: 0.68rem;
  }

  .play-title {
    text-align: left;
  }

  .play-title span {
    font-size: 0.72rem;
  }

  .play-title h2 {
    font-size: clamp(1.05rem, 5vw, 1.3rem);
  }

  .play-title p {
    font-size: 0.88rem;
  }

  .play-rules {
    max-width: 100%;
    justify-content: flex-start;
  }

  .play-session-meta {
    justify-items: stretch;
  }

  .play-session-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .current-turn-card {
    gap: 10px;
    padding: 10px;
  }

  .gameplay-shell .current-turn-card {
    gap: 10px;
    padding: 10px;
  }

  .gameplay-shell .now-playing {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    min-height: 76px;
    padding: 8px;
  }

  .gameplay-shell .big-avatar {
    width: 58px;
    height: 58px;
  }

  .gameplay-shell .now-playing h2 {
    font-size: clamp(1.9rem, 12vw, 2.75rem);
  }

  .gameplay-shell .score-entry.single-metric .metric-field > span {
    font-size: 1.05rem;
  }

  .gameplay-shell .score-entry.single-metric .number-input-wrap input {
    min-height: 64px;
    padding-right: 64px;
    font-size: clamp(2.15rem, 12vw, 3.15rem);
  }

  .gameplay-shell .score-entry.single-metric .number-stepper-buttons,
  .gameplay-shell .score-entry.single-metric .number-stepper-button {
    width: 52px;
  }

  .gameplay-shell .score-entry.single-metric .number-stepper-button svg {
    width: 22px;
    height: 22px;
  }

  .gameplay-stats-grid {
    grid-template-columns: 1fr;
  }

  .gameplay-stat-tile {
    min-height: 82px;
  }

  .gameplay-shell .play-actions {
    grid-template-columns: minmax(0, 1fr) minmax(94px, 0.55fr);
    gap: 8px;
  }

  .gameplay-shell .record-button,
  .gameplay-shell .finish-session-button,
  .gameplay-shell .play-actions .secondary-button {
    min-width: 0;
    min-height: 52px;
    font-size: 0.96rem;
  }

  .bingo-panel {
    gap: 12px;
  }

  .bingo-claimant-panel {
    padding: 8px;
  }

  .bingo-claimant-chip {
    min-width: 118px;
    min-height: 52px;
  }

  .bingo-board {
    gap: 5px;
  }

  .bingo-square {
    min-height: 104px;
    padding: 7px;
  }

  .bingo-square strong {
    font-size: 0.76rem;
  }

  .bingo-board-5 .bingo-square {
    min-height: 88px;
    padding: 5px;
  }

  .bingo-board-5 .bingo-square strong {
    font-size: 0.62rem;
  }

  .bingo-board-5 .bingo-square-owner .mini-avatar {
    display: none;
  }

  .bingo-steal-tag {
    position: static;
    justify-self: start;
    font-size: 0.52rem;
  }

  .gameplay-shell .turn-taker-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gameplay-shell .turn-taker-actions .primary-button,
  .gameplay-shell .turn-taker-actions .secondary-button {
    padding-inline: 10px;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
  }

  .gameplay-shell .turn-taker-actions .primary-button svg,
  .gameplay-shell .turn-taker-actions .secondary-button svg {
    flex: 0 0 auto;
  }

  .gameplay-shell .turn-taker-actions .secondary-button:last-child {
    font-size: 0.88rem;
  }

  .koth-match-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .koth-combo-meter {
    width: min(150px, 100%);
    min-width: 118px;
    margin-top: 2px;
    transform-origin: center;
  }

  .koth-match-grid {
    grid-template-columns: 1fr;
  }

  .koth-versus {
    justify-self: center;
    width: 42px;
    height: 42px;
  }

  .koth-player-card {
    min-height: 190px;
  }

  .hotseat-timer-panel {
    min-height: 92px;
    padding: 14px;
  }

  .hotseat-timer-panel strong {
    font-size: 3.1rem;
  }

  .turn-kicker span,
  .session-chips span {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .session-chips {
    gap: 6px;
  }

  .history-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .gameplay-shell .history-drawer {
    --history-drawer-max-height: none;
    max-height: none;
    overflow: visible;
  }

  .gameplay-shell .history-body {
    overflow: visible;
    overscroll-behavior: auto;
  }

  .gameplay-shell .history-list {
    padding-right: 0;
  }

  .standing-row {
    grid-template-columns: 22px 42px minmax(0, 1fr) 32px;
    gap: 8px;
    min-height: 72px;
    padding: 10px;
  }

  .standing-row.turn-order-row {
    grid-template-columns: 22px 42px minmax(0, 1fr) minmax(46px, max-content);
    padding-right: 12px;
  }

  .standing-row .mini-avatar,
  .standing-row small,
  .standing-row strong,
  .standing-row p {
    grid-column: auto;
  }

  .standing-row small {
    justify-self: end;
    text-align: right;
  }

  .standing-row p {
    overflow-wrap: normal;
  }

  .history-row p,
  .history-row span {
    grid-column: 1 / -1;
  }

  .standing-row.expandable-summary-row .standing-row-main {
    grid-template-columns: 22px 42px minmax(0, 1fr) 32px 22px;
    gap: 8px;
  }

  .standing-row.expandable-summary-row .summary-part-list {
    margin-left: 72px;
  }

  .history-row.expandable-summary-row span {
    grid-column: auto;
  }

  .history-row.expandable-summary-row .history-row-main {
    grid-template-columns: 32px minmax(0, 1fr) 22px;
    gap: 8px;
  }

  .history-row.expandable-summary-row .mini-avatar {
    width: 32px;
    height: 32px;
  }

  .history-row.expandable-summary-row .summary-preview {
    grid-column: 2 / -1;
    justify-self: start;
    text-align: left;
  }

  .history-row.expandable-summary-row .summary-chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .history-row.expandable-summary-row .summary-part-list {
    margin-left: 0;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
