*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
  /* No scroll on desktop */
}

body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  /* No scroll on desktop */
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #000000;
  }
}

#app-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  /* Fit visible area */
  overflow: hidden;
  /* App content doesn't scroll, body does */
  z-index: 1;
  /* Respect notch and home indicator */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

#map {
  height: 100%;
  width: 100%;
}



/* ... existing styles ... */

/* Mobile Tweaks */
@media (max-width: 900px) {
  html {
    overflow: auto;
  }

  body {
    min-height: 125%;
    /* Ensure ample scroll area */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #app-container {
    position: absolute;
    /* Scroll with body */
    height: 100%;
    /* Cover full 125% height */
    overflow: hidden;
  }

  #restaurantsPanel.collapsed {
    /* ... existing collapsed styles ... */
    max-height: 45vh;
    /* slightly taller on mobile if needed */
    max-height: 45dvh;
  }
}

/* Base centered panel styling + fade/slide animation */
.center-panel {
  /* Use fixed positioning to cover screen, then flexbox to center content */
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  pointer-events: none;
  /* Let clicks pass through when hidden */

  display: flex;
  align-items: center;
  justify-content: center;

  /* Transition opacity for fade effect */
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* The actual card content wrapper */
/* The actual card content wrapper - Liquid Glass Style (Advanced) */
.panel-card {
  text-align: center;
  padding: 32px 40px;
  border-radius: 28px;
  /* Generous rounding */

  /* Advanced Liquid Glass Effect */
  backdrop-filter: saturate(210%) blur(40px);
  -webkit-backdrop-filter: saturate(210%) blur(40px);
  background: rgba(255, 255, 255, 0.4);
  /* High transparency */
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* Specular edge */

  color: #111;
  /* Soft deep shadow + inner highlight */
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
  width: min(380px, 90vw);

  /* Initial state: slightly down for slide-up effect */
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

/* active panel visible */
.center-panel.active {
  opacity: 1;
  pointer-events: auto;
  /* Enable clicks */
}

/* Slide card to 0 when active */
.center-panel.active .panel-card {
  transform: translateY(0);
}



@media (prefers-color-scheme: dark) {
  .center-panel {
    background: rgba(0, 0, 0, 0.4);
    /* Slightly lighter dim to see map */
  }

  .panel-card {
    background: rgba(20, 20, 20, 0.5);
    /* Deep dark glass with bleed through */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
      0 25px 60px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  }
}

/* Panel 1: welcome */
#welcomePanel h1 {
  margin: 0 0 20px;
  font-size: 2rem;
  font-weight: 700;
}

.primary-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 26px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;

  background: #0f62c8;
  color: white;
  transition: opacity 0.15s, transform 0.15s;
}

.primary-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.primary-btn.small {
  padding: 9px 18px;
  font-size: 0.95rem;
  margin-top: 16px;
}

@media (prefers-color-scheme: dark) {
  .primary-btn {
    background: #3d8dff;
  }
}



