*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 640px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.2rem;
  color: #f5c842;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: #9a9ab0;
  font-size: 1rem;
}

.filters {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  border: 1px solid #0f3460;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="number"],
select {
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #f5c842;
}

input::placeholder {
  color: #4a5a70;
}

.field-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toggle-btn {
  flex: unset;
  padding: 0.6rem 0.8rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #9a9ab0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.toggle-btn.toggle-on {
  background: #1e4d2b;
  border-color: #5dd67a;
  color: #5dd67a;
}

.type-tag {
  font-size: 0.78rem;
  color: #6a7a90;
}

.buttons {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.2rem;
}

button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

button:active {
  transform: scale(0.97);
}

#suggest-btn {
  background: #f5c842;
  color: #1a1a2e;
}

#surprise-btn {
  background: #e05252;
  color: #fff;
}

button:hover {
  opacity: 0.9;
}

.results h2 {
  font-size: 1.1rem;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

#game-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.game-card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.game-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-card-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.why-btn {
  flex: unset;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid #f5c842;
  border-radius: 6px;
  color: #f5c842;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.why-btn:hover:not(:disabled) {
  background: rgba(245, 200, 66, 0.12);
}

.why-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.why-text {
  font-size: 0.9rem;
  color: #c0c8d8;
  line-height: 1.5;
  border-top: 1px solid #0f3460;
  padding-top: 0.6rem;
}

.game-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 0.3rem;
}

.game-meta {
  font-size: 0.85rem;
  color: #9a9ab0;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-low    { background: #1e4d2b; color: #5dd67a; }
.badge-medium { background: #4d3a1a; color: #f5a842; }
.badge-high   { background: #4d1a1a; color: #f55252; }

.game-rating {
  font-size: 0.8rem;
  color: #f5c842;
  letter-spacing: 0.05em;
}

.coop-tag {
  font-size: 0.78rem;
  color: #5dd67a;
}

.hidden {
  display: none !important;
}

.no-results p {
  text-align: center;
  color: #9a9ab0;
  font-size: 1rem;
  padding: 1.5rem;
  background: #16213e;
  border-radius: 10px;
  border: 1px solid #0f3460;
}

/* ── Games in Progress ───────────────────────────────────────────────────── */
.games-in-progress {
  background: #16213e;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #f5a842;
}

.games-in-progress .section-label {
  margin-bottom: 0.8rem;
  color: #f5a842;
}

.gip-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gip-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
}

.gip-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.gip-game {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e0e0;
}

.gip-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.gip-players {
  display: flex;
  gap: 0.25rem;
}

.gip-time {
  font-size: 0.78rem;
  color: #9a9ab0;
}

.resume-btn {
  flex: unset;
  white-space: nowrap;
  padding: 0.4rem 0.9rem;
  background: #f5a842;
  color: #1a1a2e;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.resume-btn:hover {
  opacity: 0.9;
}

/* ── Roll Call ───────────────────────────────────────────────────────────── */
.roll-call {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #0f3460;
}

.roll-call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vault-btn {
  flex: unset;
  padding: 0.35rem 0.9rem;
  background: transparent;
  border: 1px solid #f5c842;
  border-radius: 6px;
  color: #f5c842;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.vault-btn:hover {
  background: rgba(245, 200, 66, 0.1);
  opacity: 1;
}

.roll-call-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.roll-call-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 20px;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, border-color 0.15s;
  user-select: none;
}

.roll-call-chip:hover {
  opacity: 0.75;
}

.roll-call-chip.active {
  opacity: 1;
  border-color: #f5c842;
}

.roll-call-chip.active:hover {
  opacity: 0.85;
}

.check {
  font-size: 0.75rem;
  color: #f5c842;
  font-weight: 700;
}

/* ── Player Vault Modal list ─────────────────────────────────────────────── */
.vault-list {
  margin-top: 0.8rem;
}

.vault-header-row,
.vault-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
}

.vault-header-row {
  border-bottom: 1px solid #1a4a80;
  margin-bottom: 0.2rem;
}

.vault-row {
  border-bottom: 1px solid #0f3460;
}

.vault-row:last-child {
  border-bottom: none;
}

.vault-col-player {
  font-size: 0.88rem;
  color: #e0e0e0;
}

.vault-col-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a7a90;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-align: right;
}

