.games-header,
.visages-detail,
.lobby-shell,
.game-shell {
  display: grid;
  gap: 18px;
}

.games-header {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 18px;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
  gap: 16px;
}

.game-card {
  min-height: 342px;
  display: grid;
  grid-template-rows: 146px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-glow);
}

.game-art {
  display: grid;
  place-items: center;
  background: #111026;
}

.game-art .familles-hub-art {
  width: min(88%, 280px);
  height: 116px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.grammar-clash-hub-art {
  width: min(82%, 210px);
  aspect-ratio: 1.9;
  display: grid;
  place-items: center;
  border: 1px solid rgba(230, 197, 110, 0.46);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 24%, rgba(244, 214, 120, 0.32), transparent 28%),
    linear-gradient(135deg, rgba(143, 92, 255, 0.7), rgba(50, 215, 255, 0.28) 48%, rgba(255, 115, 71, 0.52));
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.12);
}

.grammar-clash-hub-art span {
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(4, 11, 26, 0.72);
  color: var(--gold);
  font-size: 1.65rem;
  font-weight: 950;
  letter-spacing: 0;
}

.game-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.game-body p {
  color: var(--soft);
  margin-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--ice);
  background: rgba(204, 234, 255, 0.13);
  border: 1px solid rgba(204, 234, 255, 0.24);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.visages-detail {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}

.visages-detail h1 {
  font-size: 3.2rem;
  margin: 8px 0 12px;
}

.visages-detail p {
  color: var(--soft);
  font-weight: 850;
}

.detail-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-glow);
}

.prep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.prep-list .eyebrow {
  width: 100%;
}

.detail-panel label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 950;
}

.mode-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}

.mode-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 950;
}

.mode-choice label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
}

.inline-check {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 8px !important;
}

.join-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.grammar-clash-detail h1 {
  max-width: 760px;
}

.grammar-live-shell,
.grammar-live-lobby,
.grammar-live-game {
  min-height: calc(100vh - 32px);
}

.grammar-fullscreen-panel {
  min-height: calc(100vh - 120px);
  display: grid;
  align-content: center;
  gap: 24px;
}

.grammar-live-hero {
  display: grid;
  gap: 8px;
  max-width: 840px;
}

.grammar-live-hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.7rem);
  line-height: 0.95;
}

.grammar-live-hero p {
  margin: 0;
  color: var(--soft);
  font-weight: 850;
}

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

.grammar-mode-card {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(230, 197, 110, 0.14), rgba(50, 215, 255, 0.08) 48%, rgba(143, 92, 255, 0.12)),
    rgba(10, 24, 46, 0.88);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.grammar-mode-card h2,
.grammar-mode-card p {
  margin: 0;
}

.grammar-mode-card h2 {
  font-size: 1.55rem;
}

.grammar-mode-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.mode-status {
  width: max-content;
  padding: 5px 9px;
  border: 1px solid rgba(230, 197, 110, 0.42);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.mode-meta span {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(204, 234, 255, 0.08);
  color: var(--ice);
  font-size: 0.76rem;
  font-weight: 950;
}

.grammar-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 24, 46, 0.86);
  box-shadow: var(--shadow), var(--inner-glow);
}

.grammar-settings-grid.compact {
  max-width: 680px;
}

.grammar-settings-grid label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-weight: 900;
}

.grammar-settings-grid input,
.grammar-settings-grid select {
  min-height: 46px;
  border: 1px solid rgba(210, 236, 255, 0.22);
  border-radius: 8px;
  background: rgba(4, 11, 26, 0.7);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
}

.grammar-settings-grid .grammar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(230, 197, 110, 0.26);
  border-radius: 8px;
  background: rgba(230, 197, 110, 0.08);
}

.grammar-clash-shell,
.grammar-game-shell {
  --shadow-faction: rgba(143, 92, 255, 0.22);
}

.grammar-lobby-grid,
.grammar-arena-grid,
.grammar-end-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.76fr) minmax(0, 1.24fr);
  align-items: start;
  gap: 16px;
}

.grammar-lobby-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 36, 0.54);
}

.grammar-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  background: rgba(204, 234, 255, 0.08);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
}

.grammar-tab.active {
  border-color: rgba(230, 197, 110, 0.6);
  background: rgba(230, 197, 110, 0.16);
  color: var(--gold);
}

.grammar-lobby-panel {
  display: grid;
  gap: 16px;
}

.grammar-lobby-footer {
  grid-template-columns: minmax(0, 1fr);
}

.grammar-lobby-grid {
  grid-template-columns: minmax(240px, 0.66fr) minmax(0, 1.34fr);
}

.grammar-player-list {
  max-height: 62vh;
  overflow: auto;
}

.grammar-player-card {
  position: relative;
  padding-left: 62px;
  box-shadow: inset 4px 0 0 var(--faction);
}

.avatar-token {
  position: absolute;
  left: 14px;
  top: 18px;
  width: 36px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(230, 197, 110, 0.38);
  border-radius: 50%;
  background: rgba(230, 197, 110, 0.13);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
}

.grammar-clash-top h1 span {
  color: var(--gold);
}

.grammar-setup-panel,
.grammar-action-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-glow);
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}

.faction-card {
  min-height: 126px;
  display: grid;
  gap: 8px;
  justify-items: start;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(210, 236, 255, 0.22);
  border-radius: 8px;
  background: rgba(13, 30, 54, 0.82);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.faction-card:hover {
  transform: translateY(-1px);
  border-color: var(--faction);
}

.faction-card.selected {
  border-color: var(--faction);
  box-shadow: inset 0 -4px 0 var(--faction);
}

.faction-card span {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--faction) 28%, rgba(9, 21, 42, 0.92));
  color: #ffffff;
  font-weight: 950;
}

.faction-card strong,
.faction-card small,
.faction-card em {
  line-height: 1.2;
}

.faction-card small,
.faction-card em {
  color: var(--soft);
  font-weight: 850;
}

.faction-card em {
  font-style: normal;
  font-size: 0.74rem;
}

.faction-detail-card {
  box-shadow: inset 4px 0 0 var(--faction), var(--shadow), var(--inner-glow);
}

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

.faction-detail-list span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid rgba(210, 236, 255, 0.16);
  border-radius: 8px;
  background: rgba(204, 234, 255, 0.08);
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 850;
}

.faction-detail-list b {
  color: var(--text);
}

.quick-rule-grid,
.rules-grid,
.rules-power-grid {
  display: grid;
  gap: 10px;
}

.quick-rule-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-rule-grid span,
.rules-card {
  padding: 12px;
  border: 1px solid rgba(210, 236, 255, 0.17);
  border-radius: 8px;
  background: rgba(10, 24, 45, 0.66);
  color: var(--soft);
  font-weight: 850;
}

.grammar-rules-panel {
  display: grid;
  gap: 14px;
}

.rules-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rules-power-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.rules-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
}

.rules-card p {
  margin: 0;
}

.faction-rule-card {
  box-shadow: inset 3px 0 0 var(--faction);
}

.faction-rule-card span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 950;
}

.grammar-settings-strip,
.grammar-status-strip,
.grammar-gain-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grammar-settings-strip span,
.grammar-gain-row span,
.grammar-status-strip article {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  background: rgba(204, 234, 255, 0.1);
  color: var(--ice);
  font-size: 0.82rem;
  font-weight: 900;
}

.grammar-status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
}

.grammar-status-strip article span {
  color: var(--soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grammar-status-strip article strong {
  color: var(--text);
  font-size: 1.05rem;
}

.grammar-question-panel h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.18;
}

.grammar-question-stage {
  display: grid;
  justify-items: center;
}

.grammar-question-stage .grammar-question-panel {
  width: min(920px, 100%);
}

.grammar-question-screen,
.grammar-feedback-screen,
.grammar-rules-intro {
  min-height: calc(100vh - 230px);
  display: grid;
  place-items: center;
}

.live-question-card,
.grammar-feedback-card,
.grammar-rules-intro {
  width: min(980px, 100%);
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.01)),
    rgba(8, 20, 40, 0.88);
  box-shadow: var(--shadow), var(--inner-glow);
}

.live-question-card h2,
.grammar-feedback-card h2,
.grammar-rules-intro h2 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 5vw, 4rem);
  line-height: 1.05;
}

.grammar-feedback-screen.correct .grammar-feedback-card {
  border-color: rgba(91, 240, 132, 0.48);
  background: linear-gradient(160deg, rgba(91, 240, 132, 0.24), rgba(8, 20, 40, 0.92));
}

.grammar-feedback-screen.incorrect .grammar-feedback-card {
  border-color: rgba(255, 95, 95, 0.48);
  background: linear-gradient(160deg, rgba(255, 95, 95, 0.24), rgba(8, 20, 40, 0.92));
}

.grammar-feedback-card p {
  color: var(--soft);
  font-weight: 850;
}

.grammar-host-live-panel {
  display: grid;
  gap: 14px;
}

.host-progress-grid {
  max-height: 40vh;
}

.grammar-combat-card.answered,
.grammar-combat-card.feedback-correct {
  border-color: rgba(91, 240, 132, 0.42);
}

.grammar-combat-card.feedback-wrong {
  border-color: rgba(255, 95, 95, 0.42);
}

.grammar-combat-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.52fr) minmax(0, 1.48fr);
  align-items: start;
  gap: 16px;
}

.grammar-left-column {
  display: grid;
  gap: 12px;
}

.answer-grid,
.grammar-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.answer-choice,
.grammar-action-button {
  min-height: 58px;
  padding: 12px;
  border: 1px solid rgba(210, 236, 255, 0.22);
  border-radius: 8px;
  background: rgba(19, 43, 74, 0.88);
  color: var(--text);
  text-align: left;
  font-weight: 950;
  cursor: pointer;
}

.answer-choice:hover,
.grammar-action-button:hover {
  border-color: rgba(230, 197, 110, 0.62);
}

.answer-choice:disabled,
.grammar-action-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.grammar-action-button {
  display: grid;
  gap: 4px;
}

.grammar-action-button span {
  color: var(--soft);
  font-size: 0.78rem;
}

.grammar-action-button.faction-power {
  border-color: rgba(230, 197, 110, 0.44);
  background:
    linear-gradient(135deg, rgba(230, 197, 110, 0.16), rgba(143, 92, 255, 0.16)),
    rgba(19, 43, 74, 0.88);
}

.grammar-action-panel.active {
  border-color: rgba(230, 197, 110, 0.5);
  box-shadow: 0 0 0 1px rgba(230, 197, 110, 0.18), 0 0 28px rgba(230, 197, 110, 0.12), var(--shadow);
}

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

.grammar-action-status span {
  padding: 8px;
  border: 1px solid rgba(210, 236, 255, 0.16);
  border-radius: 8px;
  background: rgba(204, 234, 255, 0.08);
  color: var(--ice);
  font-size: 0.78rem;
  font-weight: 950;
}

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

.grammar-action-button.selected {
  border-color: var(--gold);
  background: rgba(230, 197, 110, 0.18);
  box-shadow: inset 0 -4px 0 var(--gold);
}

.compact-cancel {
  min-height: 34px;
  justify-self: start;
}

.grammar-feedback {
  display: grid;
  gap: 10px;
  color: var(--soft);
  font-weight: 850;
}

.grammar-feedback b {
  color: var(--text);
}

.grammar-leaderboard {
  display: grid;
  gap: 8px;
}

.grammar-player-board {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.004)),
    var(--panel);
}

.grammar-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 2px;
}

.grammar-combat-card {
  position: relative;
  min-height: 132px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(210, 236, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 29, 54, 0.84);
  color: var(--text);
  text-align: left;
  box-shadow: inset 4px 0 0 var(--faction);
  transition: transform 140ms ease, border-color 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.grammar-combat-card.targetable {
  cursor: pointer;
  border-color: rgba(230, 197, 110, 0.72);
  box-shadow: inset 4px 0 0 var(--faction), 0 0 0 1px rgba(230, 197, 110, 0.24), 0 0 18px rgba(230, 197, 110, 0.16);
  animation: targetPulse 900ms ease-in-out infinite;
}

.grammar-combat-card.targetable:hover {
  transform: translateY(-2px);
}

.grammar-combat-card.invalid-target {
  opacity: 0.46;
}

.grammar-combat-card.me {
  border-color: rgba(50, 215, 255, 0.42);
}

.grammar-combat-card.eliminated {
  opacity: 0.42;
  filter: grayscale(0.9);
}

.combat-card-top,
.combat-card-stats,
.combat-status-icons {
  display: grid;
  gap: 4px;
}

.combat-card-top small,
.combat-card-stats,
.grammar-combat-card .eliminated-mark {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.combat-card-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.combat-card-stats span {
  min-width: 0;
}

.combat-status-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.combat-status-icons span {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(230, 197, 110, 0.14);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 950;
}

.floating-combat-text {
  position: absolute;
  right: 10px;
  top: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(4, 11, 26, 0.78);
  color: #fff;
  font-weight: 950;
  animation: floatCombat 900ms ease-out forwards;
}

.floating-combat-text.heal,
.floating-combat-text.regrowth {
  color: #9ff7a8;
}

.floating-combat-text.blocked,
.floating-combat-text.shield {
  color: #9edfff;
}

.floating-combat-text.curse,
.floating-combat-text.moonCurse {
  color: #d9b7ff;
}

.grammar-combat-card.effect-attack,
.grammar-combat-card.effect-moonStrike,
.grammar-combat-card.effect-fireBlast {
  animation: hitShake 520ms ease both;
}

.grammar-combat-card.effect-attack::after,
.grammar-combat-card.effect-moonStrike::after,
.grammar-combat-card.effect-fireBlast::after,
.grammar-combat-card.effect-blocked::after,
.grammar-combat-card.effect-heal::after,
.grammar-combat-card.effect-regrowth::after,
.grammar-combat-card.effect-curse::after,
.grammar-combat-card.effect-moonCurse::after,
.grammar-combat-card.effect-speedHack::after,
.grammar-combat-card.effect-timeShift::after,
.grammar-combat-card.effect-shield::after,
.grammar-combat-card.effect-elimination::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0;
  animation: impactFlash 900ms ease-out forwards;
}

.grammar-combat-card.effect-attack::after {
  background: linear-gradient(135deg, transparent 38%, rgba(255, 72, 72, 0.5) 42%, transparent 48%);
}

.grammar-combat-card.effect-moonStrike::after {
  background: radial-gradient(circle, rgba(229, 222, 255, 0.52), rgba(143, 92, 255, 0.18), transparent 68%);
}

.grammar-combat-card.effect-fireBlast::after {
  background: radial-gradient(circle at 50% 45%, rgba(255, 124, 52, 0.62), rgba(255, 50, 36, 0.2), transparent 70%);
}

.grammar-combat-card.effect-blocked::after,
.grammar-combat-card.effect-shield::after {
  background: radial-gradient(circle, rgba(111, 210, 255, 0.5), rgba(230, 197, 110, 0.26), transparent 72%);
}

.grammar-combat-card.effect-heal::after,
.grammar-combat-card.effect-regrowth::after {
  background: radial-gradient(circle at 50% 80%, rgba(91, 240, 132, 0.44), transparent 68%);
}

.grammar-combat-card.effect-curse::after,
.grammar-combat-card.effect-moonCurse::after {
  background: radial-gradient(circle, rgba(143, 92, 255, 0.3), rgba(38, 10, 60, 0.42));
}

.grammar-combat-card.effect-speedHack::after {
  background: repeating-linear-gradient(135deg, rgba(50, 215, 255, 0.38) 0 2px, transparent 2px 10px);
}

.grammar-combat-card.effect-timeShift::after {
  background: radial-gradient(circle at 35% 35%, rgba(244, 214, 120, 0.44), transparent 22%), radial-gradient(circle at 70% 70%, rgba(143, 92, 255, 0.36), transparent 38%);
}

.grammar-combat-card.effect-elimination::after {
  background: rgba(0, 0, 0, 0.34);
}

.personal-effect {
  outline: 2px solid rgba(255, 255, 255, 0.45);
}

.local-impact-popup {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 16px;
  border: 1px solid rgba(230, 197, 110, 0.5);
  border-radius: 8px;
  background: rgba(7, 18, 36, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 950;
  text-align: center;
  animation: localPopup 1600ms ease-out forwards;
}

.grammar-history-log {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 29, 54, 0.84);
}

.grammar-history-list {
  display: grid;
  gap: 7px;
  max-height: 250px;
  overflow: auto;
}

.history-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(210, 236, 255, 0.14);
  border-radius: 8px;
  background: rgba(4, 11, 26, 0.38);
}

.history-entry span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
}

.history-entry p {
  margin: 0;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.history-entry.as-target {
  border-color: rgba(255, 115, 71, 0.56);
  background: rgba(255, 115, 71, 0.11);
}

.history-entry.as-actor {
  border-color: rgba(50, 215, 255, 0.36);
}

/* Moonveil Grammar Clash premium visual system */
.grammar-live-shell,
.grammar-live-lobby,
.grammar-live-game {
  --moon-bg: #050816;
  --moon-panel: rgba(7, 15, 34, 0.88);
  --moon-panel-soft: rgba(12, 28, 58, 0.74);
  --moon-gold: #d9a441;
  --moon-gold-light: #f4d27a;
  --moon-purple: #7b2cbf;
  --moon-shadow: #26104a;
  --moon-green: #1f9b5f;
  --moon-red: #8f1825;
  --moon-cyan: #32d7ff;
  --moon-border: rgba(244, 210, 122, 0.58);
  --moon-glow: 0 0 30px rgba(123, 44, 191, 0.36), 0 0 18px rgba(217, 164, 65, 0.2);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.38), rgba(5, 8, 22, 0.76)),
    url("/assets/grammar-clash/backgrounds/mode-select-bg.png") center / cover no-repeat,
    radial-gradient(circle at 72% 12%, rgba(244, 210, 122, 0.2), transparent 7%),
    radial-gradient(circle at 15% 22%, rgba(123, 44, 191, 0.34), transparent 22%),
    radial-gradient(circle at 82% 62%, rgba(38, 16, 74, 0.58), transparent 34%),
    linear-gradient(180deg, #050816 0%, #081b3a 48%, #050816 100%);
}

.grammar-live-shell::before,
.grammar-live-lobby::before,
.grammar-live-game::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 10% 16%, rgba(255, 255, 255, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 26% 8%, rgba(244, 210, 122, 0.78) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 28%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 71% 22%, rgba(123, 44, 191, 0.88) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.62) 0 1px, transparent 2px);
  background-size: 240px 190px;
  opacity: 0.5;
}

.grammar-live-shell::after,
.grammar-live-lobby::after,
.grammar-live-game::after {
  position: absolute;
  inset: auto -10% -18% -10%;
  z-index: -1;
  height: 42%;
  content: "";
  background:
    radial-gradient(ellipse at 50% 100%, rgba(123, 44, 191, 0.38), transparent 62%),
    linear-gradient(180deg, transparent, rgba(5, 8, 22, 0.86));
  pointer-events: none;
}

.MoonveilPanel,
.MoonveilCard,
.MoonveilPlayerCard,
.MoonveilFactionCard,
.grammar-setup-panel,
.grammar-player-board,
.grammar-history-log,
.live-question-card,
.grammar-feedback-card,
.grammar-rules-intro,
.moonveil-code-panel {
  border: 1px solid var(--moon-border);
  background:
    linear-gradient(180deg, rgba(244, 210, 122, 0.055), rgba(123, 44, 191, 0.025)),
    var(--moon-panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), var(--moon-glow);
}

.MoonveilGlowBorder,
.grammar-mode-card.available,
.faction-card.selected,
.grammar-combat-card.targetable {
  box-shadow:
    0 0 0 1px rgba(244, 210, 122, 0.55),
    0 0 26px rgba(123, 44, 191, 0.48),
    0 0 12px rgba(244, 210, 122, 0.34);
}

.MoonveilTitle,
.grammar-live-hero h1,
.moonveil-mini-logo span,
.moonveil-code-panel h1,
.grammar-feedback-card h2,
.grammar-rules-intro h2,
.grammar-clash-top h1 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--moon-gold-light);
  letter-spacing: 0;
  text-shadow: 0 2px 0 #6b431d, 0 0 22px rgba(244, 210, 122, 0.42);
}

.MoonveilButton,
.mode-play-button,
.grammar-live-shell .primary-button,
.grammar-live-lobby .primary-button,
.grammar-live-game .primary-button,
.grammar-live-shell .ghost-button,
.grammar-live-lobby .ghost-button,
.grammar-live-game .ghost-button {
  border: 1px solid rgba(244, 210, 122, 0.62);
  background:
    linear-gradient(180deg, rgba(123, 44, 191, 0.72), rgba(58, 10, 94, 0.92)),
    rgba(12, 28, 58, 0.76);
  color: #fff8d7;
  box-shadow: inset 0 0 18px rgba(244, 210, 122, 0.12), 0 0 16px rgba(123, 44, 191, 0.28);
  text-transform: uppercase;
}

.grammar-live-shell .danger-button,
.grammar-live-lobby .danger-button,
.grammar-live-game .danger-button {
  border-color: rgba(244, 210, 122, 0.5);
  background: linear-gradient(180deg, rgba(74, 22, 38, 0.88), rgba(28, 8, 18, 0.92));
}

.grammar-mode-select,
.grammar-settings-screen,
.grammar-join-screen {
  place-items: center;
  text-align: center;
}

.grammar-live-hero {
  justify-items: center;
  margin-inline: auto;
}

.moonveil-game-logo {
  width: min(420px, 82vw);
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(244, 210, 122, 0.26));
}

.moonveil-game-logo.small {
  width: min(240px, 46vw);
  max-height: 78px;
  justify-self: start;
}

.moonveil-mini-logo img {
  width: 100%;
  max-height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(244, 210, 122, 0.22));
}

.grammar-mode-grid {
  width: min(1180px, 100%);
}

.grammar-mode-card {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  align-content: end;
  border-color: rgba(244, 210, 122, 0.36);
  background:
    radial-gradient(circle at 50% 24%, rgba(123, 44, 191, 0.44), transparent 24%),
    linear-gradient(180deg, rgba(123, 44, 191, 0.34), rgba(5, 8, 22, 0.92) 62%),
    rgba(5, 8, 22, 0.88);
}

.grammar-mode-card.available::before,
.grammar-mode-card.locked::before {
  position: absolute;
  inset: 18px 18px auto;
  height: 132px;
  border: 1px solid rgba(244, 210, 122, 0.22);
  border-radius: 8px;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 210, 122, 0.26), transparent 15%),
    radial-gradient(circle at 50% 50%, rgba(123, 44, 191, 0.68), transparent 42%),
    linear-gradient(135deg, rgba(8, 27, 58, 0.9), rgba(38, 16, 74, 0.72));
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.06);
}

.grammar-mode-card.locked::before {
  filter: grayscale(1);
  opacity: 0.5;
}

.grammar-mode-card h2,
.faction-card strong {
  font-family: Georgia, "Times New Roman", serif;
  color: #fff5cf;
  text-shadow: 0 0 14px rgba(244, 210, 122, 0.22);
}

.mode-play-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 8px;
  font-weight: 950;
}

.mode-play-button.disabled {
  opacity: 0.5;
}

.grammar-settings-grid {
  width: min(900px, 100%);
  border-color: var(--moon-border);
  background: var(--moon-panel);
}

.grammar-settings-grid label span {
  color: var(--moon-gold-light);
}

.grammar-settings-grid input,
.grammar-settings-grid select {
  border-color: rgba(244, 210, 122, 0.32);
  background: rgba(5, 8, 22, 0.82);
}

.moonveil-lobby-frame {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 22px;
  min-height: calc(100vh - 32px);
}

.moonveil-lobby-sidebar,
.moonveil-lobby-main,
.moonveil-lobby-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.moonveil-lobby-sidebar {
  min-height: calc(100vh - 76px);
  padding: 18px;
  border: 1px solid var(--moon-border);
  background: linear-gradient(180deg, rgba(38, 16, 74, 0.58), rgba(5, 8, 22, 0.88));
  box-shadow: var(--moon-glow);
}

.moonveil-mini-logo {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.moonveil-mini-logo span {
  font-size: 2.15rem;
  line-height: 1;
}

.moonveil-mini-logo strong {
  color: var(--moon-gold-light);
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.moonveil-lobby-sidebar .grammar-lobby-tabs {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.moonveil-lobby-sidebar .grammar-tab {
  justify-content: start;
  min-height: 62px;
  padding: 0 18px;
  border-color: rgba(244, 210, 122, 0.28);
  background: rgba(8, 27, 58, 0.64);
  color: #d9d2e8;
  text-align: left;
}

.moonveil-lobby-sidebar .grammar-tab.active {
  background: linear-gradient(90deg, rgba(123, 44, 191, 0.78), rgba(38, 16, 74, 0.56));
  box-shadow: inset 4px 0 0 var(--moon-gold-light), 0 0 18px rgba(123, 44, 191, 0.38);
}

.moonveil-host-card {
  position: relative;
  min-height: 100px;
  display: grid;
  align-content: center;
  gap: 4px;
  margin-top: auto;
  padding: 14px 14px 14px 64px;
  border: 1px solid rgba(244, 210, 122, 0.3);
  background: rgba(5, 8, 22, 0.62);
}

.moonveil-code-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
}

.moonveil-code-panel h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  letter-spacing: 0.18em;
}

.moonveil-code-panel p {
  margin: 0;
  color: #f4ecff;
  font-weight: 850;
}

.moonveil-code-panel b {
  color: #d88cff;
}

.moonveil-lobby-side .lobby-controls {
  display: grid;
  gap: 12px;
}

.moonveil-lobby-side .gold-button {
  min-height: 82px;
  font-size: 1.45rem;
}

.grammar-settings-strip {
  display: grid;
  gap: 10px;
}

.grammar-settings-strip span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.grammar-settings-strip b {
  color: var(--moon-gold-light);
}

.lobby-players-layout {
  grid-template-columns: minmax(0, 1fr);
}

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

.grammar-player-card {
  min-height: 76px;
  border-color: rgba(244, 210, 122, 0.24);
  background: linear-gradient(90deg, rgba(5, 8, 22, 0.88), rgba(12, 28, 58, 0.72));
}

.faction-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.faction-card {
  position: relative;
  min-height: 370px;
  overflow: hidden;
  align-content: end;
  border-color: color-mix(in srgb, var(--faction) 66%, var(--moon-gold) 22%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--faction) 22%, transparent), rgba(5, 8, 22, 0.96) 62%),
    var(--moon-panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 20px color-mix(in srgb, var(--faction) 30%, transparent);
}

