@import url('https://fonts.googleapis.com/css2?family=Stint+Ultra+Expanded&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* ── Reset & variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

* {
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Slim scrollbars — WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

:root {
  --bg:      #ffffff;
  --surface: #f7f7f7;
  --border:  #e2e2e2;
  --text:    #000;
  --muted:   #666678;
  --green:   #61b759;
  --yellow:  #eab308;
  --grey:    #bbb;
  --alert:   #ef4444;
  --accent:  #00a2ec;

  --row-wrong-bg:       #bbb;
  --row-wrong-border:   #aaa;
  --row-wrong-text:     #000;
  --row-partial-bg:     #eab308;
  --row-partial-border: #d19f04;
  --row-partial-text:   #000;
  --row-correct-bg:     #61b759;
  --row-correct-border: #4ca144;
  --row-correct-text:   #000;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

h3 {
  margin-bottom: 30px;
  text-transform: uppercase;
  color: var(--accent);
}

strong {
  font-weight: 600;
}

/* ── Base layout ───────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", sans-serif;
  font-weight: 300;
}

.container {
  max-width: 1800px;
  width: 95%;
  margin: 40px auto 0;
}

.game-wrapper {
  display: flex;
  height: calc(100vh - 160px);
  margin-bottom: 70px;
}

.game-panel {
  flex-basis: 28%;
  padding-right: 40px;
  margin-right: 40px;
  border-right: 1px solid var(--border);
  position: relative;
  height: 100%;
  overflow-y: auto;
}

#map-container {
  flex-grow: 1;
  border: 1px solid var(--border);
  background: #ebebec;
  max-height: 100%;
}

footer {
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 24px 0;
  background: var(--bg);
  font-size: 14px;
  color: var(--muted);
  z-index: 10;
}

footer.relative {
  position: relative;
  margin-top: 40px;
}

footer a {
  color: var(--muted);
  vertical-align: middle;
  transition: color .15s;
  text-decoration: none;
  padding-left: 10px;
  margin-left: 7px;
  border-left: 1px solid var(--border);
}
footer a:hover { color: var(--text); }

footer a.social-link svg  {
  vertical-align: middle;
  margin-bottom: 2px;
}

footer span {
  padding: 0 10px;
}

footer .image-credit {
  display: none;
}

footer.home .image-credit {
  display: inline-block;
}

/* ── Home page ─────────────────────────────────────────────────────────── */
header {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.standfirst {
  width: 100%;
  font-size: 1.25em;
  font-weight: 300;
  line-height: 1.3;
  text-align: center;
}

.steps {
  display: flex;
  margin: 20px 0 60px 0;
  position: relative;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: absolute;
  transform: translateX(-50%);
}

.step.step-1 {left: 0}
.step.step-2 {left: 50%}
.step.step-3 {left: 100%}

.circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #000;
}

.line {
  width: 200px;
  height: 8px;
  background: var(--accent);
  margin-top: 8px;
  flex-shrink: 0;
}

.label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  position: absolute;
  top: 35px;
  white-space: nowrap;
}

.city-item {
  background: var(--surface);
  display: block;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  border-radius: 12px;
  overflow: hidden;
  transition: 0.5s ease-in-out;
}

.city-item:hover {
  background-color: var(--border);
}

.city-image {
  height: fit-content;
  position: relative;
  overflow: hidden;
}

.city-image img {
  width: 100%;
  display: block;
  transition: 0.5s ease-in-out;
}

.city-item:hover .city-image img {
  transform: scale(1.05);
}

.city-details {
  padding: 20px;
}

.city-details h4 {
  font-size: 0.8em;
  font-weight: normal;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 6px 0;
}

.city-details p {
  font-size: 0.9em;
  line-height: 1.4;
}

/* Owl carousel */
.owl-stage {
  display: flex;
}

.owl-item {
  display: flex;
}

.owl-carousel {
  position: relative;
}

.owl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  margin-top: 0 !important;
}

.owl-prev,
.owl-next {
  pointer-events: all;
  width: 36px;
  height: 36px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 3rem !important;
  font-weight: 200 !important;
  color: var(--muted) !important;
}

.owl-prev { margin-left: -36px !important; }
.owl-next { margin-right: -36px !important; }

.owl-theme .owl-nav [class*=owl-]:hover {
  background: transparent !important;
}

.owl-dots {
  margin-top: 10px;
}

.owl-theme .owl-dots .owl-dot.active span, .owl-theme .owl-dots .owl-dot:hover span {
  background: var(--accent) !important;
}



/* ── Title bar ─────────────────────────────────────────────────────────── */
.title {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 30px;
}

.logo-city {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo {
  width: 275px;
}

.logo img {
  width: 100%;
  display: block;
}

.city {
  font-family: "Stint Ultra Expanded", serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.15em;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* ── Options row ───────────────────────────────────────────────────────── */
.options-container {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── Mode toggle ───────────────────────────────────────────────────────── */
.btn-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.mode-btn {
  padding: 8px 20px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mode-btn.active { background: var(--accent); color: #fff; }
.mode-btn:not(.active):hover { background: var(--border); color: var(--text); }

/* ── Daily notice ──────────────────────────────────────────────────────── */
#daily-notice {
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: 30px;
}
#daily-notice strong { color: var(--text); }

/* ── Guess counter ─────────────────────────────────────────────────────── */
#guess-counter {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

/* ── Input area ────────────────────────────────────────────────────────── */
#input-area {
  display: flex;
  gap: 10px;
  width: 100%;
  /*max-width: 560px;*/
  position: relative;
}

#guess-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .7rem 1rem;
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color .2s;
}
#guess-input:focus { border-color: var(--text); }

/* ── Autocomplete dropdown ─────────────────────────────────────────────── */
#autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: calc(100% - 80px);  /* replace right: 70px with explicit width */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 100;
  display: none;
}
.ac-item {
  padding: .55rem 1rem;
  cursor: pointer;
  font-size: .95rem;
  transition: background .15s;
}
.ac-item:hover,
.ac-item.active { background: var(--border); }

/* ── Submit + hint buttons ─────────────────────────────────────────────── */
#submit-btn, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .7rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
#submit-btn:hover           { opacity: .85; }
#submit-btn:active          { transform: scale(.97); }
#submit-btn:disabled        { opacity: .4; cursor: not-allowed; }

#hint-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
#hint-btn:hover    { background: var(--border); }
#hint-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Error message ─────────────────────────────────────────────────────── */
#error-msg {
  color: var(--alert);
  font-size: 0.9em;
  font-weight: 400;
  min-height: 1.2em;
  margin: 5px 0 8px 0;
}

/* ── Results list ──────────────────────────────────────────────────────── */
#results {
  width: 100%;
  /*max-width: 560px;*/
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ── Guess row ─────────────────────────────────────────────────────────── */
.guess-row {
  border-radius: 12px;
  padding: 10px 15px;
  animation: slideIn .25s ease;
  font-size: 0.9rem;
  font-weight: 500;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.guess-row.wrong   { background: var(--row-wrong-bg);   border: 1px solid var(--row-wrong-border); }
.guess-row.partial { background: var(--row-partial-bg); border: 1px solid var(--row-partial-border); }
.guess-row.correct { background: var(--row-correct-bg); border: 1px solid var(--row-correct-border); }
.guess-row.lost    { background: var(--alert); border: 1px solid #dc2626;}

.guess-row.wrong   .station-name,
.guess-row.partial .station-name,
.guess-row.correct .station-name { color: var(--bg); }

.guess-row.wrong   .status-label { color: var(--row-wrong-text); }
.guess-row.partial .status-label { color: var(--row-partial-text); }
.guess-row.correct .status-label { color: var(--row-correct-text); }

.station-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* critical — allows flex children to shrink below content size */
  color: #fff;
  /*font-weight: 600;*/
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  /*font-weight: 600;*/
}

.station-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 1.2rem;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.distance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 18px;
  height: 18px;
}

/* ── Hint row ──────────────────────────────────────────────────────────── */
/* hint rows now use .guess-row styling — no separate hint-row CSS needed */

/* ── End-game overlay & modal ──────────────────────────────────────────── */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  overflow-y: auto;
  padding: 2rem 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}
