@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, h3, h4 {
  font-weight: 600;
}

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

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

h4 {
  margin-bottom: 20px;
}

p {
  margin-bottom: 10px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: inherit;
}

strong, b {
  font-weight: 500;
}

.mt-20 {
  margin-top: 20px;
}

/* ── 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 p {
  margin-bottom: 0;
}

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 .chip {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #fff;
  padding: 4px 7px;
  background: var(--alert);
  position: relative;
  top: -3px;
  border-radius: 5px;
  margin-left: 5px;
}

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

/* 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: 250px;
}

.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 {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 15px;
  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);
}

#guess-input::-webkit-search-cancel-button {
  display: none;
}

#guess-clear {
  display: none;
  position: absolute;
  right: 75px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

#guess-clear:hover {
  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: 8px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 14px;
  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: 2rem 2rem 1rem;
  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); }

.recommended {
  margin-top: 12px;
}

.recommended a {
  color: var(--muted);
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

#modal-daily-actions .btn {
  flex: 1;
}

#share-feedback {
  font-size:0.8rem;
  margin-top: 15px;
}

.btn.play-again {
  margin: 1.5rem auto 0;
}


/*#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; }*/

/* Melbourne invite and trial modals */
#melbourne-invite-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#melbourne-invite-overlay.show { display: flex; }

#melbourne-invite-modal {
  background: var(--bg, #0f1117);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  position: relative;
  text-align: center;
}
#melbourne-invite-modal h3 { margin-bottom: .5rem; line-height: 1.3; text-wrap: balance; }
#melbourne-invite-modal p { color: var(--muted, #888); font-size: .9rem; margin-bottom: 1rem; }
#melbourne-invite-modal .btn {
  display: inline-block;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  background: var(--accent, #00a2ec);
  color: #fff;
  text-decoration: none;
}


#melbourne-trial-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#melbourne-trial-overlay.show { display: flex; }

#melbourne-trial-modal {
  background: var(--bg, #0f1117);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  position: relative;
  text-align: center;
}
#melbourne-trial-modal h3 { margin-bottom: .5rem; }
#melbourne-trial-modal p { color: var(--muted, #888); font-size: .9rem; margin-bottom: 1rem; }
#melbourne-trial-buttons { display: flex; flex-direction: column; gap: .5rem; }
#melbourne-trial-buttons button {
  padding: .6rem;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}
#melbourne-trial-buttons button:hover { border-color: var(--accent, #00a2ec); }

#melbourne-trial-buttons button.current-vote {
  border-color: var(--accent, #00a2ec);
  background: rgba(0, 162, 236, 0.1);
  font-weight: 600;
}

/* ── 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); }


#hint-popup {
  display: none;
}

/* Interactive Tour */
.tour-btn-container {
  display: flex;
  justify-content: center;
  margin: 50px 0;
}

/* ── Take-the-tour prompt (first-time or lapsed players, game.php) ── */
#tour-prompt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#tour-prompt-overlay.show { display: flex; }

#tour-prompt-modal {
  background: var(--bg, #0f1117);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  position: relative;
  text-align: center;
}
#tour-prompt-modal h3 { margin-bottom: .5rem; line-height: 1.3; text-wrap: balance; }
#tour-prompt-modal p { color: var(--muted, #888); font-size: .9rem; margin-bottom: 1.25rem; }
#tour-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
#tour-prompt-actions .btn {
  display: block;
  width: 100%;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
}
#tour-prompt-actions .btn-primary {
  background: var(--accent, #00a2ec);
  color: #fff;
}
#tour-prompt-actions .btn-secondary {
  background: none;
  color: var(--muted, #888);
}

/* ── Rules & FAQs ───────────────────────────────────────────────── */
.rules-faqs {
  display: flex;
  gap: 60px;
  font-size: 0.9em;
}

.rules {
  flex: 3;
  position: relative;
}

.btn.tour-btn {
  position: absolute;
  top: 0;
  right: 0;
}

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

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

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

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

.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;
  gap: 15px;
}

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

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

/* ── FAQ ── */
.faq {
  flex: 2;
}

.faq-list {
  margin-bottom: 30px;
}

.faq-item {
  border-bottom: 1px solid var(--border, #ddd);
}

.faq-list .faq-item:first-of-type {
  border-top: 1px solid var(--border, #ddd);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 15px 15px 15px 0;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
}



.faq-chevron {
  flex-shrink: 0;
  transition: transform .2s ease;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}


/* ── 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: 270px;
  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: 10px;
  width: 100%;
  padding: 10px 20px 10px 15px;
  border-left: 4px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  color: var(--text);
  font-weight: 600; 
  font-size: .9rem; 
}

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

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

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.city-links {
  margin-bottom: 20px;
}

.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-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;
  position: relative;
  right: -5px;
}
.sidebar-score.won  { background: var(--green); color: #fff; }
.sidebar-score.lost { background: var(--alert); color: #fff; }

/* Toggle for cities with multiple maps */
.sidebar-group-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.sidebar-group-chevron {
  margin-left: auto;
  transition: transform .2s ease;
}

.sidebar-group.expanded .sidebar-group-chevron {
  transform: rotate(180deg);
}

.sidebar-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}

.sidebar-group-items .sidebar-btn {
  padding: 8px 20px 8px 30px;
  font-weight: 400;
}

.sidebar-group.expanded .sidebar-group-items {
  max-height: 200px;
}

.city-tag {
  display: inline-block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #fff;
  background: var(--accent, #00a2ec);
  border-radius: 6px;
  padding: 3px 7px 2px;
  vertical-align: middle;
  margin-left: 5px;
}


/* ── Nav / Chat 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;
}

.nav-icons {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.chat-nav-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}

.chat-nav-badge:hover {
  background: var(--surface);
}


.chat-nav-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--alert);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}


/* ── 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 {
  border-color: color-mix(in srgb, var(--border) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

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

.badge-card.locked .badge-name,
.badge-card.locked .badge-desc {
  opacity: 0.45;
}

.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;
}

/* unlocked progress */
.badge-progress { margin-top: .5rem; }
.badge-progress-bar {
  background: var(--border);
  border-radius: 999px;
  width: 60px;
  height: 6px;
  overflow: hidden;
}
.badge-progress-fill {
  background: var(--accent);
  height: 100%;
  border-radius: 999px;
}
.badge-progress-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: .3rem;
}

/* ── 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;*/
}



/* ── About page ─────────────────────────────────────────────────────── */
.about {
  display: flex;
  gap: 40px
}

.about div {
  flex: 2;
}

.about-other-games {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 !important;
}

.partner-logo {
  width: 200px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: 0.3s ease-in-out;
}

.partner-logo:hover {
  background: var(--border);
}

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

.affiliations {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}



/* ── 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: 92%;
    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);
  }

  .rules-faqs {
    flex-direction: column;
    gap: 30px;
  }

}


/* ── 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;
  }

  .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: 99;
  }

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

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

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

  .line-status {
    flex-direction: column;
    gap: 20px;
    margin: 15px 0;
  }

  .tour-btn-container {
    margin: 30px 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;
  }

  /* About */
  .about {
    flex-direction: column;
  }

  .about-other-games {
    align-items: flex-start;
    margin-bottom: 30px;
  }

  .partner-logo {
    width: 170px;
  }

  .affiliations {
    align-items: flex-start;
  }



}