.faction-card .faction-emblem {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  border-color: color-mix(in srgb, var(--faction) 70%, var(--moon-gold) 30%);
}

.faction-card .faction-art {
  position: absolute;
  inset: 54px 12px auto;
  width: auto;
  height: 170px;
  border: 1px solid color-mix(in srgb, var(--faction) 60%, var(--moon-gold) 20%);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--faction) 72%, white 8%), transparent 17%),
    radial-gradient(circle at 50% 48%, rgba(5, 8, 22, 0.26), rgba(5, 8, 22, 0.84) 58%),
    linear-gradient(135deg, color-mix(in srgb, var(--faction) 60%, #050816 40%), #050816);
  box-shadow: inset 0 0 36px color-mix(in srgb, var(--faction) 42%, transparent);
}

.faction-card strong,
.faction-card small,
.faction-card em,
.faction-card .selected-badge {
  position: relative;
  z-index: 2;
}

.faction-card strong {
  font-size: 1.2rem;
}

.faction-card .selected-badge {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(244, 210, 122, 0.16);
  color: var(--moon-gold-light);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.grammar-question-screen {
  background:
    radial-gradient(circle at 50% 96%, rgba(123, 44, 191, 0.34), transparent 18%),
    radial-gradient(circle at 80% 22%, rgba(244, 210, 122, 0.12), transparent 12%);
}

.live-question-card {
  text-align: center;
}

.live-question-card h2 {
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid rgba(244, 210, 122, 0.5);
  background: rgba(5, 8, 22, 0.66);
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.answer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.answer-choice {
  min-height: 108px;
  display: grid;
  place-items: center;
  border-width: 2px;
  background: rgba(8, 27, 58, 0.76);
  font-size: clamp(1.35rem, 3.8vw, 2.2rem);
  text-align: center;
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.04);
}

.answer-choice:nth-child(1) {
  border-color: #d96dff;
  background: linear-gradient(180deg, rgba(123, 44, 191, 0.42), rgba(5, 8, 22, 0.76));
}

.answer-choice:nth-child(2) {
  border-color: #32a7ff;
  background: linear-gradient(180deg, rgba(20, 93, 174, 0.42), rgba(5, 8, 22, 0.76));
}

.answer-choice:nth-child(3) {
  border-color: #25e0b8;
  background: linear-gradient(180deg, rgba(20, 143, 117, 0.42), rgba(5, 8, 22, 0.76));
}

.answer-choice:nth-child(4) {
  border-color: #d9a441;
  background: linear-gradient(180deg, rgba(140, 83, 18, 0.46), rgba(5, 8, 22, 0.76));
}

.answer-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(244, 210, 122, 0.22);
}

.answer-choice:disabled {
  transform: none;
}

.grammar-feedback-screen {
  text-align: center;
}

.grammar-feedback-card {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.grammar-feedback-card h2 {
  font-size: clamp(3rem, 9vw, 7rem);
}

.feedback-orb {
  width: min(190px, 40vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 950;
}

.grammar-feedback-screen.correct {
  background: radial-gradient(circle at 50% 38%, rgba(93, 255, 105, 0.34), transparent 28%);
}

.grammar-feedback-screen.correct .feedback-orb {
  color: #b8ff7a;
  box-shadow: 0 0 54px rgba(100, 255, 86, 0.42), inset 0 0 30px rgba(100, 255, 86, 0.18);
}

.grammar-feedback-screen.incorrect {
  background: radial-gradient(circle at 50% 38%, rgba(255, 50, 70, 0.36), transparent 28%);
}

.grammar-feedback-screen.incorrect .feedback-orb {
  color: #ff5757;
  box-shadow: 0 0 54px rgba(255, 50, 70, 0.42), inset 0 0 30px rgba(255, 50, 70, 0.18);
}

.grammar-gain-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.grammar-gain-row span {
  padding: 9px 14px;
  border: 1px solid rgba(244, 210, 122, 0.38);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.58);
  color: var(--moon-gold-light);
  font-weight: 950;
}

.grammar-rules-intro {
  text-align: center;
}

.grammar-action-phase-screen {
  grid-template-columns: minmax(285px, 0.42fr) minmax(0, 1.58fr);
}

.grammar-action-panel {
  border-color: rgba(244, 210, 122, 0.44);
}

.grammar-action-panel.active {
  animation: panelGlow 1800ms ease-in-out infinite;
}

.grammar-action-panel .section-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--moon-gold-light);
}

.grammar-action-button {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  border-color: rgba(244, 210, 122, 0.22);
  background: rgba(5, 8, 22, 0.64);
}

.grammar-action-button span::after {
  content: " ◆";
  color: #c989ff;
}

.grammar-action-button.selected {
  border-color: var(--moon-gold-light);
  background: linear-gradient(90deg, rgba(123, 44, 191, 0.72), rgba(38, 16, 74, 0.56));
}

.grammar-player-board {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.grammar-player-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-height: 64vh;
}

.grammar-combat-card {
  min-height: 260px;
  align-content: start;
  border-color: color-mix(in srgb, var(--faction) 58%, var(--moon-gold) 18%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--faction) 24%, transparent), rgba(5, 8, 22, 0.94) 56%),
    rgba(5, 8, 22, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 18px color-mix(in srgb, var(--faction) 28%, transparent);
}

.combat-avatar-portrait {
  min-height: 106px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--faction) 64%, var(--moon-gold) 18%);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--faction) 65%, white 10%), transparent 24%),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(135deg, color-mix(in srgb, var(--faction) 48%, #050816 52%), #050816);
}

.combat-avatar-portrait > span {
  width: 54px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(5, 8, 22, 0.62);
  color: var(--moon-gold-light);
  font-weight: 950;
}

.combat-avatar-portrait > .account-avatar-media {
  position: relative;
  inset: auto;
  width: min(82%, 92px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.combat-avatar-portrait .account-avatar-img {
  object-position: center 20%;
}

.combat-hp-wrap {
  display: grid;
  gap: 5px;
}

.combat-hp-wrap b {
  color: #fff8d7;
  font-size: 0.86rem;
}

.combat-hp-bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(244, 210, 122, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
}

.combat-hp-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #52e35f, #b9ff75);
  box-shadow: 0 0 10px rgba(82, 227, 95, 0.4);
  transition: width 260ms ease;
}

.combat-card-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grammar-history-log {
  border-color: rgba(244, 210, 122, 0.4);
}

.history-entry.as-actor,
.history-entry.as-target {
  border-color: rgba(244, 210, 122, 0.52);
  background: rgba(123, 44, 191, 0.18);
}

@keyframes panelGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(123, 44, 191, 0.28), 0 0 8px rgba(244, 210, 122, 0.18); }
  50% { box-shadow: 0 0 32px rgba(123, 44, 191, 0.44), 0 0 18px rgba(244, 210, 122, 0.28); }
}

.grammar-live-lobby {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.34), rgba(5, 8, 22, 0.74)),
    url("/assets/grammar-clash/backgrounds/lobby-bg.png") center / cover no-repeat;
}

.grammar-live-game.phase-rules_intro {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.28), rgba(5, 8, 22, 0.72)),
    url("/assets/grammar-clash/backgrounds/mode-select-bg.png") center / cover no-repeat;
}

.grammar-live-game.phase-question {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.24), rgba(5, 8, 22, 0.52)),
    url("/assets/grammar-clash/backgrounds/question-bg.png") center / cover no-repeat;
}

.grammar-live-game.phase-action {
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.2), rgba(5, 8, 22, 0.58)),
    url("/assets/grammar-clash/backgrounds/action-bg.png") center / cover no-repeat;
}

.grammar-live-game.phase-answer_feedback:has(.grammar-feedback-screen.correct) {
  background:
    linear-gradient(180deg, rgba(0, 34, 16, 0.1), rgba(5, 8, 22, 0.32)),
    url("/assets/grammar-clash/feedback/correct-bg.png") center / cover no-repeat;
}

.grammar-live-game.phase-answer_feedback:has(.grammar-feedback-screen.incorrect) {
  background:
    linear-gradient(180deg, rgba(60, 0, 8, 0.1), rgba(5, 8, 22, 0.32)),
    url("/assets/grammar-clash/feedback/incorrect-bg.png") center / cover no-repeat;
}

.avatar-token {
  background-position: center;
  background-size: cover;
}

.faction-card .faction-art {
  background:
    linear-gradient(180deg, transparent, rgba(5, 8, 22, 0.2)),
    var(--faction-art) center / cover no-repeat;
}

.combat-avatar-portrait {
  background:
    linear-gradient(180deg, transparent, rgba(5, 8, 22, 0.2)),
    color-mix(in srgb, var(--faction) 24%, #050816);
}

.grammar-time-shift-prompt {
  color: var(--gold);
  font-weight: 950;
}

@keyframes targetPulse {
  0%, 100% { box-shadow: inset 4px 0 0 var(--faction), 0 0 0 1px rgba(230, 197, 110, 0.2), 0 0 12px rgba(230, 197, 110, 0.12); }
  50% { box-shadow: inset 4px 0 0 var(--faction), 0 0 0 1px rgba(230, 197, 110, 0.52), 0 0 24px rgba(230, 197, 110, 0.28); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  42% { transform: translateX(5px); }
  64% { transform: translateX(-3px); }
  82% { transform: translateX(2px); }
}

@keyframes impactFlash {
  0% { opacity: 0; transform: scale(0.96); }
  18% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

@keyframes floatCombat {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-28px) scale(1.02); }
}

@keyframes localPopup {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  15%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

@media (prefers-reduced-motion: reduce) {
  .grammar-combat-card,
  .grammar-combat-card::after,
  .floating-combat-text,
  .local-impact-popup {
    animation: none !important;
  }
}

/* Moonveil Voca Hunt */
.voca-hunt-hub-art {
  width: min(84%, 230px);
  display: grid;
  place-items: center;
  gap: 10px;
  color: #d9fff7;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.voca-hunt-orb,
.voca-logo-orb {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 255, 224, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), transparent 12%),
    radial-gradient(circle, rgba(49, 218, 184, 0.8), rgba(22, 83, 120, 0.76) 58%, rgba(3, 14, 32, 0.96) 70%);
  box-shadow:
    0 0 0 7px rgba(93, 255, 219, 0.08),
    0 0 34px rgba(75, 236, 204, 0.42),
    inset 0 0 20px rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 1.65rem;
  font-weight: 950;
}

.voca-setup-shell {
  display: grid;
  gap: 24px;
  padding-bottom: 40px;
}

.voca-setup-hero {
  min-height: 250px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(118, 255, 222, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 20%, rgba(83, 235, 203, 0.18), transparent 26%),
    radial-gradient(circle at 8% 94%, rgba(117, 103, 255, 0.22), transparent 34%),
    linear-gradient(125deg, rgba(5, 22, 42, 0.98), rgba(13, 42, 62, 0.94));
  box-shadow: var(--shadow), inset 0 0 60px rgba(255, 255, 255, 0.025);
}

.voca-setup-hero::before,
.voca-game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    radial-gradient(circle at 20% 20%, white 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 50%, white 0 1px, transparent 1.5px),
    radial-gradient(circle at 35% 75%, white 0 1px, transparent 1.5px);
  background-size: 130px 130px, 190px 190px, 230px 230px;
  pointer-events: none;
}

.voca-back-link {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 1;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: rgba(214, 241, 248, 0.72);
  font-weight: 900;
  cursor: pointer;
}

.voca-title-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.voca-title-lockup h1 {
  margin: 3px 0 7px;
  font-size: clamp(3rem, 7vw, 5.7rem);
  line-height: 0.86;
  letter-spacing: -0.065em;
}

.voca-title-lockup p:last-child {
  max-width: 690px;
  margin: 0;
  color: rgba(214, 241, 248, 0.75);
  font-weight: 800;
}

.voca-library-stat {
  position: relative;
  z-index: 1;
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: 16px;
  border: 1px solid rgba(118, 255, 222, 0.2);
  border-radius: 12px;
  background: rgba(2, 16, 31, 0.64);
  text-align: right;
}

.voca-library-stat strong {
  color: #8fffe6;
  font-size: 1.8rem;
}

.voca-library-stat span {
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 900;
}

.voca-setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  align-items: start;
  gap: 20px;
}

.voca-theme-library {
  min-width: 0;
  display: grid;
  gap: 16px;
}

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

.voca-section-heading h2 {
  margin: 3px 0 0;
  font-size: 1.75rem;
}

.voca-search input {
  width: min(270px, 34vw);
  border-color: rgba(134, 223, 215, 0.2);
  background: rgba(6, 23, 42, 0.72);
}

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

.voca-theme-card {
  min-height: 98px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(182, 225, 238, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--theme-accent) 8%, transparent), transparent 45%),
    rgba(7, 24, 44, 0.78);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.voca-theme-card:hover,
.voca-theme-card.selected {
  border-color: color-mix(in srgb, var(--theme-accent) 60%, white 8%);
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--theme-accent) 17%, transparent), transparent 60%),
    rgba(9, 32, 55, 0.96);
  transform: translateY(-1px);
}

.voca-theme-card.selected {
  box-shadow: inset 3px 0 0 var(--theme-accent), 0 10px 26px rgba(0, 0, 0, 0.18);
}

.voca-theme-sigil {
  width: 46px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 55%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-accent) 13%, rgba(3, 14, 30, 0.9));
  color: var(--theme-accent);
  font-size: 1.05rem;
  font-weight: 950;
}

.voca-theme-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.voca-theme-copy strong {
  line-height: 1.15;
}

.voca-theme-copy small {
  overflow: hidden;
  color: var(--soft);
  font-size: 0.71rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-theme-copy em {
  color: color-mix(in srgb, var(--theme-accent) 72%, white);
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 900;
}

.voca-theme-arrow {
  color: var(--theme-accent);
  font-size: 1.5rem;
}

.voca-empty-search {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--soft);
  text-align: center;
}

.voca-expedition-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 13px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 36%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--theme-accent) 22%, transparent), transparent 30%),
    linear-gradient(180deg, rgba(9, 32, 53, 0.98), rgba(4, 19, 36, 0.98));
  box-shadow: var(--shadow), inset 0 0 40px rgba(255, 255, 255, 0.02);
}

.voca-selected-emblem {
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 65%, white 10%);
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--theme-accent) 42%, transparent), transparent 58%),
    rgba(2, 16, 32, 0.76);
  box-shadow: 0 0 32px color-mix(in srgb, var(--theme-accent) 28%, transparent);
}

.voca-selected-emblem span {
  color: var(--theme-accent);
  font-size: 2rem;
  font-weight: 950;
}

.voca-expedition-panel h2 {
  margin: -5px 0 0;
  font-size: 1.65rem;
  line-height: 1.05;
  text-align: center;
}

.voca-expedition-panel > .eyebrow,
.voca-selected-summary {
  margin: 0;
  text-align: center;
}

.voca-selected-summary {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.voca-subtheme-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.voca-subtheme-list span {
  padding: 5px 8px;
  border: 1px solid rgba(190, 230, 239, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(218, 241, 247, 0.75);
  font-size: 0.65rem;
  font-weight: 850;
}

.voca-subtheme-list b {
  color: var(--theme-accent);
}

.voca-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding-top: 4px;
}

.voca-settings label {
  display: grid;
  gap: 5px;
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 900;
}

.voca-settings select {
  min-width: 0;
  font-size: 0.78rem;
}

.voca-format-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.voca-format-strip span {
  padding: 7px 3px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--theme-accent) 8%, rgba(255, 255, 255, 0.03));
  color: rgba(225, 247, 249, 0.72);
  font-size: 0.61rem;
  font-weight: 900;
  text-align: center;
}

.voca-start-button {
  min-height: 52px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 82%, white), color-mix(in srgb, var(--theme-accent) 65%, #06273a));
  color: #041821;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 10px 28px color-mix(in srgb, var(--theme-accent) 17%, transparent);
}

.voca-loading,
.voca-missing-session {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.voca-loading h1,
.voca-missing-session h1 {
  margin: 8px 0 0;
}

.voca-game-shell {
  min-height: calc(100vh - 32px);
  position: relative;
  display: grid;
  grid-template-rows: auto 4px 1fr;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 24%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 72% 42%, color-mix(in srgb, var(--theme-accent) 11%, transparent), transparent 27%),
    radial-gradient(circle at 18% 90%, rgba(117, 96, 255, 0.16), transparent 33%),
    linear-gradient(145deg, #041326, #08283a 52%, #06192e);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.28);
}

.voca-game-topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(197, 233, 242, 0.1);
  background: rgba(2, 14, 29, 0.72);
  backdrop-filter: blur(15px);
}

.voca-exit-button {
  width: 40px;
  aspect-ratio: 1;
  border: 1px solid rgba(207, 237, 244, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 1.4rem;
  cursor: pointer;
}

.voca-game-territory {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.voca-game-territory > span {
  width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 55%, transparent);
  border-radius: 50%;
  color: var(--theme-accent);
  font-weight: 950;
}

.voca-game-territory div {
  min-width: 0;
  display: grid;
}

.voca-game-territory small,
.voca-game-stats small {
  color: rgba(203, 231, 239, 0.55);
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voca-game-territory strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-game-stats {
  display: flex;
  gap: 7px;
}

.voca-game-stats > span {
  min-width: 76px;
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid rgba(204, 237, 244, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.voca-game-stats strong {
  color: #ebfffb;
  font-size: 1rem;
}

.voca-progress-track {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.voca-progress-track span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--theme-accent), #e8fff9);
  box-shadow: 0 0 16px var(--theme-accent);
  transition: width 260ms ease;
}

.voca-game-layout {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 15px;
  padding: 15px;
}

.voca-question-arena {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(420px, 1.45fr);
  align-items: center;
  gap: 24px;
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid rgba(205, 238, 245, 0.09);
  border-radius: 12px;
  background: rgba(2, 14, 29, 0.34);
}

.voca-question-arena.boss {
  border-color: rgba(246, 190, 87, 0.22);
  background:
    radial-gradient(circle at 24% 50%, rgba(244, 158, 74, 0.11), transparent 26%),
    rgba(24, 12, 27, 0.45);
}

.voca-spirit-stage {
  min-height: 340px;
  position: relative;
  display: grid;
  place-items: center;
}

.voca-spirit-ring {
  width: min(260px, 90%);
  aspect-ratio: 1;
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 42%, transparent);
  border-radius: 50%;
  box-shadow: inset 0 0 45px color-mix(in srgb, var(--theme-accent) 11%, transparent), 0 0 40px rgba(0, 0, 0, 0.35);
  animation: vocaRing 14s linear infinite;
}

.voca-spirit-ring::before,
.voca-spirit-ring::after {
  content: "✦  ·  ✧  ·  ✦  ·  ✧";
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: start center;
  border: 1px dashed color-mix(in srgb, var(--theme-accent) 24%, transparent);
  border-radius: 50%;
  color: color-mix(in srgb, var(--theme-accent) 70%, white);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
}

.voca-spirit-ring::after {
  inset: 43px;
  place-items: end center;
  transform: rotate(180deg);
}

.voca-word-spirit {
  width: 122px;
  aspect-ratio: 0.94;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 72%, white 15%);
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.78), transparent 8%),
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--theme-accent) 70%, white 8%), color-mix(in srgb, var(--theme-accent) 48%, #092238) 62%, rgba(2, 17, 33, 0.9));
  box-shadow: 0 0 55px color-mix(in srgb, var(--theme-accent) 34%, transparent), inset 0 -18px 28px rgba(0, 0, 0, 0.25);
  color: white;
  font-size: 2.7rem;
  font-weight: 950;
  animation: vocaFloat 3.4s ease-in-out infinite;
}

.voca-spirit-shadow {
  width: 130px;
  height: 25px;
  position: absolute;
  bottom: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.44);
  filter: blur(7px);
}

.voca-question-card {
  width: 100%;
  max-width: 750px;
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(213, 241, 247, 0.13);
  border-radius: 14px;
  background: rgba(6, 25, 44, 0.84);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22), inset 0 0 38px rgba(255, 255, 255, 0.02);
}

.voca-question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: color-mix(in srgb, var(--theme-accent) 72%, white);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.voca-question-meta span:last-child {
  max-width: 52%;
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-question-instruction {
  margin: 0;
  color: rgba(211, 238, 244, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.voca-question-card > h1 {
  margin: 0;
  color: #f4fffd;
  font-size: clamp(1.55rem, 4vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.voca-visual-cue {
  min-height: 142px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 18px 30px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 34%, transparent);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--theme-accent) 20%, transparent), transparent 58%),
    rgba(1, 15, 29, 0.58);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.025);
}

.voca-visual-cue > span {
  display: grid;
  place-items: center;
  font-size: clamp(3.4rem, 8vw, 5.8rem);
  filter: drop-shadow(0 12px 15px rgba(0, 0, 0, 0.28));
}

.voca-visual-cue.pictogram > span:not(:only-of-type) {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
}

.voca-visual-cue.illustration {
  min-height: 208px;
  gap: 12px;
  padding: 12px 12px 29px;
}

.voca-visual-cue .voca-illustration-tile {
  width: min(172px, 38vw);
  aspect-ratio: 1;
  flex: 0 1 172px;
  border: 1px solid rgba(230, 197, 110, 0.42);
  border-radius: 13px;
  background-image: var(--voca-atlas);
  background-position: var(--voca-atlas-x) var(--voca-atlas-y);
  background-size: calc(var(--voca-atlas-columns) * 100%) calc(var(--voca-atlas-rows) * 100%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  filter: none;
}

.voca-visual-cue.illustration .voca-illustration-tile:not(:only-of-type) {
  width: min(124px, 20vw);
  flex-basis: 124px;
}

.voca-visual-cue small {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  color: color-mix(in srgb, var(--theme-accent) 72%, white);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voca-question-clue,
.voca-active-hint {
  margin: -5px 0 0;
  color: var(--soft);
  font-weight: 850;
}

.voca-active-hint {
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(230, 197, 110, 0.25);
  border-radius: 8px;
  background: rgba(230, 197, 110, 0.08);
  color: var(--gold);
  font-size: 0.76rem;
}

.voca-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.voca-answer-option {
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(204, 236, 243, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #edfffb;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.voca-answer-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--theme-accent) 58%, transparent);
  background: color-mix(in srgb, var(--theme-accent) 10%, rgba(255, 255, 255, 0.04));
  transform: translateY(-1px);
}

.voca-answer-option > span {
  width: 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--theme-accent);
  font-size: 0.72rem;
  font-weight: 950;
}

.voca-answer-option strong {
  line-height: 1.22;
}

.voca-answer-option.eliminated {
  opacity: 0.18;
  filter: grayscale(1);
}

.voca-write-form {
  display: grid;
  gap: 7px;
}

.voca-write-form label {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.voca-write-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.voca-write-form input {
  min-height: 54px;
  font-size: 1.05rem;
}

.voca-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
}

.voca-feedback.correct {
  border-color: rgba(92, 244, 188, 0.34);
  background: rgba(40, 182, 131, 0.1);
}

.voca-feedback.incorrect {
  border-color: rgba(255, 125, 137, 0.32);
  background: rgba(195, 65, 83, 0.1);
}

.voca-feedback-mark {
  width: 40px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1.35rem;
  font-weight: 950;
}

.voca-feedback div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.voca-feedback p,
.voca-feedback small {
  margin: 0;
  color: rgba(218, 242, 246, 0.72);
  font-size: 0.77rem;
}

.voca-feedback p b {
  color: white;
}

.voca-codex-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(205, 238, 245, 0.1);
  border-radius: 12px;
  background: rgba(2, 15, 30, 0.68);
}

.voca-codex-heading {
  display: flex;
  justify-content: space-between;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.voca-codex-heading strong {
  color: var(--theme-accent);
}

.voca-codex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.voca-codex-spirit {
  min-height: 56px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(204, 236, 243, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.voca-codex-spirit b {
  width: 20px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(219, 241, 246, 0.42);
  font-size: 0.65rem;
}

.voca-codex-spirit small {
  overflow: hidden;
  color: rgba(215, 239, 244, 0.5);
  font-size: 0.59rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.voca-codex-spirit.mastered {
  border-color: color-mix(in srgb, var(--theme-accent) 35%, transparent);
  background: color-mix(in srgb, var(--theme-accent) 8%, transparent);
}

.voca-codex-spirit.mastered b {
  background: var(--theme-accent);
  color: #04212a;
}

.voca-codex-spirit.mastered small {
  color: #eafffa;
}

.voca-codex-spirit.fragile {
  border-color: rgba(255, 152, 117, 0.24);
}

.voca-codex-spirit.fragile b {
  color: #ffb299;
}

.voca-inventory {
  display: grid;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid rgba(205, 238, 245, 0.08);
}

.voca-inventory p {
  margin: 0 0 2px;
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.voca-inventory > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(206, 234, 240, 0.44);
  font-size: 0.68rem;
  font-weight: 850;
}

.voca-inventory > span.active {
  color: #eafffa;
}

.voca-inventory b {
  width: 22px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218, 244, 247, 0.12);
  border-radius: 50%;
  color: var(--gold);
  font-size: 0.61rem;
}

.voca-hint-button {
  min-height: 40px;
  margin-top: 2px;
  font-size: 0.72rem;
}

.voca-artifact-screen,
.voca-results-shell {
  min-height: calc(100vh - 32px);
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--theme-accent) 20%, transparent), transparent 27%),
    radial-gradient(circle at 50% 100%, rgba(113, 94, 255, 0.18), transparent 35%),
    linear-gradient(155deg, #061529, #0b2c3e);
  text-align: center;
}

.voca-artifact-screen h1,
.voca-results-shell h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: -0.055em;
}

.voca-artifact-screen > p,
.voca-results-shell > p {
  margin: 0;
  color: var(--soft);
  font-weight: 850;
}

.voca-artifact-portal,
.voca-results-emblem {
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 55%, white 10%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--theme-accent) 40%, transparent), rgba(2, 17, 33, 0.9) 68%);
  box-shadow: 0 0 55px color-mix(in srgb, var(--theme-accent) 28%, transparent);
}

