:root {
  --bg: #12092a;
  --bg-soft: #1a1033;
  --card: #241645;
  --card-2: #2d1b58;
  --text: #f3e9ff;
  --muted: #a99dc7;
  --primary: #ff4d8f;
  --primary-2: #ff7aa6;
  --accent: #7dd3fc;
  --good: #4ade80;
  --bad: #f87171;
  --warn: #facc15;
  --border: #3a265f;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --radius: 18px;
}

[data-theme="light"] {
  --bg: #f5f0ff;
  --bg-soft: #fff;
  --card: #ffffff;
  --card-2: #f5f0ff;
  --text: #1a0b36;
  --muted: #6b5b8a;
  --primary: #e11d74;
  --primary-2: #f43f7d;
  --accent: #0284c7;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #ca8a04;
  --border: #e0d5f2;
  --shadow: 0 10px 40px rgba(100, 50, 150, 0.12);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: contain;
}

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 77, 143, 0.18), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(125, 211, 252, 0.12), transparent 45%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 15% 10%, rgba(225, 29, 116, 0.08), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(2, 132, 199, 0.06), transparent 45%),
    var(--bg);
}

#app {
  width: 100%;
  max-width: 520px;
  padding: 16px;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  position: relative;
}

@media (min-height: 760px) and (min-width: 640px) {
  body { align-items: center; }
  #app { padding: 24px; }
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}
.top-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-width: 44px;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
}
.top-toggle:active { transform: scale(0.95); }
.top-toggle.off { opacity: 0.45; }
.top-toggle.leave {
  background: transparent;
  border-color: var(--bad);
  color: var(--bad);
}
.top-toggle.leave:hover { background: rgba(248, 113, 113, 0.1); }

.screen {
  display: none;
  animation: fadeIn 0.25s ease;
}
.screen.active { display: block; }

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 16px;
}

.hero {
  text-align: center;
  padding-top: 28px;
}
.brand-logo {
  display: block !important;
  position: relative !important;
  width: 200px !important;
  height: 200px !important;
  max-width: 60% !important;
  margin: 0 auto 8px !important;
  float: none !important;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(255, 77, 143, 0.3));
  animation: floaty 4s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.logo {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.logo-m {
  color: var(--primary);
  text-shadow: 0 0 24px rgba(255, 77, 143, 0.4);
}
.tagline {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 24px;
}

h3 {
  margin: 18px 0 10px;
  font-size: 16px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.mtop { margin-top: 10px; }

.input-group {
  text-align: left;
  margin-bottom: 12px;
}
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="number"], input:not([type]), select {
  width: 100%;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 143, 0.18);
}