#overlay.show { display: flex; }

#modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 450px;
  width: 90%;
  margin: auto;
  position: relative;
  animation: popIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}
#modal .emoji { 
  font-size: 3rem; 
  margin-bottom: .8rem; 
}
#modal h2 {
  font-size: 1.4rem; 
  margin-bottom: .6rem; 
}
#modal p {
  color: var(--muted); 
  line-height: 1.6; 
  font-size: .9rem;
  text-wrap: pretty;
}

#modal .answer-reveal {
  margin-top: .8rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ── Modal streak pills ────────────────────────────────────────────────── */
#modal-streak {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
/* Mode label above streak pills (shown when hard-mode.js is loaded) */
.streak-mode-label {
  width: 100%;
  text-align: center;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.modal-streak-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  padding: 0 20px;
  border-right: 1px solid var(--border);
}
.modal-streak-pill:last-child { border-right: none; }
.modal-streak-pill .pill-val {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.modal-streak-pill .pill-lbl {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.stops-separator {
  color: var(--accent);
  margin: 0 4px;
  font-size: 1.1em;
}

/* ── Route toggle ──────────────────────────────────────────────────────── */
.route-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  font-family: inherit;
}
.route-toggle-btn svg {
  width: 12px;
  height: 12px;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.route-toggle-btn.open svg { transform: rotate(180deg); }

#modal-route {
  margin-top: .75rem;
  text-align: center;
  line-height: 1.3;
  border-top: 1px solid var(--border);
  padding-top: .75rem;
}
#modal-route-title {
  font-weight: 600;
  color: var(--text) !important;
  margin-bottom: .5rem;
}
#modal-route-stops {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 400;
}
#modal-route-stops span          { display: inline-block; }
#modal-route-stops span:first-child,
#modal-route-stops span:last-child { color: var(--text); }