.voca-artifact-portal span,
.voca-results-emblem span {
  color: white;
  font-size: 2.2rem;
  font-weight: 950;
}

.voca-artifact-grid {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.voca-artifact-grid button {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(210, 241, 246, 0.14);
  border-radius: 13px;
  background: rgba(4, 21, 39, 0.76);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.voca-artifact-grid button:hover {
  border-color: color-mix(in srgb, var(--theme-accent) 62%, transparent);
  transform: translateY(-4px);
}

.voca-artifact-grid button > span {
  width: 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 52%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-accent) 12%, transparent);
  color: var(--theme-accent);
  font-size: 1.35rem;
  font-weight: 950;
}

.voca-artifact-grid small {
  color: var(--soft);
  line-height: 1.45;
}

.voca-result-stats {
  width: min(800px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.voca-result-stats article {
  display: grid;
  gap: 3px;
  padding: 16px;
  border: 1px solid rgba(210, 241, 246, 0.12);
  border-radius: 11px;
  background: rgba(4, 21, 39, 0.66);
}

.voca-result-stats strong {
  color: var(--theme-accent);
  font-size: 1.65rem;
}

.voca-result-stats span {
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.voca-review-list {
  width: min(800px, 100%);
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 166, 133, 0.15);
  border-radius: 11px;
  background: rgba(50, 20, 30, 0.25);
  text-align: left;
}

.voca-review-list h2 {
  margin: 0;
  font-size: 1rem;
}

.voca-review-list > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.voca-review-list span {
  display: grid;
  gap: 1px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.voca-review-list small {
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-perfect-run {
  padding: 12px 16px;
  border: 1px solid rgba(84, 241, 182, 0.18);
  border-radius: 9px;
  background: rgba(46, 174, 124, 0.08);
  color: #a7f3d0 !important;
}

.voca-result-actions {
  display: flex;
  gap: 9px;
}

@keyframes vocaRing {
  to { transform: rotate(360deg); }
}

@keyframes vocaFloat {
  0%, 100% { transform: translateY(-7px) rotate(-1deg); }
  50% { transform: translateY(8px) rotate(1deg); }
}

@media (max-width: 1080px) {
  .voca-setup-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .voca-theme-grid {
    grid-template-columns: 1fr;
  }

  .voca-question-arena {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .voca-setup-layout,
  .voca-game-layout {
    grid-template-columns: 1fr;
  }

  .voca-expedition-panel {
    position: static;
    order: -1;
  }

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

  .voca-question-arena {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .voca-spirit-stage {
    min-height: 190px;
  }

  .voca-spirit-ring {
    width: 180px;
  }

  .voca-word-spirit {
    width: 90px;
    font-size: 2rem;
  }

  .voca-spirit-shadow {
    bottom: 12px;
  }

  .voca-codex-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .voca-codex-heading,
  .voca-codex-grid {
    grid-column: 1;
  }

  .voca-inventory,
  .voca-hint-button {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .voca-setup-hero {
    min-height: 330px;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 54px 20px 20px;
  }

  .voca-title-lockup {
    grid-template-columns: 1fr;
  }

  .voca-title-lockup .voca-logo-orb {
    width: 58px;
  }

  .voca-library-stat {
    text-align: left;
  }

  .voca-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .voca-search input,
  .voca-theme-grid {
    width: 100%;
  }

  .voca-theme-grid,
  .voca-answer-grid,
  .voca-artifact-grid,
  .voca-result-stats,
  .voca-review-list > div {
    grid-template-columns: 1fr;
  }

  .voca-settings {
    grid-template-columns: 1fr;
  }

  .voca-game-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .voca-game-stats {
    grid-column: 1 / -1;
  }

  .voca-game-stats > span {
    flex: 1;
    min-width: 0;
  }

  .voca-game-layout {
    padding: 8px;
  }

  .voca-question-arena {
    padding: 10px;
  }

  .voca-question-card {
    padding: 16px;
  }

  .voca-write-form > div,
  .voca-feedback {
    grid-template-columns: 1fr;
  }

  .voca-feedback-mark {
    display: none;
  }

  .voca-codex-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .voca-codex-heading,
  .voca-codex-grid,
  .voca-inventory,
  .voca-hint-button {
    grid-column: 1;
  }

  .voca-artifact-screen,
  .voca-results-shell {
    min-height: calc(100vh - 16px);
    padding: 18px;
  }

  .voca-artifact-grid button {
    min-height: 150px;
  }

  .voca-result-actions {
    width: 100%;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voca-spirit-ring,
  .voca-word-spirit {
    animation: none !important;
  }
}

/* Voca Hunt · cinematic encounter layer */
.voca-no-repeat-note {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0 9px;
  align-items: center;
  margin: 2px 0 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 24%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--theme-accent) 7%, rgba(255, 255, 255, 0.025));
  color: rgba(211, 238, 244, 0.63);
  font-size: 0.7rem;
  line-height: 1.35;
}

.voca-no-repeat-note > span {
  width: 30px;
  aspect-ratio: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 40%, transparent);
  border-radius: 50%;
  color: var(--theme-accent);
  font-size: 1.05rem;
  font-weight: 950;
}

.voca-no-repeat-note b {
  color: #effffc;
  font-size: 0.72rem;
}

.voca-game-shell {
  min-height: calc(100vh - 32px);
  isolation: isolate;
  grid-template-rows: 68px 42px minmax(0, 1fr);
  border-color: rgba(137, 219, 231, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(1, 8, 18, 0.84) 0%, rgba(2, 13, 27, 0.53) 40%, rgba(1, 9, 21, 0.74) 100%),
    linear-gradient(180deg, rgba(2, 10, 22, 0.28) 45%, rgba(1, 7, 17, 0.88) 100%),
    url("/assets/voca-hunt/arena-moonveil.webp") center / cover no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 -120px 160px rgba(0, 0, 0, 0.35),
    0 24px 80px rgba(0, 0, 0, 0.4);
}

.voca-game-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(130, 226, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 226, 237, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent 12%, black 66%, transparent 100%);
  pointer-events: none;
}

.voca-game-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 20% 62%, color-mix(in srgb, var(--theme-accent) 18%, transparent), transparent 26%);
  pointer-events: none;
}

.voca-ambient-layer,
.voca-ambient-layer span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.voca-ambient-layer {
  z-index: 0;
  overflow: hidden;
}

.voca-ambient-layer span {
  width: 3px;
  height: 3px;
  top: 72%;
  left: 18%;
  border-radius: 50%;
  background: #d6ffff;
  box-shadow: 0 0 14px 4px color-mix(in srgb, var(--theme-accent) 65%, transparent);
  animation: vocaMote 7s ease-in-out infinite;
}

.voca-ambient-layer span:nth-child(2) {
  top: 32%;
  left: 67%;
  animation-delay: -2.5s;
  animation-duration: 10s;
}

.voca-ambient-layer span:nth-child(3) {
  top: 84%;
  left: 84%;
  animation-delay: -5s;
  animation-duration: 8s;
}

.voca-game-topbar {
  z-index: 5;
  gap: 15px;
  padding: 10px 18px;
  border-bottom-color: rgba(171, 225, 234, 0.12);
  background: linear-gradient(90deg, rgba(1, 9, 20, 0.92), rgba(3, 20, 36, 0.78), rgba(1, 9, 20, 0.92));
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(24px) saturate(1.2);
}

.voca-exit-button {
  width: 42px;
  position: relative;
  display: grid;
  place-items: center;
  border-color: rgba(200, 237, 243, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.025);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.voca-exit-button:hover {
  border-color: rgba(255, 158, 167, 0.45);
  background: rgba(166, 49, 68, 0.14);
  transform: rotate(4deg) scale(1.04);
}

.voca-exit-button span {
  transform: translateY(-1px);
}

.voca-game-territory {
  gap: 12px;
}

.voca-game-territory > .voca-territory-sigil {
  width: 44px;
  position: relative;
  border-color: color-mix(in srgb, var(--theme-accent) 62%, white 8%);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--theme-accent) 22%, transparent), rgba(3, 20, 35, 0.92) 68%);
  box-shadow: 0 0 24px color-mix(in srgb, var(--theme-accent) 23%, transparent), inset 0 0 13px rgba(255, 255, 255, 0.04);
}

.voca-game-territory small {
  margin-bottom: 2px;
  color: color-mix(in srgb, var(--theme-accent) 55%, rgba(205, 233, 240, 0.58));
  letter-spacing: 0.12em;
}

.voca-game-territory strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.voca-game-stats {
  gap: 8px;
}

.voca-game-stats > span {
  min-width: 86px;
  padding: 7px 12px;
  border-color: rgba(201, 235, 241, 0.12);
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.voca-game-stats > span.charged {
  border-color: rgba(237, 195, 105, 0.42);
  background: linear-gradient(155deg, rgba(237, 195, 105, 0.12), rgba(255, 255, 255, 0.018));
  box-shadow: 0 0 22px rgba(237, 195, 105, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.voca-game-stats strong {
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.voca-game-stats .charged strong {
  color: #ffe3a1;
}

.voca-route-progress {
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(175, 225, 235, 0.08);
  background: rgba(1, 10, 22, 0.68);
  backdrop-filter: blur(18px);
}

.voca-route-progress > span {
  color: rgba(208, 236, 241, 0.52);
  font-size: 0.59rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.voca-route-progress > strong {
  min-width: 58px;
  color: #effffc;
  font-size: 0.82rem;
  text-align: right;
}

.voca-route-progress > strong small {
  color: rgba(207, 235, 240, 0.45);
  font-size: 0.62rem;
}

.voca-progress-track {
  height: 6px;
  overflow: visible;
  border: 1px solid rgba(206, 239, 244, 0.08);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.voca-progress-track i {
  height: 100%;
  position: relative;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--theme-accent) 78%, #5fd9ff), #e4fff8);
  box-shadow: 0 0 16px color-mix(in srgb, var(--theme-accent) 55%, transparent);
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.voca-progress-track i::after {
  content: "";
  width: 10px;
  aspect-ratio: 1;
  position: absolute;
  top: 50%;
  right: -4px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 12px var(--theme-accent);
  transform: translateY(-50%);
}

.voca-game-layout {
  z-index: 2;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 14px;
  padding: 14px;
}

.voca-question-arena {
  min-height: 660px;
  position: relative;
  display: block;
  padding: 46px clamp(16px, 2.4vw, 32px) 24px;
  overflow: hidden;
  border-color: rgba(196, 234, 241, 0.15);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(1, 10, 22, 0.52), rgba(3, 18, 31, 0.16) 42%, rgba(1, 9, 21, 0.35)),
    radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--theme-accent) 17%, transparent), transparent 26%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32), 0 18px 45px rgba(0, 0, 0, 0.22);
}

.voca-question-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 0 30%, rgba(138, 232, 240, 0.028) 45%, transparent 60%);
  pointer-events: none;
}

.voca-question-arena.boss {
  border-color: rgba(237, 193, 103, 0.3);
  background:
    linear-gradient(90deg, rgba(18, 7, 20, 0.68), rgba(20, 13, 27, 0.25) 48%, rgba(10, 6, 18, 0.48)),
    radial-gradient(circle at 19% 52%, rgba(237, 166, 81, 0.22), transparent 29%);
  box-shadow: inset 0 0 90px rgba(108, 44, 34, 0.18), 0 18px 45px rgba(0, 0, 0, 0.28);
}

.voca-question-arena.feedback-correct {
  animation: vocaSuccessPulse 620ms ease both;
}

.voca-question-arena.feedback-incorrect {
  animation: vocaMissPulse 520ms ease both;
}

.voca-arena-status {
  position: absolute;
  top: 14px;
  right: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(212, 239, 243, 0.52);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voca-live-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--theme-accent) 65%, white);
}

.voca-live-chip i {
  width: 6px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 10px var(--theme-accent);
  animation: vocaSignal 1.8s ease-in-out infinite;
}

.voca-encounter-grid {
  min-height: 590px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 0.48fr) minmax(480px, 1.52fr);
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
}

.voca-spirit-stage {
  min-height: 430px;
  isolation: isolate;
}

.voca-spirit-aura {
  width: min(340px, 110%);
  aspect-ratio: 1;
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--theme-accent) 20%, transparent), transparent 67%);
  filter: blur(2px);
  animation: vocaAura 4.5s ease-in-out infinite;
}

.voca-spirit-ring {
  width: min(286px, 100%);
  border-color: color-mix(in srgb, var(--theme-accent) 54%, transparent);
  background:
    radial-gradient(circle, transparent 55%, color-mix(in srgb, var(--theme-accent) 9%, transparent) 56% 63%, transparent 64%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--theme-accent) 45%, transparent) 0 1deg, transparent 1deg 23deg);
  box-shadow: inset 0 0 58px color-mix(in srgb, var(--theme-accent) 12%, transparent), 0 0 60px rgba(0, 0, 0, 0.25);
  animation-duration: 22s;
}

.voca-spirit-ring::before,
.voca-spirit-ring::after {
  inset: 22px;
  border-color: color-mix(in srgb, var(--theme-accent) 35%, transparent);
  color: color-mix(in srgb, var(--theme-accent) 80%, white);
  text-shadow: 0 0 8px var(--theme-accent);
}

.voca-spirit-ring::after {
  inset: 51px;
}

.voca-word-spirit {
  width: 138px;
  position: relative;
  border-color: color-mix(in srgb, var(--theme-accent) 78%, white 12%);
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.92), transparent 5%),
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--theme-accent) 92%, white 8%), color-mix(in srgb, var(--theme-accent) 43%, #062031) 54%, rgba(2, 12, 27, 0.97) 78%);
  box-shadow:
    0 0 24px color-mix(in srgb, var(--theme-accent) 42%, transparent),
    0 0 72px color-mix(in srgb, var(--theme-accent) 25%, transparent),
    inset 0 -22px 34px rgba(0, 0, 0, 0.32),
    inset 0 2px 0 rgba(255, 255, 255, 0.26);
}

.voca-word-spirit::before,
.voca-word-spirit::after {
  content: "";
  width: 13px;
  height: 5px;
  position: absolute;
  top: 48%;
  border-radius: 50%;
  background: #eaffff;
  box-shadow: 0 0 9px #9dffff;
}

.voca-word-spirit::before { left: 35px; }
.voca-word-spirit::after { right: 35px; }

.voca-word-spirit i {
  position: relative;
  z-index: 1;
  margin-top: 43px;
  font-style: normal;
  font-size: 1.35rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.voca-spirit-shadow {
  width: 152px;
  bottom: 74px;
  background: color-mix(in srgb, var(--theme-accent) 18%, rgba(0, 0, 0, 0.58));
  filter: blur(9px);
}

.voca-spirit-caption {
  max-width: 210px;
  position: absolute;
  bottom: 2px;
  display: grid;
  gap: 4px;
  padding: 9px 13px;
  border: 1px solid rgba(204, 237, 243, 0.12);
  border-radius: 10px;
  background: rgba(1, 11, 24, 0.65);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.22);
  text-align: center;
  backdrop-filter: blur(12px);
}

.voca-spirit-caption small {
  color: color-mix(in srgb, var(--theme-accent) 65%, white);
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voca-spirit-caption strong {
  overflow: hidden;
  color: rgba(235, 252, 250, 0.82);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-question-card {
  max-width: 850px;
  position: relative;
  gap: 15px;
  padding: clamp(20px, 2.3vw, 30px);
  border-color: rgba(193, 231, 238, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(8, 29, 48, 0.93), rgba(3, 16, 32, 0.91)),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--theme-accent) 12%, transparent), transparent 38%);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.065),
    inset 0 0 55px rgba(142, 224, 235, 0.018);
  backdrop-filter: blur(24px) saturate(1.12);
  animation: vocaCardIn 420ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.voca-question-card::before {
  content: "";
  width: 80px;
  height: 2px;
  position: absolute;
  top: -1px;
  left: 28px;
  background: linear-gradient(90deg, var(--theme-accent), transparent);
  box-shadow: 0 0 12px var(--theme-accent);
}

.voca-question-meta {
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(197, 233, 239, 0.09);
}

.voca-question-meta > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.voca-question-meta i {
  width: 26px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 32%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--theme-accent) 8%, transparent);
  color: #edfffc;
  font-style: normal;
  font-size: 0.58rem;
}

.voca-question-presentation {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2.2vw, 26px);
}

.voca-question-card.has-visual .voca-question-presentation {
  grid-template-columns: 210px minmax(0, 1fr);
}

.voca-question-copy {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.voca-question-instruction {
  color: color-mix(in srgb, var(--theme-accent) 35%, rgba(213, 239, 243, 0.72));
  font-size: 0.74rem;
  line-height: 1.4;
}

.voca-question-copy h1 {
  margin: 0;
  color: #f4fffd;
  font-size: clamp(1.7rem, 3vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.voca-prompt-sigil {
  width: 118px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 45%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--theme-accent) 22%, transparent), rgba(2, 13, 29, 0.74) 64%),
    conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--theme-accent) 20%, transparent), transparent 45%);
  box-shadow: 0 0 35px color-mix(in srgb, var(--theme-accent) 14%, transparent), inset 0 0 25px rgba(255, 255, 255, 0.02);
}

.voca-prompt-sigil::before,
.voca-prompt-sigil::after {
  content: "✦";
  position: absolute;
  top: 5px;
  color: color-mix(in srgb, var(--theme-accent) 70%, white);
  font-size: 0.65rem;
}

.voca-prompt-sigil::after {
  top: auto;
  bottom: 5px;
  transform: rotate(45deg);
}

.voca-prompt-sigil span {
  color: #f1fffd;
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-shadow: 0 0 15px var(--theme-accent);
}

.voca-prompt-sigil i {
  position: absolute;
  inset: 13px;
  border: 1px dashed color-mix(in srgb, var(--theme-accent) 32%, transparent);
  border-radius: 50%;
  animation: vocaRing 16s linear infinite reverse;
}

.voca-visual-cue,
.voca-visual-cue.illustration {
  width: 200px;
  min-height: 200px;
  aspect-ratio: 1;
  flex-wrap: wrap;
  align-content: center;
  gap: 7px;
  padding: 10px 10px 27px;
  border-color: color-mix(in srgb, var(--theme-accent) 42%, rgba(226, 195, 115, 0.3));
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--theme-accent) 20%, transparent), transparent 66%),
    linear-gradient(145deg, rgba(8, 29, 48, 0.8), rgba(1, 11, 24, 0.88));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.voca-visual-cue .voca-illustration-tile {
  width: 162px;
  flex: 0 1 162px;
  border-color: rgba(239, 205, 119, 0.5);
  border-radius: 12px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: vocaVisualReveal 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.voca-visual-cue.illustration .voca-illustration-tile:not(:only-of-type) {
  width: 78px;
  flex-basis: 78px;
}

.voca-country-flag {
  width: min(230px, 100%);
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border: 2px solid rgba(239, 205, 119, 0.72);
  border-radius: 12px;
  background: rgba(231, 240, 248, 0.14);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.voca-visual-cue small {
  bottom: 8px;
  color: color-mix(in srgb, var(--theme-accent) 68%, white);
  letter-spacing: 0.14em;
}

.voca-question-clue,
.voca-active-hint {
  margin: 0;
  font-size: 0.78rem;
}

.voca-answer-grid {
  gap: 10px;
}

.voca-answer-option {
  min-height: 72px;
  position: relative;
  grid-template-columns: 36px minmax(0, 1fr) 12px;
  gap: 12px;
  padding: 11px 13px;
  overflow: hidden;
  border-color: rgba(199, 234, 240, 0.14);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.022));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.voca-answer-option::after {
  content: "›";
  color: rgba(220, 242, 246, 0.26);
  font-size: 1.15rem;
  transition: color 160ms ease, transform 160ms ease;
}

.voca-answer-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--theme-accent) 58%, white 6%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 14%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.025));
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-2px) scale(1.006);
}

.voca-answer-option:hover:not(:disabled)::after {
  color: var(--theme-accent);
  transform: translateX(2px);
}

.voca-answer-option > span {
  width: 34px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 28%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--theme-accent) 8%, rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.voca-answer-option strong {
  font-size: 0.86rem;
  font-weight: 850;
}

.voca-write-form {
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(199, 233, 240, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.voca-write-form input {
  border-color: color-mix(in srgb, var(--theme-accent) 26%, rgba(204, 235, 241, 0.14));
  background: rgba(1, 10, 23, 0.72);
}

.voca-feedback {
  min-height: 78px;
  padding: 14px;
  border-radius: 13px;
  animation: vocaFeedbackIn 350ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.voca-feedback.correct {
  border-color: rgba(88, 246, 187, 0.42);
  background: linear-gradient(90deg, rgba(31, 158, 112, 0.18), rgba(34, 104, 91, 0.08));
  box-shadow: inset 3px 0 0 #5af0b8, 0 0 24px rgba(55, 211, 153, 0.07);
}

.voca-feedback.incorrect {
  border-color: rgba(255, 121, 139, 0.4);
  background: linear-gradient(90deg, rgba(171, 47, 69, 0.18), rgba(104, 34, 59, 0.08));
  box-shadow: inset 3px 0 0 #ff8092, 0 0 24px rgba(218, 69, 97, 0.06);
}

.voca-feedback-mark {
  width: 44px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.voca-control-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
  color: rgba(205, 234, 240, 0.36);
  font-size: 0.59rem;
  font-weight: 800;
}

.voca-control-hint b {
  padding: 2px 5px;
  border: 1px solid rgba(208, 238, 243, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(231, 250, 248, 0.72);
}

.voca-codex-panel {
  max-height: calc(100vh - 150px);
  position: relative;
  align-content: start;
  gap: 13px;
  padding: 15px;
  overflow: hidden;
  border-color: rgba(195, 232, 239, 0.16);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(4, 20, 37, 0.91), rgba(1, 11, 24, 0.87));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px) saturate(1.12);
}

.voca-codex-overview {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(196, 231, 238, 0.09);
}

.voca-codex-overview > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.voca-codex-overview small {
  color: color-mix(in srgb, var(--theme-accent) 65%, white);
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voca-codex-overview strong {
  overflow: hidden;
  color: #effffc;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-codex-overview > div:last-child > span {
  color: rgba(202, 232, 238, 0.46);
  font-size: 0.6rem;
}

.voca-route-orb {
  width: 64px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--theme-accent) var(--route-progress), rgba(255, 255, 255, 0.075) 0);
  box-shadow: 0 0 24px color-mix(in srgb, var(--theme-accent) 12%, transparent);
}

.voca-route-orb::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(205, 238, 243, 0.1);
  border-radius: 50%;
  background: #06182a;
}

.voca-route-orb > span {
  z-index: 1;
  color: #f1fffd;
  font-size: 0.92rem;
  font-weight: 950;
}

.voca-route-orb small {
  margin-left: 1px;
  color: rgba(219, 243, 245, 0.5);
  font-size: 0.5rem;
}

.voca-codex-heading {
  padding: 0 2px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.voca-codex-grid {
  max-height: min(350px, 40vh);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--theme-accent) 35%, transparent) transparent;
}

.voca-codex-spirit {
  min-height: 50px;
  border-color: rgba(201, 234, 240, 0.085);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.033), rgba(255, 255, 255, 0.012));
}

.voca-codex-spirit.mastered {
  border-color: color-mix(in srgb, var(--theme-accent) 38%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 12%, transparent), rgba(255, 255, 255, 0.012));
}

.voca-inventory {
  gap: 7px;
}

