:root {
  --bg-main: #ffffff;
  --bg-panel: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-color: #0284c7;
  --grid-border: #e2e8f0;
  --cell-bg: #ffffff;
  --cell-border: #1e293b;
  --cell-hover: #f1f5f9;
  --cell-correct: #4caf50;
  --cell-wrong: #ef4444;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

.split-screen {
  display: flex;
  height: 100%;
  width: 100%;
}

#left-panel {
  flex: 0 0 40%;
  padding: 3rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--grid-border);
  box-shadow: 2px 0 15px rgba(0,0,0,0.05);
  z-index: 10;
  overflow-y: auto;
  position: relative;
}

#right-panel {
  flex: 1;
  position: relative;
  background-color: #f8fafc; /* Match light map */
}

header {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.clue-banner {
  background-color: #8b5cf6;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translate(-50%, -150%);
  width: 80%;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clue-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

h1 {
  margin: 0 0 0.5rem 0;
  color: var(--accent-color);
  font-size: 3rem;
  letter-spacing: -1px;
}

#game-date {
  color: var(--text-muted);
  font-weight: 500;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: 80px repeat(3, 1fr);
  grid-template-rows: 80px repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 500px;
}

.header-corner {
  /* Empty top-left cell */
}

.col-header, .row-header {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--grid-bg);
  border-radius: 8px;
  padding: 0.5rem;
}

.grid-cell {
  background: var(--grid-bg);
  border: 2px solid var(--grid-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.grid-cell:hover:not(.solved) {
  border-color: var(--highlight);
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.grid-cell.active {
  border-color: var(--accent-color);
  background-color: #e0f2fe;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}

.grid-cell.solved {
  background-color: var(--cell-correct);
  border-color: var(--cell-correct);
  color: white;
}

#map-container {
  width: 100%;
  height: 100%;
}

.map-route-hover {
  cursor: pointer;
}

.map-route-visible {
  transition: all 0.2s ease;
  pointer-events: none;
}

.map-route-group:hover .map-route-visible {
  filter: brightness(1.2);
}

.map-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--grid-border);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 100;
  min-width: 200px;
  font-family: 'Inter', sans-serif;
}

.map-tooltip h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-main);
}

.tooltip-meta {
  margin: 0 0 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tooltip-flags {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tooltip-flags img {
  width: 24px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.game-status {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 500px;
}

.status-panel {
  background: var(--bg-main);
  border: 1px solid var(--grid-border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-panel h3 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
}

.flags-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  min-height: auto;
}

.flags-grid img, .placeholder-flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  border: 1px solid var(--grid-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.placeholder-flag {
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 10px;
  font-weight: bold;
}

.cell-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cell-eraser {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  z-index: 10;
}

.cell-eraser:hover {
  opacity: 1;
}

.flag-icon {
  width: 20px;
  height: 15px;
  margin-top: 4px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.1);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
  color: var(--accent-color);
  margin-top: 0;
}

.stats-grid {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid var(--grid-border);
  padding: 1rem;
  border-radius: 8px;
  flex: 1;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.share-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

.share-btn:hover {
  background: #0369a1;
}

/* Progressive Hints UI */
.hint-container {
  margin-top: 1rem;
  background-color: #fffbeb; /* Light yellow for hint area */
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.hint-container h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: #b45309;
}

#hint-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.4;
}

#hint-list li {
  margin-bottom: 0.25rem;
}

.hint-item-strike {
  color: #dc2626;
  font-weight: bold;
}

/* Mystery Routes */
.row-header.mystery {
  color: var(--text-muted);
  font-style: italic;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
}

.grid-cell.strike-flash {
  animation: flash-error 0.5s ease;
}

@keyframes flash-error {
  0% { background-color: var(--grid-bg); border-color: var(--grid-border); }
  50% { background-color: #fee2e2; border-color: #ef4444; }
  100% { background-color: var(--grid-bg); border-color: var(--grid-border); }
}