/* Recent list on welcome */
.recent-list {
  margin-top: 24px;
  display: flex;
  flex-direction: row;
  /* wrap items */
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  /* Slightly more gap for wrapped rows */
  opacity: 0;
  animation: fadeIn 0.5s ease 0.5s forwards;
  /* delay fade in */
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.recent-title {
  width: 100%;
  /* Force title to own row */
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.6;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .recent-item {
    background: var(--bg-dark, rgba(0, 0, 0, 0.3));
    /* Use dark variable */
    color: #fff;
  }
}

.recent-item {
  font-size: 0.85rem;
  /* slightly smaller text */
  padding: 4px 12px;
  /* reduced height */

  /* Default to bright variable, fallback to dark grey */
  background: var(--bg-light, #333);

  border-radius: 99px;
  color: #fff;
  /* Enforce white text */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  /* Ensure contrast */
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
  /* Ensure proper spacing */
}

.recent-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  /* background: rgba(255, 255, 255, 0.8); REMOVED to keep theme color */
  border-color: rgba(255, 255, 255, 0.6);
}

.recent-item:active {
  transform: scale(0.95);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(320px, 90vw);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.modal-content p {
  margin: 0 0 20px;
  opacity: 0.7;
  font-size: 0.95rem;
}

.map-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.map-choice-btn {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.map-choice-btn:hover {
  background: #eee;
  transform: translateX(2px);
  border-color: #bbb;
}

.pref-check {
  margin-bottom: 16px;
  font-size: 0.9rem;
  opacity: 0.9;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-color-scheme: dark) {
  .recent-item {
    background: rgba(0, 0, 0, 0.3);
    color: #eee;
  }

  .recent-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .modal-content {
    background: #222;
    color: #f5f5f5;
  }

  .map-choice-btn {
    background: #333;
    border-color: #444;
    color: #fff;
  }

  .map-choice-btn:hover {
    background: #444;
    border-color: #666;
  }

  .close-modal-btn {
    color: #aaa;
  }
}

/* Panel 2: address – desktop defaults */
#addressPanel .panel-card {
  padding: 10px 12px;
  width: min(420px, 95vw);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Wider address panel on desktop */
@media (min-width: 901px) {
  #addressPanel .panel-card {
    width: 50vw;
  }
}

.location-row-wrapper {
  position: relative;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  height: 42px;
  width: 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;

  background: #ffffff;
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  background: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  .icon-btn {
    background: #222;
    color: #f5f5f5;
  }

  .icon-btn:hover {
    background: #333;
  }
}

.address-input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

.address-input::placeholder {
  color: #999;
}

.address-input:focus {
  border-color: #1d8ff2;
  box-shadow: 0 0 0 2px rgba(29, 143, 242, 0.25);
}

@media (prefers-color-scheme: dark) {
  .address-input {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
  }

  .address-input::placeholder {
    color: #777;
  }

  .address-input:focus {
    border-color: #4cb0ff;
    box-shadow: 0 0 0 2px rgba(76, 176, 255, 0.35);
  }
}

/* Suggestions dropdown */
.suggestions {
  position: absolute;
  top: 50px;
  left: 50px;
  right: 50px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  text-align: left;
  font-size: 0.85rem;
  z-index: 10000;
}

.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  .suggestions {
    background: rgba(10, 10, 10, 0.96);
    color: #f5f5f5;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
  }

  .suggestion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .suggestion-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* Panel 3: transport choice */
#nextPanel .panel-card {
  width: min(420px, 95vw);
}

#nextPanel h2 {
  margin: 0 0 18px;
  font-size: 1.4rem;
  font-weight: 600;
}

.mode-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.mode-btn {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  background: #ffffff;
  color: #111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  font-size: 1.6rem;
}

.mode-btn span.mode-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  background: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  .mode-btn {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
  }

  .mode-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Filter Row */
.filter-row {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.filter-row .filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 4px;
  opacity: 0.9;
}

.cuisine-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  /* custom arrow? maybe later */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
}

.cuisine-select:focus {
  border-color: #0f62c8;
  box-shadow: 0 0 0 2px rgba(15, 98, 200, 0.2);
}

@media (prefers-color-scheme: dark) {
  .cuisine-select {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  }
}

/* Panel 4: loading restaurants */
#loadingPanel .panel-card {
  width: min(420px, 95vw);
}

#loadingPanel h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.loading-sub {
  font-size: 0.9rem;
  opacity: 0.8;
}

.spinner {
  margin: 18px auto 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: #0f62c8;
  animation: spin 0.9s linear infinite;
}

@media (prefers-color-scheme: dark) {
  .spinner {
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #3d8dff;
  }
}