.voca-inventory > span {
  padding: 5px 7px;
  border: 1px solid rgba(202, 235, 241, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.voca-inventory > span.active {
  border-color: color-mix(in srgb, var(--theme-accent) 28%, transparent);
  background: color-mix(in srgb, var(--theme-accent) 7%, transparent);
}

.voca-hint-button {
  min-height: 43px;
  border-color: color-mix(in srgb, var(--theme-accent) 23%, transparent);
  background: color-mix(in srgb, var(--theme-accent) 6%, rgba(255, 255, 255, 0.025));
}

@keyframes vocaMote {
  0%, 100% { opacity: 0; transform: translate3d(0, 35px, 0) scale(0.7); }
  35%, 68% { opacity: 0.75; }
  60% { transform: translate3d(22px, -45px, 0) scale(1); }
}

@keyframes vocaSignal {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes vocaAura {
  0%, 100% { opacity: 0.6; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes vocaCardIn {
  from { opacity: 0; transform: translate3d(18px, 8px, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes vocaVisualReveal {
  from { opacity: 0; transform: scale(0.9) rotate(-2deg); filter: saturate(0.4); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes vocaFeedbackIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes vocaSuccessPulse {
  0% { box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32); }
  45% { box-shadow: inset 0 0 100px rgba(49, 224, 158, 0.22), 0 0 35px rgba(55, 211, 153, 0.1); }
  100% { box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32); }
}

@keyframes vocaMissPulse {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-3px); box-shadow: inset 0 0 95px rgba(220, 53, 84, 0.17); }
  56% { transform: translateX(3px); }
}

@media (max-width: 1180px) {
  .voca-game-layout {
    grid-template-columns: minmax(0, 1fr) 245px;
  }

  .voca-encounter-grid {
    grid-template-columns: 170px minmax(420px, 1fr);
    gap: 20px;
  }

  .voca-spirit-ring {
    width: 220px;
  }

  .voca-word-spirit {
    width: 112px;
  }

  .voca-word-spirit::before { left: 28px; }
  .voca-word-spirit::after { right: 28px; }

  .voca-question-card.has-visual .voca-question-presentation {
    grid-template-columns: 175px minmax(0, 1fr);
  }

  .voca-visual-cue,
  .voca-visual-cue.illustration {
    width: 168px;
    min-height: 168px;
  }

  .voca-visual-cue .voca-illustration-tile {
    width: 134px;
    flex-basis: 134px;
  }
}

@media (max-width: 960px) {
  .voca-game-shell {
    grid-template-rows: auto 40px minmax(0, 1fr);
  }

  .voca-game-layout {
    grid-template-columns: 1fr;
  }

  .voca-question-arena {
    min-height: 0;
  }

  .voca-encounter-grid {
    min-height: 0;
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .voca-spirit-stage {
    min-height: 310px;
  }

  .voca-spirit-ring {
    width: 190px;
  }

  .voca-spirit-caption {
    max-width: 160px;
  }

  .voca-codex-panel {
    max-height: none;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    align-items: start;
  }

  .voca-codex-overview {
    padding: 0;
    border: 0;
  }

  .voca-codex-heading,
  .voca-codex-grid {
    grid-column: 2;
  }

  .voca-codex-grid {
    max-height: 150px;
  }

  .voca-inventory,
  .voca-hint-button {
    grid-column: 3;
  }
}

@media (max-width: 720px) {
  .voca-game-shell {
    min-height: calc(100vh - 16px);
    border-radius: 12px;
    background-position: 42% center;
  }

  .voca-game-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px 10px;
  }

  .voca-game-stats {
    width: 100%;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .voca-game-stats > span {
    min-width: 0;
    padding: 6px;
  }

  .voca-route-progress {
    padding: 0 12px;
  }

  .voca-route-progress > span {
    display: none;
  }

  .voca-route-progress {
    grid-template-columns: minmax(80px, 1fr) auto;
  }

  .voca-game-layout {
    padding: 7px;
  }

  .voca-question-arena {
    padding: 44px 8px 9px;
    border-radius: 12px;
  }

  .voca-arena-status {
    right: 10px;
    left: 10px;
  }

  .voca-arena-status > span:last-child {
    display: none;
  }

  .voca-encounter-grid {
    grid-template-columns: 1fr;
  }

  .voca-spirit-stage {
    min-height: 155px;
  }

  .voca-spirit-aura { width: 190px; }
  .voca-spirit-ring { width: 145px; }
  .voca-spirit-ring::before { inset: 13px; }
  .voca-spirit-ring::after { inset: 31px; }

  .voca-word-spirit {
    width: 78px;
    font-size: 1.5rem;
  }

  .voca-word-spirit::before,
  .voca-word-spirit::after {
    width: 8px;
    top: 45%;
  }

  .voca-word-spirit::before { left: 20px; }
  .voca-word-spirit::after { right: 20px; }
  .voca-word-spirit i { margin-top: 26px; font-size: 0.9rem; }
  .voca-spirit-shadow { width: 92px; bottom: 18px; }
  .voca-spirit-caption { display: none; }

  .voca-question-card {
    gap: 12px;
    padding: 15px;
    border-radius: 14px;
  }

  .voca-question-meta > span:last-child {
    display: none;
  }

  .voca-question-presentation,
  .voca-question-card.has-visual .voca-question-presentation {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .voca-question-copy {
    justify-items: center;
  }

  .voca-prompt-sigil {
    width: 82px;
  }

  .voca-visual-cue,
  .voca-visual-cue.illustration {
    width: min(200px, 70vw);
    min-height: min(200px, 70vw);
  }

  .voca-answer-grid {
    grid-template-columns: 1fr;
  }

  .voca-answer-option {
    min-height: 60px;
  }

  .voca-write-form > div,
  .voca-feedback {
    grid-template-columns: 1fr;
  }

  .voca-feedback-mark {
    display: none;
  }

  .voca-control-hint {
    justify-content: center;
  }

  .voca-control-hint span:last-child {
    display: none;
  }

  .voca-codex-panel {
    grid-template-columns: 1fr;
  }

  .voca-codex-overview,
  .voca-codex-heading,
  .voca-codex-grid,
  .voca-inventory,
  .voca-hint-button {
    grid-column: 1;
  }

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

@media (prefers-reduced-motion: reduce) {
  .voca-ambient-layer span,
  .voca-live-chip i,
  .voca-spirit-aura,
  .voca-spirit-ring,
  .voca-word-spirit,
  .voca-prompt-sigil i,
  .voca-question-card,
  .voca-visual-cue .voca-illustration-tile,
  .voca-question-arena,
  .voca-feedback {
    animation: none !important;
  }
}

.grammar-rank-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(210, 236, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 24, 45, 0.62);
  box-shadow: inset 3px 0 0 var(--faction, var(--gold));
}

.grammar-rank-row.me {
  border-color: rgba(230, 197, 110, 0.5);
}

.grammar-rank-row span {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.grammar-podium {
  display: grid;
  gap: 14px;
}

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

.podium-row span {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(230, 197, 110, 0.36);
  border-radius: 8px;
  background: rgba(230, 197, 110, 0.1);
  text-align: center;
  font-weight: 950;
}

.podium-row b {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #23190b;
}

.podium-row small {
  color: var(--soft);
  font-size: 0.76rem;
}

.lobby-top,
.game-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.004)),
    var(--panel);
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.54fr) minmax(0, 1.46fr);
  align-items: start;
  gap: 16px;
}

.player-list,
.character-select-grid,
.character-grid {
  display: grid;
  gap: 10px;
}

.player-list {
  grid-template-columns: 1fr;
  align-content: start;
}

.player-card,
.game-player-card,
.question-panel,
.history-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.004)),
    var(--panel);
}

.character-select-grid,
.character-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.character-select-grid {
  grid-auto-rows: 1fr;
}

.character-card {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  padding: 10px;
  color: var(--text);
  background: rgba(18, 39, 64, 0.82);
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.character-card:hover {
  transform: translateY(-1px);
  border-color: rgba(230, 197, 110, 0.46);
}

.character-card.selected {
  border-color: rgba(230, 197, 110, 0.72);
  box-shadow: inset 0 -4px 0 var(--gold);
}

.character-card.eliminated {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.portrait-token {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(2, 8, 19, 0), rgba(2, 8, 19, 0.18)),
    var(--portrait-src) var(--portrait-x) var(--portrait-y) / var(--portrait-size, 400% 400%) no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.character-card strong {
  line-height: 1.05;
  min-height: 2.1em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.character-card small {
  color: var(--soft);
  line-height: 1.1;
}

.character-card em {
  color: rgba(216, 232, 255, 0.78);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.25;
}

.character-select-grid .character-card {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(2.1em, auto);
}

.lobby-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 8px;
  margin-top: 12px;
}

.gold-button {
  background: linear-gradient(135deg, #e6c56e, #f4df9a);
  color: #07101f;
}

.lobby-status {
  align-self: center;
  color: var(--soft);
  font-weight: 850;
}

.visages-game-active .app-sidebar {
  display: none;
}

.visages-game-active .app-shell {
  margin-left: 0;
}

.visages-game-active .page {
  width: min(1760px, calc(100% - 34px));
  padding-top: 22px;
}

.game-shell {
  grid-template-columns: 1fr;
  gap: 10px;
}

.game-top {
  min-height: 76px;
  align-items: center;
  padding: 10px 14px;
}

.game-top h1 {
  margin: 2px 0 5px;
  font-size: 1.9rem;
}

.game-top p:not(.eyebrow) {
  margin: 0;
  color: var(--soft);
  font-size: 0.92rem;
  font-weight: 850;
}

.game-top .ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

.board-area {
  display: grid;
  gap: 10px;
  overflow-x: visible;
}

.match-strip,
.game-control-deck {
  display: grid;
  gap: 10px;
}

.match-strip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.7fr);
}

.match-player,
.match-state {
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.82);
}

.match-player strong,
.match-state strong {
  display: block;
  margin: 2px 0;
  font-size: 1.35rem;
  line-height: 1.05;
}

.match-player span,
.match-state span {
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 850;
}

.match-player.active-turn {
  border-color: rgba(117, 228, 193, 0.58);
  box-shadow: inset 4px 0 0 var(--green);
}

.match-player.active-turn .eyebrow,
.match-player.active-turn strong {
  color: var(--green);
}

.game-control-deck {
  grid-template-columns: minmax(340px, 1.2fr) minmax(300px, 0.8fr);
  align-items: start;
}

.game-control-deck .question-panel {
  min-height: 0;
}

.game-control-deck .question-panel:first-of-type:nth-last-of-type(3) {
  grid-column: auto;
}

.game-board {
  position: relative;
  min-height: 620px;
  aspect-ratio: 1672 / 941;
  padding: 0;
  border: 1px solid rgba(198, 228, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(2, 8, 19, 0.02), rgba(2, 8, 19, 0.16)),
    url("/assets/moonveil-faces/board-bg.png") center / 100% 100% no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-board .character-grid {
  position: absolute;
  top: 16%;
  left: 50%;
  width: min(34%, 700px);
  height: auto;
  aspect-ratio: 1;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  grid-auto-rows: unset;
  align-content: center;
  justify-content: center;
  gap: clamp(4px, 0.42vw, 8px);
  box-sizing: border-box;
}

.game-board .character-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  gap: 0;
  grid-template-rows: 1fr;
  aspect-ratio: 1;
  padding: clamp(2px, 0.22vw, 5px);
  overflow: hidden;
  background: rgba(5, 14, 27, 0.28);
  border-color: rgba(223, 238, 255, 0.22);
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(1px);
}

.game-board .character-card:hover {
  transform: translateY(-1px) scale(1.012);
}

.game-board .portrait-token {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.game-board .character-card strong {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 1;
  min-height: 0;
  display: block;
  color: #ffffff;
  font-size: clamp(0.52rem, 0.62vw, 0.76rem);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-board .character-card small {
  display: none;
}

.game-board .character-card em {
  display: none;
}

.familles-detail {
  align-items: stretch;
}

.familles-lobby-shell,
.familles-game-shell {
  gap: 12px;
}

.familles-game-shell {
  position: relative;
}

.familles-turn-banner {
  min-height: 82px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(210, 236, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.88);
  box-shadow: var(--shadow);
}

.familles-turn-banner.is-my-turn {
  border-color: rgba(117, 228, 193, 0.58);
  background:
    linear-gradient(100deg, rgba(117, 228, 193, 0.16), rgba(8, 21, 38, 0.9) 42%),
    rgba(8, 21, 38, 0.88);
}

.familles-turn-banner.is-waiting {
  border-color: rgba(230, 197, 110, 0.34);
}

.familles-turn-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 950;
}

.familles-turn-banner.is-my-turn .familles-turn-symbol {
  color: var(--green);
  animation: famillesTurnPulse 1700ms ease-in-out infinite;
}

.familles-turn-banner > div:not(.familles-deck-counter) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.familles-turn-banner small {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.familles-turn-banner strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-deck-counter {
  min-width: 108px;
  display: grid;
  grid-template-columns: 52px auto;
  gap: 8px;
  align-items: center;
}

.familles-deck-counter > div {
  display: grid;
  line-height: 1;
}

.familles-deck-counter b {
  color: var(--text);
  font-size: 1.45rem;
}

.familles-deck-counter small {
  margin-top: 3px;
}

.familles-deck-stack {
  position: relative;
  width: 42px;
  height: 54px;
  display: block;
}

.familles-deck-stack i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(230, 197, 110, 0.62);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(230, 197, 110, 0.24), rgba(93, 154, 218, 0.18)),
    #0b1d36;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
}

.familles-deck-stack i:nth-child(1) {
  transform: translate(-5px, 3px) rotate(-5deg);
}

.familles-deck-stack i:nth-child(2) {
  transform: translate(3px, 2px) rotate(4deg);
}

.familles-deck-stack i:nth-child(3)::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-style: normal;
}

.familles-player-zone {
  display: grid;
  gap: 8px;
}

.familles-step-heading {
  min-height: 38px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.familles-step-heading > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #07101f;
  font-size: 0.78rem;
  font-weight: 1000;
}

.familles-step-heading > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.familles-step-heading strong {
  color: var(--text);
  line-height: 1.1;
}

.familles-step-heading small {
  overflow: hidden;
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-step-heading.member-step {
  margin-top: 15px;
}

.familles-lobby-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1.5fr);
  gap: 16px;
  align-items: start;
}

.familles-rules-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    var(--panel);
}

.familles-rule-grid,
.familles-score-strip,
.familles-table,
.familles-family-board {
  display: grid;
  gap: 10px;
}

.familles-rule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.familles-rule-grid span {
  min-height: 82px;
  display: grid;
  align-content: center;
  padding: 12px;
  color: var(--soft);
  background: rgba(204, 234, 255, 0.09);
  border: 1px solid rgba(204, 234, 255, 0.17);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.32;
}

.familles-score-strip {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.familles-player-seat {
  position: relative;
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.familles-player-seat.selectable {
  cursor: pointer;
}

.familles-player-seat.selectable:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 197, 110, 0.58);
  background: rgba(21, 43, 69, 0.96);
}

.familles-player-seat.selected-target {
  border-color: var(--gold);
  background:
    linear-gradient(110deg, rgba(230, 197, 110, 0.18), rgba(8, 21, 38, 0.92) 62%),
    rgba(8, 21, 38, 0.9);
  box-shadow: inset 0 -4px 0 var(--gold), var(--shadow);
}

.familles-player-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210, 236, 255, 0.24);
  border-radius: 50%;
  background: rgba(204, 234, 255, 0.12);
  background-position: center;
  background-size: cover;
  color: var(--ice);
  font-size: 0.96rem;
  font-weight: 1000;
}

.familles-player-seat.selected-target .familles-player-avatar {
  border-color: rgba(230, 197, 110, 0.72);
  background-color: rgba(230, 197, 110, 0.2);
  color: var(--gold);
}

.familles-player-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.familles-player-copy small {
  color: var(--soft);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.familles-player-copy strong,
.familles-player-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-player-copy strong {
  color: var(--text);
  font-size: 1rem;
}

.familles-player-copy em {
  color: var(--soft);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.familles-seat-families {
  position: absolute;
  right: 8px;
  bottom: 7px;
  display: flex;
  gap: 3px;
}

.familles-seat-families i {
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.familles-seat-families i.filled {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(230, 197, 110, 0.42);
}

.match-player.winner-turn {
  border-color: rgba(230, 197, 110, 0.72);
  box-shadow: inset 4px 0 0 var(--gold);
}

.familles-table {
  grid-template-columns: minmax(360px, 0.96fr) minmax(320px, 1.04fr);
  align-items: start;
}

.familles-request-panel {
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.familles-family-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 8px;
}

.familles-family-choice {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--family-accent) 42%, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--family-accent) 13%, transparent), transparent 65%),
    rgba(11, 29, 52, 0.9);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.familles-family-choice:hover {
  transform: translateY(-1px);
  border-color: var(--family-accent);
}

.familles-family-choice.selected {
  border-color: var(--family-accent);
  box-shadow: inset 0 -4px 0 var(--family-accent);
}

.familles-family-choice > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--family-accent) 28%, #07101f);
  color: color-mix(in srgb, var(--family-accent) 68%, #fff);
  font-size: 1rem;
}

.familles-family-choice strong {
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.familles-family-choice small {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 950;
}

.familles-member-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(84px, 1fr));
  gap: 8px;
}

.familles-member-choice {
  min-width: 0;
  min-height: 150px;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 5px;
  align-content: start;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--family-accent) 38%, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--family-accent) 16%, transparent), rgba(4, 13, 26, 0.22)),
    rgba(10, 27, 50, 0.92);
  color: var(--text);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.familles-member-choice:not(:disabled):hover {
  transform: translateY(-3px);
  border-color: var(--family-accent);
}

.familles-member-choice.selected {
  border-color: var(--gold);
  box-shadow: inset 0 -4px 0 var(--gold), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.familles-member-choice.owned {
  opacity: 0.58;
  cursor: default;
}

.familles-member-choice:disabled:not(.owned) {
  opacity: 0.48;
  cursor: not-allowed;
}

.familles-member-portrait {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent, rgba(2, 8, 19, 0.14)),
    var(--portrait-src) var(--portrait-x) var(--portrait-y) / var(--portrait-size) no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.familles-member-choice strong,
.familles-member-choice small {
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-member-choice strong {
  font-size: 0.77rem;
}

.familles-member-choice small {
  color: var(--soft);
  font-size: 0.61rem;
  font-weight: 900;
}

.familles-member-choice.selected small {
  color: var(--gold);
}

.familles-action-bar {
  margin-top: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(210, 236, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 13, 27, 0.38);
}

.familles-action-bar.ready {
  border-color: rgba(117, 228, 193, 0.36);
  background: rgba(117, 228, 193, 0.07);
}

.familles-action-bar .familles-request-preview {
  margin: 0;
}

.familles-request-preview small,
.familles-request-preview strong {
  display: block;
}

.familles-request-preview small {
  margin-bottom: 3px;
  color: var(--green);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.familles-request-preview strong {
  color: var(--ice);
  font-size: 0.9rem;
  line-height: 1.28;
}

.familles-ask-button {
  width: 148px;
  min-height: 62px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.familles-ask-button > span {
  font-size: 1.1rem;
}

.familles-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.familles-compose label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 950;
}

.familles-compose select {
  min-width: 0;
}

.familles-compose .primary-button {
  min-height: 44px;
}

.familles-request-preview {
  margin-top: 12px;
  min-height: 50px;
  display: grid;
  align-content: center;
  padding: 10px 12px;
  color: var(--ice);
  background: rgba(117, 228, 193, 0.08);
  border: 1px solid rgba(117, 228, 193, 0.18);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.3;
}

.familles-log {
  min-height: 430px;
}

.familles-log .history-list {
  max-height: 376px;
}

.familles-history-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid rgba(210, 236, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
}

.familles-history-entry > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(204, 234, 255, 0.1);
  color: var(--ice);
  font-size: 0.72rem;
  font-weight: 1000;
}

.familles-history-entry p {
  margin: 0;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.familles-history-entry.family {
  border-color: rgba(230, 197, 110, 0.32);
  background: rgba(230, 197, 110, 0.08);
}

.familles-history-entry.family > span,
.familles-history-entry.good-draw > span {
  color: var(--gold);
}

.familles-history-entry.given {
  border-color: rgba(117, 228, 193, 0.25);
}

.familles-history-entry.given > span {
  color: var(--green);
}

.familles-history-entry.draw > span {
  color: var(--soft);
}

.familles-history-empty {
  color: var(--soft);
}

.compact-heading {
  margin-bottom: 8px;
}

.compact-heading h2 {
  margin-bottom: 0;
  font-size: 1.6rem;
}

.familles-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.familles-card {
  position: relative;
  min-height: 214px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  padding: 9px;
  overflow: hidden;
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--family-accent) 58%, rgba(255, 255, 255, 0.2));
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2)),
    color-mix(in srgb, var(--family-accent) 28%, #07101f);
  box-shadow: var(--shadow);
}

.familles-card.interactive {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

.familles-card.interactive:hover {
  z-index: 2;
  transform: translateY(-5px);
  border-color: var(--family-accent);
  filter: brightness(1.06);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

.familles-card.interactive.selected {
  border-color: var(--gold);
  box-shadow: inset 0 -4px 0 var(--gold), 0 12px 24px rgba(0, 0, 0, 0.25);
}

.familles-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  pointer-events: none;
}

.familles-card-sigil {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  color: color-mix(in srgb, var(--family-accent) 70%, #fff);
  font-size: 1.15rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}

.familles-portrait {
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(2, 8, 19, 0), rgba(2, 8, 19, 0.12)),
    var(--portrait-src) var(--portrait-x) var(--portrait-y) / var(--portrait-size) no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.familles-card div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.familles-card p,
.familles-card h3,
.familles-card strong {
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.familles-card h3 {
  margin: 0;
  color: #fff;
  font-size: 1.04rem;
}

.familles-card strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
}

.familles-family-board {
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
}

.familles-family-card {
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--family-accent) 55%, rgba(255, 255, 255, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--family-accent) 22%, transparent), rgba(255, 255, 255, 0.03)),
    rgba(8, 21, 38, 0.82);
}

.familles-family-card.completed {
  border-color: var(--family-accent);
  box-shadow: inset 0 -4px 0 var(--family-accent);
}

.familles-family-card h3 {
  min-height: 2.2em;
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.1;
}

.familles-family-mini {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.familles-family-mini span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: #07101f;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 1000;
  opacity: 0.45;
}

.familles-family-mini span.owned {
  background: color-mix(in srgb, var(--family-accent) 70%, #fff);
  opacity: 1;
}

.familles-feedback-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 8, 19, 0.54);
  backdrop-filter: blur(5px);
  animation: famillesFeedbackLayer 240ms ease both;
}

.familles-feedback-panel {
  position: relative;
  width: min(460px, 100%);
  min-height: 320px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(117, 228, 193, 0.55);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 10%, rgba(117, 228, 193, 0.2), transparent 48%),
    rgba(7, 18, 36, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), var(--inner-glow);
  text-align: center;
  animation: famillesFeedbackPanel 420ms cubic-bezier(0.2, 0.9, 0.2, 1.15) both;
}

.familles-feedback-layer.draw .familles-feedback-panel {
  border-color: rgba(230, 197, 110, 0.52);
  background:
    radial-gradient(circle at 50% 10%, rgba(230, 197, 110, 0.2), transparent 48%),
    rgba(7, 18, 36, 0.98);
}

.familles-feedback-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(117, 228, 193, 0.16);
  color: var(--green);
  font-size: 1.4rem;
  font-weight: 1000;
}

.familles-feedback-layer.draw .familles-feedback-symbol {
  background: rgba(230, 197, 110, 0.16);
  color: var(--gold);
}

.familles-feedback-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.8rem;
}

.familles-feedback-panel > p:not(.eyebrow) {
  margin: 0;
  color: var(--soft);
  font-weight: 850;
}

.familles-feedback-card {
  width: min(270px, 100%);
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 6px;
  text-align: left;
}

.familles-feedback-card .familles-member-portrait {
  width: 78px;
}

.familles-feedback-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.familles-feedback-card small,
.familles-feedback-card span {
  overflow: hidden;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.familles-feedback-card strong {
  color: var(--text);
  font-size: 1.1rem;
}

.familles-complete-callout {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  padding: 8px 12px;
  border: 1px solid rgba(230, 197, 110, 0.4);
  border-radius: 8px;
  background: rgba(230, 197, 110, 0.12);
}

.familles-complete-callout strong {
  color: var(--gold);
}

.familles-complete-callout span {
  color: var(--ice);
  font-size: 0.78rem;
  font-weight: 900;
}

.familles-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.familles-confetti i {
  --confetti-color: #e6c56e;
  position: absolute;
  top: -12px;
  left: calc(6% + (var(--confetti-index) * 6.6%));
  width: 7px;
  height: 14px;
  background: var(--confetti-color);
  transform: rotate(calc(var(--confetti-index) * 23deg));
  animation: famillesConfetti 1500ms calc(var(--confetti-index) * 35ms) ease-out infinite;
}

.familles-confetti i:nth-child(3n + 1) {
  --confetti-color: #75e4c1;
}

.familles-confetti i:nth-child(3n + 2) {
  --confetti-color: #5fa8ff;
}

@keyframes famillesTurnPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(117, 228, 193, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(117, 228, 193, 0.12);
  }
}

@keyframes famillesFeedbackLayer {
  from {
    opacity: 0;
  }
}

@keyframes famillesFeedbackPanel {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
}

@keyframes famillesConfetti {
  from {
    opacity: 1;
    transform: translateY(-10px) rotate(0);
  }
  to {
    opacity: 0;
    transform: translateY(360px) rotate(540deg);
  }
}

.question-list {
  display: grid;
  gap: 6px;
}

.question-list button {
  min-height: 34px;
  padding: 7px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: left;
}

.answer-row,
.question-compose,
.game-actions {
  display: grid;
  gap: 8px;
}

.answer-row,
.question-compose {
  grid-template-columns: minmax(0, 1fr) 82px 82px;
  align-items: stretch;
}

.question-compose .visages-input {
  grid-column: 1;
  width: 100%;
  min-height: 70px;
}

.question-compose #ask-question-button {
  grid-column: 2 / span 2;
  min-height: 70px;
}