/* ── Modal action buttons ──────────────────────────────────────────────── */
#modal-daily-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1.5rem;
}

#share-btn,
#stats-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: .75rem 1.5rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  font-family: 'DM Sans', sans-serif;
}
#share-btn   { background: var(--accent); color: #fff; }
#stats-btn { background: var(--accent); color: var(--surface); }
#share-btn:hover,
#stats-btn:hover { opacity: .8; }

#play-again-btn {
  margin: 1.5rem auto 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .75rem 2rem;
  font-size: .9rem;
  cursor: pointer;
  transition: opacity .2s;
}
#play-again-btn:hover { opacity: .85; }

/* ── Admin panel ───────────────────────────────────────────────────────── */
#admin-panel {
  width: 100%;
  /*max-width: 560px;*/
  margin-bottom: 1.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  display: none;
}

#admin-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  user-select: none;
  font-size: .75rem;
  color: #4a4a80;
  letter-spacing: .5px;
}
#admin-toggle:hover { color: var(--muted); }

#admin-caret {
  display: inline-block;
  transition: transform .2s;
  font-size: .7rem;
}
#admin-panel.open #admin-caret { transform: rotate(90deg); }

#admin-body { display: none; margin-top: .75rem; }
#admin-panel.open #admin-body { display: flex; flex-direction: column; gap: .6rem; }

#admin-input-row {
  display: flex;
  gap: .5rem;
  position: relative;
}

#admin-station-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .85rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
}
#admin-station-input:focus       { border-color: var(--accent); }
#admin-station-input::placeholder { color: #4a4a80; }

#admin-autocomplete {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 150;
  overflow: hidden;
  display: none;
}

.admin-btn {
  background: transparent;
  border-radius: 8px;
  padding: .5rem .85rem;
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
#admin-set-btn   { background: var(--accent); color: var(--bg); border: 0; }
#admin-reset-btn { background: var(--alert);  color: var(--bg); border: 0; }
#admin-set-btn:hover,
#admin-reset-btn:hover { opacity: .85; }

#admin-msg      { font-size: .9rem; color: var(--muted); }
#admin-msg.ok   { color: var(--accent); }
#admin-msg.err  { color: var(--alert); }




/* ── Rules ───────────────────────────────────────────────── */
.rules {
  margin-top: 40px;
}

.rules-content {
  display: flex;
  gap: 50px;
}

.rules-content .col {
  flex: 1;
}

.rules-content .subhead {
  font-weight: 600;
}

.rules-content p {
  margin-bottom: 10px;
}

.line-status {
  display: flex;
  gap: 25px;
  margin: 20px 0;
}

.line-status .status {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.line-status .status img  {
  width: 100%;
  display: block;
}

/* Rules popup */

#rules-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#rules-overlay.show { display: flex; }

#rules-modal {
  background: var(--bg);
  width: 720px;
  height: 85vh;
  padding: 10px;
  border-radius: 10px;
  animation: popIn .25s cubic-bezier(.34, 1.56, .64, 1);
}

.rules-modal-inner {
  overflow-y: auto;
  height: 100%;
  padding: 30px;
  position: relative;
}

#rules-modal .rules-content {
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

#rules-modal .line-status {
  flex-direction: column;
  margin: 15px 0 5px 0;
  gap: 15px;
}