#room-code {
  text-transform: uppercase;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 800;
  font-size: 22px;
}

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.12s ease, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 6px 20px rgba(255, 77, 143, 0.32);
}
.btn-secondary {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn.small { padding: 8px 12px; font-size: 13px; width: auto; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 14px 0 0;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.room-code {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--primary);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.player-list li {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.player-list .player-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list .player-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-kick {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--bad);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  transition: background 0.15s;
}
.btn-kick:hover { background: rgba(248, 113, 113, 0.12); }
.player-list li.eliminated { opacity: 0.45; }
.player-list li.eliminated .player-name { text-decoration: line-through; }
.player-list li.eliminated .badge.elim {
  background: var(--bad);
  color: white;
}
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.you { background: var(--accent); color: #0b1f33; }

.settings .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.settings label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.settings-readonly {
  list-style: none;
  padding: 0;
  margin: 0;
}
.settings-readonly li {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.settings-readonly li:last-child { border-bottom: none; }
.settings-readonly b { color: var(--text); }

/* Reveal */
.reveal-card { text-align: center; padding: 28px 22px; }
.reveal-cover {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  margin-top: 18px;
}
.cover-text { color: var(--muted); margin-bottom: 14px; }

.word-big {
  font-size: 42px;
  font-weight: 900;
  color: var(--primary);
  margin: 12px 0;
  word-break: break-word;
  letter-spacing: -1px;
}
.impostor-badge {
  background: linear-gradient(135deg, #7c2d12, #b91c1c);
  color: white;
  padding: 18px;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 14px 0;
  box-shadow: 0 6px 24px rgba(185, 28, 28, 0.35);
}
.ready-list { margin-top: 16px; }

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.chip-list li {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.chip-list li.done {
  background: var(--good);
  color: #0b2814;
  border-color: transparent;
}
.chip-list li.current {
  background: var(--primary);
  color: white;
  border-color: transparent;
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 143, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 77, 143, 0); }
}

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.phase-title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
}
.timer {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: right;
}
.timer.warning { color: var(--warn); }
.timer.danger { color: var(--bad); animation: shake 0.4s ease infinite; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.order-row { margin-bottom: 12px; }

.input-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 6px;
}
.input-row input { flex: 1; }
.input-row .btn { margin: 0; width: auto; padding: 14px 18px; }

.hint-waiting {
  background: var(--card-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  margin: 10px 0;
}

.hints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hints-list li {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hints-list .hint-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.hints-list .hint-text {
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}
.hints-list.small-list li { padding: 8px 12px; font-size: 13px; }

.vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.vote-card {
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  min-height: 110px;
  justify-content: center;
}
.vote-card:active:not(:disabled) { transform: scale(0.97); }
.vote-card:hover:not(:disabled) {
  border-color: var(--primary);
}
.vote-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255, 77, 143, 0.22), rgba(255, 77, 143, 0.06));
  box-shadow: 0 0 0 3px rgba(255, 77, 143, 0.15);
}
.vote-card .avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
  border-width: 3px;
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.vote-card.voted .avatar { border-color: var(--good); }
.vote-card.skipped-vote .avatar { border-color: var(--muted); opacity: 0.7; }
.vote-card .vote-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 14px;
  word-break: break-word;
}
.vote-card .vote-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.vote-card .vote-hint {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  font-style: italic;
  padding: 4px 8px;
  background: rgba(125, 211, 252, 0.08);
  border-radius: 8px;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.25;
}
.vote-card .vote-hint.skipped {
  color: var(--muted);
  background: transparent;
  font-style: italic;
  opacity: 0.7;
}
.vote-card .vote-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--good);
  color: #0b2814;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.vote-card .vote-check.skipped { background: var(--muted); color: var(--bg); }
.vote-card.voted { border-color: var(--good); }
.vote-card.skipped-vote { opacity: 0.6; border-style: dashed; }
.vote-card.eliminated-target { opacity: 0.4; border-style: dotted; cursor: not-allowed; }
.vote-card:disabled { cursor: not-allowed; }
/* Elimination screen */
.elimination-card {
  text-align: center;
  padding: 32px 22px;
}
.elim-headline {
  font-size: 26px;
  font-weight: 900;
  margin: 18px 0 10px;
  padding: 16px;
  border-radius: 14px;
  letter-spacing: -0.5px;
}
.elim-headline.bad { background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(248, 113, 113, 0.04)); color: var(--bad); }
.elim-headline.good { background: linear-gradient(135deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.04)); color: var(--good); }
.elim-headline.neutral { background: var(--card-2); color: var(--muted); }
.elim-name { font-size: 32px; font-weight: 900; margin-bottom: 8px; color: var(--text); }
.elim-sub { margin-bottom: 18px; }
.elim-progress {
  height: 6px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 8px;
}
.elim-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  width: 100%;
  transition: width linear;
}

.result-winner {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin: 10px 0 16px;
  padding: 14px;
  border-radius: 14px;
}
.result-winner.win-players {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.05));
  color: var(--good);
}
.result-winner.win-impostor {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(248, 113, 113, 0.05));
  color: var(--bad);
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: center;
  margin-bottom: 6px;
}
.result-row .word-big { font-size: 28px; }
.result-impostor {
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
}

.scoreboard {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.scoreboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
}
.scoreboard .score-val {
  font-weight: 900;
  color: var(--primary);
  font-size: 18px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 100;
  font-size: 14px;
  max-width: 90%;
}

.settings .grid .full { grid-column: 1 / -1; }

/* Word reminder banner (hint/voting screens) */
.word-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 77, 143, 0.15), rgba(255, 77, 143, 0.05));
  border: 1px solid rgba(255, 77, 143, 0.3);
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.word-reminder b {
  font-size: 22px;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.word-reminder.small b { font-size: 18px; }
.word-reminder.impostor {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(185, 28, 28, 0.08));
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--bad);
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.word-reminder.impostor .impostor-label {
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
}
.word-reminder.impostor .impostor-cat {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}
.word-reminder.impostor .impostor-cat b {
  color: var(--warn);
  text-transform: capitalize;
  font-weight: 700;
}

