:root {
  --header-h: 56px; /* matches our top nav height; adjust if needed */
}

@media (min-width: 1024px) {
  /* Desktop layout container */
  .choice-board {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
  }

  /* Lanes */
  .lane {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 320px;
  }
  .lane--a, .lane--b, .lane--c { grid-column: auto; }

  .lane-h {
    position: sticky; top: calc(var(--header-h) + 8px);
    z-index: 2;
    padding: 6px 8px;
    font: 600 12px/1.2 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    letter-spacing: .02em;
    color: #f1f5f9; /* increased contrast from slate-300 */
    background: rgba(8,10,14,.6);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  .lane-list {
    display: grid;
    gap: 8px;
    grid-auto-rows: minmax(0, auto);
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 4px;
  }

  /* Cards */
  .choice-card {
    position: relative;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    /* extra padding so badges don’t overlap text */
    padding: 10px 32px 10px 32px;
    width: 100%;
    transition: box-shadow .15s ease, background .15s ease, border-color .15s ease;
    cursor: pointer;
  }
  .choice-card:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
  .choice-card:focus-visible {
    outline: 2px solid rgba(147,197,253,.9); /* sky-300 */
    outline-offset: 2px;
  }

  /* NPC presence highlight */
  .choice-card.is-npc {
    border-color: rgba(245,197,83,.55); /* gold */
    box-shadow: 0 0 0 1px rgba(245,197,83,.25) inset;
  }
  .choice-card.is-npc:hover {
    background: rgba(245,197,83,.06);
    border-color: rgba(245,197,83,.8);
  }

  .choice-label { color: #e5e7eb; font-weight: 600; font-size: 15px; }
  .choice-label .quest-marker,
  .choice-label-line .quest-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 0.85rem;
    line-height: 1;
    color: #8bd0ff;
    transition: all 0.2s ease;
    border-radius: 2px;
    padding: 1px 2px;
    min-width: 16px;
    min-height: 16px;
  }
  .choice-label .quest-marker[data-status='completed'],
  .choice-label-line .quest-marker[data-status='completed'] { color: #5de3a9; }
  .choice-label .quest-marker[data-status='failed'],
  .choice-label-line .quest-marker[data-status='failed'] { color: #ff6b6b; }
  .choice-label .quest-marker[data-status='available'],
  .choice-label-line .quest-marker[data-status='available'] { color: #e0e7ff; }
  .choice-label .quest-marker[data-status='active'],
  .choice-label-line .quest-marker[data-status='active'] { color: #8bd0ff; }
  .choice-label .quest-marker[data-status='reminder'],
  .choice-label-line .quest-marker[data-status='reminder'] { color: #cbd5f5; }
  .choice-label .quest-marker::before { content: '\2726'; }
  
  /* Enhanced accessibility and focus states */
  .choice-label .quest-marker:focus-visible,
  .choice-label-line .quest-marker:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    background: rgba(139, 208, 255, 0.1);
  }
  
  /* Better contrast for different backgrounds */
  .choice-card:hover .quest-marker {
    opacity: 0.9;
  }
  
  /* Subtle pulse animation for active quests */
  .choice-label .quest-marker[data-status='active']::before,
  .choice-label-line .quest-marker[data-status='active']::before {
    animation: quest-pulse 2s ease-in-out infinite;
  }
  
  @keyframes quest-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
  }
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .choice-label .quest-marker,
    .choice-label-line .quest-marker {
      border: 1px solid currentColor;
      background: rgba(255, 255, 255, 0.05);
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    .choice-label .quest-marker[data-status='active']::before,
    .choice-label-line .quest-marker[data-status='active']::before {
      animation: none;
    }
  }
  .choice-meta  { margin-top: 4px; color: #f1f5f9; font-size: 12px; opacity: .85; }

  .choice-tells {
    margin-top: 4px; color: #fbbf24; /* amber-400 */
    font-size: 13px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  }
  .tells-hover .choice-card:hover .choice-tells { -webkit-line-clamp: 3; }

  /* Badges (top-right) */
  .choice-badges { position: absolute; top: 6px; right: 8px; display: flex; gap: 4px; }
  .chip {
    font: 700 10px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    padding: 4px 6px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    color: #e5e7eb; background: rgba(255,255,255,.06);
  }
  .chip--risk-low { color:#bbf7d0; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); } /* green */
  .chip--risk-med { color:#fef9c3; background: rgba(234,179,8,.12); border-color: rgba(234,179,8,.35); } /* amber */
  .chip--risk-high { color:#fecaca; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); } /* red */
  .chip--ritual { color:#bfdbfe; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); } /* blue */

  /* Hotkey bubble */
  .hotkey {
    position: absolute; left: 8px; top: 8px;
    width: 18px; height: 18px; border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    font: 700 10px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    color:#f1f5f9; background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    opacity:.7;
    z-index: 1; /* ensure bubble sits above card contents */
  }
  .choice-card:hover .hotkey { opacity:1; }

  /* Density toggle */
  .choices-compact .choice-card { padding: 6px 44px 6px 28px; border-radius: 10px; }
  .choices-compact .choice-label { font-size: 14px; }
  .choices-compact .choice-meta  { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .choice-tells { -webkit-line-clamp: 2; }
  .tells-hover .choice-card:hover .choice-tells { -webkit-line-clamp: 2; }
}

@media (hover: none) and (pointer: coarse) {
  .choice-tells { -webkit-line-clamp: 2; }
  .tells-hover .choice-card:hover .choice-tells { -webkit-line-clamp: 2; }
}

/* Mobile-specific quest marker enhancements */
@media (max-width: 640px) {
  .choice-label .quest-marker,
  .choice-label-line .quest-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-size: 1rem;
    line-height: 1;
    color: #8bd0ff;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 3px 6px;
    min-width: 24px;
    min-height: 24px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
  }

  /* Enhanced mobile status colors with better contrast */
  .choice-label .quest-marker[data-status='completed'],
  .choice-label-line .quest-marker[data-status='completed'] {
    color: #5de3a9;
    background: rgba(93, 227, 169, 0.15);
    border-color: rgba(93, 227, 169, 0.4);
  }

  .choice-label .quest-marker[data-status='failed'],
  .choice-label-line .quest-marker[data-status='failed'] {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.4);
  }

  .choice-label .quest-marker[data-status='available'],
  .choice-label-line .quest-marker[data-status='available'] {
    color: #e0e7ff;
    background: rgba(224, 231, 255, 0.1);
    border-color: rgba(224, 231, 255, 0.3);
  }

  .choice-label .quest-marker[data-status='active'],
  .choice-label-line .quest-marker[data-status='active'] {
    color: #8bd0ff;
    background: rgba(139, 208, 255, 0.15);
    border-color: rgba(139, 208, 255, 0.4);
  }

  .choice-label .quest-marker[data-status='reminder'],
  .choice-label-line .quest-marker[data-status='reminder'] {
    color: #cbd5f5;
    background: rgba(203, 213, 245, 0.1);
    border-color: rgba(203, 213, 245, 0.3);
  }

  .choice-label .quest-marker::before {
    content: '\2726';
    font-size: 1rem;
  }

  /* Enhanced mobile focus states */
  .choice-label .quest-marker:focus-visible,
  .choice-label-line .quest-marker:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    background: rgba(139, 208, 255, 0.2);
    transform: scale(1.05);
  }

  /* Better hover states for touch devices */
  .choice-card:hover .quest-marker {
    opacity: 1;
    transform: scale(1.05);
  }

  /* Mobile-specific pulse animation for active quests */
  .choice-label .quest-marker[data-status='active']::before,
  .choice-label-line .quest-marker[data-status='active']::before {
    animation: quest-pulse-mobile 3s ease-in-out infinite;
  }

  @keyframes quest-pulse-mobile {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
  }
}

@media (max-width: 480px) {
  /* Extra small screens - optimize further */
  .choice-label .quest-marker,
  .choice-label-line .quest-marker {
    margin-left: 6px;
    font-size: 0.9rem;
    padding: 2px 4px;
    min-width: 20px;
    min-height: 20px;
  }

  .choice-label .quest-marker::before {
    content: '\2726';
    font-size: 0.9rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .choice-label .quest-marker,
  .choice-label-line .quest-marker {
    /* Ensure minimum touch target size */
    min-width: 32px;
    min-height: 32px;
    padding: 4px 8px;
  }

  /* Reduce animations on touch devices to improve performance */
  .choice-label .quest-marker[data-status='active']::before,
  .choice-label-line .quest-marker[data-status='active']::before {
    animation: none;
  }
}

/* Hide duplicated per-card group tags on desktop if present in the legacy renderer */
@media (min-width: 1024px) {
  .legacy-group-tag { display: none !important; }
}

