:root {
  --tt-bg: #101418;
  --tt-panel: #182028;
  --tt-panel-2: #202a34;
  --tt-line: #34414f;
  --tt-text: #f4f7fb;
  --tt-muted: #a8b3c0;
  --tt-accent: #2dd4bf;
  --tt-warn: #f97316;
}

body.thinktank-standalone {
  margin: 0;
  background: var(--tt-bg);
}

body.thinktank-standalone {
  overflow-x: hidden;
}

html:fullscreen,
html:-webkit-full-screen {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--tt-bg);
}

html:fullscreen body.thinktank-standalone,
html:-webkit-full-screen body.thinktank-standalone {
  margin: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--tt-bg);
}

html:fullscreen body.thinktank-standalone .tt-app,
html:-webkit-full-screen body.thinktank-standalone .tt-app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.tt-app:fullscreen,
.tt-app:-webkit-full-screen {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
  border-radius: 0;
}

.tt-app.tt-pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: auto;
  border-radius: 0 !important;
}

body.tt-no-scroll {
  overflow: hidden !important;
}

.tt-app {
  min-height: 100vh;
  color: var(--tt-text);
  background: radial-gradient(circle at 50% -10%, #263443 0, var(--tt-bg) 42rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tt-app * {
  box-sizing: border-box;
}

.tt-app button,
.tt-button {
  border: 1px solid var(--tt-line);
  border-radius: 6px;
  background: var(--tt-panel-2);
  color: var(--tt-text);
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tt-app button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.tt-primary {
  background: var(--tt-accent) !important;
  border-color: var(--tt-accent) !important;
  color: #07100f !important;
}

.tt-setup,
.tt-join {
  width: min(92vw, 760px);
  margin: 0 auto;
  padding: 8vh 0;
}

.tt-setup h1,
.tt-join h1 {
  margin: 0 0 24px;
  font-size: clamp(2.3rem, 7vw, 5rem);
}

.tt-setup form,
.tt-join form,
.tt-player-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: rgba(24, 32, 40, .92);
  border: 1px solid var(--tt-line);
  border-radius: 8px;
}

.tt-app label {
  display: grid;
  gap: 6px;
  color: var(--tt-muted);
  font-size: .86rem;
  font-weight: 700;
}

.tt-app input,
.tt-app select,
.tt-app textarea {
  width: 100%;
  border: 1px solid var(--tt-line);
  border-radius: 6px;
  background: #0d1217;
  color: var(--tt-text);
  min-height: 44px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.35;
}

.tt-app textarea {
  min-height: 78px;
}

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

.tt-mode-pick label {
  position: relative;
  display: block;
  min-height: 118px;
  cursor: pointer;
}

.tt-mode-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.tt-mode-pick span {
  display: grid;
  align-content: start;
  height: 100%;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--tt-line);
  border-radius: 8px;
  background: #0d1217;
}

.tt-mode-pick input:checked + span {
  border-color: var(--tt-accent);
  box-shadow: inset 0 0 0 1px var(--tt-accent);
}

.tt-mode-pick strong {
  color: var(--tt-text);
  font-size: 1rem;
}

.tt-mode-pick small {
  color: var(--tt-muted);
  line-height: 1.35;
}

.tt-topic-pick__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tt-topic-pick__row select {
  flex: 1;
  min-width: 0;
}

.tt-topic-dice {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 0 10px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.tt-topic-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.tt-topic-fields label {
  display: grid;
  gap: 6px;
}

.tt-topic-fields input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--tt-line);
  border-radius: 6px;
  background: var(--tt-panel-2);
  color: var(--tt-text);
  font: inherit;
}

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

.tt-setup-grid label input[type="checkbox"] {
  width: 20px;
  min-height: auto;
  height: 20px;
  margin: 0;
  padding: 0;
  justify-self: start;
  accent-color: var(--tt-accent);
}

.tt-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 120px) minmax(130px, 180px);
  gap: 12px;
}

.tt-room-code-pick {
  align-self: end;
  display: grid !important;
  gap: 2px;
  padding: 6px 12px !important;
  min-height: 44px;
}