.loading-icons {
  margin-top: 24px;
  font-size: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.loading-icons span {
  display: inline-block;
  animation: bounceFood 1.4s infinite ease-in-out both;
}

.loading-icons span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-icons span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Weather Widget */
.weather-widget {
  margin-top: 20px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.weather-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 5px;
  animation: floatWeather 3s ease-in-out infinite;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

.weather-desc {
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 4px;
}

@keyframes floatWeather {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceFood {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Panel 5: restaurants wheel */
#restaurantsPanel .panel-card {
  width: min(420px, 95vw);
  transition: padding 1.5s ease, transform 1.5s ease, bottom 1.5s ease;
}

#restaurantsPanel h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.rest-count {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 16px;
}

.wheel-wrapper {
  position: relative;
  width: min(80vw, 320px);
  height: min(80vw, 320px);
  margin: 0 auto;
  overflow: hidden;
  max-height: 360px;
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, margin 0.35s ease;
}

#wheelCanvas {
  width: 100%;




  height: 100%;
  border-radius: 50%;
  display: block;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  color: #0f62c8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: opacity 0.35s ease;
}

@media (prefers-color-scheme: dark) {
  .wheel-pointer {
    color: #3d8dff;
  }
}

#spinBtn {
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, margin 0.35s ease;
}

.selected-rest {
  margin-top: 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Map links container (now for icons) */
.map-links {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Icon-style links */
.map-icon {
  width: 120px;
  height: 60px;
  /* Compact height */
  padding: 0 2px;
  border-radius: 10px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  /* Very tight gap */

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

/* ... hover ... */

.map-icon svg {
  width: 20px;
  /* Micro icon */
  height: 20px;
  flex-shrink: 0;
}

.map-icon span {
  font-size: 0.55rem;
  /* Micro text */
  font-weight: 700;
  /* Bold to maintain legibility */
  color: #555;
  text-align: center;
  line-height: 1;
  letter-spacing: 0.2px;
  /* Help legibility at small size */
  white-space: nowrap;
  /* Prevent awkward wrapping like 'M\naps' */
  overflow: hidden;
  text-overflow: ellipsis;
  /* Fallback if somehow still too long */
  max-width: 100%;
}

/* Brand Specifics */
.map-icon.gmaps {
  color: #DB4437;
}

/* Icon color */
.map-icon.apple {
  color: #000;
}

.map-icon.osm {
  color: #78AC40;
}

@media (prefers-color-scheme: dark) {
  .map-icon {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .map-icon span {
    color: #bbb;
  }

  .map-icon.gmaps {
    color: #EA4335;
  }

  .map-icon.apple {
    color: #fff;
  }

  .map-icon.osm {
    color: #8CD052;
  }
}



@media (prefers-color-scheme: dark) {
  .map-icon {
    background: rgba(0, 0, 0, 0.7);
  }
}

/* "Return to start" button in results */
/* "Return to start" button in results */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#restaurantsPanel.show-text .result-actions {
  opacity: 1;
  transform: translateY(0);
}

#backToStartBtn {
  margin-top: 0;
  display: none;
}

/* --- COLLAPSED WHEEL AFTER SPIN --- */
#restaurantsPanel.collapsed {
  padding: 8px 14px 10px;
  /* tighter tile around text */
}

/* hide empty count row when collapsed */
#restaurantsPanel.collapsed .rest-count {
  display: none;
}

/* RESULT TEXT ANIMATION */
.selected-rest,
.map-links {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#restaurantsPanel.show-text .selected-rest,
#restaurantsPanel.show-text .map-links {
  opacity: 1;
  transform: translateY(0);
}

/* bring the main text closer to the top when collapsed */
#restaurantsPanel.collapsed .selected-rest {
  margin-top: 12px;
}

#restaurantsPanel.collapsed .result-actions {
  margin-top: 8px;
  /* tighter spacing when collapsed */
}

#restaurantsPanel.collapsed .wheel-wrapper,
#restaurantsPanel.collapsed #spinBtn,
#restaurantsPanel.collapsed .wheel-pointer {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transform: translateY(40px);
  pointer-events: none;
}