.current-question {
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(191, 227, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.current-question small {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.current-question strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.validation-feedback {
  display: none;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(191, 227, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.validation-feedback:not(:empty) {
  display: grid;
}

.validation-feedback p,
.validation-feedback small {
  margin: 0;
  color: var(--soft);
  font-weight: 850;
}

.validation-feedback strong {
  color: var(--ice);
  font-size: 0.9rem;
}

.validation-feedback.allow {
  border-color: rgba(117, 228, 193, 0.34);
}

.validation-feedback.warn,
.validation-feedback.checking {
  border-color: rgba(230, 197, 110, 0.4);
}

.validation-feedback.block {
  border-color: rgba(242, 139, 130, 0.42);
  background: rgba(242, 139, 130, 0.09);
}

.history-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.game-history {
  margin-top: 2px;
}

.history-list div {
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  color: var(--soft);
}

.result-modal {
  padding: 18px;
  border: 1px solid rgba(230, 197, 110, 0.42);
  border-radius: 8px;
  background: rgba(20, 28, 42, 0.96);
}

@media (max-width: 980px) {
  .visages-detail,
  .lobby-grid,
  .familles-lobby-grid,
  .game-shell,
  .match-strip,
  .game-control-deck,
  .familles-table,
  .familles-compose,
  .familles-rule-grid {
    grid-template-columns: 1fr;
  }

  .lobby-controls,
  .mode-choice,
  .question-compose,
  .answer-row {
    grid-template-columns: 1fr;
  }

  .visages-game-active .page {
    width: min(100% - 20px, 760px);
  }

  .game-top,
  .lobby-top {
    padding: 10px;
  }

  .game-top h1,
  .lobby-top h1 {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

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

  .player-card,
  .question-panel,
  .history-panel {
    padding: 11px;
  }

  .familles-log {
    min-height: 0;
  }

  .familles-log .history-list {
    max-height: 220px;
  }

  .character-select-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
  }

  .character-select-grid .character-card {
    min-height: 178px;
    padding: 8px;
    gap: 6px;
  }

  .board-area {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .game-board {
    width: 100%;
    min-width: min(680px, 178vw);
    min-height: 0;
  }

  .game-board .character-grid {
    top: 15%;
    width: min(46%, 330px);
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .question-compose .visages-input,
  .question-compose #ask-question-button {
    grid-column: auto;
  }

  .familles-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .familles-card {
    min-height: 198px;
  }

  .familles-member-picker {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
  }

  .familles-member-choice {
    min-height: 168px;
  }

  .grammar-lobby-grid,
  .grammar-arena-grid,
  .grammar-end-grid,
  .grammar-combat-layout {
    grid-template-columns: 1fr;
  }

  .grammar-mode-grid,
  .grammar-settings-grid,
  .moonveil-lobby-frame {
    grid-template-columns: 1fr;
  }

  .moonveil-lobby-sidebar {
    min-height: 0;
  }

  .moonveil-lobby-sidebar .grammar-lobby-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .moonveil-lobby-sidebar .grammar-tab {
    justify-content: center;
    min-height: 48px;
    padding: 0 8px;
    text-align: center;
  }

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

  .grammar-action-columns,
  .faction-detail-list {
    grid-template-columns: 1fr;
  }

  .grammar-player-grid {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .lobby-shell,
  .game-shell {
    gap: 10px;
  }

  .player-list {
    grid-template-columns: 1fr;
  }

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

  .player-card h2 {
    margin: 2px 0;
    font-size: 1rem;
  }

  .player-card p {
    margin: 0;
    font-size: 0.82rem;
  }

  .character-select-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .character-select-grid .character-card {
    min-height: 156px;
    padding: 6px;
  }

  .character-select-grid .character-card strong {
    font-size: 0.78rem;
  }

  .match-player,
  .match-state {
    min-height: 0;
    padding: 8px;
  }

  .match-player strong,
  .match-state strong {
    font-size: 1rem;
  }

  .match-player span,
  .match-state span {
    display: block;
    overflow: hidden;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .question-list {
    max-height: 150px;
    overflow: auto;
  }

  .familles-score-strip,
  .familles-family-board {
    grid-template-columns: 1fr;
  }

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

  .familles-card {
    min-height: 184px;
  }

  .familles-card h3 {
    font-size: 0.92rem;
  }

  .match-player .familles-player-avatar {
    display: grid;
    overflow: visible;
    font-size: 0.9rem;
    white-space: normal;
  }

  .match-player .familles-player-copy {
    display: grid;
    overflow: visible;
    white-space: normal;
  }

  .match-player .familles-seat-families {
    display: flex;
    overflow: visible;
    white-space: normal;
  }

  .familles-turn-banner {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .familles-turn-symbol {
    width: 40px;
    height: 40px;
  }

  .familles-deck-counter {
    grid-column: 1 / -1;
    justify-self: end;
    min-width: 94px;
    margin-top: -48px;
  }

  .familles-turn-banner strong {
    padding-right: 96px;
    font-size: 0.88rem;
    white-space: normal;
  }

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

  .familles-member-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .familles-member-choice {
    min-height: 142px;
  }

  .familles-action-bar {
    grid-template-columns: 1fr;
  }

  .familles-ask-button {
    width: 100%;
    min-height: 50px;
  }

  .familles-feedback-panel {
    min-height: 300px;
    padding: 18px;
  }

  .answer-grid,
  .grammar-action-grid,
  .podium-row {
    grid-template-columns: 1fr;
  }

  .moonveil-lobby-sidebar .grammar-lobby-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .grammar-mode-card {
    min-height: 190px;
  }

  .live-question-card h2,
  .grammar-feedback-card h2,
  .grammar-rules-intro h2 {
    font-size: 1.8rem;
  }

  .grammar-status-strip {
    grid-template-columns: 1fr;
  }

  .faction-grid {
    grid-template-columns: 1fr;
  }

  .combat-card-stats,
  .grammar-action-status {
    grid-template-columns: 1fr;
  }

  .local-impact-popup {
    top: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .familles-turn-symbol,
  .familles-feedback-layer,
  .familles-feedback-panel,
  .familles-confetti i,
  .familles-card.interactive,
  .familles-player-seat,
  .familles-family-choice,
  .familles-member-choice {
    animation: none !important;
    transition: none !important;
  }
}

/* Moonveil Grammar Clash final visual pass */
body.visages-game-active {
  margin: 0;
  overflow-x: hidden;
}

body.visages-game-active .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

body.visages-game-active #page-grammar-clash-detail,
body.visages-game-active #page-grammar-clash-detail *,
body.visages-game-active #page-grammar-clash-lobby,
body.visages-game-active #page-grammar-clash-lobby *,
body.visages-game-active #page-grammar-clash-game,
body.visages-game-active #page-grammar-clash-game * {
  box-sizing: border-box;
}

body.visages-game-active #page-grammar-clash-detail,
body.visages-game-active #page-grammar-clash-lobby,
body.visages-game-active #page-grammar-clash-game {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.visages-game-active #page-grammar-clash-detail .grammar-clash-detail,
body.visages-game-active #grammar-clash-lobby,
body.visages-game-active #grammar-clash-game {
  width: 100%;
  min-height: 100dvh;
}

body.visages-game-active #page-grammar-clash-detail .grammar-clash-detail {
  grid-template-columns: 1fr;
  align-items: center;
  max-width: none;
}

body.visages-game-active #page-grammar-clash-detail .grammar-clash-detail h1 {
  max-width: none;
}

.grammar-live-shell,
.grammar-live-lobby,
.grammar-live-game {
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  padding: clamp(14px, 2vw, 28px);
  color: #fff6df;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.grammar-live-shell {
  display: grid;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.2), rgba(5, 8, 22, 0.54)),
    url("/assets/grammar-clash/backgrounds/mode-select-bg.png") center / cover no-repeat;
}

.grammar-fullscreen-panel {
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(14px, 2vw, 24px);
  width: 100%;
}

.grammar-live-hero {
  width: min(1100px, 100%);
  gap: 4px;
}

.grammar-live-hero .moonveil-game-logo {
  width: clamp(250px, 34vw, 470px);
  max-height: 145px;
  object-fit: contain;
}

.grammar-live-hero .eyebrow {
  margin: 0;
}

.grammar-live-hero h1 {
  margin: 0;
  font-size: clamp(2.65rem, 5vw, 5.6rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.grammar-live-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 4px auto 0;
  color: #fff0c7;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
}

.grammar-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  align-items: stretch;
  gap: clamp(18px, 2.4vw, 34px);
  width: min(1230px, 100%);
}

.grammar-mode-card {
  min-height: clamp(380px, 44vh, 550px);
  display: grid;
  align-content: end;
  gap: 14px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 2px solid rgba(244, 210, 122, 0.46);
  border-radius: 12px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(123, 44, 191, 0.12), rgba(5, 8, 22, 0.94) 70%),
    radial-gradient(circle at 50% 27%, rgba(178, 76, 255, 0.42), transparent 26%),
    rgba(5, 8, 22, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 24px rgba(123, 44, 191, 0.28);
}

.grammar-mode-card.available {
  border-color: #f4d27a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 34px rgba(196, 66, 255, 0.48),
    0 0 18px rgba(244, 210, 122, 0.38);
}

.grammar-mode-card.available::before,
.grammar-mode-card.locked::before {
  inset: clamp(16px, 2vw, 24px) clamp(16px, 2vw, 24px) auto;
  height: clamp(135px, 20vh, 210px);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 245, 207, 0.92), transparent 8%),
    radial-gradient(circle at 50% 50%, rgba(123, 44, 191, 0.75), transparent 42%),
    linear-gradient(135deg, rgba(38, 16, 74, 0.88), rgba(8, 27, 58, 0.72));
}

.grammar-mode-card.locked {
  opacity: 0.76;
  filter: saturate(0.35);
}

.grammar-mode-card.locked::after {
  position: absolute;
  top: clamp(72px, 13vh, 142px);
  left: 50%;
  z-index: 2;
  width: 78px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 12px;
  content: "🔒";
  transform: translateX(-50%);
  background: rgba(5, 8, 22, 0.72);
  color: #fff;
  font-size: 2rem;
}

.grammar-mode-card h2 {
  margin: 0;
  font-size: clamp(1.75rem, 2.6vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.grammar-mode-card p {
  margin: 0;
  color: #fff0df;
  font-size: clamp(0.98rem, 1.2vw, 1.18rem);
}

.mode-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #f4d27a;
  font-weight: 900;
}

.mode-play-button {
  min-height: 58px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(184, 62, 255, 0.92), rgba(96, 18, 140, 0.96));
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}

.grammar-mode-select > .ghost-button {
  align-self: end;
}

.grammar-settings-screen .grammar-settings-grid,
.grammar-join-screen .grammar-settings-grid {
  width: min(900px, 100%);
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid rgba(244, 210, 122, 0.5);
  border-radius: 12px;
  background: rgba(5, 8, 22, 0.82);
  box-shadow: var(--moon-glow);
}

.grammar-live-lobby {
  display: grid;
  background:
    linear-gradient(90deg, rgba(5, 8, 22, 0.2), rgba(5, 8, 22, 0.32)),
    url("/assets/grammar-clash/backgrounds/lobby-bg.png") center / cover no-repeat;
}

.moonveil-lobby-frame {
  grid-template-columns: minmax(230px, 280px) minmax(480px, 1fr) minmax(270px, 350px);
  gap: clamp(14px, 1.6vw, 26px);
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  width: 100%;
}

.grammar-live-lobby.moonveil-lobby-frame {
  min-height: 100dvh;
}

.moonveil-lobby-sidebar {
  min-height: 100%;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(11, 15, 42, 0.9), rgba(17, 9, 42, 0.84));
}

.moonveil-lobby-main {
  align-content: start;
}

.moonveil-lobby-main::before {
  content: "Lobby / Game Code";
  justify-self: center;
  margin: 0 0 2px;
  color: #fff6df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 2.7vw, 2.7rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(123, 44, 191, 0.5);
}

.moonveil-code-panel {
  width: min(680px, 100%);
  justify-self: center;
  border-radius: 10px;
  padding: clamp(14px, 1.8vw, 24px);
  background: rgba(5, 8, 22, 0.78);
}

.moonveil-code-panel h1 {
  width: min(540px, 100%);
  padding: 8px 16px;
  border: 1px solid rgba(244, 210, 122, 0.36);
  border-radius: 6px;
  background: rgba(8, 13, 32, 0.82);
  font-size: clamp(3rem, 6.4vw, 6rem);
  letter-spacing: clamp(0.12em, 1vw, 0.22em);
  line-height: 1;
}

.moonveil-lobby-side {
  align-content: center;
}

.moonveil-lobby-frame:has(.faction-stage) {
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
}

.moonveil-lobby-frame:has(.faction-stage) .moonveil-lobby-side {
  display: none;
}

.moonveil-lobby-side .gold-button {
  min-height: clamp(70px, 9vh, 96px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2.4vw, 2.55rem);
}

.grammar-player-card {
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(244, 210, 122, 0.36);
  background: linear-gradient(90deg, rgba(5, 8, 22, 0.9), rgba(12, 20, 48, 0.74));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--faction) 78%, #f4d27a 12%);
}

.grammar-player-card .avatar-token {
  position: static;
  grid-row: 1 / span 3;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.grammar-player-card h2 {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
}

.grammar-player-card p {
  margin: 0;
}

.grammar-player-card .ready-badge {
  grid-column: 3;
  grid-row: 1 / span 3;
  width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(151, 255, 116, 0.45);
  border-radius: 50%;
  background: rgba(26, 122, 40, 0.68);
  color: #bfff9a;
  font-size: 1.35rem;
  font-weight: 950;
  box-shadow: 0 0 14px rgba(80, 255, 98, 0.24);
}

.faction-stage {
  display: grid;
  gap: clamp(14px, 1.6vw, 24px);
}

.moon-section-title {
  display: grid;
  justify-items: center;
  text-align: center;
}

.moon-section-title h2 {
  margin: 0;
  color: #fff6df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.8vw, 3rem);
  line-height: 1.02;
  text-transform: uppercase;
}

.faction-card-stage {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  align-items: start;
}

.faction-card {
  --faction-power-top: 65.6%;
  --faction-desc-top: 71.5%;
  --faction-cost-left: 39%;
  --faction-cost-bottom: 7.25%;
  --faction-cost-size: 15.2%;
  --faction-power-size: clamp(0.86rem, 1vw, 1.14rem);
  --faction-desc-size: clamp(0.55rem, 0.65vw, 0.72rem);
  aspect-ratio: 2 / 3;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.faction-card[data-faction="shadowCoven"] {
  --faction-power-top: 65.3%;
  --faction-desc-top: 71.4%;
  --faction-cost-left: 39.15%;
  --faction-cost-bottom: 7.15%;
}

.faction-card[data-faction="emberLegion"] {
  --faction-power-top: 66%;
  --faction-desc-top: 71.9%;
  --faction-cost-left: 39.7%;
  --faction-cost-bottom: 7.35%;
  --faction-desc-size: clamp(0.52rem, 0.61vw, 0.68rem);
}

.faction-card[data-faction="wildGrove"] {
  --faction-power-top: 66.1%;
  --faction-desc-top: 72%;
  --faction-cost-left: 39.4%;
  --faction-cost-bottom: 7.25%;
}

.faction-card[data-faction="neonSyndicate"] {
  --faction-power-top: 65.9%;
  --faction-desc-top: 71.9%;
  --faction-cost-left: 39.05%;
  --faction-cost-bottom: 7.15%;
  --faction-desc-size: clamp(0.52rem, 0.61vw, 0.68rem);
}

.faction-card[data-faction="astralDominion"] {
  --faction-power-top: 66.4%;
  --faction-desc-top: 72.3%;
  --faction-cost-left: 39.25%;
  --faction-cost-bottom: 7.1%;
}

.faction-card:disabled {
  cursor: default;
}

.faction-card span,
.faction-card .faction-ui-overlay,
.faction-card .faction-ui-overlay span {
  width: auto;
  aspect-ratio: auto;
  display: block;
  place-items: normal;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.faction-card .faction-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: var(--faction-art) center / contain no-repeat;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--faction) 40%, transparent));
}

.faction-ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  padding: 0;
  pointer-events: none;
  text-align: center;
}

.faction-ui-overlay strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.faction-type-pill {
  display: none !important;
}

.faction-ui-overlay > b {
  position: absolute;
  top: var(--faction-power-top);
  right: 13%;
  left: 13%;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--faction-power-size);
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.86);
}

.faction-ui-overlay em {
  position: absolute;
  top: var(--faction-desc-top);
  right: 14%;
  left: 14%;
  min-height: 0;
  display: block;
  color: #fff4e6;
  font-size: var(--faction-desc-size);
  font-style: normal;
  font-weight: 850;
  line-height: 1.12;
  text-shadow: 0 1px 8px #000;
}

.faction-energy-cost {
  position: absolute;
  bottom: var(--faction-cost-bottom);
  left: var(--faction-cost-left);
  display: grid;
  place-items: center;
  width: var(--faction-cost-size);
  aspect-ratio: 1;
  color: #fff6df;
  transform: translateX(-50%);
}

.faction-energy-cost > b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.5vw, 1.65rem);
  line-height: 1;
  text-shadow: 0 0 10px #000;
}

.faction-energy-cost i,
.faction-energy-cost small {
  display: none;
}

.faction-card .selected-badge {
  position: absolute;
  top: 5%;
  right: 8%;
  z-index: 3;
  border: 1px solid rgba(244, 210, 122, 0.76);
  background: rgba(5, 8, 22, 0.78);
}

.faction-card.selected .faction-art {
  filter:
    drop-shadow(0 0 12px rgba(244, 210, 122, 0.72))
    drop-shadow(0 0 28px color-mix(in srgb, var(--faction) 55%, transparent));
}

.faction-detail-card {
  width: min(780px, 100%);
  justify-self: center;
}

.grammar-live-game.phase-question .game-top,
.grammar-live-game.phase-question .grammar-status-strip,
.grammar-live-game.phase-answer_feedback .game-top,
.grammar-live-game.phase-answer_feedback .grammar-status-strip,
.grammar-live-game.phase-action .game-top,
.grammar-live-game.phase-action .grammar-status-strip,
.grammar-live-game.phase-rules_intro .game-top,
.grammar-live-game.phase-rules_intro .grammar-status-strip {
  display: none;
}

.grammar-live-game.phase-question {
  display: grid;
  align-items: stretch;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.14), rgba(5, 8, 22, 0.34)),
    url("/assets/grammar-clash/backgrounds/question-bg.png") center / cover no-repeat;
}

.grammar-question-screen {
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: clamp(22px, 4vh, 46px);
  width: 100%;
  background: none;
}

.grammar-question-hud {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(180px, 0.7fr) auto minmax(220px, 0.9fr);
  align-items: center;
  gap: clamp(12px, 1.4vw, 24px);
  width: 100%;
  padding: 0 clamp(4px, 1vw, 18px);
}

.grammar-question-hud .moonveil-game-logo.small {
  width: clamp(190px, 18vw, 310px);
}

.question-progress-pill,
.question-stat-pack span,
.action-round-pill {
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: 8px 18px;
  border: 1px solid rgba(244, 210, 122, 0.34);
  border-radius: 10px;
  background: rgba(5, 8, 22, 0.72);
  color: #fff6df;
  font-weight: 950;
}

.question-progress-pill {
  justify-self: start;
  color: #f4d27a;
  font-size: clamp(1.1rem, 1.8vw, 1.75rem);
}

.question-timer-orb,
.action-timer-orb {
  width: clamp(104px, 10vw, 154px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 3px solid #f4d27a;
  border-radius: 50%;
  background: rgba(5, 8, 22, 0.82);
  color: #fff0bd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 26px rgba(244, 210, 122, 0.38), inset 0 0 24px rgba(244, 210, 122, 0.12);
  animation: moonTimerPulse 1000ms ease-in-out infinite;
}

.question-stat-pack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.question-stat-pack b {
  margin-left: 6px;
  color: #fff;
  font-size: 1.4em;
}

.grammar-question-panel.live-question-card {
  width: min(1370px, 94vw);
  justify-self: center;
  display: grid;
  gap: clamp(22px, 3vh, 34px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.live-question-card h2 {
  width: 100%;
  margin: 0;
  padding: clamp(26px, 5vh, 58px) clamp(20px, 4vw, 64px);
  border: 2px solid rgba(244, 210, 122, 0.62);
  border-radius: 10px;
  background: rgba(5, 8, 22, 0.68);
  color: #f8f8ff;
  font-size: clamp(2rem, 4.3vw, 4.2rem);
  line-height: 1.1;
}

.answer-grid {
  gap: clamp(18px, 2vw, 30px);
}

.answer-choice {
  min-height: clamp(86px, 13vh, 145px);
  border-radius: 8px;
  font-size: clamp(1.75rem, 3.4vw, 3.05rem);
}

.grammar-live-game.feedback-correct {
  background:
    linear-gradient(180deg, rgba(3, 45, 21, 0.06), rgba(5, 8, 22, 0.2)),
    url("/assets/grammar-clash/feedback/correct-bg.png") center / cover no-repeat;
}

.grammar-live-game.feedback-incorrect {
  background:
    linear-gradient(180deg, rgba(55, 0, 8, 0.06), rgba(5, 8, 22, 0.24)),
    url("/assets/grammar-clash/feedback/incorrect-bg.png") center / cover no-repeat;
}

.grammar-feedback-screen {
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  display: grid;
  align-items: end;
  justify-items: center;
  padding-bottom: clamp(28px, 5vh, 72px);
  background: none;
}

.grammar-feedback-card.feedback-overlay-card {
  width: min(780px, 92vw);
  gap: 12px;
  padding: clamp(14px, 1.8vw, 24px);
  border-radius: 12px;
  background: rgba(5, 8, 22, 0.68);
  backdrop-filter: blur(2px);
}

.feedback-overlay-card .correct-answer-line {
  width: 100%;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid rgba(244, 210, 122, 0.38);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.58);
  color: #fff0df;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
}

.feedback-explanation {
  width: 100%;
  padding: clamp(14px, 1.6vw, 22px);
  border: 1px solid rgba(244, 210, 122, 0.4);
  border-radius: 10px;
  background: rgba(5, 8, 22, 0.64);
}

.feedback-explanation p {
  margin: 0;
  color: #fff6df;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
}

.grammar-live-game.phase-action {
  display: grid;
  align-items: stretch;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.08), rgba(5, 8, 22, 0.5)),
    url("/assets/grammar-clash/backgrounds/action-bg.png") center / cover no-repeat;
}

.grammar-action-phase-screen {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 1.4vh, 18px);
  position: relative;
  width: 100%;
}

.grammar-action-hero {
  display: grid;
  grid-template-columns: minmax(190px, 0.6fr) minmax(360px, 1.2fr) auto minmax(150px, 0.45fr);
  align-items: center;
  gap: clamp(10px, 1.4vw, 22px);
  text-align: center;
}

.grammar-action-hero .moonveil-game-logo.small {
  width: clamp(170px, 17vw, 300px);
}

.grammar-action-hero h2 {
  margin: 0;
  color: #f4d27a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 4.4vw, 5rem);
  line-height: 0.88;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #6b431d, 0 0 20px rgba(244, 210, 122, 0.34);
}

.grammar-action-hero p {
  margin: 0;
}

.grammar-action-battle-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr) minmax(250px, 330px);
  gap: clamp(12px, 1.4vw, 20px);
  align-items: stretch;
  min-height: 0;
}

.grammar-left-column,
.grammar-right-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
}

.grammar-action-panel,
.grammar-history-log,
.grammar-action-legend {
  border: 1px solid rgba(244, 210, 122, 0.42);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px rgba(123, 44, 191, 0.24);
}

.grammar-action-panel {
  padding: 14px;
  max-height: calc(100dvh - 170px);
  overflow: auto;
}

.grammar-action-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grammar-action-grid {
  display: grid;
  gap: 6px;
}

.grammar-action-button {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 6px;
}

.grammar-action-button strong {
  text-align: left;
}

.grammar-action-button span {
  color: #fff6df;
  font-weight: 950;
}

.grammar-action-button span::after {
  content: " ◆";
  color: #c989ff;
}

.action-row-icon {
  width: 27px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 210, 122, 0.28);
  border-radius: 6px;
  color: #f4d27a;
  font-style: normal;
}

.grammar-action-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.grammar-action-status span {
  border: 1px solid rgba(244, 210, 122, 0.22);
  background: rgba(8, 27, 58, 0.52);
}

