/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  position: relative;
}

/* --- Screens --- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.screen.active {
  display: flex;
}

/* --- Typography --- */
h1.logo {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #e94560;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e0e0f0;
}

.subtitle {
  color: #9090b0;
  font-size: 0.95rem;
}

/* --- Card --- */
.card {
  background: #16213e;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* --- Inputs --- */
.text-input {
  width: 100%;
  padding: 12px 14px;
  background: #0f3460;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #e0e0f0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.text-input::placeholder {
  color: #5050a0;
}

.text-input:focus {
  border-color: #e94560;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  font-size: 1.1rem;
}

/* --- Mode selector --- */
.mode-selector {
  display: flex;
  gap: 8px;
}

.mode-btn {
  flex: 1;
  padding: 10px 4px;
  background: #0f3460;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #9090b0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-btn:hover {
  border-color: #e94560;
  color: #e0e0f0;
}

.mode-btn.active {
  border-color: #e94560;
  color: #e94560;
  background: #1a1a2e;
}

/* --- Buttons --- */
.btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-primary {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.btn-primary:hover {
  background: #c73550;
  border-color: #c73550;
}

.btn-accent {
  background: #16c79a;
  color: #1a1a2e;
  border-color: #16c79a;
}

.btn-accent:hover {
  background: #12a880;
  border-color: #12a880;
}

.btn-secondary {
  background: #0f3460;
  color: #e0e0f0;
  border-color: #0f3460;
}

.btn-secondary:hover {
  border-color: #e94560;
}

.btn-ghost {
  background: transparent;
  color: #9090b0;
  border-color: #3a3a5e;
}

.btn-ghost:hover {
  color: #e0e0f0;
  border-color: #9090b0;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* --- Join row --- */
.join-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.join-row .text-input {
  flex: 1;
}

/* --- Divider --- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5050a0;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2a4e;
}

/* --- Error messages --- */
.error-msg {
  color: #e94560;
  font-size: 0.9rem;
  min-height: 1.2em;
  text-align: center;
}

/* --- Waiting screen --- */
.code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #16213e;
  border-radius: 12px;
  padding: 20px 28px;
}

.room-code-large {
  font-family: 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: #e94560;
}

.copy-btn {
  background: none;
  border: 2px solid #3a3a5e;
  border-radius: 6px;
  color: #9090b0;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: #e94560;
  color: #e94560;
}

.copy-btn.copied {
  border-color: #4caf50;
  color: #4caf50;
}

.waiting-label {
  color: #9090b0;
  font-size: 1rem;
}

/* --- Animated dots --- */
.dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* --- Searching screen (matchmaking) --- */
.searching-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #2a2a4e;
  border-top-color: #16c79a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.searching-info {
  color: #9090b0;
  font-size: 0.9rem;
  text-align: center;
}

.searching-message {
  color: #9090b0;
  font-size: 1rem;
  text-align: center;
  min-height: 1.5em;
}

.searching-timer {
  font-size: 2rem;
  font-weight: 900;
  color: #e0e0f0;
}

/* --- Game screen --- */
.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a4e;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-code-small {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #9090b0;
}

.copy-btn-sm {
  background: none;
  border: none;
  color: #5050a0;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.copy-btn-sm:hover {
  color: #e94560;
}

.player-strip {
  font-size: 0.95rem;
  color: #9090b0;
  text-align: center;
}

.player-strip strong {
  color: #e0e0f0;
}

.score-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: #16213e;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
}

.score-label {
  color: #e0e0f0;
}

.score-sep {
  color: #5050a0;
}

/* --- Board --- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 360px;
}

.cell {
  aspect-ratio: 1;
  background: #16213e;
  border: 2px solid #2a2a4e;
  border-radius: 10px;
  font-size: 3rem;
  font-weight: 900;
  color: #e0e0f0;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 1;
}

.cell:hover:not(:disabled) {
  background: #1e2a50;
  border-color: #e94560;
  transform: scale(1.04);
}

.cell:disabled {
  cursor: default;
  opacity: 0.7;
}

.cell.cell-x {
  color: #e94560;
}

.cell.cell-o {
  color: #4cc9f0;
}

/* --- Status text --- */
.status-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #9090b0;
  min-height: 1.4em;
  text-align: center;
}

.status-text.your-turn {
  color: #4caf50;
}

/* --- Game actions --- */
.game-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --- Error banner --- */
.error-banner {
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid #e94560;
  border-radius: 8px;
  padding: 10px 14px;
  color: #e94560;
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
}

/* --- Login screen --- */
.screen[data-screen="login"] .card {
  gap: 14px;
}

