/**
 * Globle Unlimited — game UI styles.
 * Pairs with js/globle-game.js (mounts into #globleGameRoot).
 */

.globle-game {
  max-width: 480px;
  margin: 0 auto;
}

/* Mode tabs */
.globle-modes {
  display: flex;
  gap: 6px;
  background: #eef0f4;
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.globle-mode-tab {
  flex: 1;
  padding: 9px 8px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.globle-mode-tab:hover { color: #312e81; }
.globle-mode-tab.active {
  background: #fff;
  color: #5b21b6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.globle-mode-tab:focus-visible { outline: 2px solid #667eea; outline-offset: 2px; }

/* Options + actions bar */
.globle-optionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 12px;
}
.globle-opts { display: flex; gap: 10px 14px; flex-wrap: wrap; }
.globle-opts[hidden], .globle-daily[hidden] { display: none; }

.globle-opt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.globle-opt select,
.globle-opt input[type="date"] {
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  color: #374151;
  text-transform: none;
  letter-spacing: 0;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.globle-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.globle-guesscount {
  font-size: 0.9rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

.globle-icon { padding: 9px 11px; font-size: 1rem; line-height: 1; }

/* Hint bar */
.globle-hintbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 0;
  margin-bottom: 10px;
}
.globle-hintbar:empty { display: none; }
.globle-hint-chip {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.globle-btn {
  padding: 9px 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.globle-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.globle-btn:active { transform: translateY(1px); }
.globle-btn:disabled { opacity: 0.5; cursor: default; }

.globle-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
}
.globle-btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

/* Globe canvas */
.globle-stage {
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #f8fafc 0%, #eef2f7 100%);
  border-radius: 16px;
  padding: 10px;
  touch-action: none; /* let us own drag gestures */
}

.globle-canvas {
  cursor: grab;
  display: block;
  max-width: 100%;
}
.globle-canvas:active { cursor: grabbing; }

/* Legend */
.globle-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.globle-legend-bar {
  width: 140px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #fff7ec 0%, #fdbb84 45%, #e34a33 80%, #b30000 100%);
  border: 1px solid #e5e7eb;
}

.globle-legend-correct {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
}
.globle-legend-correct i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #2e7d32;
  display: inline-block;
}

/* High-contrast (greyscale) color mode — overrides the heat legend */
.globle-contrast .globle-legend-bar {
  background: linear-gradient(90deg, #eee 0%, #8c8c8c 55%, #1a1a1a 100%);
}

/* Input */
.globle-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.globle-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}
.globle-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Messages + closest */
.globle-msg {
  min-height: 1.2em;
  text-align: center;
  color: #b45309;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.globle-closest {
  text-align: center;
  font-size: 1rem;
  color: #1f2937;
  margin-bottom: 10px;
}

/* Guess list */
.globle-guesses {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  max-height: 280px;
  overflow-y: auto;
}

.globle-guess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f5;
}

.globle-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.globle-guess-flag { font-size: 1.1rem; }
.globle-guess-name { flex: 1; color: #374151; }
.globle-guess-km {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

/* Win panel */
.globle-win {
  text-align: center;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 2px solid #2e7d32;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
  animation: globleWinPop 0.4s ease;
}

@keyframes globleWinPop {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.globle-win-flag { font-size: 3rem; line-height: 1; }
.globle-win-name { font-size: 1.5rem; font-weight: 800; color: #14532d; margin: 4px 0; }
.globle-win-sub { color: #4b5563; margin-bottom: 14px; }
.globle-win-actions { display: flex; gap: 10px; justify-content: center; }

/* Stats */
.globle-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 6px;
}
.globle-stats:empty { display: none; }

.globle-stat { text-align: center; }
.globle-stat span {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #667eea;
  font-variant-numeric: tabular-nums;
}
.globle-stat small { font-size: 0.78rem; color: #6b7280; }

@media (prefers-reduced-motion: reduce) {
  .globle-win { animation: none; }
}

@media (max-width: 480px) {
  .globle-legend-bar { width: 100px; }
  .globle-toolbar { flex-wrap: wrap; }
}
