html, body {
  margin: 0;
  height: 100%;
  background: #3a3a3a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: #1b1b1b;
  color: #fff;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

h1 span {
  font-weight: 400;
  color: #9fd9b4;
}

.header-right {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

#names-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #ddd;
  white-space: nowrap;
  cursor: pointer;
}

#names-toggle input {
  margin: 0;
}

#status {
  font-size: 13px;
  color: #bbb;
  text-align: right;
}

#notice {
  padding: 6px 14px;
  background: #c8102e;
  color: #fff;
  font-size: 14px;
}

#map {
  flex: 1;
  background: #3a3a3a;
}

/* Queue badges */

.ride-icon {
  background: none;
  border: none;
}

.badge {
  position: absolute;
  left: 0;
  bottom: 9px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 18px;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* Small tail pointing at the attraction */
.badge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  height: 3px;
}

/* "Visa namn" swaps the wait time for the ride name, keeping the colour. */
.badge .name,
.names-mode .badge .time {
  display: none;
}

.names-mode .badge .name {
  display: inline;
}

.badge small {
  font-size: 10px;
  font-weight: 600;
}

.w0 { background: #1e8a46; }
.w1 { background: #6a9a1f; }
.w2 { background: #c99a00; }
.w3 { background: #e06c00; }
.w4 { background: #c8102e; }
.closed { background: #6b6b6b; }

/* Popup */

.leaflet-popup-content {
  margin: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
}

.popup-title {
  font-weight: 700;
  font-size: 16px;
}

.popup-wait {
  font-size: 22px;
  font-weight: 700;
}

.popup-info {
  margin-top: 4px;
  color: #a00;
}

.popup-meta {
  margin-top: 4px;
  color: #777;
  font-size: 12px;
}

/* Zoomed out: smaller badges so neighbours overlap less */
.compact .badge {
  bottom: 6px;
  padding: 0 4px;
  border-width: 1.5px;
  font-size: 11px;
  line-height: 14px;
}

.compact .badge small {
  display: none;
}

.compact .badge::after {
  bottom: -6px;
  border-width: 4px;
  border-bottom: 0;
  height: 2px;
}

/* My position */

.locate-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #444;
}

.locate-btn.active {
  color: #1a73e8;
}

.locate-btn.searching {
  color: #1a73e8;
  animation: locate-pulse 1s ease-in-out infinite alternate;
}

@keyframes locate-pulse {
  from { opacity: 1; }
  to { opacity: 0.3; }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  max-width: calc(100% - 40px);
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(27, 27, 27, 0.92);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 420px) {
  .status-word {
    display: none;
  }
}