/* --- Home screen --- */
.home-identity {
  font-size: 1.1rem;
  color: #9090b0;
}

.home-identity strong {
  color: #e0e0f0;
}

.home-card {
  gap: 10px;
}

/* --- Active sessions list (home) --- */
.active-sessions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-card {
  background: #16213e;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s, transform 0.05s;
  text-align: left;
}

.session-card:hover {
  border-color: #e94560;
}

.session-card:active {
  transform: scale(0.99);
}

.session-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.session-card-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #e0e0f0;
}

.session-card-opponent {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-card-line2 {
  font-size: 0.8rem;
  color: #9090b0;
}

.session-card-score {
  font-weight: 700;
  color: #e0e0f0;
  font-variant-numeric: tabular-nums;
}

.session-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.session-tag-your_turn {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.session-tag-their_turn {
  color: #9090b0;
  background: rgba(144, 144, 176, 0.08);
}

.session-tag-won {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.session-tag-lost {
  color: #e94560;
  background: rgba(233, 69, 96, 0.08);
}

.session-tag-draw {
  color: #f0c060;
  background: rgba(240, 192, 96, 0.08);
}

.session-tag-expired {
  color: #6a6a8a;
  background: rgba(106, 106, 138, 0.08);
}

/* Unseen indicator: small pulsing dot to the left of the card */
.session-card-unseen {
  position: relative;
}
.session-card-unseen::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c63ff;
  animation: unseen-pulse 2s ease-in-out infinite;
}
@keyframes unseen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.session-group-recent .session-card {
  opacity: 0.65;
}

.session-group-recent .session-card:hover {
  opacity: 1;
}

.session-group-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5050a0;
  padding: 0 4px;
}

/* --- Play screen --- */
.play-identity {
  font-size: 0.95rem;
  color: #9090b0;
}

.play-identity strong {
  color: #e0e0f0;
}

/* --- Profile screen --- */
.profile-header {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9090b0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-field .text-input {
  flex: 1;
}

.save-msg {
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}

.save-msg.success {
  color: #4caf50;
}

.save-msg.error {
  color: #e94560;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #9090b0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-item {
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #e0e0f0;
}

.stat-label {
  font-size: 0.75rem;
  color: #9090b0;
  text-transform: uppercase;
}

.profile-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f3460;
  border-radius: 8px;
  font-size: 0.85rem;
}

.match-info {
  color: #9090b0;
}

.match-result {
  font-weight: 700;
}

.match-result.won {
  color: #4caf50;
}

.match-result.lost {
  color: #e94560;
}

.match-result.draw {
  color: #ffb347;
}

.empty-state {
  color: #5050a0;
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 0;
}

/* --- Button disabled state --- */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background: #e94560;
  border-color: #e94560;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 28, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: #16213e;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.modal-outcome {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
}

.modal-outcome.victory {
  color: #4caf50;
}

.modal-outcome.defeat {
  color: #e94560;
}

.modal-outcome.draw {
  color: #ffb347;
}

.modal-summary {
  color: #9090b0;
  font-size: 0.95rem;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.modal-actions .btn {
  flex: 1;
  max-width: 160px;
}

.modal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.modal-state-text {
  color: #9090b0;
  font-size: 0.95rem;
  text-align: center;
}

.modal-countdown {
  color: #5050a0;
  font-size: 0.85rem;
}

/* --- Modal Board Preview --- */
.modal-board-preview {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.modal-board-preview:empty {
  display: none;
}

.modal-board-preview .preview-board {
  pointer-events: none;
}

/* Classic TTT preview */
.modal-board-preview .ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 180px;
}

.modal-board-preview .ttt-board .preview-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: #0f1a30;
  border-radius: 4px;
  border: 2px solid #2a2a4e;
}

/* Redirect TTT preview */
.modal-board-preview .redirect-board {
  max-width: 300px;
  width: 100%;
  gap: 4px;
}

.modal-board-preview .mini-board {
  gap: 1px;
  padding: 2px;
}

.modal-board-preview .mini-board .preview-cell {
  min-width: 0;
  font-size: 0.65rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1a30;
  border-radius: 2px;
  border: 1px solid #2a2a4e;
  font-weight: 700;
}

/* Suppress game-board overlays in preview */
.modal-board-preview .mini-board.won-x,
.modal-board-preview .mini-board.won-o,
.modal-board-preview .mini-board.drawn {
  opacity: 1;
}

.modal-board-preview .mini-board.won-x::after,
.modal-board-preview .mini-board.won-o::after,
.modal-board-preview .mini-board.drawn::after {
  display: none;
}

