:root {
  --bg: #efe3cf;
  --bg-top: #fbf5ec;
  --panel: rgba(255, 250, 242, 0.94);
  --ink: #171411;
  --muted: #6d655a;
  --line: rgba(23, 20, 17, 0.1);
  --accent: #e86635;
  --green: #16695e;
  --soft: #f5d687;
  --shadow: 0 16px 40px rgba(58, 35, 17, 0.12);
  --glow-accent: rgba(232, 102, 53, 0.2);
  --glow-green: rgba(22, 105, 94, 0.16);
  --field-bg: rgba(255, 255, 255, 0.85);
  --card-solid: #fff;
  --pattern: url("/img/pattern-light.png");
  --texture: url("/img/texture-light.webp");
}

body[data-theme="dark"] {
  --bg: #171b21;
  --bg-top: #232831;
  --panel: rgba(30, 35, 43, 0.92);
  --ink: #f5efe6;
  --muted: #b9b1a6;
  --line: rgba(245, 239, 230, 0.12);
  --accent: #ff8a4c;
  --green: #2d9f90;
  --soft: #5a4830;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --glow-accent: rgba(255, 138, 76, 0.16);
  --glow-green: rgba(45, 159, 144, 0.18);
  --field-bg: rgba(18, 22, 29, 0.9);
  --card-solid: rgba(21, 26, 33, 0.96);
  --pattern: url("/img/pattern-dark.png.png");
  --texture: url("/img/texture-dark.webp");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    var(--pattern) 0 0 / 420px 420px repeat,
    var(--texture) 0 0 / 250px 250px repeat,
    radial-gradient(circle at top left, var(--glow-accent), transparent 28%),
    radial-gradient(circle at bottom right, var(--glow-green), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  transition: background 0.22s ease, color 0.22s ease;
}

.app-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 72px 0 24px;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.theme-toggle span:first-child {
  font-size: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-view,
.panel--inner,
.panel--sidebar,
.panel--game,
.topbar {
  padding: 16px;
}

.compact-hero,
.room-line,
.team-tile__head,
.game-header,
.feed__head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.topbar > div:first-child {
  display: grid;
  gap: 6px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  align-self: center;
}

.eyebrow,
.panel__kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
}

.topbar__line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar__line h2 {
  font-size: clamp(1.55rem, 1.8vw, 2rem);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Rubik Mono One", monospace;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 0.95;
}

.auth-hero-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 620px;
}

.hero-note,
.topbar__subtitle,
.auth-status,
.word-card__hint,
.score-row__meta,
.team-tile__members,
.status-pill {
  color: var(--muted);
}

.auth-grid,
.compact-layout,
.team-lobby,
.scoreboard,
.event-log,
.stack-sm,
.mini-grid,
.inline-field,
.controls,
.status-strip,
.panel--sidebar,
.panel--game {
  display: grid;
  gap: 10px;
}

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

.auth-shell {
  display: grid;
  gap: 16px;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 320px;
  gap: 18px;
  align-items: end;
  padding: 6px 4px 2px;
}

.auth-hero__copy {
  display: grid;
  gap: 12px;
}

.auth-hero__copy h1 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  max-width: 8ch;
}

.auth-hero__chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-hero__chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-hero__aside {
  display: grid;
  gap: 12px;
  justify-items: end;
  text-align: right;
  align-self: center;
}

.auth-hero__aside p {
  max-width: 30ch;
  color: var(--muted);
  line-height: 1.5;
}

.auth-card {
  gap: 16px;
  min-height: 280px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  box-shadow: 0 18px 40px rgba(26, 19, 12, 0.08);
}

.auth-card__head {
  display: grid;
  gap: 8px;
}

.auth-card__head h2 {
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  line-height: 1;
}

.auth-card__head p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.auth-card--leader {
  background:
    radial-gradient(circle at top right, rgba(232, 102, 53, 0.1), transparent 24%),
    var(--panel);
}

.auth-card--player {
  background:
    radial-gradient(circle at top right, rgba(22, 105, 94, 0.12), transparent 24%),
    var(--panel);
}

.panel--inner {
  display: grid;
  gap: 12px;
  align-content: start;
}

.panel--inner button {
  justify-self: start;
  min-width: 148px;
}

.compact-layout {
  grid-template-columns: 340px 1fr;
  margin-top: 14px;
  align-items: start;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(23, 20, 17, 0.05);
  border: 1px solid rgba(23, 20, 17, 0.08);
  font-weight: 800;
  font-size: 0.92rem;
}