.tt-room-code-pick small {
  color: var(--tt-muted);
  font-size: .64rem;
  line-height: 1;
  text-transform: uppercase;
}

.tt-room-code-pick strong {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.tt-host,
.tt-play,
.tt-finished {
  min-height: 100vh;
  padding: 22px;
}

.tt-host-head,
.tt-play-head {
  display: grid;
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
}

.tt-host-head--with-brand,
.tt-play-head--with-brand {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.tt-play-head--with-brand.tt-play-head--with-end {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.tt-host-head__topic,
.tt-play-head__topic {
  min-width: 0;
}

.tt-host-head__brand,
.tt-play-head__brand,
.tt-setup-head__brand {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 4px;
}

.tt-head-actions {
  --tt-head-brand-h: clamp(38px, 6vw, 60px);
  --tt-head-brand-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 14px);
}

.tt-info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--tt-head-brand-h);
  height: var(--tt-head-brand-h);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--tt-head-brand-radius);
  background: none;
  box-shadow: none;
  color: var(--tt-text);
  cursor: pointer;
  line-height: 0;
  opacity: .92;
  user-select: none;
  overflow: hidden;
}

.tt-info-link svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tt-info-link:hover,
.tt-info-link:focus-visible,
.tt-audio-toggle:hover,
.tt-audio-toggle:focus-visible,
.tt-fullscreen-toggle:hover,
.tt-fullscreen-toggle:focus-visible {
  opacity: 1;
  filter: brightness(1.12);
  outline: none;
}

.tt-fullscreen-toggle {
  display: none;
}

@media (min-width: 901px) {
  .tt-fullscreen-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--tt-head-brand-h);
    height: var(--tt-head-brand-h);
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: var(--tt-head-brand-radius);
    background: none;
    box-shadow: none;
    color: var(--tt-text);
    cursor: pointer;
    line-height: 0;
    opacity: .92;
    user-select: none;
    overflow: hidden;
  }

  .tt-fullscreen-toggle svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .tt-fullscreen-toggle.is-fullscreen {
    color: var(--tt-accent);
    opacity: 1;
  }
}

.tt-audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--tt-head-brand-h);
  height: var(--tt-head-brand-h);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--tt-head-brand-radius);
  background: none;
  box-shadow: none;
  color: var(--tt-text);
  cursor: pointer;
  line-height: 0;
  opacity: .92;
  user-select: none;
  overflow: hidden;
}

.tt-audio-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tt-audio-toggle.is-silent {
  color: var(--tt-muted);
  opacity: .78;
}

.tt-audio-settings {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--tt-line);
}

.tt-audio-settings__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--tt-text);
}

.tt-audio-settings__row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 1fr) 1fr auto;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0 0 0.65rem;
  color: var(--tt-text);
  font-size: 0.95rem;
}

.tt-audio-settings__label {
  margin: 0;
  font-weight: 600;
  cursor: default;
}

.tt-audio-settings__range {
  width: 100%;
  min-width: 0;
  margin: 0;
  accent-color: var(--tt-accent);
  cursor: pointer;
}

.tt-audio-settings__pct {
  min-width: 2.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--tt-muted);
  font-size: 0.88rem;
}

.tt-audio-settings__note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--tt-muted);
}

.tt-audio-settings__note--warn {
  color: var(--tt-warn);
}

.tt-host-audio-policy,
.tt-setup-audio-policy {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--tt-line);
}

.tt-host-audio-policy .tt-check-option span,
.tt-setup-audio-policy .tt-check-option span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tt-host-audio-policy .tt-check-option small,
.tt-setup-audio-policy .tt-check-option small {
  color: var(--tt-muted);
  font-weight: 400;
  line-height: 1.35;
}

.tt-open-rooms {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tt-line);
}

.tt-open-rooms__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.tt-open-rooms__empty {
  margin: 0;
  color: var(--tt-muted);
  font-size: 0.92rem;
}

.tt-open-rooms__empty[hidden] {
  display: none;
}