#rules-modal .line-status .status {
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

#rules-modal .line-status .status img {
  width: 45%;
}

/* ── Hint popup overlay ────────────────────────────────────────────────── */
#hint-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
#hint-overlay.show { display: flex; }

#hint-popup {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 340px;
  animation: popIn .2s cubic-bezier(.34, 1.56, .64, 1);
  position: relative;
}
#hint-popup h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  padding-right: 1.8rem;
}
#hint-popup p {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ── Shared close button — used across all modals ── */
.btn-close {
  position: absolute;
  top: .85rem;
  right: .9rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: .15rem .35rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  z-index: 1;
}
.btn-close:hover { color: var(--text); background: var(--surface); }

#hint-close-btn {
  position: absolute;
  top: .75rem;
  right: .85rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
#hint-close-btn:hover { color: var(--text); background: var(--surface); }

#hint-confirm-row { display: flex; gap: .6rem; }

#hint-yes-btn,
#hint-no-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: .55rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
#hint-yes-btn           { background: var(--accent); color: #fff; }
#hint-no-btn            { background: var(--grey); border: 1px solid var(--border); color: var(--text); }
#hint-yes-btn:hover,
#hint-no-btn:hover      { opacity: .8; }
#hint-yes-btn:disabled  { opacity: .4; cursor: not-allowed; }

/* ── City selector sidebar ─────────────────────────────────────────────── */
#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
#sidebar-overlay.show { 
  opacity: 1;
  visibility: visible;
  overscroll-behavior: none;
  touch-action: none;
}

#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100dvh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 401;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
}
#sidebar.open { transform: translateX(0); }

#sidebar-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0 .2rem;
  line-height: 1;
  margin-bottom: 1.5rem;
}
#sidebar-close:hover { color: var(--text); }

#sidebar h2 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: 10px 16px;
  border-left: 4px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  margin-bottom: 6px;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  color: var(--text);
}

.sidebar-btn:hover {
  background: #eee; 
}

.sidebar-btn.current {
  border-color: var(--accent); 
}

