
/* =====================================================
   SQPLAYERS GLOBE GUESS — FULL CSS REPLACEMENT
   Large map | Top controls | Neon red + electric blue
   ===================================================== */

:root {
  color-scheme: dark;
  --bg: #080910;
  --panel: #111421;
  --border: rgba(151,170,211,.16);
  --text: #f4f6ff;
  --muted: #959eb5;
  --red: #ff304f;
  --red-light: #ff8195;
  --blue: #368bff;
  --blue-light: #74beff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 0 0, rgba(255,48,79,.09), transparent 35%),
    radial-gradient(ellipse at 100% 25%, rgba(54,139,255,.09), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126,148,196,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126,148,196,.035) 1px, transparent 1px);
  background-size: 42px 42px;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
#map:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 3px;
}

/* TOP BAR */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: min(1500px, calc(100% - 40px));
  min-height: 58px;
  margin: auto;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
}

.brand:hover {
  color: var(--blue-light);
}

.brand span {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.brand span::after {
  content: ".";
  color: var(--red);
}

.game-label {
  color: var(--blue-light);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 2px;
}

/* INTRO */

.layout {
  width: min(1500px, calc(100% - 40px));
  margin: auto;
  padding: 15px 0 25px;
}

.intro {
  margin: 0 auto 14px;
  text-align: center;
}

.eyebrow {
  color: var(--blue-light);
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.intro h1 {
  margin: 2px 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -.06em;
}

.intro h1 span {
  background: linear-gradient(100deg, var(--red-light), var(--red), #b47aff, var(--blue-light));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.intro > p {
  margin: 6px auto 0;
  color: var(--muted);
  font-size: .82rem;
}

/* GAME PANEL */

.game-panel {
  min-width: 0;
  padding: 17px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(13,15,26,.96);
  box-shadow: 0 20px 55px rgba(0,0,0,.2);
}

.game-heading {
  margin-bottom: 11px;
}

.game-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.game-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .76rem;
}

/* STATS */

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
}

.stat > span {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.stat strong {
  font-size: 1.3rem;
  font-weight: 950;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

/* MAP: KEEP IT LARGE */

.map-wrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 13px;
  padding-top: 47px;
  border: 1px solid rgba(54,139,255,.3);
  border-radius: 13px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(54,139,255,.07), transparent 65%),
    #090e1a;
  box-shadow: inset 0 0 35px rgba(0,0,0,.2);
}

.map-wrap::before {
  position: absolute;
  z-index: -1;
  inset: 47px 0 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(100,151,215,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,151,215,.035) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* BUTTONS ABOVE THE MAP */

.map-new-game-button {
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 9px;
  right: auto;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid rgba(255,78,105,.6);
  border-radius: 9px;
  background: #270d19;
  color: var(--red-light);
  font-size: .7rem;
  font-weight: 850;
}

.map-new-game-button:hover {
  border-color: var(--red);
  background: #401020;
}

.map-tools {
  position: absolute;
  z-index: 5;
  top: 7px;
  right: 9px;
  left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-tools button {
  min-width: 33px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(112,153,213,.3);
  border-radius: 8px;
  background: #101729;
  color: var(--blue-light);
  font-size: .75rem;
  font-weight: 850;
}

.map-tools button:hover {
  border-color: var(--blue);
  background: #183768;
}

.map-tools #resetMapButton {
  color: var(--text);
  font-size: .67rem;
}

/* BIG MAP HEIGHT */

#map {
  position: relative;
  width: 100%;
  height: clamp(420px, 58vh, 620px);
  min-height: 380px;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: pan-y;
}

#map:active {
  cursor: grabbing;
}

#map svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
}

#map svg path {
  vector-effect: non-scaling-stroke;
  stroke: rgba(132,166,209,.35);
  stroke-width: .55px;
  transition: stroke .15s ease, filter .15s ease;
}

#map svg path:hover {
  stroke: var(--blue-light);
  stroke-width: 1px;
  filter: brightness(1.2);
}

.map-message {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 8px;
  left: 10px;
  width: fit-content;
  max-width: calc(100% - 20px);
  margin: auto;
  padding: 6px 11px;
  border: 1px solid rgba(112,153,213,.23);
  border-radius: 9px;
  background: rgba(10,14,26,.93);
  color: #c5d7f3;
  font-size: .68rem;
  font-weight: 650;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}

/* COUNTRY GUESS */

.guess-form > label {
  display: block;
  margin-bottom: 6px;
  font-size: .77rem;
  font-weight: 850;
}

.input-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
}