.tt-open-rooms__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.tt-open-room {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--tt-line);
  border-radius: 10px;
  background: var(--tt-panel, rgba(255, 255, 255, 0.04));
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.tt-open-room:hover,
.tt-open-room:focus-visible {
  border-color: var(--tt-accent, #6cf);
  outline: none;
}

.tt-open-room__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.tt-open-room__code {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.tt-open-room__status {
  font-size: 0.82rem;
  color: var(--tt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tt-open-room__meta {
  font-size: 0.9rem;
  color: var(--tt-muted);
}

.tt-open-room__players {
  font-size: 0.88rem;
  line-height: 1.35;
}

.tt-open-room__players-label {
  color: var(--tt-muted);
}

.tt-open-rooms__actions {
  margin: 1rem 0 0;
}

.tt-open-rooms__start-own {
  width: 100%;
}

.tt-setup-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.tt-setup-head h1 {
  margin: 0;
}

.tt-brand-inline {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  border-radius: var(--tt-head-brand-radius, 8px);
  overflow: hidden;
}

.tt-brand-inline:hover,
.tt-brand-inline:focus-visible {
  filter: brightness(1.08);
}

.tt-head-actions .tt-brand-inline img {
  display: block;
  height: var(--tt-head-brand-h, clamp(38px, 6vw, 60px));
  max-height: var(--tt-head-brand-h, clamp(38px, 6vw, 60px));
  max-width: min(180px, 28vw);
  width: auto;
  object-fit: contain;
  border-radius: var(--tt-head-brand-radius, 8px);
}

.tt-brand-inline img {
  display: block;
  max-height: clamp(32px, 5vw, 52px);
  max-width: min(150px, 26vw);
  width: auto;
  height: auto;
  object-fit: contain;
}

.tt-brand-corner {
  display: none !important;
}

.tt-lobby-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.tt-room--compact strong {
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
}

.tt-rule-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tt-rule-options label,
.tt-host-only,
.tt-check-option {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--tt-line);
  border-radius: 8px;
  background: #0d1217;
  color: var(--tt-text);
}

.tt-rule-options input,
.tt-host-only input,
.tt-check-option input {
  width: 18px;
  min-height: 18px;
}

.tt-host-head h1,
.tt-play-head h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: .95;
}

.tt-host-head p,
.tt-play-head p {
  margin: 8px 0 0;
  color: var(--tt-muted);
  font-size: clamp(1rem, 1.6vw, 1.55rem);
}

.tt-play-head small {
  display: block;
  color: var(--tt-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tt-room {
  position: relative;
  text-align: center;
  border: 1px solid var(--tt-line);
  background: var(--tt-panel);
  border-radius: 8px;
  padding: 12px 18px;
}

.tt-room small {
  display: block;
  color: var(--tt-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.tt-room strong {
  display: block;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1;
}

.tt-room-code-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: stretch;
}

.tt-room-code {
  display: grid !important;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 12px 18px;
}

.tt-room-code.is-copied {
  border-color: var(--tt-accent);
  background: color-mix(in srgb, var(--tt-accent) 24%, var(--tt-panel)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-accent) 28%, transparent);
}

.tt-share {
  width: 58px;
  min-height: 100%;
  padding: 0;
}

.tt-share svg {
  width: 30px;
  height: 30px;
}

.tt-share.is-copied {
  background: var(--tt-accent) !important;
  border-color: var(--tt-accent) !important;
  color: #07100f !important;
}

.tt-end-room {
  width: 100%;
  min-height: 76px;
}

.tt-end-room strong {
  font-size: clamp(1.25rem, 2.2vw, 2rem);
}

.tt-qr {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #07100f;
  overflow: hidden;
}

.tt-qr svg {
  width: 112px;
  height: 112px;
  border-radius: 6px;
}

.tt-qr-action {
  cursor: pointer;
}

.tt-lobby-qr-board {
  position: relative;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 2px;
  width: min(100%, calc(100vh - 190px));
  min-width: 0;
  aspect-ratio: var(--tt-cols, 12) / var(--tt-rows, 12);
  margin: 0 auto;
  padding: clamp(6px, 1.2vw, 10px) !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #000 !important;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  overflow: hidden;
}

.tt-lobby-qr-board__top {
  display: inline-flex;
  align-self: center;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  max-width: 100%;
  margin: 0;
  padding: 0 2px 1px;
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  line-height: 1;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.tt-lobby-room-code {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #000;
  font-size: 1em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .1em;
  cursor: pointer;
  user-select: none;
}

.tt-lobby-room-code.is-copied {
  opacity: .55;
}

.tt-lobby-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 0.82em;
  height: 0.82em;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #000;
  cursor: pointer;
  line-height: 0;
}

.tt-lobby-share svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tt-lobby-share.is-copied {
  opacity: .55;
}

.tt-lobby-qr-board__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.tt-lobby-qr-board__qr svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tt-lobby-qr-board__mode {
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 0 4px 1px;
  color: #000;
  pointer-events: none;
  line-height: 1;
}

.tt-lobby-qr-board__mode strong {
  font-size: clamp(.7rem, 1.25vw, .85rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .04em;
}

.tt-lobby-qr-board__badge {
  position: absolute;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  display: grid;
  width: clamp(48px, 8vw, 76px);
  height: clamp(48px, 8vw, 76px);
  place-items: center;
  border-radius: 999px;
  background: var(--tt-accent);
  color: #07100f;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 900;
  box-shadow: 0 0 0 5px #fff;
}

.tt-qr-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--tt-accent);
  color: #07100f;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 3px #fff;
}

.tt-stop-symbol {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: #111820;
  color: #fb7185;
  font-size: 4rem;
  font-weight: 900;
}

.tt-local-join {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.tt-local-join__button {
  min-height: 38px;
}

.tt-host-layout,
.tt-play-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(270px, 340px);
  gap: 18px;
}

.tt-finished-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(270px, 340px);
  gap: 18px;
}

.tt-words-side .tt-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tt-close-finished {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: 44px;
  min-height: 44px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.55rem;
  line-height: 1;
}

.tt-finish-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: auto;
  background: rgba(8, 12, 16, .18);
}

.tt-finish-overlay--celebration {
  z-index: 70;
  background: rgba(8, 12, 16, .42);
  pointer-events: none;
}

.tt-confetti-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tt-finish-winner {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 6px;
  justify-items: center;
  width: min(92vw, 640px);
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
}

.tt-finish-winner__name {
  margin: 0;
  font-size: clamp(2.4rem, 11vw, 5.2rem);
  line-height: 1.05;
  font-weight: 900;
  color: #f6d365;
  background: linear-gradient(180deg, #fff7c2 0%, #f6d365 38%, #d4a017 72%, #b8860b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(212, 160, 23, .55)) drop-shadow(0 0 28px rgba(255, 236, 160, .35));
}

.tt-finish-winner__wins {
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fde68a;
  text-shadow: 0 0 18px rgba(251, 191, 36, .45);
}

.tt-finish-winner__meta {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(.9rem, 2.4vw, 1.1rem);
  font-weight: 700;
}

.tt-cell.is-celebration-flash {
  animation: tt-celebration-cell 0.42s ease-out;
  z-index: 2;
}

.tt-word-list__item.is-celebration-word button {
  border-color: #fbbf24 !important;
  background: color-mix(in srgb, #fbbf24 28%, var(--tt-panel-2)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, #fbbf24 40%, transparent);
}

@keyframes tt-celebration-cell {
  0% {
    filter: brightness(1);
    box-shadow: none;
  }
  35% {
    filter: brightness(1.85);
    box-shadow: inset 0 0 0 2px #fde047, 0 0 16px rgba(251, 191, 36, .65);
  }
  100% {
    filter: brightness(1.2);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35);
  }
}

.tt-finish-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(92vw, 520px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(15, 22, 29, .94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .45);
  text-align: center;
}

.tt-finish-card small {
  color: var(--tt-accent);
  font-weight: 800;
  text-transform: uppercase;
}

.tt-finish-card strong {
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.tt-finish-card p {
  margin: 0;
  color: var(--tt-muted);
  font-weight: 800;
}

.tt-board,
.tt-board-wrap,
.tt-words-side {
  min-width: 0;
}

.tt-board-wrap {
  width: 100%;
  max-width: 100%;
}

.tt-board-wrap,
.tt-words-side {
  position: sticky;
  top: 12px;
  align-self: start;
}

.tt-words-side {
  max-height: calc(100vh - 44px);
  overflow: hidden;
}

.tt-words-side .tt-word-list ol {
  max-height: calc(100vh - 110px);
}

.tt-grid {
  --tt-grid-line: rgba(255, 255, 255, .12);
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(var(--tt-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--tt-rows), minmax(0, 1fr));
  width: min(100%, calc(100vh - 150px));
  max-width: 100%;
  min-width: 0;
  aspect-ratio: var(--tt-cols) / var(--tt-rows);
  margin: 0 auto;
  border: 1px solid var(--tt-line);
  background: #0b1015;
  overflow: hidden;
}

.tt-grid .tt-cell {
  --tt-cell-grid-line: inset 0 0 0 1px var(--tt-grid-line);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0 !important;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #121922 !important;
  color: var(--tt-text) !important;
  font-size: clamp(0.45rem, calc(100cqw / var(--tt-cols, 16) * 0.68), 1.55rem);
  line-height: 1;
  text-align: center;
  touch-action: manipulation;
  box-shadow: var(--tt-cell-grid-line);
}

@supports not (width: 1cqw) {
  .tt-grid .tt-cell {
    font-size: clamp(0.5rem, 2.2vw, 1.55rem);
  }
}

.tt-cell.is-filled {
  background: color-mix(in srgb, var(--tt-cell-color) 35%, #111820) !important;
  box-shadow: var(--tt-cell-grid-line);
}

.tt-app.tt-show-filled-color-bar .tt-cell.is-filled {
  box-shadow: var(--tt-cell-grid-line), inset 0 -3px 0 var(--tt-cell-color);
}

.tt-cell.is-crossing {
  outline: 2px solid #facc15;
  outline-offset: -3px;
}

.tt-cell.is-aim {
  background: color-mix(in srgb, var(--tt-accent) 28%, #121922) !important;
  box-shadow: var(--tt-cell-grid-line), inset 0 0 0 2px color-mix(in srgb, var(--tt-accent) 58%, transparent);
}

.tt-cell.is-aim-remote {
  background: color-mix(in srgb, #f8fafc 18%, #121922) !important;
  box-shadow: var(--tt-cell-grid-line), inset 0 0 0 2px rgba(248, 250, 252, .2);
}

.tt-cell.is-aim-remote-start {
  outline: 2px solid rgba(248, 250, 252, .72);
  outline-offset: -3px;
}

.tt-cell.is-aim-start {
  background: color-mix(in srgb, var(--tt-accent) 45%, #121922) !important;
  outline: 3px solid var(--tt-accent);
  outline-offset: -3px;
}

.tt-cell.is-word-highlight {
  outline: 3px solid #ef4444 !important;
  outline-offset: -3px;
  box-shadow: var(--tt-cell-grid-line), inset 0 0 0 2px #fecaca;
  z-index: 2;
}

.tt-cell.is-remove-flash {
  animation: tt-remove-flash .9s ease-out;
}

@keyframes tt-remove-flash {
  0%,
  65% {
    background: #ef4444 !important;
    color: #fff !important;
    box-shadow: var(--tt-cell-grid-line), inset 0 0 0 3px #fecaca;
  }
  100% {
    box-shadow: var(--tt-cell-grid-line);
  }
}

.tt-grid:not(.tt-grid--tap) {
  cursor: text;
}

.tt-grid:not(.tt-grid--tap) .tt-cell {
  pointer-events: none;
}

.tt-grid--tap {
  width: min(100%, calc(100vh - 190px));
}

.tt-grid--tap .tt-cell {
  cursor: crosshair;
  pointer-events: auto;
  transition: background .12s ease, box-shadow .12s ease, filter .12s ease;
}

.tt-grid--cell-hover.tt-grid--tap .tt-cell:not(.is-filled):not(.is-aim):not(.is-aim-start):is(.is-cell-hover, :focus-visible) {
  background: color-mix(in srgb, var(--tt-accent) 20%, #1a2836) !important;
  box-shadow: var(--tt-cell-grid-line), inset 0 0 0 1px color-mix(in srgb, var(--tt-accent) 45%, transparent);
}

.tt-grid--cell-hover.tt-grid--tap .tt-cell.is-filled:not(.is-aim):not(.is-aim-start):is(.is-cell-hover, :focus-visible) {
  background: color-mix(in srgb, var(--tt-cell-color) 48%, #243040) !important;
  filter: brightness(1.18);
}

.tt-cell.is-selected {
  outline: 3px solid var(--tt-accent);
  outline-offset: -3px;
}

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

.tt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tt-score {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tt-score li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--tt-line);
  border-radius: 8px;
  background: var(--tt-panel);
}

.tt-score li.is-inactive {
  opacity: .48;
  filter: grayscale(1);
}

.tt-score li.is-self-player {
  border-color: var(--tt-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tt-accent) 42%, transparent);
}

.tt-score small {
  grid-column: 2 / -1;
  color: var(--tt-muted);
}

.tt-score-name {
  display: inline-flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.tt-idle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tt-muted);
  font-size: .78rem;
  font-weight: 800;
}

.tt-idle button {
  width: 24px;
  min-height: 24px;
  padding: 0 !important;
  border-radius: 50% !important;
  color: #fee2e2;
  background: #7f1d1d !important;
  border-color: #991b1b !important;
  line-height: 1;
}

.tt-word-list {
  display: grid;
  gap: 8px;
}

.tt-word-list h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tt-word-list__count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--tt-muted);
}

.tt-word-list ol {
  display: grid;
  gap: 6px;
  max-height: 240px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.tt-word-list button {
  width: 100%;
  min-height: 42px;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
}

.tt-word-list__item.is-word-active button,
.tt-word-list__item.is-pending-delete button,
.tt-word-list button:not(:disabled):hover {
  border-color: #ef4444;
  background: color-mix(in srgb, #ef4444 20%, var(--tt-panel-2));
}

.tt-word-list__item.is-pending-delete button {
  box-shadow: 0 0 0 2px color-mix(in srgb, #ef4444 45%, transparent);
}

.tt-word-list button:disabled {
  opacity: .72;
  cursor: default;
}

.tt-word-list small {
  color: var(--tt-muted);
  white-space: nowrap;
}

.tt-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

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

.tt-stats span {
  min-height: 70px;
  display: grid;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--tt-line);
  border-radius: 8px;
  background: var(--tt-panel);
  font-size: 1.4rem;
  font-weight: 800;
}

.tt-stats small {
  color: var(--tt-muted);
  font-size: .75rem;
  font-weight: 700;
}

.tt-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.tt-cloud b {
  color: var(--tt-accent);
}

.tt-cloud small {
  color: var(--tt-muted);
}

.tt-player {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px;
}

.tt-player header h1 {
  margin: 4px 0;
  font-size: 2.2rem;
}

.tt-player header p,
.tt-muted {
  color: var(--tt-muted);
}

.tt-word-form {
  display: grid;
  gap: 12px;
}

.tt-word-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.tt-word-end-link {
  color: var(--tt-accent);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tt-word-end-link:hover,
.tt-word-end-link:focus-visible {
  text-decoration: underline;
}

.tt-host-end-row {
  margin: 0 0 0.75rem;
  text-align: right;
}

.tt-manual {
  display: grid;
  gap: 10px;
}

.tt-dir {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tt-dir .is-active {
  background: var(--tt-warn) !important;
  border-color: var(--tt-warn) !important;
}

.tt-manual-hint {
  margin: -2px 0 0;
  color: var(--tt-muted);
  font-size: .82rem;
  line-height: 1.35;
}

.tt-grid.is-placement-prompt {
  border-color: var(--tt-accent) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--tt-accent) 55%, transparent),
    0 0 28px color-mix(in srgb, var(--tt-accent) 38%, transparent);
  animation: tt-placement-prompt-grid .7s ease;
}

.tt-word-form button.tt-primary.is-placement-prompt,
.tt-word-form button.tt-primary.is-awaiting-position.is-placement-prompt {
  opacity: 1 !important;
  cursor: pointer;
  background: var(--tt-accent) !important;
  border-color: var(--tt-accent) !important;
  color: #07100f !important;
  animation: tt-placement-prompt-btn .7s ease;
}

.tt-word-form button.tt-primary.is-awaiting-position:disabled {
  opacity: .72;
}

@keyframes tt-placement-prompt-grid {
  0%,
  100% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--tt-accent) 35%, transparent),
      0 0 12px color-mix(in srgb, var(--tt-accent) 22%, transparent);
  }

  45% {
    box-shadow:
      0 0 0 4px var(--tt-accent),
      0 0 32px color-mix(in srgb, var(--tt-accent) 55%, transparent);
  }
}

@keyframes tt-placement-prompt-btn {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }

  45% {
    filter: brightness(1.12);
    transform: scale(1.02);
  }
}

.tt-feedback {
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: #263443;
}

.tt-ended {
  color: var(--tt-accent);
  align-self: center;
}

.tt-panel-title {
  margin: 0;
  font-size: 1.25rem;
}

.tt-hof {
  color: #111827;
}

@media (max-width: 900px) {
  .tt-host,
  .tt-play,
  .tt-finished {
    padding: 10px;
  }

  .tt-host-head,
  .tt-play-head,
  .tt-host-layout,
  .tt-play-layout,
  .tt-finished-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tt-host-head--with-brand,
  .tt-play-head--with-brand {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .tt-host-head h1,
  .tt-play-head h1 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .tt-host-head p,
  .tt-play-head p {
    font-size: .95rem;
  }

  .tt-play-head > div:first-child > small {
    display: none;
  }

  .tt-brand-inline img {
    max-height: 28px;
    max-width: 110px;
  }

  .tt-head-actions {
    --tt-head-brand-h: 34px;
  }

  .tt-board-wrap,
  .tt-words-side {
    position: static;
  }

  .tt-board-wrap {
    order: -1;
  }

  .tt-host-layout > .tt-panel,
  .tt-play-layout > .tt-panel {
    order: 1;
  }

  .tt-host-layout > .tt-words-side,
  .tt-play-layout > .tt-words-side,
  .tt-finished-layout > .tt-words-side {
    order: 2;
  }

  .tt-finished-layout > .tt-panel {
    order: 1;
  }

  .tt-words-side,
  .tt-words-side .tt-word-list ol {
    max-height: none;
  }

  .tt-local-join {
    justify-content: stretch;
  }

  .tt-local-join__button {
    width: 100%;
  }

  .tt-qr:not(.tt-qr-action) {
    display: none;
  }

	  .tt-grid {
	    width: min(100%, calc(100vw - 20px));
	    max-height: min(68vh, calc(100vw - 20px));
	  }

	  .tt-lobby-qr-board {
	    width: min(100%, calc(100vw - 20px));
	    max-height: min(68vh, calc(100vw - 20px));
	  }

	  .tt-lobby-qr-board__top {
	    font-size: clamp(1.35rem, 8vw, 2.1rem);
	  }

  .tt-grid--tap {
    width: min(100%, calc(100vw - 20px));
  }

  .tt-grid .tt-cell {
    font-size: clamp(0.45rem, calc(100cqw / var(--tt-cols, 16) * 0.68), 1rem);
  }

  @supports not (width: 1cqw) {
    .tt-grid .tt-cell {
      font-size: clamp(0.5rem, 4vw, 1rem);
    }
  }

  .tt-panel {
    gap: 10px;
  }

  .tt-setup,
  .tt-join {
    width: min(100% - 20px, 760px);
    padding: 18px 0;
  }

  .tt-setup form,
  .tt-join form,
  .tt-player-card {
    padding: 14px;
  }

	  .tt-mode-pick,
	  .tt-name-row,
	  .tt-setup-grid,
	  .tt-rule-options {
	    grid-template-columns: 1fr;
	  }

  .tt-setup .tt-room-code-pick {
    width: 100%;
    justify-items: center;
    text-align: center;
  }

  .tt-setup .tt-room-code-pick strong {
    font-size: clamp(1.2rem, 5.5vw, 1.55rem);
    letter-spacing: 0.1em;
  }

  .tt-mode-pick label {
    min-height: auto;
  }
}

.tt-credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 4, 14, .72);
  transition: opacity .28s ease, visibility 0s linear .3s;
}

.tt-credits-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.tt-credits-rail {
  position: absolute;
  inset: clamp(12px, 3vw, 34px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transform: translate3d(108%, 0, 0);
  transition: transform .55s cubic-bezier(.32, .72, .25, 1);
}

.tt-credits-overlay.is-open .tt-credits-rail {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.tt-credits-sheet {
  position: relative;
  box-sizing: border-box;
  flex: 0 1 auto;
  width: 100%;
  max-width: min(960px, 100%);
  max-height: min(92dvh, calc(100vh - 24px));
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #f3f7ff;
  background:
    linear-gradient(180deg, rgba(64, 231, 255, .13) 0%, transparent 42%),
    linear-gradient(165deg, rgba(8, 16, 34, .97) 0%, rgba(4, 9, 20, .99) 100%);
  border: 1px solid rgba(135, 216, 255, .22);
  border-radius: 24px;
  box-shadow:
    0 24px 90px rgba(0, 0, 0, .5),
    inset 0 0 100px rgba(60, 120, 255, .08);
}

.tt-credits-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(4, 9, 20, .82);
  color: #fff;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}

.tt-credits-close:hover {
  border-color: var(--tt-accent);
  background: rgba(4, 9, 20, .94);
}

.tt-credits-inner {
  padding: 0 25px;
}

.tt-credits-sheet .tt-audio-settings {
  margin-top: 0;
  padding-top: 0;
  border-bottom-color: rgba(135, 216, 255, .22);
}

.tt-credits-og:not([hidden]) + .tt-credits-close + .tt-credits-inner .tt-audio-settings {
  padding-top: clamp(12px, 2.5vw, 18px);
}

.tt-credits-sheet .tt-audio-settings__row,
.tt-credits-sheet .tt-audio-settings__label {
  color: #f3f7ff;
}

.tt-credits-sheet .tt-audio-settings__pct {
  color: rgba(220, 235, 255, .78);
}

.tt-credits-sheet .tt-audio-settings__note {
  color: rgba(220, 235, 255, .72);
}

.tt-credits-og {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  object-fit: contain;
  object-position: center top;
  background: rgba(0, 0, 0, .22);
  vertical-align: top;
}

.tt-credits-og:not([hidden]) {
  cursor: pointer;
}

.tt-credits-og[hidden] {
  display: none !important;
}

.tt-credits-og:not([hidden]) + .tt-credits-close + .tt-credits-inner {
  padding-top: 0;
}

.tt-credits-body {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(.95rem, 2.2vw, 1.05rem);
  line-height: 1.55;
  color: #c5dbf4;
}

.tt-credits-body a {
  color: #7ee8ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tt-credits-body a:hover {
  color: #dff8ff;
}

.tt-credits-body p {
  margin: 0 0 14px;
}

.tt-credits-body p:last-child {
  margin-bottom: 0;
}

.tt-credits-rule {
  display: block;
  margin: 22px auto 20px;
  max-width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.tt-credits-hub {
  max-width: 100%;
  margin: 0 auto;
  padding-top: 4px;
  text-align: center;
}

.tt-credits-hub-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #f0f6ff;
  font-weight: 800;
  font-size: 1rem;
}

.tt-credits-hub-link:hover {
  color: #dff8ff;
}

.tt-credits-hub-visual img {
  display: block;
  max-height: 56px;
  width: auto;
  max-width: min(100%, 220px);
  object-fit: contain;
}