/* --- NO RESULTS: hide wheel elements --- */
#restaurantsPanel.no-results .wheel-wrapper,
#restaurantsPanel.no-results #spinBtn,
#restaurantsPanel.no-results .wheel-pointer {
  display: none;
}

/* --- DESKTOP: result panel floating ~75% down AFTER collapse --- */
@media (min-width: 901px) {

  /*
     When collapsed on desktop, we want the CARD to move down.
     The container (#restaurantsPanel) remains full screen flex centered.
     So we can just translate the card down.
  */
  #restaurantsPanel.collapsed .panel-card {
    position: relative;
    /* Instead of fixed positioning the container, we move the card */
    transform: translateY(35vh) !important;
    /* Move card down from center. 35vh is approx 75% down */
    width: 360px;
    padding: 8px 16px 12px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
  }

  /* Reset the container to allow clicks through if needed, 
     but .center-panel already handles pointer-events based on .active 
  */
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 900px) {

  /* Global mobile overwrite for all cards */
  .panel-card {
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }

  /* Specific panel padding tweaks */
  #welcomePanel .panel-card {
    padding: 28px 20px;
  }

  #addressPanel .panel-card {
    padding: 10px 0 10px;
    /* Reduced side padding on container, handled by inner rows */
  }

  #nextPanel .panel-card,
  #loadingPanel .panel-card,
  #restaurantsPanel .panel-card {
    padding: 24px 20px;
  }

  /* extra luft runt ikon + input-raden i adresspanelen */
  #addressPanel .location-row {
    padding: 0 16px;
  }

  /* Removed .center-panel padding constraint to allow full edge-to-edge */
  .center-panel {
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .wheel-wrapper {
    width: min(90vw, 320px);
    height: min(90vw, 320px);
  }

  /* result panel anchored to bottom ONLY after collapse */
  /* result panel anchored to bottom ONLY after collapse */
  /* result panel anchored to bottom ONLY after collapse */
  #restaurantsPanel.collapsed {
    position: fixed;
    bottom: 0;
    left: 50%;
    /* Keep left 50% to match uncollapsed */
    right: auto;
    top: auto;

    transform: translate(-50%, 0);
    /* Slide down to 0 offset */

    width: 100vw;
    border-radius: 16px 16px 0 0;
    padding: 12px 16px 32px;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.3);

    max-height: 40vh;
    overflow: hidden;
    opacity: 1;
    pointer-events: auto;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Removed animation, utilizing transition on 'bottom' and 'transform' */
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- PARTICLE LAYER ON WELCOME --- */
#particleLayer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5000;
  /* under panelerna (9000), över kartan */
  transition: opacity 0.7s ease;
}

#particleLayer.fade-out {
  opacity: 0;
}

.particle {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(0);
  animation-name: floatUp;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(40vh);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    transform: translateY(-20vh);
    opacity: 0;
  }
}

/* Main Logo on Welcome Screen */
.main-logo {
  display: block;
  margin: 0 auto 24px;
  max-width: 80%;
  height: auto;
  max-height: 120px;
  /* Prevent it from being too huge */
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

@media (prefers-color-scheme: dark) {
  .main-logo {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  }
}

/* --- NEW LAYOUT STRUCTURE --- */
#app-container {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  /* Keep app "fullscreen" logic inside here */
}

/* About Link */
.about-trigger {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.8rem;
  color: #666;
  text-decoration: underline;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s;
}

.about-trigger:hover {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .about-trigger {
    color: #ccc;
  }
}

