/* Farkle 5-dice — Dev host + invite-only join table */
/* Author: Dave Greenlaw */

.fk-app {
  --fk-felt: color-mix(in srgb, #1e3a5f 42%, var(--surface, #f5f6f8));
  --fk-die: var(--surface, #fff);
  --fk-die-ink: var(--text, #1a1a1a);
  --fk-gold: #d4a017;
}

/* Play help ("Your turn / tap scoring dice…") — reclaim board height. */
.fk-app > .crib-status {
  display: none !important;
}

.fk-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  flex: 1 1 auto;
  min-height: 0;
}

.fk-stage {
  padding: 10px 10px 16px;
  min-height: 0;
}

.fk-table {
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 30%, color-mix(in srgb, var(--fk-felt) 82%, #fff), var(--fk-felt));
  border: 1px solid var(--crib-felt-line, var(--border));
  box-shadow:
    0 16px 36px color-mix(in srgb, var(--text, #000) 16%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
  padding: 10px 12px 14px;
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px 12px;
  min-height: 0;
  position: relative;
}

.fk-score-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 11rem;
}

.fk-table .fk-score-strip {
  grid-column: 1;
  grid-row: 1 / span 2;
  flex-direction: column;
  flex-wrap: nowrap;
  max-width: none;
  align-self: stretch;
}

.fk-felt {
  grid-column: 2;
  grid-row: 1;
}

.fk-actions {
  grid-column: 2;
  grid-row: 2;
}

.fk-score-strip__seat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(128, 128, 128, 0.28));
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font-size: 13px;
}

.fk-score-strip__seat.is-empty {
  opacity: 0.45;
}

.fk-score-strip__seat.is-turn {
  border-color: var(--accent, #0078d4);
  box-shadow: inset 0 0 0 1px var(--accent, #0078d4);
}

.fk-score-strip__seat.is-you strong::after {
  content: " (you)";
  font-weight: 500;
  color: var(--text-muted, #5c6470);
}

.fk-score-strip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 8rem;
}

.fk-felt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 160px;
  padding: 12px 8px;
}

.fk-live,
.fk-aside {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.fk-live {
  perspective: 420px;
}

.fk-first {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px 18px;
  min-height: 96px;
}

.fk-first__seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fk-first__name {
  font-size: 12px;
  font-weight: 650;
  color: var(--text, #1a1a1a);
}

.fk-first__seat.is-turn .fk-die,
.fk-first__seat.is-turn .fk-first__play {
  box-shadow: 0 0 0 2px var(--accent, #0078d4);
}

button.fk-first__play {
  appearance: none;
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  padding: 4px;
  border-radius: 10px;
  cursor: pointer;
}

button.fk-first__play:hover,
button.fk-first__play:focus-visible {
  outline: 2px solid var(--accent, #0078d4);
  outline-offset: 2px;
}

html[data-theme="dark"] .fk-first__name,
html[data-theme="soft"] .fk-first__name,
html[data-theme="glass"] .fk-first__name {
  color: var(--text, #f8fafc);
}

html[data-a11y-view="comfort"] button.fk-first__play {
  min-height: 44px;
  min-width: 44px;
}

.fk-live.is-six .fk-die {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
}

.fk-aside {
  opacity: 0.92;
  padding-bottom: 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--border, #ccc) 70%, transparent);
}

.fk-die {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border, #ccc);
  background: var(--fk-die);
  color: var(--fk-die-ink);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent),
    0 4px 10px color-mix(in srgb, var(--text, #000) 12%, transparent);
  display: grid;
  place-items: center;
  appearance: none;
  font: inherit;
  cursor: default;
  color-scheme: inherit;
}

.fk-die.is-legal,
.fk-die.is-selected {
  cursor: pointer;
}

.fk-die.is-scrapable {
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent),
    0 0 0 2px color-mix(in srgb, var(--accent, #0078d4) 42%, transparent);
}

.fk-die.is-scrapable:hover,
.fk-die.is-scrapable:focus-visible {
  outline: 2px solid var(--accent, #0078d4);
  outline-offset: 2px;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent),
    0 0 0 2px var(--accent, #0078d4);
}

.fk-die.is-legal:focus-visible {
  outline: 2px solid var(--accent, #0078d4);
  outline-offset: 2px;
}

.fk-die__pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  gap: 3px;
}

.fk-pip {
  width: 7px;
  height: 7px;
  margin: auto;
  border-radius: 50%;
  background: transparent;
}

.fk-pip.is-on {
  background: var(--fk-die-ink);
}

.fk-die__face {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.fk-die--ghost {
  background: color-mix(in srgb, var(--fk-die) 35%, transparent);
  border-style: dashed;
  box-shadow: none;
}

.fk-die--aside {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

.fk-die.is-selected {
  transform: translateY(-6px);
  border-color: var(--accent, #0078d4);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent, #0078d4) 28%, transparent);
}

.fk-die.fk-die--pending {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
}

.fk-die.is-selected,
.fk-die.fk-die--pending {
  animation: none;
}

.fk-die.is-glow,
.fk-die--single.is-legal {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent),
    0 0 0 2px color-mix(in srgb, var(--fk-gold) 70%, transparent),
    0 0 14px color-mix(in srgb, var(--fk-gold) 45%, transparent);
}

.fk-die.is-pulse,
.fk-die--three,
.fk-die--four,
.fk-die--five,
.fk-die--six,
.fk-die--pair {
  animation: fk-pulse 1.1s ease-in-out infinite;
}

.fk-die.is-sweep,
.fk-die--straight {
  animation: fk-sweep 0.9s ease both;
}

.fk-live.is-rolling .fk-die {
  animation: fk-tumble 0.7s cubic-bezier(0.22, 0.8, 0.28, 1) both;
  animation-delay: calc(var(--fk-i, 0) * 75ms);
}

.fk-live.is-rolling.is-hot .fk-die {
  animation-name: fk-whoosh-land;
}

.fk-live.is-hot:not(.is-rolling) .fk-die {
  animation: fk-whoosh 0.7s ease both;
}

.fk-live.is-farkle .fk-die,
.fk-table.is-farkle .fk-die {
  animation: fk-shake 0.5s ease;
}

.fk-aside.is-catch .fk-die {
  animation: fk-keep 0.45s ease both;
  animation-delay: calc(var(--fk-i, 0) * 55ms);
}

.fk-die--ghost.is-waiting {
  animation: fk-wait 1.25s ease-in-out infinite;
  animation-delay: calc(var(--fk-i, 0) * 90ms);
}

.fk-table.is-farkle {
  animation: fk-shake 0.45s ease;
  box-shadow:
    0 0 0 3px color-mix(in srgb, #b91c1c 55%, transparent),
    0 16px 36px color-mix(in srgb, #b91c1c 22%, transparent);
}

.fk-table.is-infinity {
  animation: fk-cam-shake 0.72s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.fk-app .fk-fly--streak .crib-score-fly__msg {
  font-size: 1.35em;
  letter-spacing: 0.06em;
  color: var(--fk-gold, #d4a017);
  text-shadow: 0 1px 0 color-mix(in srgb, var(--text, #1a1a1a) 22%, transparent);
}

.fk-app .fk-fly--infinity .crib-score-fly__msg {
  font-size: 1.55em;
  letter-spacing: 0.1em;
}

.fk-bust-stamp {
  grid-column: 2;
  grid-row: 1;
  z-index: 3;
  pointer-events: none;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px 10px;
  border-radius: 8px;
  border: 3px solid color-mix(in srgb, #b91c1c 72%, var(--text, #1a1a1a));
  background: color-mix(in srgb, #b91c1c 16%, var(--surface, #fff));
  color: color-mix(in srgb, #b91c1c 68%, var(--text, #1a1a1a));
  transform: rotate(-8deg);
  box-shadow: 0 8px 20px color-mix(in srgb, #b91c1c 22%, transparent);
}

.fk-bust-stamp[hidden] {
  display: none !important;
}

.fk-bust-stamp strong {
  font-size: 1.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 1;
}

.fk-bust-stamp span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #1a1a1a);
}

.fk-table.is-busted .fk-bust-stamp {
  animation: fk-stamp-in 0.35s ease both;
}

.fk-over-stamp {
  grid-column: 2;
  grid-row: 1;
  z-index: 3;
  pointer-events: none;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px 10px;
  border-radius: 8px;
  border: 3px solid color-mix(in srgb, var(--accent, #0078d4) 72%, var(--text, #1a1a1a));
  background: color-mix(in srgb, var(--accent, #0078d4) 16%, var(--surface, #fff));
  color: color-mix(in srgb, var(--accent, #0078d4) 58%, var(--text, #1a1a1a));
  transform: rotate(-6deg);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent, #0078d4) 22%, transparent);
}

.fk-over-stamp[hidden] {
  display: none !important;
}

.fk-over-stamp strong {
  font-size: 1.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 1;
}

.fk-over-stamp span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #1a1a1a);
  text-align: center;
  max-width: 16rem;
}

.fk-table.is-over .fk-over-stamp {
  animation: fk-stamp-in 0.35s ease both;
}

.fk-score-strip__seat.is-winner {
  border-color: var(--accent, #0078d4);
  background: color-mix(in srgb, var(--accent, #0078d4) 14%, var(--surface, #fff));
  box-shadow: inset 0 0 0 1px var(--accent, #0078d4);
  font-weight: 800;
}

.fk-die--dead {
  filter: grayscale(0.3) contrast(0.92);
  opacity: 0.9;
  border-color: color-mix(in srgb, #b91c1c 42%, var(--border, #ccc));
}

.fk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.fk-wait {
  margin: 0;
  color: var(--text-muted, #5c6470);
  font-size: 13px;
}

.fk-turn-total {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #0078d4);
  flex-shrink: 0;
}

.fk-setup-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fk-setup,
.fk-setup-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px auto 4px;
  max-width: 42rem;
}

.fk-setup-host {
  width: 100%;
  margin: 0;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.28));
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
}

.fk-setup-host[hidden] {
  display: none;
}

.fk-setup-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(128, 128, 128, 0.28));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color-scheme: inherit;
}

.fk-setup-toggle:focus-visible {
  outline: 2px solid var(--accent, #0078d4);
  outline-offset: 2px;
}

.fk-setup-toggle__title {
  font-weight: 700;
  font-size: 13px;
}

.fk-setup-toggle__sum {
  font-size: 12px;
  color: var(--text-muted, #5c6470);
}

.fk-setup-host.is-collapsed {
  padding: 6px 10px 8px;
}

.fk-setup-panel[hidden] {
  display: none !important;
}

.fk-app:has(.fk-empty),
.fk-app:has(.crib-empty) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fk-empty-cta {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 12px -16px -24px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg, var(--surface, #f5f6f8)) 92%, transparent);
  border-top: 1px solid var(--border, rgba(128, 128, 128, 0.28));
}

.fk-empty-cta .pill-btn {
  min-width: 10rem;
}

.fk-setup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  width: 100%;
}

.fk-setup-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text, #1a1a1a);
  min-width: 4.75rem;
}

.fk-setup-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text, #1a1a1a);
  font-size: 12px;
}

.fk-setup-num__txt {
  color: var(--text-muted, #5c6470);
}

.fk-setup-input {
  width: 5.75rem;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  color-scheme: light;
  font: inherit;
}

.fk-setup-input:focus-visible {
  outline: 2px solid var(--accent, #0078d4);
  outline-offset: 2px;
}

@keyframes fk-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes fk-sweep {
  0% { transform: translateX(-12px); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}

@keyframes fk-whoosh {
  0% { transform: translateY(-28px) scale(1.08); opacity: 0.2; }
  100% { transform: none; opacity: 1; }
}

@keyframes fk-tumble {
  0% { transform: translateY(-56px) rotateX(78deg) rotateZ(-42deg) scale(0.62); opacity: 0.15; }
  58% { transform: translateY(8px) rotateX(-14deg) rotateZ(14deg) scale(1.07); opacity: 1; }
  100% { transform: none; }
}

@keyframes fk-whoosh-land {
  0% { transform: translateY(-52px) scale(1.14) rotate(-16deg); opacity: 0.15; }
  100% { transform: none; opacity: 1; }
}

@keyframes fk-keep {
  0% { transform: translateY(26px) scale(1.14); opacity: 0.35; }
  100% { transform: none; opacity: 1; }
}

@keyframes fk-wait {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-5px); opacity: 0.7; }
}

@keyframes fk-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes fk-cam-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-7px, 3px) rotate(-0.7deg); }
  22% { transform: translate(8px, -4px) rotate(0.8deg); }
  34% { transform: translate(-6px, -3px) rotate(-0.55deg); }
  46% { transform: translate(7px, 4px) rotate(0.5deg); }
  58% { transform: translate(-4px, 2px) rotate(-0.35deg); }
  70% { transform: translate(4px, -2px) rotate(0.28deg); }
  86% { transform: translate(-2px, 1px) rotate(-0.12deg); }
}

@keyframes fk-stamp-in {
  from { opacity: 0; transform: rotate(-8deg) scale(1.18); }
  to { opacity: 1; transform: rotate(-8deg) scale(1); }
}

@media (max-width: 820px) {
  .fk-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .fk-table {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .fk-table .fk-score-strip {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .fk-felt {
    grid-column: 1;
    grid-row: 2;
  }
  .fk-actions {
    grid-column: 1;
    grid-row: 3;
  }
  .fk-bust-stamp,
  .fk-over-stamp {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 720px) {
  .fk-die {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
  .fk-score-strip__seat {
    min-height: 36px;
  }
  .fk-app .crib-lens {
    -webkit-overflow-scrolling: touch;
  }
  .fk-app .fk-turn-total {
    grid-area: scores;
    min-width: 0;
  }
  .fk-app .crib-toolbar,
  .yz-app .crib-toolbar {
    grid-template-areas:
      "scores lens"
      "left dev";
    padding: 4px 8px;
  }
  .fk-app .crib-game-focus-btn,
  .yz-app .crib-game-focus-btn {
    display: none !important;
  }
  .fk-app .crib-dev-tools-btn,
  .yz-app .crib-dev-tools-btn {
    grid-area: dev;
    justify-self: end;
  }
  .fk-setup-host:not(.is-collapsed) .fk-setup-panel {
    max-height: min(42vh, 22rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 8px;
  }
  .fk-setup-toggle {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fk-die.is-pulse,
  .fk-die--three,
  .fk-die--four,
  .fk-die--five,
  .fk-die--six,
  .fk-die--pair,
  .fk-die.is-sweep,
  .fk-die--straight,
  .fk-live.is-hot .fk-die,
  .fk-live.is-rolling .fk-die,
  .fk-live.is-farkle .fk-die,
  .fk-aside.is-catch .fk-die,
  .fk-die--ghost.is-waiting,
  .fk-table.is-farkle,
  .fk-table.is-infinity,
  .fk-table.is-busted .fk-bust-stamp,
  .fk-table.is-over .fk-over-stamp {
    animation: none;
  }
}

.fk-app.is-game-focus [data-fk-dev-tools],
.fk-app.is-game-focus .crib-chat,
.fk-app.is-game-focus .fk-setup-host {
  display: none !important;
}

.composer-farkle-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

html[data-a11y-view="comfort"] .fk-die,
html[data-a11y-view="comfort"] .fk-actions .pill-btn,
html[data-a11y-view="comfort"] .fk-setup-input,
html[data-a11y-view="comfort"] .fk-setup .pill-btn,
html[data-a11y-view="comfort"] .fk-setup-toggle,
html[data-a11y-view="comfort"] .fk-empty-cta .pill-btn {
  min-height: 44px;
}

html[data-a11y-view="comfort"] .fk-die.fk-die--pending {
  min-width: 44px;
  min-height: 44px;
}

html[data-a11y-view="contrast"] .fk-die.is-selected,
html[data-a11y-view="contrast"] .fk-die.fk-die--pending {
  border-width: 2px;
}

html[data-a11y-view="comfort"] .fk-bust-stamp,
html[data-a11y-view="comfort"] .fk-over-stamp {
  padding: 12px 22px 14px;
}

html[data-a11y-view="comfort"] .fk-bust-stamp strong,
html[data-a11y-view="comfort"] .fk-over-stamp strong {
  font-size: 1.85rem;
}

html[data-a11y-view="contrast"] .fk-die,
html[data-a11y-view="contrast"] .fk-score-strip__seat,
html[data-a11y-view="contrast"] .fk-setup-input,
html[data-a11y-view="contrast"] .fk-setup-toggle,
html[data-a11y-view="contrast"] .fk-bust-stamp,
html[data-a11y-view="contrast"] .fk-over-stamp {
  border-width: 2px;
}

html[data-a11y-view="contrast"] .fk-die.is-scrapable {
  box-shadow: 0 0 0 3px var(--accent, #0078d4);
}

html[data-a11y-view="contrast"] .fk-bust-stamp,
html[data-a11y-view="contrast"] .fk-over-stamp {
  border-width: 4px;
  background: var(--surface, #fff);
}

html[data-theme="dark"] .fk-app .fk-fly--streak .crib-score-fly__msg,
html[data-theme="soft"] .fk-app .fk-fly--streak .crib-score-fly__msg,
html[data-theme="glass"] .fk-app .fk-fly--streak .crib-score-fly__msg {
  color: var(--fk-gold, #e6c15a);
  background: color-mix(in srgb, var(--surface, #1c1f28) 88%, #000);
}

html[data-a11y-view="contrast"] .fk-app .fk-fly--streak .crib-score-fly__msg {
  border-width: 2px;
  color: var(--fk-gold, #d4a017);
}

html[data-a11y-view="comfort"] .fk-app .fk-fly--streak .crib-score-fly__msg {
  font-size: 1.65rem;
}

html[data-a11y-view="comfort"] .fk-app .fk-fly--infinity .crib-score-fly__msg {
  font-size: 1.85rem;
}

html[data-theme="dark"] .fk-die,
html[data-theme="soft"] .fk-die,
html[data-theme="glass"] .fk-die,
html[data-theme="dark"] .fk-setup-input,
html[data-theme="soft"] .fk-setup-input,
html[data-theme="glass"] .fk-setup-input,
html[data-theme="dark"] .fk-setup-toggle,
html[data-theme="soft"] .fk-setup-toggle,
html[data-theme="glass"] .fk-setup-toggle {
  color-scheme: dark;
}

html[data-theme="glass"] .fk-app {
  --fk-felt: color-mix(in srgb, #1e3a5f 35%, var(--surface, transparent));
  --fk-die: color-mix(in srgb, var(--surface, #fff) 70%, transparent);
}

html[data-theme="dark"] .fk-bust-stamp,
html[data-theme="soft"] .fk-bust-stamp,
html[data-theme="glass"] .fk-bust-stamp {
  background: color-mix(in srgb, #b91c1c 28%, var(--surface, #1c1f28));
  color: color-mix(in srgb, #fecaca 55%, var(--text, #fff));
}

html[data-theme="dark"] .fk-over-stamp,
html[data-theme="soft"] .fk-over-stamp,
html[data-theme="glass"] .fk-over-stamp {
  background: color-mix(in srgb, var(--accent, #4ea1ff) 28%, var(--surface, #1c1f28));
  color: color-mix(in srgb, var(--accent, #4ea1ff) 45%, var(--text, #fff));
}

html[data-theme="glass"] .fk-over-stamp {
  backdrop-filter: blur(8px);
}

html[data-theme="glass"] .fk-die,
html[data-theme="glass"] .fk-score-strip__seat,
html[data-theme="glass"] .fk-table,
html[data-theme="glass"] .fk-setup-host,
html[data-theme="glass"] .fk-setup-input,
html[data-theme="glass"] .fk-setup-toggle,
html[data-theme="glass"] .fk-bust-stamp,
html[data-theme="glass"] .fk-over-stamp {
  border-color: var(--glass-edge, var(--border));
  backdrop-filter: blur(8px);
}