.vault-header-row .vault-col-player {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a7a90;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vault-col-date {
  font-size: 0.8rem;
  color: #6a7a90;
  text-align: right;
  white-space: nowrap;
}

/* ── Player Input Row (shared: vault modal) ──────────────────────────────── */
.player-input-row {
  display: flex;
  gap: 0.6rem;
}

.player-input-row input[type="text"] {
  flex: 1;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
}

.player-input-row input[type="text"]:focus {
  outline: none;
  border-color: #f5c842;
}

.player-input-row input[type="text"].input-error {
  border-color: #e05252;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

#add-vault-btn {
  flex: unset;
  padding: 0.6rem 1.2rem;
  background: #f5c842;
  color: #1a1a2e;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 20px;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transition: opacity 0.15s;
}

.avatar:hover {
  opacity: 0.8;
}

.avatar-initials {
  color: #1a1a2e;
}

.avatar-emoji {
  background: #1a3060;
  font-size: 1rem;
}

.player-name {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.player-remove {
  flex: unset;
  background: none;
  border: none;
  color: #6a7a90;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: auto;
  transition: color 0.15s;
}

.player-remove:hover {
  color: #e05252;
  opacity: 1;
}

.add-player-row {
  margin-top: 0.4rem;
}

.add-player-row select {
  width: 100%;
  background: #0f3460;
  border: 1px dashed #1a4a80;
  border-radius: 8px;
  color: #6a7a90;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.add-player-row select:focus {
  outline: none;
  border-color: #f5c842;
  color: #e0e0e0;
}

/* ── Expanded Game Card ──────────────────────────────────────────────────── */
.game-card {
  cursor: pointer;
  transition: border-color 0.15s;
}

.game-card:hover {
  border-color: #1a4a80;
}

.game-card.expanded {
  border-color: #f5c842;
}

.game-detail {
  border-top: 1px solid #0f3460;
  padding-top: 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-detail-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #9a9ab0;
}

.lets-play-btn {
  flex: unset;
  white-space: nowrap;
  padding: 0.5rem 1.4rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.lets-play-btn:hover {
  opacity: 0.9;
}

/* ── Modal Overlay ───────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.88);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

/* ── Session Modal ───────────────────────────────────────────────────────── */
.modal-panel {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid #0f3460;
  flex-shrink: 0;
}

.session-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f5c842;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pause-btn {
  flex: unset;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid #4a5a70;
  border-radius: 6px;
  color: #9a9ab0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.pause-btn:hover {
  border-color: #9a9ab0;
  color: #e0e0e0;
  opacity: 1;
}


.modal-close {
  flex: unset;
  background: none;
  border: none;
  color: #9a9ab0;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.modal-close:hover {
  color: #e0e0e0;
  opacity: 1;
}

/* ── Modal Columns / Slider Layout ──────────────────────────────────────── */
.modal-cols {
  overflow: hidden;
}

.modal-left-col {
  overflow: hidden;
}

.left-slider {
  display: flex;
  width: 200%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-slider.show-feedback {
  transform: translateX(-50%);
}

.session-panels {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.modal-section {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #0f3460;
  background: #16213e;
}

.modal-section:last-child {
  border-bottom: none;
}

.modal-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a7a90;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.session-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.no-players-msg {
  font-size: 0.82rem;
  color: #6a7a90;
  font-style: italic;
}

/* Desktop: 2-column dashboard */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
  }

  .modal-panel {
    width: 92vw;
    max-width: 1300px;
    height: 88vh;
    max-height: 88vh;
    overflow: hidden;
  }

  .modal-cols {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    background: #0a1628;
    gap: 1px;
  }

  .modal-left-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0a1628;
    gap: 1px;
  }

  .left-slider {
    flex: 1;
    min-height: 0;
  }

  .session-panels {
    overflow-y: auto;
  }

  .session-panels .modal-section:last-child {
    flex: 1;
    min-height: 0;
    border-bottom: none;
  }

  .feedback-body {
    overflow-y: auto;
  }

  .modal-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0a1628;
    gap: 1px;
  }

  .modal-right-col .modal-section:last-child {
    flex: 1;
    min-height: 0;
    border-bottom: none;
  }

  .modal-section {
    padding: 0.8rem 1rem;
    border-bottom: none;
    overflow-y: auto;
  }
}

/* ── Timer ───────────────────────────────────────────────────────────────── */
.timer-display {
  font-size: 2rem;
  font-weight: 700;
  color: #f5c842;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.6rem;
}

.timer-controls {
  display: flex;
  gap: 0.5rem;
}

.timer-controls button {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

#timer-toggle-btn {
  background: #f5c842;
  color: #1a1a2e;
}

.timer-reset-btn {
  background: #0f3460;
  color: #9a9ab0;
  border: 1px solid #1a4a80;
}

/* ── Dice Roller ─────────────────────────────────────────────────────────── */
.dice-die-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.dice-die-btn {
  padding: 0.3rem 0.55rem;
  background: #0f3460;
  color: #9a9ab0;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.dice-die-btn:hover {
  color: #e8eaf6;
  border-color: #3a6aaa;
}

.dice-die-btn.active {
  background: #1a4a80;
  color: #f5c842;
  border-color: #f5c842;
}

.dice-roll-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.dice-svg {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

@keyframes dice-shake {
  0%   { transform: rotate(0deg)   scale(1); }
  15%  { transform: rotate(-10deg) scale(1.12); }
  35%  { transform: rotate(9deg)   scale(1.08); }
  55%  { transform: rotate(-6deg)  scale(1.1); }
  75%  { transform: rotate(4deg)   scale(1.05); }
  100% { transform: rotate(0deg)   scale(1); }
}

.dice-shaking {
  animation: dice-shake 0.5s ease-in-out;
}

.dice-roll-btn {
  padding: 0.45rem 1rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.dice-roll-btn:hover {
  background: #ffd966;
}

.dice-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.4rem;
}

.dice-history-chip {
  font-size: 0.75rem;
  color: #6a7a90;
  background: #0f3460;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.dice-history-chip strong {
  color: #9a9ab0;
}

/* ── Score Tracker ───────────────────────────────────────────────────────── */
.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.score-header .modal-section-label {
  margin-bottom: 0;
}

.score-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.score-mode-btn {
  flex: unset;
  padding: 0.25rem 0.7rem;
  background: transparent;
  border: 1px solid #4a5a70;
  border-radius: 6px;
  color: #9a9ab0;
  font-size: 0.75rem;
  cursor: pointer;
}

.score-mode-btn:hover {
  border-color: #9a9ab0;
  opacity: 1;
}

.low-score-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #9a9ab0;
  cursor: pointer;
  user-select: none;
}

.low-score-toggle input {
  accent-color: #f5c842;
  cursor: pointer;
}

.score-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.score-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.score-player .player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-controls-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.score-adj {
  flex: unset;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.score-adj:hover {
  background: #1a4a80;
  opacity: 1;
}

.score-input {
  width: 60px;
  text-align: center;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 1rem;
  padding: 0.3rem 0.4rem;
}

.score-input:focus {
  outline: none;
  border-color: #f5c842;
}

.winlose-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.outcome-btn {
  flex: 1;
  padding: 0.6rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #9a9ab0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.outcome-btn:hover {
  opacity: 0.85;
}

.outcome-win {
  background: #1e4d2b;
  border-color: #5dd67a;
  color: #5dd67a;
}

.outcome-loss {
  background: #4d1a1a;
  border-color: #e05252;
  color: #e05252;
}

.end-game-btn {
  width: 100%;
  padding: 0.45rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #9a9ab0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0.5rem;
}

.end-game-btn:hover:not(:disabled) {
  border-color: #f5c842;
  color: #f5c842;
  opacity: 1;
}

.end-game-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.winner-banner {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f5c842;
  padding: 0.4rem;
  border-radius: 8px;
  background: rgba(245, 200, 66, 0.08);
}

/* ── Feedback View ───────────────────────────────────────────────────────── */
.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.2rem 1.5rem;
  width: 50%;
  flex-shrink: 0;
}

.feedback-section {
  margin-bottom: 1rem;
}

.feedback-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.feedback-player-header .modal-section-label {
  margin-bottom: 0;
}

.feedback-progress {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6a7a90;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feedback-player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.feedback-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 20px;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
  user-select: none;
}

.feedback-chip:hover {
  opacity: 0.75;
}

.feedback-chip.active {
  opacity: 1;
  border-color: #f5c842;
}

.feedback-chip.done {
  opacity: 0.75;
  border-color: #5dd67a;
}

.feedback-chip.active.done {
  opacity: 1;
  border-color: #5dd67a;
}

.feedback-chip-check {
  font-size: 0.7rem;
  color: #5dd67a;
  font-weight: 700;
}

.feedback-active-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #0f3460;
}