.grammar-player-board {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.grammar-player-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-content: start;
  gap: clamp(8px, 1vw, 14px);
  height: 100%;
  max-height: min(64vh, 620px);
  padding: 4px 4px 14px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.grammar-combat-card {
  min-height: 0;
  height: clamp(236px, 31vh, 310px);
  padding: clamp(7px, 0.8vw, 10px);
  border-width: 2px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(78px, 1fr) auto auto;
  gap: clamp(5px, 0.65vh, 8px);
  overflow: hidden;
}

.combat-card-top b {
  font-size: clamp(0.82rem, 0.96vw, 1.05rem);
  line-height: 1.05;
}

.combat-card-top small {
  font-size: clamp(0.68rem, 0.82vw, 0.86rem);
  line-height: 1.1;
}

.combat-avatar-portrait {
  min-height: 0;
  height: 100%;
  border-radius: 6px;
  background-size: cover;
}

.combat-hp-wrap {
  gap: 5px;
}

.combat-hp-wrap b {
  font-size: clamp(0.84rem, 1.02vw, 1.05rem);
  line-height: 1.05;
}

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

.combat-card-stats span {
  min-width: 0;
  padding: 4px 3px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(5, 8, 22, 0.55);
  font-size: clamp(0.58rem, 0.72vw, 0.74rem);
  line-height: 1.05;
  text-overflow: clip;
  white-space: normal;
}

.combat-card-stats span small,
.combat-card-stats span b {
  display: block;
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-card-stats span small {
  color: #cbd5ec;
  font-size: 0.78em;
}

.combat-card-stats span b {
  margin-top: 2px;
  color: #fff5d7;
  font-size: 1.08em;
}

.grammar-history-log {
  max-height: min(44vh, 420px);
  overflow: hidden;
}

.grammar-history-list {
  max-height: min(36vh, 350px);
  overflow: auto;
}

.history-entry {
  padding: 8px;
  border-radius: 6px;
}

.history-entry p {
  font-size: 0.86rem;
  line-height: 1.25;
}

.grammar-action-legend {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.grammar-action-legend span {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  color: #fff2dc;
  font-weight: 850;
}

.grammar-action-legend i {
  color: #f4d27a;
  font-style: normal;
}

.legend-hp {
  width: 20px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38d853, #b9ff75);
}

.action-bottom-tip {
  justify-self: center;
  max-width: min(720px, 92vw);
  margin: 0;
  padding: 9px 18px;
  border: 1px solid rgba(244, 210, 122, 0.22);
  border-radius: 6px;
  background: rgba(5, 8, 22, 0.56);
  color: #fff4df;
  text-align: center;
  font-weight: 850;
}

.grammar-rules-intro {
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  width: min(960px, 100%);
  margin: auto;
  border-radius: 12px;
  background: rgba(5, 8, 22, 0.58);
}

@keyframes moonTimerPulse {
  0%, 100% {
    box-shadow: 0 0 24px rgba(244, 210, 122, 0.34), inset 0 0 20px rgba(244, 210, 122, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 36px rgba(244, 210, 122, 0.54), inset 0 0 30px rgba(244, 210, 122, 0.18);
    transform: scale(1.025);
  }
}

@media (max-width: 1420px) {
  .grammar-live-hero .moonveil-game-logo {
    width: clamp(230px, 28vw, 360px);
    max-height: 112px;
  }

  .grammar-live-hero h1 {
    font-size: clamp(2.35rem, 4.45vw, 4.7rem);
  }

  .grammar-mode-card {
    min-height: 335px;
    padding: 22px;
  }

  .grammar-mode-card.available::before,
  .grammar-mode-card.locked::before {
    height: 126px;
  }

  .moonveil-lobby-frame {
    grid-template-columns: 230px minmax(420px, 1fr) 290px;
    gap: 14px;
  }

  .grammar-live-lobby {
    padding: 14px;
  }

  .moonveil-lobby-sidebar {
    padding: 14px;
  }

  .moonveil-code-panel h1 {
    font-size: clamp(3rem, 5.3vw, 4.8rem);
  }

  .moonveil-lobby-side .gold-button {
    min-height: 68px;
  }

  .grammar-player-list {
    max-height: 390px;
    overflow: auto;
    padding-right: 4px;
  }

  .faction-ui-overlay em {
    font-size: 0.68rem;
  }

  .grammar-action-phase-screen {
    gap: 8px;
  }

  .grammar-action-hero h2 {
    font-size: clamp(2.1rem, 4vw, 4.4rem);
  }

  .action-timer-orb {
    width: 104px;
  }

  .grammar-action-panel {
    max-height: calc(100dvh - 145px);
    padding: 10px;
  }

  .grammar-action-button {
    min-height: 38px;
    padding: 5px 8px;
  }

  .grammar-action-columns {
    gap: 8px;
  }

  .grammar-action-battle-grid {
    grid-template-columns: minmax(245px, 300px) minmax(0, 1fr) minmax(230px, 285px);
    gap: 10px;
  }

  .grammar-player-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    max-height: min(66vh, 560px);
  }

  .grammar-combat-card {
    height: clamp(198px, 27vh, 248px);
    grid-template-rows: auto minmax(58px, 1fr) auto auto;
  }

  .action-bottom-tip {
    max-width: min(640px, 90vw);
    padding: 7px 14px;
    font-size: 0.88rem;
  }
}

@media (max-width: 1180px) {
  .grammar-mode-grid,
  .faction-card-stage {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .moonveil-lobby-frame {
    grid-template-columns: 1fr;
  }

  .moonveil-lobby-sidebar {
    min-height: 0;
  }

  .moonveil-lobby-sidebar .grammar-lobby-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .moonveil-lobby-side {
    align-content: start;
  }

  .grammar-question-hud,
  .grammar-action-hero {
    grid-template-columns: 1fr auto 1fr;
  }

  .grammar-question-hud .moonveil-game-logo.small,
  .grammar-action-hero .moonveil-game-logo.small {
    display: none;
  }

  .question-progress-pill,
  .action-round-pill {
    justify-self: stretch;
  }

  .grammar-action-battle-grid {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .grammar-right-column {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .grammar-live-game.phase-action {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .grammar-action-phase-screen {
    height: auto;
    min-height: calc(100dvh - 24px);
  }
}

@media (max-width: 820px) {
  .grammar-live-shell,
  .grammar-live-lobby,
  .grammar-live-game {
    padding: 12px;
  }

  .grammar-mode-grid,
  .answer-grid,
  .grammar-action-battle-grid,
  .grammar-right-column {
    grid-template-columns: 1fr;
  }

  .grammar-question-hud,
  .grammar-action-hero {
    grid-template-columns: 1fr;
  }

  .question-timer-orb,
  .action-timer-orb {
    width: 108px;
    font-size: 2.8rem;
  }

  .question-stat-pack {
    grid-template-columns: 1fr 1fr;
  }

  .live-question-card h2 {
    font-size: clamp(1.7rem, 8vw, 2.7rem);
  }

  .answer-choice {
    min-height: 78px;
  }

  .faction-card-stage {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .grammar-player-grid {
    max-height: none;
    overflow: visible;
  }

  .grammar-player-board {
    overflow: visible;
  }

  .grammar-combat-card {
    height: auto;
    min-height: 250px;
  }
}

/* Grammar Clash interaction pass */
.question-progress-wrap {
  display: grid;
  gap: 8px;
  align-self: center;
}

.grammar-round-track,
.feedback-countdown-track {
  width: 100%;
  height: 7px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(244, 210, 122, 0.26);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.7);
}

.grammar-round-track i,
.feedback-countdown-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #7b2cbf, #f4d27a);
  box-shadow: 0 0 12px rgba(244, 210, 122, 0.5);
  transition: width 180ms linear;
}

.question-timer-orb,
.action-timer-orb {
  --timer-progress: 360deg;
  position: relative;
  isolation: isolate;
  border: 0;
  background:
    radial-gradient(circle, rgba(5, 8, 22, 0.96) 0 62%, transparent 63%),
    conic-gradient(#f4d27a var(--timer-progress), rgba(79, 55, 121, 0.5) 0);
  transition: color 180ms ease, filter 180ms ease;
}

.question-timer-orb::after,
.action-timer-orb::after {
  position: absolute;
  inset: 8px;
  z-index: -1;
  border: 1px solid rgba(244, 210, 122, 0.46);
  border-radius: 50%;
  content: "";
  box-shadow: inset 0 0 20px rgba(123, 44, 191, 0.3);
}

.question-timer-orb.urgent,
.action-timer-orb.urgent {
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255, 91, 87, 0.75));
  animation: grammarTimerUrgent 520ms ease-in-out infinite;
}

.question-kicker {
  justify-self: center;
  margin: 0 0 -14px;
  padding: 7px 16px;
  border: 1px solid rgba(244, 210, 122, 0.34);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.78);
  color: #f4d27a;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.answer-choice {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.answer-choice:not(:disabled):hover {
  transform: translateY(-4px);
  filter: brightness(1.12);
}

.answer-choice:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

.answer-choice.selected {
  border-color: #fff5c8;
  filter: brightness(1.15);
  box-shadow: 0 0 0 3px rgba(244, 210, 122, 0.34), 0 0 30px rgba(176, 76, 255, 0.42);
}

.answer-choice.selected::after {
  position: absolute;
  top: 10px;
  right: 14px;
  content: "Locked";
  color: #fff3c4;
  font-size: clamp(0.68rem, 0.8vw, 0.82rem);
  font-weight: 950;
  text-transform: uppercase;
}

.answer-key {
  width: clamp(34px, 3.6vw, 50px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(5, 8, 22, 0.36);
  color: #fff5cf;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 950;
}

.answer-submitted-status {
  justify-self: center;
  margin: -10px 0 0;
  padding: 9px 18px;
  border: 1px solid rgba(244, 210, 122, 0.38);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.8);
  color: #fff3c4;
  font-weight: 900;
}

.feedback-bonus-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-bonus-row span {
  padding: 6px 11px;
  border: 1px solid rgba(244, 210, 122, 0.4);
  border-radius: 999px;
  background: rgba(123, 44, 191, 0.28);
  color: #fff5d6;
  font-size: 0.82rem;
  font-weight: 900;
}

.feedback-countdown {
  width: 100%;
  display: grid;
  gap: 7px;
  color: #fff0c2;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.grammar-action-status span {
  display: grid;
  gap: 1px;
  color: #f4d27a;
  text-transform: capitalize;
}

.grammar-action-status span b {
  color: #fff;
  font-size: 0.67rem;
  text-transform: uppercase;
}

.grammar-action-status span.used {
  border-color: rgba(255, 118, 110, 0.38);
  background: rgba(109, 22, 33, 0.42);
  color: #ffaaa4;
}

.grammar-action-status span.ready {
  border-color: rgba(112, 239, 143, 0.38);
  background: rgba(17, 94, 55, 0.4);
  color: #a7ffbe;
}

.grammar-action-button {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
}

.grammar-action-button span::after {
  content: none;
}

.grammar-action-button .action-button-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.grammar-action-button .action-button-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.91rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grammar-action-button .action-button-copy small {
  overflow: hidden;
  color: #cfd9f4;
  font-size: 0.68rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grammar-action-button .action-cost {
  min-width: 31px;
  padding: 5px 6px;
  border: 1px solid rgba(210, 137, 255, 0.42);
  border-radius: 6px;
  background: rgba(88, 28, 136, 0.48);
  color: #fff5dc;
  font-size: 0.8rem;
  font-weight: 950;
  text-align: center;
}

.grammar-action-button .action-cost::after {
  margin-left: 2px;
  content: "◆";
  color: #d98cff;
  font-size: 0.68em;
}

.grammar-action-button:disabled .action-button-copy small {
  color: #f2a9a5;
}

.targeting-command {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(244, 210, 122, 0.48);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(123, 44, 191, 0.45), rgba(16, 37, 78, 0.65));
  color: #fff;
  text-align: center;
  box-shadow: 0 0 18px rgba(145, 55, 225, 0.28);
}

.targeting-command span {
  color: #ffe8ae;
  font-size: 0.75rem;
}

.grammar-combat-card {
  position: relative;
}

.combat-rank-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 4;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 210, 122, 0.48);
  border-radius: 50%;
  background: rgba(5, 8, 22, 0.84);
  color: #f4d27a;
  font-size: 0.72rem;
  font-weight: 950;
}

.combat-target-callout {
  position: absolute;
  inset: auto 8px 8px;
  z-index: 6;
  padding: 6px 8px;
  border: 1px solid #f4d27a;
  border-radius: 5px;
  background: rgba(91, 28, 132, 0.9);
  color: #fff8d9;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
  animation: targetCalloutPulse 700ms ease-in-out infinite;
}

.grammar-combat-card.critical-hp {
  box-shadow: inset 0 0 20px rgba(229, 48, 59, 0.2), 0 0 14px rgba(229, 48, 59, 0.34);
}

.grammar-history-list .history-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.history-entry .history-icon {
  grid-row: 1 / span 2;
  width: 27px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 210, 122, 0.25);
  border-radius: 5px;
  background: rgba(8, 27, 58, 0.6);
  color: #f4d27a;
  font-style: normal;
  font-weight: 950;
}

.history-entry > span,
.history-entry > p {
  grid-column: 2;
}

.history-entry > p {
  margin: 0;
}

@keyframes grammarTimerUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes targetCalloutPulse {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.25); transform: translateY(-2px); }
}

@media (max-width: 1420px) {
  .grammar-action-button .action-button-copy small {
    font-size: 0.62rem;
  }

  .question-kicker {
    margin-bottom: -10px;
  }
}

@media (max-width: 820px) {
  .answer-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .question-progress-wrap {
    width: 100%;
  }

  .question-progress-pill {
    justify-self: stretch;
  }
}

/* Moonveil Faces interactive pass */
.faces-lobby-shell,
.faces-game-shell {
  --faces-green: #75e4c1;
  --faces-red: #f28b82;
  --faces-gold: #e6c56e;
  --faces-blue: #8fc4ff;
}

.faces-lobby-shell {
  gap: 12px;
}

.faces-lobby-top {
  align-items: center;
  background:
    linear-gradient(110deg, rgba(34, 77, 126, 0.38), rgba(7, 20, 38, 0.92) 62%),
    var(--panel);
}

.faces-room-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.faces-room-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.faces-room-title strong {
  padding: 6px 11px;
  border: 1px solid rgba(230, 197, 110, 0.5);
  border-radius: 7px;
  background: rgba(230, 197, 110, 0.12);
  color: var(--faces-gold);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  letter-spacing: 0;
}

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

.faces-lobby-progress div {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(191, 227, 255, 0.15);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.78);
  color: var(--soft);
  transition: border-color 180ms ease, background 180ms ease;
}

.faces-lobby-progress div.complete {
  border-color: rgba(117, 228, 193, 0.42);
  background: rgba(117, 228, 193, 0.09);
  color: var(--faces-green);
}

.faces-lobby-progress span {
  min-width: 40px;
  color: var(--ice);
  font-size: 1.05rem;
  font-weight: 1000;
}

.faces-lobby-progress strong {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.faces-lobby-grid {
  grid-template-columns: minmax(235px, 0.42fr) minmax(0, 1.58fr);
}

.faces-lobby-side {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
}

.faces-lobby-controls {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 0;
  padding: 9px;
  border: 1px solid rgba(191, 227, 255, 0.15);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.84);
}

.faces-lobby-controls .primary-button {
  width: 100%;
}

.faces-lobby-shell.duel .character-select-grid {
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
}

.faces-lobby-shell.duel .character-select-grid .character-card {
  min-height: 150px;
  grid-template-rows: auto auto;
  gap: 5px;
  padding: 8px;
}

.faces-lobby-player {
  min-height: 90px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  padding: 11px;
}

.faces-lobby-player.ready {
  border-color: rgba(117, 228, 193, 0.35);
  background:
    linear-gradient(105deg, rgba(117, 228, 193, 0.09), transparent 60%),
    rgba(8, 21, 38, 0.88);
}

.faces-lobby-player h2,
.faces-lobby-player p {
  margin: 0;
}

.faces-lobby-player h2 {
  font-size: 1.04rem;
}

.faces-lobby-player p:not(.eyebrow) {
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.faces-lobby-avatar,
.faces-lobby-player > i {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-weight: 1000;
}

.faces-lobby-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(143, 196, 255, 0.36);
  background: rgba(143, 196, 255, 0.12);
  color: var(--ice);
}

.faces-lobby-player > i {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
}

.faces-lobby-player.ready > i {
  background: rgba(117, 228, 193, 0.14);
  color: var(--faces-green);
}

.faces-secret-preview {
  min-height: 98px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px dashed rgba(191, 227, 255, 0.22);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.72);
}

.faces-secret-preview.selected {
  border-style: solid;
  border-color: rgba(230, 197, 110, 0.5);
  background:
    linear-gradient(110deg, rgba(230, 197, 110, 0.12), transparent 70%),
    rgba(8, 21, 38, 0.84);
}

.faces-secret-preview-portrait {
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 7px;
  background:
    linear-gradient(180deg, transparent, rgba(2, 8, 19, 0.18)),
    var(--portrait-src) var(--portrait-x) var(--portrait-y) / var(--portrait-size, cover) no-repeat,
    rgba(143, 196, 255, 0.08);
  color: var(--soft);
  font-size: 1.5rem;
  font-weight: 1000;
}

.faces-secret-preview small,
.faces-secret-preview strong {
  display: block;
}

.faces-secret-preview small {
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.faces-secret-preview strong {
  margin-top: 3px;
  color: var(--text);
  line-height: 1.15;
}

.faces-selection-heading {
  padding: 4px 0 10px;
}

.faces-selection-heading h2 {
  margin: 2px 0;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
}

.faces-lobby-top .ghost-button.copied {
  border-color: rgba(117, 228, 193, 0.42);
  color: var(--faces-green);
}

#page-visages-game .faces-game-shell {
  position: relative;
  width: 100%;
  gap: 10px;
}

.faces-hud {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(360px, 1.35fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid rgba(191, 227, 255, 0.19);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(40, 85, 137, 0.27), transparent 58%),
    rgba(6, 18, 35, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.faces-brand {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 3px 6px;
}

.faces-brand > strong,
.faces-brand > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faces-brand > strong {
  color: var(--text);
  font-size: 1.05rem;
}

.faces-brand > span {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.faces-turn-banner {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(143, 196, 255, 0.26);
  border-radius: 8px;
  background: rgba(143, 196, 255, 0.08);
}

.faces-turn-banner.ask {
  border-color: rgba(117, 228, 193, 0.44);
  background: rgba(117, 228, 193, 0.09);
}

.faces-turn-banner.answer {
  border-color: rgba(230, 197, 110, 0.5);
  background: rgba(230, 197, 110, 0.1);
}

.faces-turn-banner.ended {
  border-color: rgba(230, 197, 110, 0.45);
}

.faces-turn-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 196, 255, 0.14);
  color: var(--faces-blue);
  font-size: 1.25rem;
  font-weight: 1000;
}

.faces-turn-banner.ask .faces-turn-symbol {
  background: rgba(117, 228, 193, 0.14);
  color: var(--faces-green);
  animation: facesTurnPulse 1800ms ease-in-out infinite;
}

.faces-turn-banner.answer .faces-turn-symbol,
.faces-turn-banner.ended .faces-turn-symbol {
  background: rgba(230, 197, 110, 0.15);
  color: var(--faces-gold);
}

.faces-turn-banner small,
.faces-turn-banner strong,
.faces-turn-banner > div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faces-turn-banner small {
  color: var(--soft);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.faces-turn-banner strong {
  margin: 1px 0;
  color: var(--text);
  font-size: 1rem;
}

.faces-turn-banner > div > span {
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.faces-hud-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.faces-suspect-counter {
  min-width: 104px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(230, 197, 110, 0.27);
  border-radius: 8px;
  background: rgba(230, 197, 110, 0.07);
}

.faces-suspect-counter strong {
  color: var(--faces-gold);
  font-size: 1.35rem;
  line-height: 1;
}

.faces-suspect-counter span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.faces-icon-button {
  width: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(191, 227, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  font-size: 1.45rem;
}

.faces-icon-button:hover {
  border-color: rgba(242, 139, 130, 0.4);
  color: var(--faces-red);
}

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

.faces-player-chip {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(191, 227, 255, 0.15);
  border-radius: 8px;
  background: rgba(8, 21, 38, 0.78);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.faces-player-chip.opponent {
  direction: rtl;
  text-align: right;
}

.faces-player-chip.opponent > * {
  direction: ltr;
}

.faces-player-chip.active-turn {
  border-color: rgba(117, 228, 193, 0.45);
  background:
    linear-gradient(100deg, rgba(117, 228, 193, 0.1), transparent 62%),
    rgba(8, 21, 38, 0.84);
  box-shadow: inset 3px 0 0 var(--faces-green);
}

.faces-player-chip.opponent.active-turn {
  box-shadow: inset -3px 0 0 var(--faces-green);
}

.faces-player-portrait,
.faces-result-portrait {
  display: grid;
  place-items: center;
  border: 1px solid rgba(191, 227, 255, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(180deg, transparent, rgba(2, 8, 19, 0.2)),
    var(--portrait-src) var(--portrait-x) var(--portrait-y) / var(--portrait-size, cover) no-repeat,
    rgba(143, 196, 255, 0.08);
  color: var(--soft);
  font-weight: 1000;
}

.faces-player-portrait {
  width: 48px;
  aspect-ratio: 1;
}

.faces-player-portrait.hidden-secret {
  background:
    linear-gradient(135deg, rgba(143, 196, 255, 0.14), rgba(4, 13, 27, 0.9));
  color: var(--faces-blue);
  font-size: 1.35rem;
}

.faces-player-chip small,
.faces-player-chip strong,
.faces-player-chip div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faces-player-chip small {
  color: var(--soft);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.faces-player-chip strong {
  color: var(--text);
  font-size: 0.92rem;
}

.faces-player-chip div > span {
  color: var(--faces-gold);
  font-size: 0.68rem;
  font-weight: 850;
}

.faces-control-deck {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  align-items: stretch;
}

.faces-control-deck.is-ended {
  grid-template-columns: 1fr;
}

.faces-control-deck .faces-question-panel,
.faces-control-deck .faces-accusation-panel {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  background:
    linear-gradient(130deg, rgba(143, 196, 255, 0.08), transparent 58%),
    rgba(7, 19, 37, 0.91);
}

.faces-control-deck .faces-question-panel.ask {
  border-color: rgba(117, 228, 193, 0.26);
}

.faces-control-deck .faces-question-panel.answer {
  border-color: rgba(230, 197, 110, 0.38);
}

.faces-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.faces-panel-heading h2 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.faces-panel-heading > span {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 196, 255, 0.1);
  color: var(--faces-blue);
  font-weight: 1000;
}

.faces-panel-heading.compact h2 {
  font-size: 1.05rem;
}

.faces-question-helper {
  border: 1px solid rgba(143, 196, 255, 0.14);
  border-radius: 8px;
  background: rgba(143, 196, 255, 0.045);
}

.faces-question-helper summary {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  color: var(--ice);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 950;
  list-style: none;
}

.faces-question-helper summary::-webkit-details-marker {
  display: none;
}

.faces-question-helper summary span {
  color: var(--faces-gold);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.faces-question-chips {
  display: flex;
  gap: 6px;
  padding: 0 8px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.faces-question-chips button {
  min-width: min(260px, 80vw);
  min-height: 38px;
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--ice);
  border-color: rgba(143, 196, 255, 0.16);
  background: rgba(143, 196, 255, 0.07);
  font-size: 0.72rem;
  font-weight: 850;
}

.faces-question-chips button:hover {
  border-color: rgba(117, 228, 193, 0.4);
  background: rgba(117, 228, 193, 0.08);
}

.faces-question-compose {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.faces-question-compose .visages-input {
  grid-column: auto;
  min-height: 92px;
  resize: vertical;
}

.faces-question-send {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
}

.faces-question-send > span {
  justify-self: end;
  color: var(--soft);
  font-size: 0.62rem;
  font-weight: 850;
}

.faces-question-send .primary-button {
  width: 100%;
  min-height: 68px;
}

.faces-pending-question {
  min-height: 105px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid rgba(191, 227, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.faces-pending-question.incoming {
  border-color: rgba(230, 197, 110, 0.42);
  background:
    linear-gradient(110deg, rgba(230, 197, 110, 0.11), transparent 68%),
    rgba(255, 255, 255, 0.04);
  animation: facesIncomingQuestion 360ms ease both;
}

.faces-pending-question > small {
  color: var(--faces-gold);
  font-size: 0.65rem;
  font-weight: 950;
  text-transform: uppercase;
}

.faces-pending-question blockquote {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.95rem, 1.7vw, 1.2rem);
  font-weight: 950;
  line-height: 1.25;
}

.faces-pending-question > p {
  margin: 0;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.faces-pending-question .faces-question-correction {
  padding-left: 9px;
  border-left: 2px solid rgba(117, 228, 193, 0.48);
  color: var(--faces-green);
}

.faces-waiting-dots {
  display: flex;
  gap: 4px;
}

.faces-waiting-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faces-blue);
  animation: facesWaitingDot 1200ms ease-in-out infinite;
}

.faces-waiting-dots i:nth-child(2) {
  animation-delay: 140ms;
}

.faces-waiting-dots i:nth-child(3) {
  animation-delay: 280ms;
}

.faces-answer-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.faces-answer-button {
  min-height: 52px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #07101f;
  font-size: 1rem;
  font-weight: 1000;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.faces-answer-button span {
  font-size: 1.2rem;
}

.faces-answer-button.yes {
  border-color: rgba(117, 228, 193, 0.7);
  background: var(--faces-green);
}

.faces-answer-button.no {
  border-color: rgba(242, 139, 130, 0.72);
  background: var(--faces-red);
}

.faces-answer-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.faces-accusation-panel {
  border-color: rgba(230, 197, 110, 0.2);
}

.faces-accusation-panel.active {
  border-color: rgba(230, 197, 110, 0.58);
  background:
    linear-gradient(130deg, rgba(230, 197, 110, 0.15), transparent 65%),
    rgba(7, 19, 37, 0.94);
  box-shadow: inset 0 0 0 1px rgba(230, 197, 110, 0.08);
}

.faces-accusation-panel > p {
  margin: 0;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.35;
}

.faces-guess-preview {
  min-height: 70px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px;
  border: 1px dashed rgba(230, 197, 110, 0.3);
  border-radius: 8px;
}

.faces-guess-preview.has-selection {
  border-style: solid;
  background: rgba(230, 197, 110, 0.08);
}

.faces-guess-preview .faces-player-portrait {
  width: 54px;
}

.faces-guess-preview small,
.faces-guess-preview strong {
  display: block;
}

.faces-guess-preview small {
  color: var(--soft);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.faces-guess-preview strong {
  margin-top: 3px;
  color: var(--text);
  line-height: 1.1;
}

.faces-guess-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.faces-surrender-button {
  min-height: 30px;
  margin-top: auto;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: rgba(242, 139, 130, 0.72);
  font-size: 0.66rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faces-surrender-button:hover {
  color: var(--faces-red);
}

.faces-board-toolbar {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(191, 227, 255, 0.17);
  border-radius: 8px;
  background: rgba(7, 19, 37, 0.88);
}

.faces-board-toolbar.accusation-active {
  border-color: rgba(230, 197, 110, 0.52);
  background:
    linear-gradient(100deg, rgba(230, 197, 110, 0.12), transparent 60%),
    rgba(7, 19, 37, 0.9);
}

.faces-board-toolbar p {
  margin: 0;
}

.faces-board-toolbar strong,
.faces-board-toolbar > div:first-child > span {
  display: inline-block;
}

.faces-board-toolbar strong {
  margin-right: 8px;
  color: var(--text);
  font-size: 0.86rem;
}

.faces-board-toolbar > div:first-child > span {
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 850;
}

.faces-board-actions {
  display: flex;
  gap: 7px;
}

.faces-board-actions .ghost-button {
  min-height: 36px;
  padding: 0 10px;
}

#page-visages-game .game-board {
  border-color: rgba(143, 196, 255, 0.34);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#page-visages-game .game-board.is-accusing {
  border-color: rgba(230, 197, 110, 0.72);
  box-shadow:
    0 0 0 2px rgba(230, 197, 110, 0.12),
    0 20px 54px rgba(0, 0, 0, 0.3);
}

#page-visages-game .game-board .character-card {
  isolation: isolate;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

#page-visages-game .game-board .character-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 2;
  border-radius: 6px;
  background: transparent;
  pointer-events: none;
  transition: background 170ms ease;
}

#page-visages-game .game-board .character-card:hover:not(:disabled) {
  z-index: 3;
  transform: translateY(-2px) scale(1.035);
  border-color: rgba(117, 228, 193, 0.68);
  box-shadow:
    0 9px 20px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(117, 228, 193, 0.11);
}

#page-visages-game .game-board .character-card.eliminated {
  opacity: 1;
  filter: none;
  border-color: rgba(242, 139, 130, 0.2);
}

#page-visages-game .game-board .character-card.eliminated .portrait-token {
  filter: grayscale(1) brightness(0.42);
  transform: scale(0.96);
}

#page-visages-game .game-board .character-card.eliminated::after {
  background: rgba(3, 9, 18, 0.46);
}

.character-state-mark {
  display: none;
}

#page-visages-game .game-board .character-state-mark {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: clamp(1.1rem, 2vw, 2.2rem);
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
}

#page-visages-game .game-board .character-card.eliminated .character-state-mark {
  color: rgba(242, 139, 130, 0.92);
}

#page-visages-game .game-board .character-card.guess-candidate:not(.eliminated) {
  cursor: crosshair;
}

#page-visages-game .game-board .character-card.guess-candidate:not(.eliminated):not(.guess-selected) {
  border-color: rgba(230, 197, 110, 0.34);
}

#page-visages-game .game-board .character-card.guess-selected {
  z-index: 5;
  border-color: var(--faces-gold);
  transform: translateY(-3px) scale(1.055);
  box-shadow:
    0 0 0 3px rgba(230, 197, 110, 0.2),
    0 12px 24px rgba(0, 0, 0, 0.36);
  animation: facesGuessPulse 1400ms ease-in-out infinite;
}