#room-code {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.topbar__subtitle {
  font-size: 0.95rem;
  line-height: 1.35;
  max-width: 56ch;
  margin: 0;
}

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

.field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(23, 20, 17, 0.12);
  background: var(--field-bg);
  color: var(--ink);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

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

button:not(:disabled):hover,
.ghost-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

button:not(:disabled):active,
.ghost-link:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #ff8c56);
  color: #fff;
}

.accent-button {
  background: var(--green);
  color: #fff;
}

.ghost-button,
.text-button,
.ghost-link {
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
}

.icon-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: 14px;
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 17, 0.04);
  font-size: 1.1rem;
  font-weight: 800;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.icon-chip svg {
  width: 20px;
  height: 20px;
  transition: transform 0.18s ease;
}

.icon-chip::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  opacity: 0;
  transform: scale(0.55);
}

.icon-chip--success {
  background: var(--green);
  border-color: rgba(22, 105, 94, 0.72);
  color: #fff;
  box-shadow:
    0 0 0 6px rgba(22, 105, 94, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  animation: icon-chip-pop 0.42s ease;
}

.icon-chip--success svg {
  animation: icon-chip-hide 1.2s ease forwards;
}

.icon-chip--success::after {
  animation: icon-chip-check 1.2s ease forwards;
}

@keyframes icon-chip-pop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes icon-chip-hide {
  0%,
  18% {
    opacity: 1;
    transform: scale(1);
  }

  30%,
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes icon-chip-check {
  0%,
  20% {
    opacity: 0;
    transform: scale(0.55);
  }

  35%,
  82% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.78);
  }
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  white-space: nowrap;
  padding: 0 16px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
}

.auth-status:empty {
  display: none;
}

.ghost-button--sm {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 0.95rem;
}

.text-button {
  padding: 8px 0 0;
  text-align: left;
}

#leave-room {
  min-height: 44px;
  padding-inline: 20px;
  border-radius: 16px;
  white-space: nowrap;
}

#leave-room {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 17, 0.04);
}

.ghost-button--game-action {
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
}

.ghost-button--pause {
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
}

.ghost-button--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 16px;
}