.feedback-active-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
}

.feedback-player-form {
  flex: 1;
  min-height: 0;
}

.feedback-field {
  margin-bottom: 0.9rem;
}

.feedback-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #0f3460;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.summary-row span:first-child {
  color: #6a7a90;
  flex-shrink: 0;
}

.summary-row span:last-child {
  color: #e0e0e0;
  text-align: right;
}

.star-rating {
  display: flex;
  gap: 0.4rem;
}

.star-btn {
  flex: unset;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #2a3a5a;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
}

.star-btn:hover,
.star-btn.star-on {
  color: #f5c842;
  opacity: 1;
}

.star-btn:active {
  transform: scale(1.2);
}

.play-again-btns {
  display: flex;
  gap: 0.6rem;
}

.play-again-btn {
  flex: 1;
  padding: 0.5rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #9a9ab0;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.play-again-btn:hover {
  border-color: #9a9ab0;
  opacity: 1;
}

.play-again-active {
  border-color: #f5c842 !important;
  color: #f5c842 !important;
  background: rgba(245, 200, 66, 0.08) !important;
}

.session-notes {
  width: 100%;
  min-height: 80px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 0.6rem 0.8rem;
  resize: vertical;
}

.session-notes:focus {
  outline: none;
  border-color: #f5c842;
}