#page-visages-game .game-board .character-card.guess-selected .character-state-mark {
  top: 4px;
  right: 4px;
  bottom: auto;
  left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--faces-gold);
  color: #07101f;
  font-size: 0.82rem;
  text-shadow: none;
}

#page-visages-game .game-board .character-card:disabled {
  cursor: not-allowed;
}

.faces-notice {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 90;
  min-width: min(360px, calc(100vw - 28px));
  min-height: 50px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(143, 196, 255, 0.42);
  border-radius: 8px;
  background: rgba(6, 18, 35, 0.96);
  color: var(--text);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  animation: facesNoticeIn 280ms ease both;
}

.faces-notice > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 196, 255, 0.12);
  color: var(--faces-blue);
  font-weight: 1000;
}

.faces-notice.yes {
  border-color: rgba(117, 228, 193, 0.55);
}

.faces-notice.yes > span {
  background: rgba(117, 228, 193, 0.14);
  color: var(--faces-green);
}

.faces-notice.no,
.faces-notice.alert {
  border-color: rgba(242, 139, 130, 0.55);
}

.faces-notice.no > span,
.faces-notice.alert > span {
  background: rgba(242, 139, 130, 0.14);
  color: var(--faces-red);
}

.faces-result-panel {
  position: relative;
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(120deg, rgba(230, 197, 110, 0.14), transparent 58%),
    rgba(7, 19, 37, 0.97);
}

.faces-result-panel.victory {
  border-color: rgba(230, 197, 110, 0.68);
}

.faces-result-copy {
  position: relative;
  z-index: 2;
}

.faces-result-copy h2 {
  margin: 3px 0 7px;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.faces-result-copy > p:not(.eyebrow) {
  color: var(--soft);
  font-weight: 850;
}

.faces-xp-reward {
  display: block;
  width: fit-content;
  margin: 12px 0;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--faces-gold);
  color: #07101f;
}

.faces-result-secrets {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.faces-result-secrets article {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(191, 227, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.faces-result-secrets article.winner {
  border-color: rgba(230, 197, 110, 0.6);
  background: rgba(230, 197, 110, 0.1);
}

.faces-result-portrait {
  width: min(126px, 100%);
  aspect-ratio: 1;
}

.faces-result-secrets small {
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 900;
}

.faces-result-secrets strong {
  color: var(--text);
  line-height: 1.1;
}

.faces-result-rays {
  position: absolute;
  top: 50%;
  left: 72%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(230, 197, 110, 0.1) 0 5deg, transparent 5deg 18deg);
  animation: facesResultSpin 18s linear infinite;
  pointer-events: none;
}

#page-visages-game .game-history {
  border-color: rgba(143, 196, 255, 0.14);
  background: rgba(7, 19, 37, 0.78);
}

#page-visages-game .game-history .history-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-height: 180px;
}

#page-visages-game .game-history .history-list div {
  border: 1px solid rgba(143, 196, 255, 0.1);
  background: rgba(143, 196, 255, 0.045);
}

@keyframes facesTurnPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(117, 228, 193, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(117, 228, 193, 0.12);
  }
}

@keyframes facesWaitingDot {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes facesIncomingQuestion {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes facesGuessPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(230, 197, 110, 0.16), 0 12px 24px rgba(0, 0, 0, 0.36);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(230, 197, 110, 0.08), 0 14px 28px rgba(0, 0, 0, 0.4);
  }
}

@keyframes facesNoticeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
}

@keyframes facesResultSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .faces-hud {
    grid-template-columns: minmax(170px, 0.7fr) minmax(280px, 1.3fr) auto;
  }

  .faces-brand > span {
    display: none;
  }

  .faces-control-deck {
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  }
}

@media (max-width: 820px) {
  .faces-lobby-grid,
  .faces-control-deck,
  .faces-result-panel {
    grid-template-columns: 1fr;
  }

  .faces-lobby-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .faces-secret-preview {
    min-height: 90px;
  }

  .faces-hud {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .faces-brand {
    display: none;
  }

  .faces-turn-banner {
    min-width: 0;
  }

  .faces-player-strip {
    grid-template-columns: 1fr 1fr;
  }

  .faces-control-deck .faces-question-panel,
  .faces-control-deck .faces-accusation-panel {
    min-height: 0;
  }

  .faces-question-compose {
    grid-template-columns: 1fr;
  }

  .faces-question-send {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
  }

  .faces-question-send .primary-button {
    min-height: 50px;
  }

  .faces-result-secrets {
    max-width: 430px;
  }
}

@media (max-width: 620px) {
  .faces-lobby-progress {
    grid-template-columns: 1fr;
  }

  .faces-lobby-progress div {
    min-height: 44px;
  }

  .faces-lobby-side {
    grid-template-columns: 1fr;
  }

  .faces-hud {
    padding: 7px;
  }

  .faces-turn-banner {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 6px 8px;
  }

  .faces-turn-symbol {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .faces-turn-banner > div > span,
  .faces-suspect-counter span {
    display: none;
  }

  .faces-suspect-counter {
    min-width: 44px;
    padding: 4px;
  }

  .faces-icon-button {
    width: 38px;
    min-width: 38px;
  }

  .faces-player-chip {
    min-height: 54px;
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 6px;
  }

  .faces-player-portrait {
    width: 38px;
  }

  .faces-player-chip small {
    display: none;
  }

  .faces-player-chip strong {
    font-size: 0.78rem;
  }

  .faces-player-chip div > span {
    font-size: 0.58rem;
  }

  .faces-answer-buttons,
  .faces-guess-actions {
    grid-template-columns: 1fr;
  }

  .faces-question-send {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .faces-question-send > span {
    justify-self: end;
  }

  .faces-board-toolbar {
    align-items: flex-start;
  }

  .faces-board-actions .ghost-button span {
    display: none;
  }

  .faces-board-actions .ghost-button {
    width: 38px;
    padding: 0;
    font-size: 1.1rem;
  }

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

  #page-visages-game .game-history .history-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faces-turn-symbol,
  .faces-waiting-dots i,
  .faces-pending-question,
  .faces-notice,
  .faces-result-rays,
  #page-visages-game .game-board .character-card {
    animation: none !important;
    transition: none !important;
  }
}

/* Voca Hunt · illustrated realm atlas */
.voca-realm-cover-image {
  display: block;
  background-image: var(--realm-cover);
  background-position: var(--realm-cover-x) var(--realm-cover-y);
  background-size: 400% 300%;
  background-repeat: no-repeat;
}

body[data-game="voca-hunt"][data-phase="detail"] {
  background: #020814;
}

body[data-game="voca-hunt"] #page-voca-hunt-detail {
  width: min(1800px, calc(100% - 24px));
  padding: 12px 0 24px;
}

.voca-setup-shell {
  min-height: calc(100dvh - 36px);
  position: relative;
  isolation: isolate;
  gap: 0;
  padding: 0 0 34px;
  overflow: hidden;
  border: 1px solid rgba(133, 218, 230, 0.2);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(1, 7, 17, 0.22), rgba(1, 8, 20, 0.92) 34%, #020a16 68%),
    linear-gradient(90deg, rgba(1, 8, 19, 0.76), rgba(3, 14, 28, 0.28), rgba(1, 8, 19, 0.72)),
    url("/assets/voca-hunt/arena-moonveil.webp") top center / 100% auto no-repeat,
    #020a16;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.voca-setup-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.35;
  background:
    linear-gradient(rgba(110, 218, 231, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 218, 231, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent 20%, black 52%, transparent 100%);
  pointer-events: none;
}

.voca-setup-hero {
  min-height: clamp(420px, 47vh, 560px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  align-items: center;
  gap: clamp(30px, 5vw, 86px);
  padding: 90px clamp(28px, 5vw, 78px) 104px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.voca-setup-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 1;
  background:
    radial-gradient(circle at 76% 44%, rgba(84, 232, 219, 0.13), transparent 27%),
    linear-gradient(180deg, transparent 62%, rgba(2, 10, 22, 0.8) 100%);
  pointer-events: none;
}

.voca-setup-nav {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 clamp(22px, 3.5vw, 54px);
  border-bottom: 1px solid rgba(187, 230, 238, 0.1);
  background: linear-gradient(90deg, rgba(1, 8, 18, 0.86), rgba(4, 20, 35, 0.62), rgba(1, 8, 18, 0.84));
  backdrop-filter: blur(18px) saturate(1.15);
}

.voca-back-link {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(207, 237, 242, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(226, 246, 247, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.voca-back-link:hover {
  border-color: rgba(122, 234, 220, 0.38);
  background: rgba(95, 220, 207, 0.08);
  transform: translateX(-2px);
}

.voca-back-link span {
  color: #8ef8e8;
  font-size: 1rem;
}

.voca-academy-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(223, 244, 246, 0.56);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.voca-academy-mark i {
  width: 9px;
  aspect-ratio: 1;
  border: 1px solid #f0cc7d;
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(240, 204, 125, 0.6);
}

.voca-title-lockup {
  grid-template-columns: 100px minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 32px);
}

.voca-logo-orb {
  width: 96px;
  position: relative;
  border-color: rgba(139, 255, 233, 0.8);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95), transparent 8%),
    radial-gradient(circle, rgba(50, 221, 185, 0.88), rgba(28, 92, 135, 0.88) 55%, rgba(3, 13, 30, 0.98) 71%);
  box-shadow:
    0 0 0 8px rgba(94, 247, 220, 0.07),
    0 0 52px rgba(64, 231, 204, 0.48),
    inset 0 0 24px rgba(255, 255, 255, 0.28);
}

.voca-logo-orb::before,
.voca-logo-orb::after {
  content: "";
  position: absolute;
  inset: -17px;
  border: 1px dashed rgba(123, 242, 225, 0.28);
  border-radius: 50%;
  animation: vocaRing 24s linear infinite;
}

.voca-logo-orb::after {
  inset: -29px;
  border-style: solid;
  border-color: rgba(240, 204, 125, 0.13) transparent;
  animation-direction: reverse;
  animation-duration: 31s;
}

.voca-logo-orb i {
  color: white;
  font-style: normal;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.65);
}

.voca-title-lockup h1 {
  margin: 5px 0 13px;
  color: #f5fffd;
  font-size: clamp(4.2rem, 7.7vw, 8.3rem);
  line-height: 0.76;
  letter-spacing: -0.08em;
  text-transform: uppercase;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.5), 0 0 45px rgba(96, 231, 216, 0.12);
}

.voca-title-lockup h1 span {
  color: #91f7e8;
}

.voca-title-lockup .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}

.voca-title-lockup p:last-child {
  max-width: 700px;
  color: rgba(225, 245, 247, 0.78);
  font-size: clamp(0.95rem, 1.35vw, 1.18rem);
  font-weight: 700;
  line-height: 1.55;
}

.voca-hero-portal {
  width: min(390px, 31vw);
  aspect-ratio: 1;
  position: relative;
  z-index: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 246, 230, 0.38);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 42%, rgba(3, 15, 31, 0.52) 68%),
    conic-gradient(from 25deg, rgba(100, 243, 222, 0.04), rgba(239, 198, 108, 0.32), rgba(100, 243, 222, 0.08), rgba(141, 98, 255, 0.3), rgba(100, 243, 222, 0.04));
  box-shadow: 0 0 75px rgba(76, 227, 207, 0.16), inset 0 0 55px rgba(77, 231, 211, 0.13);
}

.voca-hero-portal::before,
.voca-hero-portal::after {
  content: "";
  position: absolute;
  inset: 19px;
  border: 1px dashed rgba(185, 242, 237, 0.32);
  border-radius: 50%;
  animation: vocaRing 36s linear infinite;
}

.voca-hero-portal::after {
  inset: 47px;
  border-color: rgba(239, 201, 113, 0.22);
  animation-direction: reverse;
  animation-duration: 27s;
}

.voca-hero-portal > span {
  position: absolute;
  inset: 38px;
  overflow: hidden;
  border: 1px solid rgba(205, 246, 242, 0.24);
  border-radius: 50%;
  background-image:
    linear-gradient(180deg, transparent 40%, rgba(2, 9, 21, 0.68)),
    url("/assets/voca-hunt/atlas-theme-realms-b.webp");
  background-position: center, 100% 100%;
  background-size: auto, 400% 300%;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.5);
  animation: vocaPortalBreathe 5s ease-in-out infinite;
}

.voca-hero-portal > i,
.voca-hero-portal > small {
  position: absolute;
  z-index: 1;
  margin: 0;
  color: #f5fffd;
  font-style: normal;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.voca-hero-portal > i {
  bottom: 17%;
  font-size: clamp(2.5rem, 4.5vw, 4.7rem);
  font-weight: 950;
  line-height: 0.8;
}

.voca-hero-portal > small {
  bottom: 8%;
  color: #f2d389;
  font-size: 0.61rem;
  font-weight: 950;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.voca-hero-stats {
  position: absolute;
  right: clamp(28px, 5vw, 78px);
  bottom: 22px;
  left: clamp(28px, 5vw, 78px);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(198, 233, 239, 0.12);
  border-radius: 13px;
  background: rgba(1, 11, 24, 0.66);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}

.voca-hero-stats > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-right: 1px solid rgba(198, 233, 239, 0.09);
}

.voca-hero-stats > span:last-child {
  border: 0;
}

.voca-hero-stats strong {
  color: #96f8e9;
  font-size: 1.15rem;
}

.voca-hero-stats small {
  color: rgba(213, 239, 243, 0.53);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voca-setup-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  gap: clamp(16px, 1.8vw, 26px);
  padding: 8px clamp(18px, 2.5vw, 38px) 0;
}

.voca-theme-library {
  gap: 18px;
  padding: clamp(18px, 2.2vw, 30px);
  border: 1px solid rgba(191, 230, 237, 0.12);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(5, 23, 40, 0.82), rgba(1, 12, 26, 0.89));
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(20px);
}

.voca-section-heading {
  align-items: center;
}

.voca-section-heading h2 {
  margin: 4px 0 5px;
  color: #f2fffd;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: -0.04em;
}

.voca-section-heading > div > p:last-child {
  max-width: 660px;
  margin: 0;
  color: rgba(210, 237, 242, 0.57);
  font-size: 0.78rem;
}

.voca-search {
  position: relative;
}

.voca-search i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #8eeedf;
  font-style: normal;
  transform: translateY(-50%);
}

.voca-search input {
  width: min(300px, 30vw);
  min-height: 46px;
  padding-left: 38px;
  border-color: rgba(139, 229, 219, 0.22);
  border-radius: 11px;
  background: rgba(1, 12, 26, 0.7);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.voca-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(194, 232, 239, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  color: rgba(222, 243, 245, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
}

.voca-library-toolbar > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.voca-library-toolbar i {
  width: 6px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #75efdc;
  box-shadow: 0 0 9px #75efdc;
}

.voca-library-toolbar small {
  color: rgba(206, 233, 239, 0.42);
}

.voca-theme-grid {
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: clamp(12px, 1.3vw, 18px);
}

.voca-theme-card {
  min-height: 278px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 178px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(189, 228, 236, 0.16);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(9, 31, 49, 0.98), rgba(2, 14, 28, 0.98));
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transform: none;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.voca-theme-card:hover,
.voca-theme-card.selected {
  border-color: color-mix(in srgb, var(--theme-accent) 62%, #f1d38d 18%);
  background: linear-gradient(160deg, rgba(9, 31, 49, 0.98), rgba(2, 14, 28, 0.98));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32), 0 0 26px color-mix(in srgb, var(--theme-accent) 11%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-5px);
}

.voca-theme-card.selected {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34), 0 0 0 1px color-mix(in srgb, var(--theme-accent) 34%, transparent), 0 0 34px color-mix(in srgb, var(--theme-accent) 16%, transparent);
}

.voca-theme-visual {
  position: relative;
  display: block;
  overflow: hidden;
  border-bottom: 1px solid rgba(207, 237, 241, 0.1);
}

.voca-theme-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(2, 13, 27, 0.88) 100%);
  pointer-events: none;
}

.voca-theme-visual > .voca-realm-cover-image {
  width: 100%;
  height: 100%;
  filter: saturate(0.92) contrast(1.03);
  transform: scale(1.015);
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 300ms ease;
}

.voca-theme-card:hover .voca-theme-visual > .voca-realm-cover-image,
.voca-theme-card.selected .voca-theme-visual > .voca-realm-cover-image {
  filter: saturate(1.1) contrast(1.04);
  transform: scale(1.08);
}

.voca-theme-visual > b,
.voca-theme-visual > em {
  position: absolute;
  z-index: 1;
  top: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(235, 248, 247, 0.16);
  border-radius: 7px;
  background: rgba(1, 10, 22, 0.68);
  color: rgba(238, 252, 250, 0.88);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
}

.voca-theme-visual > b { left: 10px; }

.voca-theme-visual > em {
  right: 10px;
  color: color-mix(in srgb, var(--theme-accent) 65%, white);
}

.voca-theme-copy {
  align-content: center;
  gap: 6px;
  padding: 14px 15px 15px;
}

.voca-theme-copy strong {
  overflow: hidden;
  color: #f3fffd;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voca-theme-copy > small {
  color: rgba(207, 235, 240, 0.5);
  font-size: 0.64rem;
}

.voca-theme-copy > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  color: rgba(205, 234, 239, 0.47);
  font-size: 0.6rem;
  font-weight: 850;
}

.voca-theme-copy > span b {
  color: var(--theme-accent);
}

.voca-theme-copy > span i {
  color: #efd18a;
  font-style: normal;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.voca-theme-card:hover .voca-theme-copy > span i,
.voca-theme-card.selected .voca-theme-copy > span i {
  opacity: 1;
  transform: none;
}

.voca-theme-selected {
  position: absolute;
  z-index: 3;
  top: 146px;
  right: 10px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 55%, white 10%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-accent) 24%, rgba(2, 15, 29, 0.92));
  color: #f3fffd;
  font-size: 0.57rem;
  font-weight: 950;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.voca-theme-card.selected .voca-theme-selected {
  opacity: 1;
  transform: none;
}

.voca-expedition-panel {
  top: 14px;
  gap: 14px;
  padding: 15px;
  border-color: color-mix(in srgb, var(--theme-accent) 35%, rgba(226, 195, 110, 0.28));
  border-radius: 17px;
  background: linear-gradient(160deg, rgba(7, 28, 47, 0.95), rgba(1, 13, 27, 0.98));
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.36), 0 0 34px color-mix(in srgb, var(--theme-accent) 8%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px) saturate(1.08);
}

.voca-expedition-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--theme-accent) 14%, transparent), transparent 34%);
  pointer-events: none;
}

.voca-selected-cover {
  min-height: 190px;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 36%, rgba(226, 197, 117, 0.3));
  border-radius: 13px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.voca-selected-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(1, 9, 21, 0.94) 100%);
  pointer-events: none;
}

.voca-selected-cover > .voca-realm-cover-image {
  position: absolute;
  inset: 0;
  transform: scale(1.03);
}

.voca-selected-cover > div {
  position: absolute;
  z-index: 1;
  right: 15px;
  bottom: 14px;
  left: 15px;
  display: grid;
  gap: 3px;
}

.voca-selected-cover small {
  color: color-mix(in srgb, var(--theme-accent) 68%, white);
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voca-selected-cover strong {
  color: #f4fffd;
  font-size: 1.35rem;
  line-height: 1;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.75);
}

.voca-selected-cover div > span {
  color: rgba(221, 242, 244, 0.62);
  font-size: 0.64rem;
  font-weight: 800;
}

.voca-panel-heading {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.voca-panel-heading .voca-selected-emblem {
  width: 42px;
  margin: 0;
  border-color: color-mix(in srgb, var(--theme-accent) 52%, white 8%);
  box-shadow: 0 0 20px color-mix(in srgb, var(--theme-accent) 18%, transparent);
}

.voca-selected-emblem i {
  color: var(--theme-accent);
  font-style: normal;
  font-weight: 950;
}

.voca-panel-heading p,
.voca-panel-heading h2 {
  margin: 0;
  text-align: left;
}

.voca-panel-heading h2 {
  color: #effffc;
  font-size: 1.25rem;
}

.voca-selected-summary {
  position: relative;
  padding: 10px 11px;
  border: 1px solid rgba(198, 232, 239, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.voca-subtheme-list {
  position: relative;
  max-height: 80px;
  justify-content: flex-start;
  overflow: auto;
}

.voca-settings {
  position: relative;
  grid-template-columns: 1fr;
  gap: 9px;
}

.voca-settings label {
  gap: 6px;
}

.voca-settings label > span {
  color: rgba(217, 239, 243, 0.58);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.voca-settings select {
  min-height: 43px;
  border-color: rgba(189, 230, 237, 0.14);
  border-radius: 9px;
  background: rgba(1, 11, 24, 0.62);
  color: #ecfffc;
}

.voca-settings select option {
  background: #06182a;
  color: #ecfffc;
}

.voca-format-strip {
  position: relative;
  gap: 6px;
}

.voca-format-strip span {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px 2px;
  border: 1px solid rgba(195, 232, 238, 0.08);
  background: color-mix(in srgb, var(--theme-accent) 6%, rgba(255, 255, 255, 0.018));
  font-size: 0.54rem;
}

.voca-format-strip b {
  color: var(--theme-accent);
  font-size: 0.8rem;
}

.voca-no-repeat-note {
  position: relative;
  margin: 0;
  background: color-mix(in srgb, var(--theme-accent) 6%, rgba(255, 255, 255, 0.018));
}

.voca-start-button {
  min-height: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 72%, white 17%);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 86%, white 10%), color-mix(in srgb, var(--theme-accent) 62%, #052635));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 12px 30px color-mix(in srgb, var(--theme-accent) 21%, transparent);
  color: #031720;
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.voca-start-button:hover:not(:disabled) {
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 15px 38px color-mix(in srgb, var(--theme-accent) 30%, transparent);
  transform: translateY(-2px);
}

.voca-start-button i {
  width: 30px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(3, 23, 32, 0.13);
  font-style: normal;
  font-size: 1rem;
}

/* Theme art enters the encounter, instead of living only in the menu. */
.voca-game-territory > .voca-territory-sigil {
  overflow: hidden;
  padding: 0;
}

.voca-territory-sigil > .voca-realm-cover-image {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.voca-realm-portal {
  width: min(260px, 100%);
  aspect-ratio: 0.78;
  position: absolute;
  z-index: -1;
  top: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 40%, rgba(237, 205, 125, 0.34));
  border-radius: 48% 48% 14px 14px / 28% 28% 14px 14px;
  background: rgba(2, 12, 26, 0.86);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38), 0 0 35px color-mix(in srgb, var(--theme-accent) 12%, transparent), inset 0 0 30px rgba(0, 0, 0, 0.28);
}

.voca-realm-portal::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(1, 9, 22, 0.9) 100%);
}

.voca-realm-portal::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 7px;
  border: 1px solid rgba(220, 245, 243, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.voca-realm-portal > .voca-realm-cover-image {
  position: absolute;
  inset: 0;
  filter: saturate(0.9) brightness(0.76);
  transform: scale(1.08);
}

.voca-spirit-aura,
.voca-spirit-ring,
.voca-word-spirit,
.voca-spirit-shadow {
  z-index: 1;
}

.voca-spirit-ring {
  width: min(228px, 86%);
}

.voca-word-spirit {
  width: 112px;
}

.voca-word-spirit::before { left: 28px; }
.voca-word-spirit::after { right: 28px; }

.voca-spirit-caption {
  z-index: 3;
  bottom: -2px;
  border-color: color-mix(in srgb, var(--theme-accent) 22%, rgba(220, 242, 244, 0.13));
  background: rgba(1, 10, 23, 0.82);
}

@keyframes vocaPortalBreathe {
  0%, 100% { filter: saturate(0.95) brightness(0.88); transform: scale(1); }
  50% { filter: saturate(1.12) brightness(1.02); transform: scale(1.025); }
}

@media (max-width: 1380px) {
  .voca-theme-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .voca-title-lockup h1 {
    font-size: clamp(4rem, 7vw, 6.7rem);
  }
}

@media (max-width: 1040px) {
  .voca-setup-hero {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .voca-hero-portal {
    width: 270px;
  }

  .voca-setup-layout {
    grid-template-columns: 1fr;
  }

  .voca-expedition-panel {
    position: relative;
    top: 0;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
  }

  .voca-selected-cover {
    grid-row: 1 / span 4;
    min-height: 100%;
  }

  .voca-start-button,
  .voca-no-repeat-note,
  .voca-expedition-panel > .form-message {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body[data-game="voca-hunt"] #page-voca-hunt-detail {
    width: calc(100% - 12px);
    padding-top: 6px;
  }

  .voca-setup-shell {
    border-radius: 14px;
    background-size: auto, auto, auto 420px, auto;
  }

  .voca-setup-hero {
    min-height: 590px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 28px;
    padding: 88px 20px 105px;
  }

  .voca-setup-nav {
    padding: 0 13px;
  }

  .voca-academy-mark {
    font-size: 0;
  }

  .voca-academy-mark i {
    display: block;
  }

  .voca-title-lockup {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .voca-logo-orb {
    width: 72px;
  }

  .voca-title-lockup h1 {
    font-size: clamp(3.8rem, 21vw, 6rem);
  }

  .voca-title-lockup p:last-child {
    font-size: 0.84rem;
  }

  .voca-hero-portal {
    width: 210px;
  }

  .voca-hero-stats {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .voca-hero-stats > span {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 6px;
    text-align: center;
  }

  .voca-hero-stats small {
    font-size: 0.5rem;
  }

  .voca-setup-layout {
    padding: 5px 7px 0;
  }

  .voca-theme-library {
    padding: 14px;
  }

  .voca-section-heading {
    align-items: stretch;
  }

  .voca-search input {
    width: 100%;
  }

  .voca-theme-grid {
    grid-template-columns: 1fr;
  }

  .voca-theme-card {
    min-height: 300px;
    grid-template-rows: 205px minmax(0, 1fr);
  }

  .voca-theme-selected {
    top: 173px;
  }

  .voca-expedition-panel {
    grid-template-columns: 1fr;
  }

  .voca-selected-cover {
    grid-row: auto;
    min-height: 210px;
  }

  .voca-start-button,
  .voca-no-repeat-note,
  .voca-expedition-panel > .form-message {
    grid-column: auto;
  }

  .voca-realm-portal {
    width: 150px;
    top: 0;
  }

  .voca-spirit-ring {
    width: 132px;
  }

  .voca-word-spirit {
    width: 72px;
  }

  .voca-word-spirit::before { left: 18px; }
  .voca-word-spirit::after { right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .voca-logo-orb::before,
  .voca-logo-orb::after,
  .voca-hero-portal::before,
  .voca-hero-portal::after,
  .voca-hero-portal > span {
    animation: none !important;
  }
}

/* Voca Hunt · legible recall input and premium realm scanner */
body[data-game="voca-hunt"] #voca-written-answer {
  color: #f4fffd !important;
  caret-color: color-mix(in srgb, var(--theme-accent) 78%, white) !important;
  -webkit-text-fill-color: #f4fffd !important;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 850;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px color-mix(in srgb, var(--theme-accent) 16%, transparent);
}

body[data-game="voca-hunt"] #voca-written-answer::placeholder {
  color: rgba(211, 238, 242, 0.36) !important;
  -webkit-text-fill-color: rgba(211, 238, 242, 0.36) !important;
}

body[data-game="voca-hunt"] #voca-written-answer:focus {
  border-color: color-mix(in srgb, var(--theme-accent) 72%, white 12%);
  background: rgba(1, 12, 26, 0.92);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--theme-accent) 13%, transparent),
    0 0 24px color-mix(in srgb, var(--theme-accent) 11%, transparent),
    inset 0 1px 5px rgba(0, 0, 0, 0.4);
}

body[data-game="voca-hunt"] #voca-written-answer:-webkit-autofill,
body[data-game="voca-hunt"] #voca-written-answer:-webkit-autofill:focus {
  -webkit-text-fill-color: #f4fffd !important;
  box-shadow: 0 0 0 1000px #031225 inset !important;
}