.ghost-button--icon svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.ghost-button--restart {
  background: linear-gradient(135deg, var(--accent), #ffb15d);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px rgba(255, 138, 76, 0.12);
}

.ghost-button--resume {
  background: linear-gradient(135deg, var(--green), #52cbb4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px rgba(45, 159, 144, 0.14);
}

.ghost-button--icon.ghost-button--restart:hover,
.ghost-button--icon.ghost-button--restart:active,
.ghost-button--icon.ghost-button--resume:hover,
.ghost-button--icon.ghost-button--resume:active {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.team-tile,
.score-row,
.status-strip article,
.feed,
.word-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.team-tile,
.feed,
.status-strip article,
.word-card,
.words-panel {
  padding: 12px;
}

.team-tile__title,
.score-row__name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-tile__title {
  flex: 1 1 auto;
}

.team-tile__head {
  align-items: center;
}

.team-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(23, 20, 17, 0.1);
  background: rgba(23, 20, 17, 0.06);
  font-size: 1.1rem;
  flex: 0 0 auto;
}

button.team-icon {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

button.team-icon:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

button.team-icon:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.team-icon--static {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.team-name-input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(23, 20, 17, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 800;
  color: var(--ink);
}

.team-name-label {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 800;
  line-height: 1.2;
}

.team-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(23, 20, 17, 0.1);
  background: rgba(23, 20, 17, 0.06);
  color: var(--muted);
  line-height: 1;
  flex: 0 0 auto;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.team-edit svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.team-edit:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.team-edit:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.team-tile__members {
  margin-top: -2px;
  line-height: 1.45;
  min-height: 24px;
}

.team-member--self {
  font-weight: 800;
  color: var(--ink);
}

.team-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(43, 167, 142, 0.2);
  background: rgba(43, 167, 142, 0.12);
  color: #14725f;
  line-height: 1;
  flex: 0 0 auto;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.team-join svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.team-join:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.team-join:not(:disabled):active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.team-join--leave {
  background: rgba(195, 64, 52, 0.12);
  border-color: rgba(195, 64, 52, 0.16);
  color: #8c3028;
}

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

.inline-field {
  grid-template-columns: 1fr auto;
}

.timer {
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: center;
  background: rgba(23, 20, 17, 0.94);
  color: #fff;
  font-family: "Rubik Mono One", monospace;
  font-size: 1rem;
}

.word-card {
  min-height: 180px;
  align-content: center;
  justify-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 241, 222, 0.86)),
    linear-gradient(135deg, rgba(232, 102, 53, 0.08), rgba(22, 105, 94, 0.08));
}

.word-card__topline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 800;
  text-align: center;
}

.word-card__team {
  color: var(--ink);
  font-size: 1.5rem;
}

.word-card__player {
  color: var(--muted);
  font-size: 1rem;
}

.word-card__word {
  text-align: center;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
}

.word-card__hint {
  text-align: center;
}

#current-word[data-private="true"] {
  letter-spacing: 0.08em;
  color: var(--muted);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.controls > button {
  width: min(240px, 100%);
}

.event-log {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.event-log li,
.score-row {
  padding: 10px 12px;
}

.event-log__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.event-log__item--correct {
  background: rgba(22, 105, 94, 0.14);
  border-color: rgba(22, 105, 94, 0.28);
}

.event-log__item--skip {
  background: rgba(195, 64, 52, 0.12);
  border-color: rgba(195, 64, 52, 0.24);
}

.event-log__item--challenged {
  box-shadow: inset 0 0 0 2px rgba(237, 133, 32, 0.95);
  border-color: rgba(237, 133, 32, 0.9);
}

.event-log__word {
  font-weight: 800;
}

.event-log__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-log__status {
  font-size: 0.9rem;
  color: var(--muted);
}

.event-log__button {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(23, 20, 17, 0.08);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.winner-banner {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 214, 135, 0.3);
  border: 1px solid rgba(245, 214, 135, 0.6);
  font-weight: 800;
}

.words-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.words-panel__status {
  color: var(--muted);
  line-height: 1.35;
}

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

#open-words-packs {
  grid-column: 1 / -1;
}

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

.packs-list__item {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(23, 20, 17, 0.1);
  border-radius: 16px;
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.packs-list__item--active {
  background: rgba(22, 105, 94, 0.14);
  border-color: rgba(22, 105, 94, 0.28);
  color: var(--green);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 17, 0.34);
  backdrop-filter: blur(3px);
}

.modal__card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(85vh, 920px);
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(23, 20, 17, 0.1);
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 24px 60px rgba(23, 20, 17, 0.2);
  overflow: hidden;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal__body {
  display: grid;
  gap: 10px;
  max-height: calc(85vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}

.modal__body p {
  line-height: 1.45;
}

.help-intro {
  display: grid;
  gap: 8px;
}

.help-section {
  border: 1px solid rgba(23, 20, 17, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.help-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 800;
}

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

.help-section summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.08);
  font-size: 18px;
  line-height: 1;
}

.help-section[open] summary::after {
  content: "−";
}

.help-section__content {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.help-rule {
  display: grid;
  gap: 6px;
}

.help-rule strong {
  font-size: 15px;
}

.help-examples {
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: 14px;
  background: rgba(23, 20, 17, 0.03);
  overflow: hidden;
}

.help-examples summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--muted);
}

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

.help-examples p {
  padding: 0 12px 12px;
}

.help-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

body[data-theme="dark"] #room-code,
body[data-theme="dark"] .team-tile,
body[data-theme="dark"] .score-row,
body[data-theme="dark"] .status-strip article,
body[data-theme="dark"] .feed,
body[data-theme="dark"] .words-panel,
body[data-theme="dark"] .packs-list__item,
body[data-theme="dark"] .modal__card,
body[data-theme="dark"] .help-section {
  background: rgba(34, 40, 49, 0.92);
  border-color: rgba(245, 239, 230, 0.1);
  box-shadow: none;
}

body[data-theme="dark"] .word-card {
  background:
    linear-gradient(135deg, rgba(34, 40, 49, 0.98), rgba(28, 33, 41, 0.96)),
    linear-gradient(135deg, rgba(255, 138, 76, 0.06), rgba(45, 159, 144, 0.08));
  border-color: rgba(245, 239, 230, 0.1);
}

body[data-theme="dark"] .word-card__team,
body[data-theme="dark"] .word-card__word,
body[data-theme="dark"] .feed__head strong,
body[data-theme="dark"] .team-tile__title,
body[data-theme="dark"] .score-row__name,
body[data-theme="dark"] .winner-banner,
body[data-theme="dark"] .modal__head h3,
body[data-theme="dark"] .help-rule strong {
  color: #f5efe6;
}