.feedback-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.8rem;
}

.back-btn {
  flex: unset;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #4a5a70;
  border-radius: 8px;
  color: #9a9ab0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.back-btn:hover {
  border-color: #9a9ab0;
  color: #e0e0e0;
  opacity: 1;
}

.feedback-finalize {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.finalize-note {
  font-size: 0.72rem;
  color: #6a7a90;
  font-style: italic;
  text-align: right;
}

.finalize-session-btn {
  flex: unset;
  padding: 0.55rem 1.2rem;
  background: #f5c842;
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.finalize-session-btn:hover {
  opacity: 0.9;
}

/* ── Spotify Player ──────────────────────────────────────────────────────── */
.spotify-container iframe {
  border-radius: 10px;
  display: block;
}

.spotify-options {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.35rem;
}

.spotify-option-btn {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #6a7a90;
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-option-btn:hover {
  color: #e0e0e0;
  border-color: #1a4a80;
}

.spotify-option-btn.active {
  color: #f5c842;
  border-color: #1a4a80;
}

.spotify-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}


.spotify-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.spotify-change-btn,
.spotify-save-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #1a4a80;
  background: transparent;
  color: #6a7a90;
  cursor: pointer;
  white-space: nowrap;
}

.spotify-change-btn:hover {
  border-color: #f5c842;
  color: #f5c842;
}

.spotify-save-btn:hover {
  border-color: #5dd67a;
  color: #5dd67a;
}

.spotify-save-btn.saved {
  border-color: #5dd67a;
  color: #5dd67a;
}

.spotify-search-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.spotify-search-row input {
  flex: 1;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
}

.spotify-search-row input:focus {
  outline: none;
  border-color: #f5c842;
}

.spotify-search-row button {
  padding: 0.35rem 0.7rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Emoji Picker ────────────────────────────────────────────────────────── */
.emoji-picker {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 1.2rem;
  width: 300px;
  text-align: center;
}

.emoji-picker-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.emoji-option {
  flex: unset;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  font-size: 1.3rem;
  padding: 0.35rem;
  cursor: pointer;
  transition: background 0.15s;
}

.emoji-option:hover {
  background: #1a4a80;
  opacity: 1;
}

.emoji-clear-btn {
  flex: unset;
  background: transparent;
  border: 1px solid #4a5a70;
  color: #9a9ab0;
  border-radius: 6px;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

/* ── Roll Call header actions ────────────────────────────────────────────── */
.roll-call-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Settings Modal ──────────────────────────────────────────────────────── */
body.hide-why .why-btn {
  display: none !important;
}

.settings-panel {
  max-width: 420px;
}

.settings-body {
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6a7a90;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #0f3460;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-row-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e0e0e0;
}

.settings-row-desc {
  font-size: 0.78rem;
  color: #6a7a90;
}

/* ── Play History Modal ──────────────────────────────────────────────────── */
.history-panel {
  max-width: 560px;
}

.history-body {
  overflow-y: auto;
  flex: 1;
  padding: 1rem 1.2rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.history-card {
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.history-game {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
}

.history-date {
  font-size: 0.75rem;
  color: #6a7a90;
  white-space: nowrap;
}

.history-players {
  display: flex;
  gap: 0.25rem;
}

.history-result {
  font-size: 0.82rem;
  color: #9a9ab0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.history-winner {
  color: #f5c842;
  font-weight: 700;
}

.history-sep {
  color: #4a5a70;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: #6a7a90;
}

.history-stars {
  color: #f5c842;
  letter-spacing: 0.02em;
}

/* ── Quick Search ────────────────────────────────────────────────────────── */
.quick-search {
  margin-bottom: 1rem;
}

.quick-search-row {
  position: relative;
  display: flex;
  align-items: center;
}

.quick-search-row input[type="text"] {
  width: 100%;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 1rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  transition: border-color 0.15s;
}

.quick-search-row input[type="text"]:focus {
  outline: none;
  border-color: #f5c842;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  flex: unset;
  background: none;
  border: none;
  color: #6a7a90;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.search-clear-btn:hover {
  color: #e0e0e0;
  opacity: 1;
}

/* ── Player Stats Modal ──────────────────────────────────────────────────── */
.stats-panel {
  max-width: 520px;
}

.stats-body {
  overflow-y: auto;
  flex: 1;
  padding: 1rem 1.2rem;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.stats-card {
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-player-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
  flex: 1;
}

.stats-games-played {
  font-size: 0.75rem;
  color: #6a7a90;
  white-space: nowrap;
}

.stats-rows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid #1a4a80;
  padding-top: 0.5rem;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
}

.stats-row span:first-child {
  color: #6a7a90;
  flex-shrink: 0;
}

.stats-row span:last-child {
  color: #e0e0e0;
  text-align: right;
}

.stats-stars {
  color: #f5c842;
}

.stats-muted {
  color: #6a7a90;
}

/* ── Stats Tabs ──────────────────────────────────────────────────────────── */
.stats-tabs {
  display: flex;
  border-bottom: 1px solid #0f3460;
  flex-shrink: 0;
}

.stats-tab {
  flex: 1;
  padding: 0.55rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6a7a90;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s;
  margin-bottom: -1px;
}

.stats-tab:hover {
  color: #9a9ab0;
  opacity: 1;
}

.stats-tab.active {
  color: #f5c842;
  border-bottom-color: #f5c842;
}

/* ── Head-to-Head ────────────────────────────────────────────────────────── */
.h2h-selectors {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.h2h-selector {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.h2h-vs {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6a7a90;
  padding-top: 0.3rem;
  flex-shrink: 0;
}

.h2h-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 20px;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
  user-select: none;
}

.h2h-chip:hover { opacity: 0.75; }
.h2h-chip.active { opacity: 1; border-color: #f5c842; }

.h2h-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #0f3460;
}

.h2h-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.h2h-player-right {
  align-items: center;
}

.h2h-name {
  font-size: 0.82rem;
  color: #9a9ab0;
  text-align: center;
}

.h2h-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: #4a5a70;
  line-height: 1;
}

.h2h-leader {
  color: #f5c842;
}

.h2h-divider {
  font-size: 1.5rem;
  color: #4a5a70;
  flex-shrink: 0;
}

.h2h-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6a7a90;
  padding-bottom: 0.5rem;
}

.h2h-result {
  min-height: 60px;
}

/* ── BGG Sync ────────────────────────────────────────────────────────────── */
.settings-row-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.bgg-username-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.bgg-username-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: #1a1a2e;
  border: 1px solid #2a3a5e;
  border-radius: 8px;
  color: #e8eaf6;
  font-size: 0.88rem;
  outline: none;
}

.bgg-username-input:focus {
  border-color: #f5c842;
}

.bgg-username-input.input-error {
  border-color: #e05252;
  animation: shake 0.3s;
}

.bgg-sync-btn {
  padding: 0.5rem 1rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.bgg-sync-btn:hover:not(:disabled) {
  background: #ffd966;
}

.bgg-sync-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.bgg-file-input {
  display: none;
}

.bgg-file-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f5c842;
  color: #1a1a2e;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.bgg-file-label:hover {
  background: #ffd966;
}

.bgg-sync-status {
  font-size: 0.78rem;
  color: #6a7a90;
  min-height: 1em;
}

.bgg-sync-ok    { color: #5dd67a; }
.bgg-sync-error { color: #e05252; }

/* ── Game Library ────────────────────────────────────────────────────────── */
.library-panel {
  width: 95vw;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 0.75rem;
  flex-wrap: wrap;
}

.library-toolbar input {
  flex: 1;
  min-width: 120px;
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.88rem;
  padding: 0.4rem 0.7rem;
}

.library-toolbar input:focus {
  outline: none;
  border-color: #f5c842;
}

.library-sort-btns {
  display: flex;
  gap: 0.25rem;
}

.lib-sort-btn {
  padding: 0.3rem 0.6rem;
  background: transparent;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #6a7a90;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.lib-sort-btn.active {
  border-color: #f5c842;
  color: #f5c842;
}

.lib-add-btn {
  padding: 0.3rem 0.75rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.lib-add-btn:hover { background: #ffd966; }

.add-game-form {
  background: #0f3460;
  border: 1px solid #1a4a80;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.add-game-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.add-game-fields input,
.add-game-fields select {
  background: #16213e;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  min-width: 0;
}

#ag-name { flex: 2; min-width: 140px; }
#ag-type, #ag-complexity { flex: 1; min-width: 100px; }
#ag-min-players, #ag-max-players, #ag-age { flex: 1; min-width: 70px; }
#ag-playtime { flex: 1; min-width: 80px; }

.add-game-fields input:focus,
.add-game-fields select:focus {
  outline: none;
  border-color: #f5c842;
}

.ag-coop-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #a0aab8;
  white-space: nowrap;
  padding: 0.35rem 0.1rem;
}

.add-game-actions {
  display: flex;
  gap: 0.5rem;
}

.ag-submit-btn {
  padding: 0.35rem 0.9rem;
  background: #f5c842;
  color: #1a1a2e;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ag-cancel-btn {
  padding: 0.35rem 0.9rem;
  background: transparent;
  border: 1px solid #1a4a80;
  border-radius: 6px;
  color: #6a7a90;
  font-size: 0.82rem;
  cursor: pointer;
}

.library-count {
  font-size: 0.75rem;
  color: #6a7a90;
  margin-bottom: 0.4rem;
}

.library-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lib-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: #0f3460;
  min-width: 0;
}

.lib-row:hover { background: #16213e; }

.lib-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.lib-thumb-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a4a80;
  color: #f5c842;
  font-weight: 700;
  font-size: 1rem;
}

.lib-info {
  flex: 1;
  min-width: 0;
}

.lib-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-meta {
  font-size: 0.72rem;
  color: #6a7a90;
  margin-top: 0.1rem;
}

.lib-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lib-rating {
  display: flex;
  gap: 0.05rem;
}

.lib-star {
  color: #1a4a80;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.1s;
  line-height: 1;
}

.lib-star.filled { color: #f5c842; }
.lib-star:hover  { color: #ffd966; }

.lib-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #1a4a80;
  background: transparent;
  color: #a0aab8;
  cursor: pointer;
  white-space: nowrap;
}

.lib-tag:hover { border-color: #f5c842; color: #f5c842; }

.lib-complexity-low    { border-color: #5dd67a; color: #5dd67a; }
.lib-complexity-medium { border-color: #f5c842; color: #f5c842; }
.lib-complexity-high   { border-color: #e05252; color: #e05252; }

.lib-toggle {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #1a4a80;
  background: transparent;
  color: #6a7a90;
  cursor: pointer;
  white-space: nowrap;
}

.lib-toggle.on {
  background: #1a4a80;
  color: #e0e0e0;
  border-color: #1a4a80;
}

.lib-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.lib-spotify-badge { color: #1DB954; border: 1px solid #1DB954; }
.lib-bgg-badge     { color: #6a7a90; border: 1px solid #1a4a80; }
.lib-bgg-badge:hover { color: #f5c842; border-color: #f5c842; }

.lib-delete {
  background: none;
  border: none;
  color: #6a7a90;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
  flex-shrink: 0;
}

.lib-delete:hover { color: #e05252; }
