/* indie-daily-games: style.css */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #f9f7f2;
  --bg-card: #ffffff;
  --bg-subtle: #f0ece3;
  --border-light: #e5dfd5;
  --border-dark: #3a3530;
  --text-primary: #1d1a16;
  --text-secondary: #635d54;
  --text-muted: #8e877c;
  
  --accent-primary: #8b3a2b; /* Terracotta ink */
  --accent-gold: #c88a2c;
  --accent-green: #2a7a4c;
  --accent-blue: #2c638e;
  
  --status-correct-bg: #eaf5ec;
  --status-correct-border: #2a7a4c;
  --status-wrong-bg: #fdf0ed;
  --status-wrong-border: #d33c2a;
  --status-misplaced-bg: #fdfbf6;
  --status-misplaced-border: #c88a2c;
  --status-neutral-bg: #edf2f7;
  --status-neutral-border: #cbd5e0;
  --status-neutral-text: #4a5568;

  --anchor-bg: #fbf6ec;
  --anchor-border: #ebd7b3;
  --anchor-accent: #c88a2c;

  --selection-bg: #e2e8f0;
  --selection-border: #475569;

  --btn-primary-bg: #1d1a16;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #38342e;

  --share-bg: #1d1a16;
  --share-text: #ece7df;
  
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 3px rgba(30, 25, 20, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 25, 20, 0.08);
  --shadow-lg: 0 8px 24px rgba(30, 25, 20, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-main: #12151a;
  --bg-card: #1b1f26;
  --bg-subtle: #242933;
  --border-light: #2d3542;
  --border-dark: #475366;
  --text-primary: #f0f3f6;
  --text-secondary: #9daec2;
  --text-muted: #6c7d93;

  --accent-primary: #e07a6d;
  --accent-gold: #e5a947;
  --accent-green: #3fb950;
  --accent-blue: #58a6ff;

  --status-correct-bg: #132a1c;
  --status-correct-border: #2ea043;
  --status-wrong-bg: #321619;
  --status-wrong-border: #f85149;
  --status-misplaced-bg: #302817;
  --status-misplaced-border: #d29922;
  --status-neutral-bg: #242c38;
  --status-neutral-border: #526175;
  --status-neutral-text: #c1cad6;

  --anchor-bg: #232018;
  --anchor-border: #483a1a;
  --anchor-accent: #e5a947;

  --selection-bg: #283344;
  --selection-border: #526b88;

  --btn-primary-bg: #f0f3f6;
  --btn-primary-text: #12151a;
  --btn-primary-hover: #dbe2ea;

  --share-bg: #0d1117;
  --share-text: #c9d1d9;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 48px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.game-viewport,
.interactive-card,
.reorder-item,
.bank-chip,
.morpheme-slot,
.level-bar,
.anchor-box,
.attempt-history-box,
.history-row,
.icon-btn,
.tab-btn {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Header & Nav */
.app-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

header {
  text-align: center;
  padding: 12px 0 6px;
  position: relative;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.top-bar-controls {
  position: absolute;
  top: 14px;
  right: 0;
  display: flex;
  gap: 8px;
}

@media (max-width: 720px) {
  header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
  }

  .brand-title {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
    text-align: left;
  }

  .brand-subtitle { display: none; }

  .top-bar-controls {
    position: static;
    justify-content: center;
    margin: 0;
  }

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

  .app-container { gap: 12px; }
  .game-viewport { scroll-margin-top: 8px; }
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-dark);
}

.tester-btn {
  max-width: 130px;
}

.tester-btn #testerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .icon-btn { padding: 5px 7px; font-size: 0.75rem; }
  .tester-btn { max-width: 88px; }
}

/* Game Tabs */
.game-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  scrollbar-width: none;
  gap: 4px;
}

.game-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  min-width: 0;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.18s ease;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.tab-btn .tab-icon {
  font-size: 1.15rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
}

.tab-btn.active {
  background: var(--selection-bg);
  color: var(--text-primary);
  box-shadow: none;
}

.tab-btn:focus { outline: none; }

.tab-btn:focus-visible {
  box-shadow: inset 0 0 0 2px var(--selection-border);
}

/* Level Selector Bar */
.level-bar {
  display: block;
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
}

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

.level-pill {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-pill:hover {
  border-color: var(--border-dark);
  color: var(--text-primary);
}

.level-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

@media (max-width: 720px) {
  .level-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Main Game Card Area */
.game-viewport {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.game-header-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.game-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-subtle);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.game-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.game-prompt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Attempt & Life Tracker */
.tracker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.attempt-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
  border: 1.5px solid var(--text-muted);
  transition: all 0.2s ease;
}

.dot.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 6px rgba(200, 138, 44, 0.4);
}