.cycle-tag {
  display: inline-block;
  background: var(--accent);
  color: #06243a;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Voting redesign */
.hints-recap-toggle {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.hints-recap-toggle summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.hints-recap-toggle summary::-webkit-details-marker { display: none; }
.hints-recap-toggle summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.2s;
}
.hints-recap-toggle[open] summary::before { transform: rotate(90deg); }
.hints-recap-toggle ul { margin-top: 10px; }

.vote-progress {
  margin-bottom: 12px;
}
.vote-progress-bar {
  height: 8px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--good));
  width: 0%;
  transition: width 0.3s ease;
}
.vote-progress-text {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

.eliminated-banner {
  background: var(--card-2);
  border: 1px dashed var(--bad);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--bad);
  font-weight: 700;
  margin-bottom: 12px;
}

.skip-btn { margin-top: 6px; }

/* AVATARS */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border);
  vertical-align: middle;
  background-size: cover;
  background-position: center;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-letter {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  border-color: transparent;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; border-width: 3px; }
.avatar-xl { width: 88px; height: 88px; font-size: 32px; border-width: 3px; }

.name-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.name-row input { flex: 1; }
.avatar-preview-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  transition: transform 0.12s;
}
.avatar-preview-btn:active { transform: scale(0.95); }
.avatar-preview-btn::after {
  content: "\270E";
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--primary);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--card);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.avatar-option {
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
  aspect-ratio: 1;
}
.avatar-option:hover { border-color: var(--primary); }
.avatar-option:active { transform: scale(0.95); }
.avatar-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255, 77, 143, 0.2), rgba(255, 77, 143, 0.05));
  box-shadow: 0 0 0 3px rgba(255, 77, 143, 0.2);
}
.avatar-option .avatar { width: 100%; height: 100%; border: none; border-radius: 50%; }
.avatar-option.none .avatar { border: 2px dashed var(--border); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.avatar-empty { padding: 40px 12px; }

.player-list .avatar { margin-right: 10px; }
.scoreboard .avatar { margin-right: 8px; }
.chip-list li .avatar { margin-right: 4px; vertical-align: middle; }
.hint-name .avatar, .hint-name-row .avatar { margin-right: 6px; vertical-align: middle; }

.small-btn { padding: 10px 12px; font-size: 13px; margin-top: 6px; }

.shared-hints {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 14px;
}
.shared-hints .chip-list { margin-top: 6px; }
.shared-hints .chip-list li { background: var(--bg-soft); }
.chip-list.center-row { justify-content: center; }

.category-hint {
  margin-top: 14px;
  padding: 10px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.category-hint b { color: var(--text); text-transform: capitalize; }

.chip-list li.skipped {
  background: var(--bg-soft);
  color: var(--muted);
  font-style: italic;
  border-style: dashed;
}

.hints-list li.skipped .hint-text {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}

.vote-card.skipped-vote {
  opacity: 0.6;
  border-style: dashed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

.confirm-modal { align-items: center; z-index: 100; }
.confirm-inner {
  max-width: 360px;
  text-align: center;
  animation: popIn 0.22s cubic-bezier(.2,.8,.3,1.1);
}
.confirm-inner h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}
.confirm-inner p {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.confirm-actions .btn { margin: 0; }
.confirm-modal.danger .btn-primary {
  background: linear-gradient(135deg, var(--bad), #ef4444);
  box-shadow: 0 6px 20px rgba(248, 113, 113, 0.32);
}
@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal.hidden { display: none; }
.modal-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 520px;
  width: 100%;
  margin: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-header h3 { margin: 0; }

.editor-form {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.editor-form .input-group { margin-bottom: 10px; }

.word-edit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.word-edit-list li {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.word-edit-list .we-word {
  font-weight: 700;
}
.word-edit-list .we-hints {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
  word-break: break-word;
}
.word-edit-list .we-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1f33;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.word-edit-list .we-tag.custom { background: var(--primary); color: white; }
.word-edit-list .we-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--bad);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.word-edit-list .we-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: var(--muted);
}

@media (min-width: 640px) {
  .vote-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .settings .grid { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 1fr; }
}