body[data-theme="dark"] .word-card__player,
body[data-theme="dark"] .word-card__hint,
body[data-theme="dark"] .event-log__status,
body[data-theme="dark"] .words-panel__status,
body[data-theme="dark"] .team-tile__members,
body[data-theme="dark"] .score-row__meta,
body[data-theme="dark"] .topbar__subtitle,
body[data-theme="dark"] .hero-note,
body[data-theme="dark"] .auth-status,
body[data-theme="dark"] .modal__body p,
body[data-theme="dark"] .help-list {
  color: #b9b1a6;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] .team-name-input {
  background: rgba(19, 24, 31, 0.96);
  border-color: rgba(245, 239, 230, 0.12);
  color: #f5efe6;
}

body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .text-button,
body[data-theme="dark"] .ghost-link,
body[data-theme="dark"] .code-chip,
body[data-theme="dark"] .icon-chip,
body[data-theme="dark"] .team-icon,
body[data-theme="dark"] .team-join,
body[data-theme="dark"] .event-log__button,
body[data-theme="dark"] .packs-list__item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 239, 230, 0.1);
  color: #f5efe6;
  box-shadow: none;
}

body[data-theme="dark"] .ghost-button--restart {
  background: linear-gradient(135deg, var(--accent), #ffb15d);
  border-color: transparent;
  color: #fff;
}

body[data-theme="dark"] .ghost-button--resume {
  background: linear-gradient(135deg, var(--green), #52cbb4);
  border-color: transparent;
  color: #fff;
}

body[data-theme="dark"] .team-join {
  background: rgba(43, 167, 142, 0.2);
  border-color: rgba(67, 204, 176, 0.28);
  color: #dff8f2;
}

body[data-theme="dark"] .team-edit,
body[data-theme="dark"] .team-icon {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 239, 230, 0.1);
  color: #f5efe6;
}

body[data-theme="dark"] .help-examples {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(245, 239, 230, 0.08);
}

body[data-theme="dark"] .help-examples summary {
  color: #b9b1a6;
}

body[data-theme="dark"] .auth-hero__chips span {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe6;
}

body[data-theme="dark"] .auth-card {
  border-color: rgba(245, 239, 230, 0.08);
  box-shadow: none;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(30, 35, 43, 0.96);
  border-color: rgba(245, 239, 230, 0.12);
}

body[data-theme="dark"] .timer {
  background: #11151b;
  color: #fff3e7;
}

body[data-theme="dark"] .event-log__item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(245, 239, 230, 0.1);
}

body[data-theme="dark"] .event-log__item--correct {
  background: rgba(45, 159, 144, 0.18);
  border-color: rgba(45, 159, 144, 0.34);
}

body[data-theme="dark"] .event-log__item--skip {
  background: rgba(195, 64, 52, 0.18);
  border-color: rgba(195, 64, 52, 0.3);
}

body[data-theme="dark"] .winner-banner {
  background: rgba(255, 190, 92, 0.14);
  border-color: rgba(255, 190, 92, 0.34);
}

body[data-theme="dark"] .team-join--leave {
  background: rgba(195, 64, 52, 0.18);
  border-color: rgba(195, 64, 52, 0.3);
  color: #ffd7d1;
}

body[data-theme="dark"] #current-word[data-private="true"] {
  color: #8f9aa6;
}

@media (max-width: 920px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
    padding: 10px 14px;
  }

  .auth-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .auth-grid,
  .compact-layout,
  .controls,
  .mini-grid,
  .compact-hero,
  .topbar__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-hero__copy h1 {
    max-width: 100%;
  }

  .auth-hero__aside {
    justify-items: start;
    text-align: left;
  }

  .auth-hero-actions {
    justify-content: flex-start;
  }

  .inline-field {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar__actions {
    justify-content: stretch;
    align-self: stretch;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  #compact-status,
  #leave-room {
    width: 100%;
    justify-content: center;
  }

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

/* Shared auth hard sync */
.auth-view .auth-card,
.auth-view .panel--inner.auth-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.auth-view .auth-card > .primary-button,
.auth-view .auth-card > .accent-button,
.auth-view .auth-card > button.primary-button,
.auth-view .auth-card > button.accent-button {
  display: inline-flex !important;
  align-self: stretch !important;
  justify-content: center !important;
  width: 100% !important;
  inline-size: 100% !important;
  min-inline-size: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
}
