:root {
  --bg: #17171A;
  --card: #1F1F23;
  --border: #313136;
  --ink: #F1F0EE;
  --muted: #8F8D93;
  --accent: #FF4655;
  --accent-dark: #FF5F6C;
  --track: #2B2B30;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: 'Sora', 'Inter', sans-serif;
  margin: 0;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Header */
.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}

.eyebrow.center {
  text-align: center;
}

.site-header h1 {
  font-size: 26px;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 20px;
}

.hidden {
  display: none;
}

/* Difficulty selector */
.difficulty-options {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.difficulty-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.difficulty-btn:hover {
  border-color: var(--accent);
}

.difficulty-btn.selected {
  background: #2A1A1C;
  border-color: var(--accent);
}

.diff-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.diff-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Region selector */
.region-section {
  margin-bottom: 20px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.region-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.region-btn {
  flex: 1 1 auto;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.region-btn:hover {
  border-color: var(--accent);
}

.region-btn.selected {
  background: #2A1A1C;
  border-color: var(--accent);
  color: var(--ink);
}

/* Team count slider */
.team-count-section {
  margin-bottom: 20px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.field-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.team-count-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  outline: none;
  margin-bottom: 8px;
  display: block;
}

.team-count-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.team-count-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Buttons */
.primary-btn {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  background: var(--track);
  color: var(--muted);
  cursor: not-allowed;
}

.team-count-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.back-btn:hover {
  border-color: var(--accent);
}

/* Game topbar (simple running stats, no round counter) */
.game-topbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.team-name {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Logo stage */
.logo-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.logo-badge {
  position: relative;
  width: 260px;
  height: 260px;
}

.badge-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--border);
}

.badge-square {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68%;
  height: 68%;
  background: #B9B9B9;
  border: none;
}

.team-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 69%;
  height: 69%;
  object-fit: contain;
  pointer-events: none;
}

/* Color picker panel */
.picker-panel {
  margin-bottom: 22px;
}

.picker-stage {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.picker-preview {
  width: 30%;
  min-height: 160px;
  background: #B9B9B9;
  border-right: 1px solid var(--border);
}

.sv-picker {
  position: relative;
  flex: 1;
  min-height: 160px;
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    hsl(var(--hue), 100%, 50%);
}

.sv-pointer {
  position: absolute;
  top: 0%;
  left: 100%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
  outline: none;
  margin-bottom: 14px;
  display: block;
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.hue-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.hex-row {
  display: none;
}

.hex-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.hex-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hex-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Feedback */
.feedback {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.feedback-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.tier-label {
  font-size: 18px;
  font-weight: 700;
}

.round-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.feedback-detail {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}

.answer-row {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.answer-swatch-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.answer-badge {
  position: relative;
  width: 96px;
  height: 96px;
}

.answer-fill {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.answer-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
}

.swatch-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* End screen */
.end-grade {
  text-align: center;
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  margin: 8px 0 12px;
}

.end-stats {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}

/* Footer */
.site-footer {
  text-align: center;
  margin-top: 24px;
}

.site-footer p {
  font-size: 12px;
  color: var(--muted);
}