.input-holder {
  position: relative;
  flex: 1;
  min-width: 0;
}

#countryInput {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(151,170,211,.22);
  border-radius: 10px;
  background: #0b0e19;
  color: var(--text);
  font-size: .82rem;
  outline: none;
}

#countryInput::placeholder {
  color: #6e7893;
}

#countryInput:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(54,139,255,.1);
}

#guessButton {
  min-width: 84px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(255,94,118,.6);
  border-radius: 10px;
  background: linear-gradient(110deg,#ff304f,#cf193f);
  color: white;
  font-size: .82rem;
  font-weight: 900;
}

#guessButton:hover {
  filter: brightness(1.1);
}

#guessButton:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* SUGGESTIONS */

.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid rgba(54,139,255,.32);
  border-radius: 10px;
  background: #111522;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}

.suggestions[hidden] {
  display: none !important;
}

.suggestions > * {
  cursor: pointer;
}

.suggestions > *:hover,
.suggestions > *.active,
.suggestions > *[aria-selected="true"] {
  background: rgba(54,139,255,.12);
  color: var(--blue-light);
}

/* FEEDBACK */

.feedback {
  margin: 10px 0 4px;
  padding: 8px 11px;
  border: 1px solid rgba(54,139,255,.17);
  border-radius: 9px;
  background: rgba(54,139,255,.045);
  color: #c5d7f3;
  font-size: .77rem;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.status {
  margin: 4px 2px 10px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* HINTS */

.hints-panel {
  margin-top: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
}

.hints-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hints-heading h3 {
  margin: 0;
  font-size: .98rem;
  font-weight: 900;
}

.hints-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.hint-count {
  flex-shrink: 0;
  padding: 5px 8px;
  border: 1px solid rgba(54,139,255,.28);
  border-radius: 8px;
  background: rgba(54,139,255,.075);
  color: var(--blue-light);
  font-size: .67rem;
  font-weight: 850;
}

.hint-progress {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 6px;
  margin: 10px 0;
}

.hint-progress span {
  display: block;
  height: 4px;
  border-radius: 8px;
  background: rgba(151,170,211,.13);
}

.hint-progress span.active,
.hint-progress span.used,
.hint-progress span.revealed {
  background: linear-gradient(90deg,var(--red),var(--blue-light));
}

.hint-empty {
  margin: 0;
  padding: 9px;
  border: 1px dashed rgba(151,170,211,.2);
  border-radius: 9px;
  color: var(--muted);
  font-size: .74rem;
  text-align: center;
}

.hint-list {
  display: grid;
  gap: 7px;
}

.hint-list > *:not(.hint-empty) {
  padding: 9px 11px;
  border: 1px solid rgba(54,139,255,.15);
  border-radius: 9px;
  background: rgba(54,139,255,.045);
  color: #dce7ff;
  font-size: .76rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.hint-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin-top: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(54,139,255,.35);
  border-radius: 9px;
  background: rgba(54,139,255,.08);
  color: var(--blue-light);
  font-size: .76rem;
  font-weight: 850;
}

.hint-button:hover {
  border-color: var(--blue);
  background: rgba(54,139,255,.14);
}

.hint-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

/* ACTIONS */

.game-actions {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  margin-top: 11px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: .77rem;
  font-weight: 850;
}

.primary {
  border: 1px solid rgba(255,94,118,.6);
  background: linear-gradient(110deg,#ff304f,#cf193f);
  color: white;
}

.primary:hover {
  filter: brightness(1.1);
}

.secondary {
  border: 1px solid rgba(151,170,211,.22);
  background: rgba(255,255,255,.025);
  color: #c0c9df;
}

.secondary:hover {
  border-color: rgba(54,139,255,.45);
  background: rgba(54,139,255,.075);
  color: var(--blue-light);
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: .5;
}

/* DISTANCE LEGEND */

.legend {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}

.legend-title {
  display: block;
  margin-bottom: 7px;
  font-size: .73rem;
  font-weight: 900;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
}

.legend-items > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .67rem;
}

.dot {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: #536078;
}

.dot.exact {
  background: #4ce5a2;
  box-shadow: 0 0 8px rgba(76,229,162,.3);
}

.dot.adjacent { background: #a1e65b; }
.dot.close { background: #f5d34e; }
.dot.medium { background: #ff9b47; }
.dot.far { background: #ff5d5d; }
.dot.distant { background: #9c6cff; }

.dot.unseen {
  background: #263047;
  border-color: rgba(151,170,211,.25);
}

/* KEYBOARD NOTE */

.keyboard-note {
  margin: 8px 0 0;
  color: #7e89a4;
  font-size: .67rem;
  line-height: 1.65;
  text-align: center;
}

/* CELEBRATION */

.celebration {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration > * {
  pointer-events: none;
}

.celebration .confetti,
.celebration .confetti-piece,
.celebration i,
.celebration span {
  animation: confetti-fall 2.8s ease-out forwards;
}

@keyframes confetti-fall {
  from { opacity: 1; transform: translateY(-12vh) rotate(0); }
  to { opacity: 0; transform: translateY(110vh) rotate(720deg); }
}

/* FOOTER */

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  width: min(1500px,calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

footer a {
  color: var(--blue-light);
  font-weight: 750;
}

footer a:hover {
  color: var(--red-light);
}

/* DESKTOP: LARGE MAP */

@media (min-width: 800px) {
  .game-panel {
    padding: 17px 20px;
  }

  #map {
    height: clamp(420px,58vh,620px);
  }
}

/* MOBILE */

@media (max-width: 600px) {
  .topbar,
  .layout,
  footer {
    width: calc(100% - 24px);
  }

  .topbar {
    min-height: 52px;
  }

  .game-label {
    font-size: .53rem;
    letter-spacing: 1px;
  }

  .layout {
    padding-top: 12px;
  }

  .intro {
    margin-bottom: 12px;
  }

  .intro h1 {
    font-size: clamp(2rem,9vw,2.8rem);
  }

  .intro > p {
    font-size: .75rem;
  }

  .game-panel {
    padding: 9px;
    border-radius: 13px;
  }

  .game-heading {
    margin-bottom: 8px;
  }

  .game-heading h2 {
    font-size: .98rem;
  }

  .game-heading p {
    font-size: .67rem;
  }

  .game-stats {
    gap: 5px;
    margin-bottom: 8px;
  }

  .stat {
    padding: 7px 6px;
  }

  .stat > span {
    font-size: .51rem;
    letter-spacing: .5px;
  }

  .stat strong {
    font-size: 1.08rem;
  }

  .map-wrap {
    padding-top: 42px;
    margin-bottom: 9px;
  }

  .map-wrap::before {
    top: 42px;
  }

  #map {
    height: 390px;
    min-height: 330px;
  }

  .map-new-game-button {
    top: 6px;
    left: 6px;
    min-height: 29px;
    padding: 5px 7px;
    font-size: .59rem;
  }

  .map-tools {
    top: 6px;
    right: 6px;
    gap: 3px;
  }

  .map-tools button {
    min-width: 26px;
    min-height: 29px;
    padding: 4px 5px;
    font-size: .66rem;
  }

  .map-tools #resetMapButton {
    font-size: .52rem;
  }

  .map-message {
    right: 6px;
    bottom: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    padding: 5px 7px;
    font-size: .59rem;
  }

  #countryInput {
    min-height: 40px;
    padding: 8px;
    font-size: .71rem;
  }

  #guessButton {
    min-width: 61px;
    min-height: 40px;
    padding: 8px;
    font-size: .71rem;
  }

  .feedback {
    margin-top: 8px;
    padding: 7px 8px;
    font-size: .7rem;
  }

  .status {
    margin: 4px 2px 8px;
    font-size: .65rem;
  }

  .hints-panel {
    margin-top: 8px;
    padding: 9px;
  }

  .hints-heading h3 {
    font-size: .87rem;
  }

  .hints-heading p {
    font-size: .64rem;
  }

  .hint-count {
    padding: 4px 6px;
    font-size: .59rem;
  }

  .hint-progress {
    gap: 4px;
    margin: 8px 0;
  }

  .hint-list > *:not(.hint-empty) {
    padding: 8px;
    font-size: .69rem;
  }

  .hint-button {
    min-height: 36px;
    margin-top: 7px;
    font-size: .69rem;
  }

  .game-actions {
    gap: 6px;
    margin-top: 8px;
  }

  .primary,
  .secondary {
    min-height: 37px;
    padding: 7px 5px;
    font-size: .65rem;
  }

  .legend {
    margin-top: 9px;
    padding: 9px;
  }

  .legend-title {
    margin-bottom: 6px;
    font-size: .67rem;
  }

  .legend-items {
    gap: 6px 9px;
  }

  .legend-items > span {
    font-size: .59rem;
  }

  .keyboard-note {
    margin-top: 7px;
    font-size: .59rem;
  }

  footer {
    padding-bottom: 14px;
    font-size: .66rem;
  }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