.dot.spent {
  background: var(--status-wrong-border);
  border-color: var(--status-wrong-border);
}

/* Anchor Banner Box */
.anchor-box {
  background: var(--anchor-bg);
  border: 1px solid var(--anchor-border);
  border-left: 4px solid var(--anchor-accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.anchor-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.anchor-content {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.anchor-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Card Grids */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 540px) {
  .cards-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.interactive-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}

.interactive-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Neutral Selection */
.interactive-card.selected {
  border-color: var(--selection-border) !important;
  background: var(--selection-bg) !important;
  box-shadow: 0 0 0 1.5px var(--selection-border) !important;
}

.interactive-card.selected .card-text {
  color: var(--text-primary) !important;
}

.interactive-card.selected .card-meta {
  color: var(--text-secondary) !important;
}

.card-text {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.15s ease;
}

.interactive-card.selected .card-checkbox {
  background: var(--selection-border) !important;
  border-color: var(--selection-border) !important;
  color: #ffffff !important;
}

/* Latitude Reorder List (Draggable) */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reorder-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  cursor: grab;
  user-select: none;
}

.reorder-item:active {
  cursor: grabbing;
}

.reorder-item.dragging {
  opacity: 0.4;
  background: #edf2f7;
  border-style: dashed;
}

.reorder-item.dragging-touch {
  opacity: 0.65;
  border-style: dashed;
  box-shadow: var(--shadow-md);
}

.reorder-item.drag-over {
  border-color: #2b6cb0;
  background: #ebf8ff;
  transform: translateY(-2px);
}

.reorder-item.selected-for-swap {
  border-color: var(--selection-border);
  background: var(--selection-bg);
  box-shadow: 0 0 0 2px var(--selection-border);
}

.reorder-item.locked {
  cursor: default;
}

.reorder-item.locked .drag-handle {
  opacity: 0.35;
  cursor: default;
}

.drag-handle {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: grab;
  padding: 0 4px;
  touch-action: none;
}

.rank-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.city-info {
  flex: 1;
}

.city-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.city-country {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reorder-controls {
  display: flex;
  gap: 4px;
}

.reorder-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.reorder-btn:hover:not(:disabled) {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.reorder-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Anachronism Text Block */
.vignette-container {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  line-height: 2;
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.clickable-word {
  display: inline-block;
  padding: 0 3px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.clickable-word:hover {
  background: var(--bg-subtle);
  color: var(--accent-primary);
}

.clickable-word.selected {
  background: var(--selection-border) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* Place Name Archaeology Slot Builder */
.archaeology-builder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.target-hero {
  text-align: center;
}

.target-word {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.target-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.slots-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.morpheme-slot {
  flex: 1;
  min-height: 54px;
  background: var(--bg-subtle);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 8px;
  text-align: center;
  user-select: none;
}

.morpheme-slot.filled {
  border-style: solid;
  border-color: #4a5568;
  background: #edf2f7;
  color: var(--text-primary);
  cursor: grab;
}

.morpheme-slot.drag-over {
  border-color: #2b6cb0 !important;
  background: #ebf8ff !important;
  border-style: solid !important;
  transform: scale(1.02);
}

.slot-plus {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-muted);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  width: 100%;
  min-height: 80px;
}

.bank-chip {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}

.bank-chip:active {
  cursor: grabbing;
}

.bank-chip.dragging {
  opacity: 0.35;
  transform: scale(0.95);
}

.bank-chip:hover:not(.used) {
  border-color: var(--border-dark);
  transform: translateY(-1px);
}

.bank-chip.used {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

/* Submit Bar */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.btn-primary {
  flex: 1;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Feedback & Results Area */
.feedback-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.feedback-banner.warning {
  background: #fef8ee;
  border: 1px solid #f9dfaf;
  color: #9e6400;
  display: block;
}

.feedback-banner.error {
  background: var(--status-wrong-bg);
  border: 1px solid var(--status-wrong-border);
  color: #a82315;
  display: block;
}

.feedback-banner.success {
  background: var(--status-correct-bg);
  border: 1px solid var(--status-correct-border);
  color: #195e34;
  display: block;
}

/* Resolution Reveal Area */
.reveal-card {
  display: none;
  background: var(--bg-card);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  flex-direction: column;
  gap: 14px;
  animation: slideUp 0.3s ease-out;
}

.reveal-card.visible {
  display: flex;
}

.reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reveal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.reveal-score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 4px;
}

.reveal-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.reveal-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-light);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-year {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
}

.latitude-gap {
  color: var(--text-secondary);
  font-size: 0.76rem;
  margin-top: 2px;
}

/* Share Box Area */
.share-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.share-preview {
  background: var(--share-bg);
  color: var(--share-text);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 14px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  line-height: 1.6;
  user-select: all;
}

.btn-share {
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-share:hover {
  background: #236840;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

/* ========================================================================== */
/* WORDLE-STYLE FEEDBACK & ATTEMPT HISTORY STYLES                             */
/* ========================================================================== */

/* Attempt History Board */
.attempt-history-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease-in;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.history-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.history-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 48px;
}

.history-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.unordered-note {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin: 8px 0 2px;
}

.history-row-unordered {
  align-items: center;
}

.unordered-result {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-chip {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-green {
  background: #eaf5ec;
  border: 1px solid #2a7a4c;
  color: #1b6339;
}

.chip-yellow {
  background: #fef8ee;
  border: 1px solid #c88a2c;
  color: #925f16;
}

.chip-red {
  background: #fdf0ed;
  border: 1px solid #d33c2a;
  color: #a82315;
}

.chip-gray {
  background: #ece8e1;
  border: 1px solid #b8b1a4;
  color: #635d54;
}

[data-theme="dark"] .chip-green {
  background: var(--status-correct-bg);
  border-color: var(--status-correct-border);
  color: #7ee787;
}

[data-theme="dark"] .chip-red {
  background: var(--status-wrong-bg);
  border-color: var(--status-wrong-border);
  color: #ff9b93;
}

[data-theme="dark"] .chip-gray,
[data-theme="dark"] .chip-yellow {
  background: var(--status-neutral-bg);
  border-color: var(--status-neutral-border);
  color: var(--status-neutral-text);
}

/* Card Feedback States (Historical Neighbor & Who Was Alive) */
.interactive-card.card-confirmed {
  border-color: #2a7a4c !important;
  background: #f0f9f3 !important;
}

.interactive-card.card-confirmed .card-checkbox {
  background: #2a7a4c !important;
  border-color: #2a7a4c !important;
  color: #fff !important;
}

.interactive-card.card-eliminated {
  border-color: #d33c2a !important;
  background: #faf4f3 !important;
  opacity: 0.65;
  pointer-events: none;
}

.interactive-card.card-eliminated .card-text {
  text-decoration: line-through;
  color: #a82315;
}

.card-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-top: 4px;
}

.status-pill-green {
  background: #eaf5ec;
  color: #1b6339;
  border: 1px solid #2a7a4c;
}

.status-pill-red {
  background: #fdf0ed;
  color: #a82315;
  border: 1px solid #d33c2a;
}

/* Latitude Feedback Badges */
.reorder-item.item-correct {
  border-color: var(--status-correct-border);
  background: var(--status-correct-bg);
}

.reorder-item.item-wrong {
  border-color: var(--status-misplaced-border);
  background: var(--status-misplaced-bg);
}

.lat-direction-badge {
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.badge-locked {
  background: var(--status-correct-bg);
  color: var(--accent-green);
  border: 1px solid var(--status-correct-border);
}

.badge-misplaced {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-text);
  border: 1px solid var(--status-neutral-border);
}

.badge-move-north {
  background: #fef8ee;
  color: #925f16;
  border: 1px solid #c88a2c;
}

.badge-move-south {
  background: #fef8ee;
  color: #925f16;
  border: 1px solid #c88a2c;
}

/* Anachronism Word Feedback */
.clickable-word.word-eliminated {
  background: #fae8e6 !important;
  color: #a82315 !important;
  text-decoration: line-through;
  opacity: 0.6;
  pointer-events: none;
}

.clickable-word.word-correct {
  background: #2a7a4c !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(42, 122, 76, 0.4);
}

.scanned-log-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-log-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-secondary);
}

.scan-log-item strong {
  color: var(--text-primary);
}

/* Place-Name Archaeology Slots Feedback */
.morpheme-slot.slot-green {
  background: #eaf5ec !important;
  border-color: #2a7a4c !important;
  color: #1b6339 !important;
}

.morpheme-slot.slot-yellow {
  background: #fef8ee !important;
  border-color: #c88a2c !important;
  color: #925f16 !important;
}

.morpheme-slot.slot-gray {
  background: #ece8e1 !important;
  border-color: #b8b1a4 !important;
  color: #635d54 !important;
}

.bank-chip.chip-eliminated {
  background: #ece8e1 !important;
  border-color: #d1cbc2 !important;
  color: #999 !important;
  text-decoration: line-through;
  pointer-events: none;
  opacity: 0.45;
}

.bank-chip.chip-confirmed {
  background: #eaf5ec !important;
  border-color: #2a7a4c !important;
  color: #1b6339 !important;
  font-weight: 700;
}