/* Winning board highlight */
.modal-board-preview .mini-board.winning-board {
  border-color: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

/* Winning cells — green glow */
.modal-board-preview .winning-cell {
  background: rgba(76, 175, 80, 0.25) !important;
  border-color: #4caf50 !important;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
  color: #4caf50 !important;
}

/* --- Spinner --- */
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #2a2a4e;
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ------------------------------------------------------------------ */
/* Redirect TTT                                                        */
/* ------------------------------------------------------------------ */

.redirect-board-header {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 500px;
  margin-bottom: 4px;
}

.rules-info-btn {
  background: none;
  border: 1px solid #2a2a4e;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  color: #9090b0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.rules-info-btn:hover {
  color: #e0e0f0;
  border-color: #e94560;
}

.redirect-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 500px;
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
  border: 2px solid #2a2a4e;
  border-radius: 8px;
  background: #16213e;
  transition: border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
  position: relative;
}

.mini-board.active {
  border-color: #e94560;
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.mini-board.won-x,
.mini-board.won-o {
  opacity: 0.45;
}

.mini-board.won-x::after,
.mini-board.won-o::after,
.mini-board.drawn::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border-radius: 6px;
  pointer-events: none;
}

.mini-board.won-x::after {
  content: 'X';
  font-size: 2.5rem;
  color: #e94560;
  background: rgba(22, 33, 62, 0.7);
}

.mini-board.won-o::after {
  content: 'O';
  font-size: 2.5rem;
  color: #4cc9f0;
  background: rgba(22, 33, 62, 0.7);
}

.mini-board.drawn {
  opacity: 0.35;
}

.mini-board.drawn::after {
  content: '\2014';
  font-size: 2rem;
  color: #9090b0;
  background: rgba(22, 33, 62, 0.5);
}

.mini-board.winning-board {
  border-color: #4caf50;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.4);
}

.mini-board .cell.winning-cell {
  background: rgba(76, 175, 80, 0.25);
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
  color: #4caf50;
}

.mini-board .cell {
  aspect-ratio: 1;
  background: #1a1a2e;
  border: 1px solid #2a2a4e;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #e0e0f0;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  line-height: 1;
}

.mini-board .cell:hover:not(:disabled) {
  background: #1e2a50;
  border-color: #e94560;
}

.mini-board .cell:disabled {
  cursor: default;
  opacity: 0.6;
}

.mini-board .cell.cell-x {
  color: #e94560;
}

.mini-board .cell.cell-o {
  color: #4cc9f0;
}

.mini-board .cell.last-move {
  border-color: #f0c040;
  box-shadow: 0 0 4px rgba(240, 192, 64, 0.3);
}

/* Rules info modal */
.rules-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 28, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.rules-modal.hidden {
  display: none;
}

.rules-modal-content {
  background: #16213e;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.rules-modal-content h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #e0e0f0;
}

.rules-modal-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #b0b0d0;
  line-height: 1.5;
}

.rules-modal-content strong {
  color: #e0e0f0;
}

.rules-close-btn {
  align-self: center;
  margin-top: 4px;
  padding: 8px 24px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.rules-close-btn:hover {
  background: #d63850;
}

@media (max-width: 400px) {
  .redirect-board {
    gap: 4px;
  }
  .mini-board {
    padding: 2px;
    gap: 1px;
  }
  .mini-board .cell {
    font-size: 0.7rem;
    min-width: 24px;
    min-height: 24px;
  }
  .mini-board.won-x::after,
  .mini-board.won-o::after {
    font-size: 1.8rem;
  }
}

/* ------------------------------------------------------------------ */
/* Friends                                                             */
/* ------------------------------------------------------------------ */

.field-hint {
  color: #6a6a8a;
  font-size: 0.75rem;
  margin: 0;
}

.handle-label {
  color: #6a6a8a;
  font-size: 0.85rem;
  text-align: center;
  margin: -4px 0 8px;
}

.badge {
  display: inline-block;
  background: #e94560;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a4e;
  gap: 8px;
}

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

.friend-info {
  color: #e0e0f0;
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.friends-list .empty-state {
  color: #6a6a8a;
  font-size: 0.85rem;
  padding: 8px 0;
}

/* ------------------------------------------------------------------ */
/* Challenge search results                                            */
/* ------------------------------------------------------------------ */

.challenge-search-results {
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item {
  background: #0f1a30;
  border: 1px solid #2a2a4e;
  border-radius: 6px;
  padding: 8px 12px;
  color: #e0e0f0;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
}

.search-result-item:hover {
  border-color: #e94560;
}

.search-result-item.selected {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}