.city-flag {
  width: 35px;
  height: 20px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.sidebar-btn .city-label {
  font-weight: 600; 
  font-size: .9rem; 
}

.sidebar-score {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-score.won  { background: var(--green); color: #fff; }
.sidebar-score.lost { background: var(--alert); color: #fff; }



/* ── Burger button ─────────────────────────────────────────────────────── */
.menu-btn {
  z-index: 399;
  background: transparent;
  border: 0;
  border-radius: 8px;
  width: 38px; height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background .15s;
}
.menu-btn:hover { background: var(--surface); }
.menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}


/* ── Achievements page layout ───────────────────────────────────────────── */
.achievements-header {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Filter buttons */
.achievements-filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
 
.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
 
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
 
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Badge grid ── */
/* Badge grid — 8 columns desktop */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 30px;
  margin-bottom: 20px;
}

.badge-card {
  background: var(--surface, #1a1d27);
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  padding: 20px 10px;
  text-align: center;
  transition: border-color .2s, opacity .2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-card.unlocked {
  border-color: var(--accent, #00a2ec);
}

.badge-card.locked {
  opacity: .45;
  filter: grayscale(1);
}

.badge-card.newly-unlocked {
  border-color: var(--accent);
  box-shadow: 0 0 10px 0 rgba(0, 162, 236, 0.4);
  animation: pulse-highlight 5s ease-out forwards;
}

@keyframes pulse-highlight {
  0%   { box-shadow: 0 0 20px 0 rgba(0, 162, 236, 0.8); }
  100% { box-shadow: 0 0 10px 0 rgba(0, 162, 236, 0.4); }
}

.badge-icon {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 1rem;
}

.badge-img {
  width: 100%;
  height: auto;
  display: block;
}

.badge-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: .25rem;
}

.badge-desc {
  font-size: 15px;
  color: var(--muted, #888);
  line-height: 1.3;
  text-wrap: pretty;
}

.badge-date {
  font-size: .8rem;
  color: var(--accent, #00a2ec);
  margin-top: .4rem;
  font-weight: 600;
}

.badge-lock {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font-size: .75rem;
  opacity: .4;
}

/* ── Toast (shared with game page via achievements.js) ── */
#achievement-toast {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: bottom 0.75s cubic-bezier(.34,1.56,.64,1);
  width: min(420px, calc(100vw - 2rem));
}

#achievement-toast.show {
  bottom: 1.5rem;
}

.achievement-toast-inner {
  background: var(--surface, #1a1d27);
  border: 1px solid var(--accent, #00a2ec);
  border-radius: 14px;
  padding: 16px 16px 16px 120px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  position: relative;
}

.achievement-toast-icon {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 90px;
}

.achievement-toast-text {
  flex: 1;
  min-width: 0;
}

.achievement-toast-label {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.achievement-toast-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.achievement-toast-view {
  flex-shrink: 0;
  background: var(--accent, #00a2ec);
  color: #fff;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.achievement-toast-close {
  display: none;
  /*flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted, #888);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;*/
}


/* ── Credits page ─────────────────────────────────────────────────────── */
.credits {
  margin-top: 30px;
}

.credits h2 {
  margin-bottom: 20px;
}

.credits a {
  color: var(--accent);
}

.credits p {
  margin-bottom: 10px;
}


/* ── Tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {

  .container {
    width: 90%;
    margin-top: 30px;
  }

  header {
    margin-bottom: 25px;
    gap: 30px;
  }

  .logo {
    width: 240px;
  }

  .game-wrapper {
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px); /* modern browsers */
  }

  .game-panel {
    flex-basis: 380px;
    padding-right: 30px;
    margin-right: 30px;
  }

  .guess-row {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .info-row, .station-info { 
    align-items: center;
  }

  .station-name {
    font-size: 1.15em;
    letter-spacing: -.02em;
  }

  .icon {
    width: 16px;
    height: 16px;
  }

  .badges-grid {
    gap: 20px;
  }

  .badge-icon {
    width: 100px;
    height: 100px;
  }

}


/* ── Portrait Tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {

  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
  }

}


/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {

  .container {
    height: auto;
    margin-top: 20px;
  }

  .container.content {
    margin-top: 100px;
  }

  .logo {
    width: 230px;
  }

  .steps {
    margin-top: 0;
  }

  .city {
    font-size: 1em;
  }

  /* home page steps */
  .standfirst {
    font-size: 1em;
  }

  .line {
    width: calc(50vw - 60px);
  }

  .label {
    font-size: 14px;
    line-height: 1.3;
    width: 80px;
    text-align: center;
    white-space: initial;
  }

  .owl-nav {
    display: none;
  }

  .city-details h2 {
    font-size: 1.25em;
  }

  .city-details h4 {
    margin-top: 2px;
  }

  .rules-content {
    flex-direction: column;
    gap: 10px;
  }

  .game-wrapper {
    flex-direction: column;
    height: auto;
    margin: 0;
  }

  .game-panel {
    flex-basis: 100%;
    padding-right: 0;
    margin-right: 0;
    border: 0;
    margin-top: 100px;
    overflow-y: initial;
  }

  .title {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
  }

  .options-container { 
    margin-bottom: 20px; 
  }

  #map-container { 
    height: 400px;
    margin-top: 20px;
  }

  .modal-streak-pill {
    padding: 0px 12px;
  }

  .rules-content {
    font-size: 0.9em;
  }

  .rules {
    margin-top: 30px;
  }

  .line-status {
    flex-direction: column;
    gap: 20px;
    margin: 15px 0 5px 0;
  }
  
  #rules-modal {
    width: 100%;
    height: 100%;
    padding: 0;
  }

  .rules-modal-inner {
    padding: 20px;
  }

  #rules-modal h3 {
    margin-bottom: 15px;
  }

  #rules-modal .line-status .status {
    flex-direction: column;
    gap: 6px;
  }

  #rules-modal .line-status .status img {
    width: 100%;
  }

  footer {
    margin-top: 20px;
    position: relative;
    padding: 10px 0;
  }

  .credits {
    margin-top: 100px;
  }

  .credits strong {
    display: block;
  }

  /* Achievements */

  .filter-btn {
    padding: 8px 12px;
  }

  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .badge-icon {
    width: 100px;
    height: 100px;
  }

  .achievement-toast-inner {
    padding: 12px 12px 12px 100px;
  }

  .achievement-toast-icon {
    width: 75px;
  }

  .achievement-toast-label {
    font-size: 0.65rem;
    margin-bottom: 0;
  }

  .achievement-toast-name {
    font-size: 0.9rem;
  }

}