body[data-game="voca-hunt"] .voca-visual-cue small {
  top: 9px;
  bottom: auto;
  left: 9px;
  padding: 4px 7px;
  border: 1px solid rgba(237, 211, 139, 0.28);
  border-radius: 6px;
  background: rgba(1, 10, 23, 0.72);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  transform: none;
  backdrop-filter: blur(8px);
}

.voca-realm-portal {
  width: min(278px, 100%);
  aspect-ratio: 0.82;
  top: 0;
  z-index: 0;
  border-color: color-mix(in srgb, var(--theme-accent) 50%, rgba(239, 207, 130, 0.38));
  border-radius: 48% 48% 18px 18px / 25% 25% 18px 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.42),
    0 0 42px color-mix(in srgb, var(--theme-accent) 14%, transparent),
    inset 0 0 36px rgba(0, 0, 0, 0.26);
}

.voca-realm-portal::before {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(1, 10, 23, 0.06) 0 45%, rgba(1, 9, 21, 0.72) 100%),
    radial-gradient(circle at 50% 48%, transparent 0 24%, color-mix(in srgb, var(--theme-accent) 9%, transparent) 48%, transparent 70%);
}

.voca-realm-portal::after {
  inset: 8px;
  border-color: color-mix(in srgb, var(--theme-accent) 27%, rgba(226, 242, 242, 0.12));
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.025);
}

.voca-realm-portal > .voca-realm-cover-image {
  filter: saturate(1.02) brightness(0.86) contrast(1.03);
  transform: scale(1.06);
}

.voca-portal-scan {
  height: 2px;
  position: absolute;
  z-index: 3;
  top: 12%;
  right: 14px;
  left: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--theme-accent) 88%, white), transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--theme-accent) 72%, transparent);
  opacity: 0.68;
  animation: vocaPortalScan 4.8s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.voca-target-reticle {
  width: 112px;
  aspect-ratio: 1;
  position: absolute;
  z-index: 4;
  bottom: 60px;
  left: 50%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 56%, rgba(238, 213, 150, 0.38));
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(2, 14, 29, 0.78) 0 25%, transparent 26%),
    repeating-conic-gradient(from 4deg, color-mix(in srgb, var(--theme-accent) 46%, transparent) 0 1deg, transparent 1deg 29deg),
    rgba(2, 13, 27, 0.42);
  box-shadow:
    0 0 0 7px rgba(2, 13, 27, 0.35),
    0 0 28px color-mix(in srgb, var(--theme-accent) 24%, transparent),
    inset 0 0 24px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.voca-target-reticle::before,
.voca-target-reticle::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.voca-target-reticle::before {
  inset: 13px;
  border: 1px dashed color-mix(in srgb, var(--theme-accent) 48%, rgba(255, 255, 255, 0.16));
  border-radius: 50%;
  animation: vocaRing 18s linear infinite;
}

.voca-target-reticle::after {
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 76%, white 12%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-accent) 38%, rgba(5, 29, 45, 0.86)), rgba(2, 12, 27, 0.9));
  box-shadow:
    0 0 20px color-mix(in srgb, var(--theme-accent) 25%, transparent),
    inset 0 0 12px rgba(255, 255, 255, 0.06);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: rotate(45deg);
}

.voca-target-reticle > i {
  width: 68px;
  aspect-ratio: 1;
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 22%, transparent);
  border-radius: 50%;
  animation: vocaRing 13s linear infinite reverse;
}

.voca-target-reticle > b {
  position: relative;
  z-index: 2;
  color: #f7fffd;
  font-size: 1rem;
  text-shadow: 0 0 12px color-mix(in srgb, var(--theme-accent) 82%, white);
}

.voca-spirit-caption {
  bottom: -4px;
  min-width: 214px;
  padding: 10px 14px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(3, 17, 33, 0.94), rgba(1, 10, 23, 0.94));
}

@keyframes vocaPortalScan {
  0%, 100% { opacity: 0; transform: translateY(0); }
  12% { opacity: 0.7; }
  72% { opacity: 0.5; }
  86% { opacity: 0; transform: translateY(245px); }
}

@media (max-width: 720px) {
  .voca-realm-portal {
    width: 164px;
  }

  .voca-target-reticle {
    width: 76px;
    bottom: 20px;
  }

  .voca-target-reticle::before {
    inset: 9px;
  }

  .voca-target-reticle::after {
    width: 34px;
  }

  .voca-target-reticle > i {
    width: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voca-portal-scan,
  .voca-target-reticle::before,
  .voca-target-reticle > i {
    animation: none !important;
  }
}

/* Grammar Clash · streamlined mode selection and lobby */
.grammar-mode-select {
  width: min(1380px, 100%);
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  margin: auto;
  align-content: center;
  justify-items: stretch;
  gap: clamp(20px, 3vw, 38px);
}

.grammar-mode-hero {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 3vw, 46px);
  padding: 0 clamp(2px, 1vw, 14px);
}

.grammar-mode-hero .moonveil-game-logo {
  width: 100%;
  max-height: 92px;
  object-fit: contain;
  object-position: left center;
}

.grammar-mode-hero h1 {
  margin: 2px 0 7px;
  color: #fff7e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 4.7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: none;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.52);
}

.grammar-mode-hero p:not(.eyebrow) {
  max-width: 690px;
  margin: 0;
  color: rgba(235, 240, 255, 0.72);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}

.grammar-join-code {
  min-width: 178px;
  justify-content: space-between;
  border-color: rgba(238, 208, 127, 0.42);
  background: rgba(7, 11, 31, 0.66);
  backdrop-filter: blur(16px);
}

.grammar-mode-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.72fr);
  gap: clamp(18px, 2.2vw, 30px);
}

.grammar-mode-select .grammar-mode-card {
  position: relative;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  font: inherit;
  text-align: left;
}

.grammar-mode-select .grammar-mode-card.available {
  min-height: clamp(390px, 52vh, 520px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  align-content: stretch;
  gap: 0;
  padding: 0;
  color: #f8f4ff;
  border: 1px solid rgba(245, 213, 127, 0.72);
  border-radius: 22px;
  background: rgba(5, 8, 24, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), 0 0 42px rgba(118, 70, 225, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.grammar-mode-select .grammar-mode-card.available:hover,
.grammar-mode-select .grammar-mode-card.available:focus-visible {
  transform: translateY(-4px);
  border-color: #ffe49c;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5), 0 0 52px rgba(155, 81, 255, 0.32);
}

.grammar-mode-select .grammar-mode-card.available::before,
.grammar-mode-select .grammar-mode-card.available::after,
.grammar-mode-select .grammar-mode-card.locked::before,
.grammar-mode-select .grammar-mode-card.locked::after {
  display: none;
  content: none;
}

.grammar-mode-cover {
  position: relative;
  min-height: 100%;
  display: block;
  overflow: hidden;
}

.grammar-mode-cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 42%, rgba(5, 8, 24, 0.92) 100%), linear-gradient(180deg, transparent 55%, rgba(5, 8, 24, 0.5));
  content: "";
}

.grammar-mode-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.grammar-mode-card.available:hover .grammar-mode-cover img {
  transform: scale(1.035);
}

.grammar-mode-cover .mode-status {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: #eaffdd;
  border: 1px solid rgba(156, 241, 125, 0.38);
  border-radius: 999px;
  background: rgba(8, 28, 22, 0.76);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.grammar-mode-cover .mode-status i {
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #8eff6e;
  box-shadow: 0 0 12px #8eff6e;
}

.grammar-mode-copy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 15px;
  padding: clamp(28px, 3vw, 46px);
}

.grammar-mode-title {
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.2vw, 3.5rem);
  line-height: 0.98;
}

.grammar-mode-description {
  color: rgba(232, 237, 255, 0.75);
  font-size: 1rem;
  line-height: 1.58;
}

.grammar-mode-select .mode-meta {
  justify-content: flex-start;
  gap: 7px;
}

.grammar-mode-select .mode-meta span {
  padding: 7px 9px;
  color: #d9dcff;
  border: 1px solid rgba(166, 153, 236, 0.22);
  border-radius: 999px;
  background: rgba(129, 99, 214, 0.1);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.grammar-mode-select .mode-play-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 18px;
  color: #171028;
  border: 1px solid #ffe69d;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffe79c, #e9af45);
  box-shadow: 0 14px 30px rgba(199, 132, 40, 0.2);
  font-size: 1rem;
  font-weight: 950;
  text-transform: none;
}

.grammar-coming-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 2.3vw, 30px);
  border: 1px solid rgba(166, 153, 236, 0.22);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(16, 18, 48, 0.88), rgba(5, 8, 24, 0.9));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.grammar-coming-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(166, 153, 236, 0.17);
}

.grammar-coming-heading h2 {
  margin: 2px 0 0;
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.2vw, 2.3rem);
}

.grammar-coming-heading > span,
.mode-lock-pill {
  color: rgba(225, 222, 242, 0.58);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.grammar-future-grid {
  display: grid;
  gap: 12px;
}

.grammar-mode-select .grammar-mode-card.locked {
  min-height: 130px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: #f0edfa;
  border: 1px solid rgba(172, 159, 225, 0.17);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  filter: none;
  opacity: 1;
}

.mode-lock-icon {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #c3b7ff;
  border: 1px solid rgba(168, 145, 255, 0.28);
  border-radius: 12px;
  background: radial-gradient(circle, rgba(128, 91, 229, 0.24), rgba(12, 14, 39, 0.5));
  font-size: 1.5rem;
}

.grammar-future-copy {
  display: grid;
  gap: 5px;
}

.grammar-future-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.grammar-future-copy > span {
  color: rgba(225, 222, 242, 0.58);
  font-size: 0.78rem;
  line-height: 1.42;
}

.mode-lock-pill {
  padding: 7px 9px;
  border: 1px solid rgba(172, 159, 225, 0.17);
  border-radius: 999px;
  white-space: nowrap;
}

.moonveil-lobby-frame {
  min-height: calc(100dvh - clamp(28px, 4vw, 56px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(14px, 1.6vw, 22px);
  padding: clamp(14px, 1.8vw, 24px);
}

.grammar-live-lobby.moonveil-lobby-frame {
  min-height: 100dvh;
}

.moonveil-lobby-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(390px, 1.1fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(190, 176, 239, 0.2);
  border-radius: 18px;
  background: rgba(5, 8, 25, 0.84);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.moonveil-lobby-brand,
.moonveil-host-card,
.moonveil-code-panel {
  display: flex;
  align-items: center;
}

.moonveil-lobby-brand {
  gap: 14px;
}

.moonveil-lobby-brand .moonveil-mini-logo {
  width: 86px;
  min-width: 86px;
  padding: 0;
}

.moonveil-lobby-brand .moonveil-mini-logo img {
  width: 100%;
  max-height: 54px;
  object-fit: contain;
}

.moonveil-lobby-brand h1 {
  margin: 2px 0 0;
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.moonveil-code-panel {
  width: 100%;
  justify-self: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(245, 213, 127, 0.36);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(65, 40, 126, 0.34), rgba(8, 13, 34, 0.78));
  box-shadow: inset 0 0 24px rgba(138, 85, 228, 0.09);
  text-align: left;
}

.moonveil-code-panel strong {
  display: block;
  margin-top: 1px;
  color: #fff5cf;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: 0.18em;
  line-height: 1;
  text-shadow: 0 0 18px rgba(245, 213, 127, 0.24);
}

.moonveil-code-panel .ghost-button {
  min-width: 112px;
  min-height: 42px;
}

.moonveil-host-card {
  justify-content: flex-end;
  gap: 10px;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: left;
}

.moonveil-host-card .avatar-token {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.moonveil-host-card > div {
  min-width: 0;
  display: grid;
}

.moonveil-host-card small {
  color: rgba(224, 225, 241, 0.54);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.moonveil-host-card strong {
  overflow: hidden;
  color: #f9f5ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moonveil-host-card .danger-button {
  min-height: 38px;
  margin-left: 5px;
  padding-inline: 12px;
}

.moonveil-lobby-main,
.moonveil-lobby-side {
  min-width: 0;
  align-content: start;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid rgba(190, 176, 239, 0.18);
  border-radius: 18px;
  background: rgba(5, 8, 25, 0.82);
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.moonveil-lobby-main::before {
  display: none;
  content: none;
}

.grammar-lobby-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(190, 176, 239, 0.15);
}

.grammar-lobby-heading h2 {
  margin: 2px 0 0;
  color: #fff8e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
}

.grammar-lobby-heading .grammar-lobby-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.grammar-lobby-heading .grammar-tab {
  min-height: 38px;
  padding: 0 13px;
  color: rgba(229, 226, 244, 0.62);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 850;
}

.grammar-lobby-heading .grammar-tab:hover {
  color: #fff;
  background: rgba(133, 94, 222, 0.11);
}

.grammar-lobby-heading .grammar-tab.active {
  color: #fff3c7;
  border-color: rgba(245, 213, 127, 0.38);
  background: rgba(192, 139, 44, 0.11);
}

.grammar-lobby-panel {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.moonveil-lobby-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grammar-lobby-readiness {
  padding: 17px;
  border: 1px solid rgba(145, 255, 120, 0.18);
  border-radius: 14px;
  background: rgba(60, 129, 58, 0.07);
}

.grammar-readiness-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 5px 0 10px;
}

.grammar-readiness-count strong {
  color: #efffe6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
  line-height: 1;
}

.grammar-readiness-count span,
.grammar-lobby-readiness > p:last-child {
  color: rgba(225, 236, 229, 0.62);
  font-size: 0.78rem;
}

.grammar-readiness-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.grammar-readiness-bar i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #87d969, #d4f58f);
  box-shadow: 0 0 12px rgba(151, 240, 117, 0.45);
}

.grammar-lobby-readiness > p:last-child {
  margin: 10px 0 0;
  line-height: 1.45;
}

.moonveil-lobby-side .lobby-controls {
  display: grid;
  gap: 10px;
}

.moonveil-lobby-side .gold-button {
  min-height: 58px;
  justify-content: space-between;
  font-family: inherit;
  font-size: 1rem;
}

.moonveil-lobby-side .gold-button:disabled {
  min-height: 58px;
  opacity: 0.48;
}

.moonveil-lobby-side .grammar-lobby-footer {
  min-height: 0;
  display: grid;
  gap: 14px;
  margin-top: 0;
  padding: 17px;
  border-color: rgba(190, 176, 239, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.grammar-faction-summary h2 {
  margin: 3px 0 5px;
  color: #fff8e8;
  font-size: 1.25rem;
}

.grammar-faction-summary > p:last-child {
  margin: 0;
  color: rgba(224, 221, 239, 0.62);
  font-size: 0.78rem;
  line-height: 1.45;
}

.moonveil-lobby-side .grammar-settings-strip {
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.moonveil-lobby-side .grammar-settings-strip span {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.7rem;
}

.moonveil-lobby-frame:has(.faction-stage) {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
}

.moonveil-lobby-frame:has(.faction-stage) .moonveil-lobby-side {
  display: flex;
}

.grammar-player-card .avatar-token {
  position: relative;
}

.grammar-player-card {
  display: grid;
}

@media (max-width: 1120px) {
  .grammar-mode-showcase {
    grid-template-columns: 1fr;
  }

  .grammar-future-grid {
    grid-template-columns: 1fr 1fr;
  }

  .moonveil-lobby-topbar {
    grid-template-columns: 1fr 1.25fr;
  }

  .moonveil-host-card {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid rgba(190, 176, 239, 0.14);
  }

  .moonveil-host-card .danger-button {
    margin-left: auto;
  }

  .moonveil-lobby-frame,
  .moonveil-lobby-frame:has(.faction-stage) {
    grid-template-columns: 1fr;
  }

  .moonveil-lobby-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .moonveil-lobby-side .grammar-lobby-footer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .grammar-mode-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .grammar-mode-hero .moonveil-game-logo {
    width: 170px;
  }

  .grammar-join-code {
    width: 100%;
  }

  .grammar-mode-select .grammar-mode-card.available {
    grid-template-columns: 1fr;
  }

  .grammar-mode-cover {
    min-height: 240px;
  }

  .grammar-mode-cover::after {
    background: linear-gradient(180deg, transparent 50%, rgba(5, 8, 24, 0.92));
  }

  .grammar-future-grid,
  .moonveil-lobby-topbar,
  .moonveil-lobby-side {
    grid-template-columns: 1fr;
  }

  .moonveil-code-panel {
    order: 3;
  }

  .moonveil-host-card {
    grid-column: auto;
  }

  .grammar-lobby-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .grammar-lobby-heading .grammar-lobby-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lobby-players-layout > .grammar-setup-panel {
    display: none;
  }

  .moonveil-lobby-side .grammar-lobby-footer {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .grammar-mode-select .grammar-mode-card.locked {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .mode-lock-icon {
    width: 48px;
  }

  .mode-lock-pill {
    grid-column: 2;
    justify-self: start;
  }

  .moonveil-lobby-topbar,
  .moonveil-lobby-main,
  .moonveil-lobby-side {
    padding: 14px;
  }

  .moonveil-lobby-brand .moonveil-mini-logo {
    width: 66px;
    min-width: 66px;
  }

  .moonveil-code-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .moonveil-code-panel .ghost-button {
    width: 100%;
  }
}

/* Grammar Clash V2: combat clarity and dual match recognition, scoped to this game. */
.grammar-live-game.phase-action { height: auto; min-height: 100dvh; overflow-y: visible; }
.grammar-live-game .grammar-action-phase-screen { height: auto; }
.grammar-live-game.phase-action .grammar-status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.grammar-live-game.host-controller .game-top { display: flex; }
.grammar-live-game.host-controller:is(.phase-question, .phase-answer_feedback, .phase-action) .game-top { padding: 8px 12px; justify-content: flex-end; }
.grammar-live-game.host-controller:is(.phase-question, .phase-answer_feedback, .phase-action) .game-top > div:first-child { display: none; }
.grammar-live-game.host-controller:is(.phase-question, .phase-answer_feedback, .phase-action) .game-top .game-actions { display: flex; flex-wrap: wrap; }
.grammar-live-game.phase-action .grammar-status-strip:not(.host-status) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grammar-live-game.phase-action .grammar-status-strip:not(.host-status) article:nth-child(n+5) { display: none; }
.grammar-live-game .grammar-player-board .grammar-combat-card { height: auto; min-height: 280px; grid-auto-rows: auto; }
.grammar-live-game .combat-target-callout { position: static; transform: none; }
.grammar-ward { display: block; padding: 5px 8px; color: #d6e3ff; font-size: .78rem; }
.grammar-ward.protected { color: #b0f4ff; border: 1px solid #6ccde9; border-radius: 8px; background: #15354c; }
.grammar-live-game .grammar-combat-card:disabled { cursor: default; opacity: 1; }
.grammar-live-game .grammar-combat-card.invalid-target { cursor: not-allowed; }
.grammar-scholar-banner { margin: 14px 0; padding: 18px 24px; border: 1px solid #a99bf0; border-radius: 18px; background: linear-gradient(120deg, #272340, #141d38); color: #eeeaff; }
.grammar-scholar-banner h2 { margin: 5px 0; }
.grammar-scholar-banner p { margin: 5px 0; }
.grammar-results-v2 { display: grid; gap: 22px; min-width: 0; }
.grammar-live-game.phase-ended .grammar-status-strip { display: none; }
.grammar-winner-avatar, .grammar-result-avatar { position: relative; }
.grammar-winner-grid, .grammar-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grammar-winner-card { display: grid; justify-items: center; align-content: start; gap: 9px; padding: 26px 20px; border: 1px solid #bd9860; border-radius: 22px; background: radial-gradient(ellipse at top, #584326, #161a2e 75%); text-align: center; color: #fff3d9; }
.grammar-winner-card.knowledge { border-color: #a79de1; background: radial-gradient(ellipse at top, #3a3265, #161a2e 75%); }
.grammar-winner-card .eyebrow { font-size: .94rem; text-transform: uppercase; letter-spacing: .1em; }
.grammar-winner-card h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); overflow-wrap: anywhere; }
.grammar-winner-card p { margin: 0; }
.grammar-winner-card small { color: #d9d4e8; }
.grammar-winner-avatar { width: 112px; height: 112px; overflow: hidden; border-radius: 50%; border: 2px solid #e6c56e; }
.grammar-winner-avatar img, .grammar-result-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.grammar-double-crown { padding: 18px; text-align: center; border: 1px solid #d7bd6d; border-radius: 18px; background: linear-gradient(100deg, #342c44, #574123, #342c44); color: #fff0b8; }
.grammar-double-crown strong { display: block; text-transform: uppercase; font-size: 1.6rem; letter-spacing: .14em; }
.grammar-double-crown p { margin: 5px 0 0; }
.grammar-match-summary, .grammar-results-ranking { padding: 22px; border: 1px solid #514565; border-radius: 18px; background: #16192de8; color: #eee9fa; min-width: 0; }
.grammar-match-summary h2, .grammar-results-ranking h2 { margin: 0 0 14px; font-size: 1.2rem; }
.grammar-match-summary > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 12px; }
.grammar-match-summary article { display: grid; gap: 6px; }
.grammar-match-summary article span { color: #ccc3dd; font-size: .8rem; }
.grammar-result-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid #4e425f; font-size: .88rem; }
.grammar-result-row b { overflow-wrap: anywhere; }
.grammar-result-row small { display: block; margin-top: 5px; color: #c8bed5; }
.grammar-result-row.forfeited { opacity: .7; }
.grammar-result-avatar { display: block; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; }
.grammar-replay-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.grammar-replay-actions button { min-height: 48px; }
.grammar-replay-actions .primary-button { min-width: 220px; font-size: 1.15rem; text-transform: uppercase; }
.grammar-results-v2 .grammar-history-list { max-height: 240px; overflow-y: auto; }
@media (max-width: 650px) {
  .grammar-live-game.phase-action .grammar-status-strip:not(.host-status) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grammar-winner-grid, .grammar-ranking-grid { grid-template-columns: minmax(0, 1fr); }
  .grammar-live-game.host-controller .game-top { flex-wrap: wrap; }
  .grammar-winner-card, .grammar-match-summary, .grammar-results-ranking { padding: 18px 14px; }
  .grammar-result-row { grid-template-columns: 36px minmax(0, 1fr); }
  .grammar-result-row > span:last-child { grid-column: 2; }
  .grammar-result-avatar { width: 36px; height: 36px; }
  .grammar-scholar-banner { padding: 16px; }
}