/* Text Content Modal Override */
.modal-content.text-content {
  width: min(600px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
  line-height: 1.6;
}

.modal-content.text-content h2 {
  font-size: 1.8rem;
  margin-top: 0;
  text-align: center;
}

.modal-content.text-content h3 {
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 12px;
}

.modal-content.text-content ul,
.modal-content.text-content ol {
  padding-left: 20px;
}

.modal-content.text-content p {
  margin-bottom: 16px;
}

.modal-content.text-content .footer-note {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}

@media (prefers-color-scheme: dark) {
  .modal-content.text-content .footer-note {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #666;
  }
}

#closeAboutBtn {
  display: block;
  margin: 20px auto 0;
  min-width: 120px;
}

/* Content Section Styling */
#info-content {
  background: #f9f9f9;
  color: #333;
  padding: 60px 20px 80px;
  min-height: 50vh;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

#info-content h2 {
  font-size: 2rem;
  margin-bottom: 24px;
  color: #111;
}

#info-content h3 {
  font-size: 1.4rem;
  margin-top: 40px;
  margin-bottom: 16px;
  color: #222;
}

#info-content p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: #444;
}

#info-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

#info-content li {
  margin-bottom: 12px;
  font-size: 1.05rem;
  color: #444;
}

.footer-note {
  margin-top: 60px;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 30px;
}

/* Dark Mode Support for Content */
@media (prefers-color-scheme: dark) {
  #info-content {
    background: #111;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  #info-content h2,
  #info-content h3 {
    color: #fff;
  }

  #info-content p,
  #info-content li {
    color: #ccc;
  }

  .footer-note {
    color: #666;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Suggestions Container */
.suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

/* Suggestion Button (Secondary Action) */
.suggestion-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: min(100%, 280px);
}

.suggestion-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-btn .icon {
  font-size: 1.2rem;
}

@media (prefers-color-scheme: dark) {
  .suggestion-btn {
    background: #333;
    border-color: #444;
    color: #eee;
  }

  .suggestion-btn:hover {
    background: #444;
    border-color: #555;
  }
}

/* Cuisine Grid */
.cuisine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.cuisine-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cuisine-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.cuisine-btn.selected {
  background: #0f62c8;
  color: white;
  border-color: #0f62c8;
  box-shadow: 0 4px 12px rgba(15, 98, 200, 0.3);
}

.cuisine-btn .c-icon {
  font-size: 1.6rem;
}

.cuisine-btn .c-label {
  font-size: 0.75rem;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .cuisine-btn {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #eee;
  }

  .cuisine-btn:hover {
    background: rgba(60, 60, 60, 0.9);
  }

  .cuisine-btn.selected {
    background: #3d8dff;
    border-color: #3d8dff;
    color: #fff;
  }
}

/* Modal Content Polish */
.modal-content.text-content {
  line-height: 1.7;
  /* Increased for readability */
  padding: 32px 28px;
  /* More breathing room */
}

.modal-content.text-content h2 {
  font-size: 2rem;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.modal-content.text-content h3 {
  font-size: 1.35rem;
  margin-top: 36px;
  margin-bottom: 16px;
  color: #222;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 8px;
}

.modal-content.text-content p {
  margin-bottom: 20px;
  color: #444;
  font-size: 1rem;
}

@media (prefers-color-scheme: dark) {
  .modal-content.text-content h3 {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .modal-content.text-content p {
    color: #ccc;
  }
}

/* Loading state for location button */
#locBtn.loading {
  animation: pulse-loading 1s infinite alternate;
  cursor: wait;
  opacity: 0.7;
}

@keyframes pulse-loading {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }

  to {
    transform: scale(1.05);
    box-shadow: 0 0 10px 4px rgba(76, 175, 80, 0);
  }
}

/* Global Spins Counter (Minimalistic, below window) */
.global-spins {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  font-family: system-ui, -apple-system, sans-serif;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 1000;

  animation: fadeIn 0.8s ease-out;
}

.global-spins .spin-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.5);
}

.global-spins .spin-label {
  font-size: 0.7rem;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .global-spins {
    color: rgba(255, 255, 255, 0.4);
  }

  .global-spins .spin-count {
    color: rgba(255, 255, 255, 0.5);
  }
}