html, body {
  height: 100%;
  margin: 0;
  background: #03121f;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, sans-serif;
}

#app {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: 0 1fr;
  transition: grid-template-columns 0.35s ease;
  overflow: hidden;
  background: #03121f;
}

#app.panel-open {
  grid-template-columns: clamp(260px, 30vw, 420px) 1fr;
}

#infoPanel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #051c2c;
  border-right: 1px solid rgba(15, 70, 109, 0.6);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  box-sizing: border-box;
  padding: clamp(10px, 2vw, 16px);
  overflow-x: hidden;
  overflow-y: auto;
}

#playerInfo {
  flex: 1;
  background: transparent;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

#playerInfo > .hud-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#panelToggle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%) rotate(180deg);
  writing-mode: vertical-rl;
  letter-spacing: 0.4em;
  background: rgba(5, 40, 57, 0.9);
  color: #9ffaff;
  border: 1px solid rgba(79, 246, 255, 0.5);
  border-radius: 8px 8px 0 0;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.25);
  font-weight: 700;
}

#panelToggle:focus-visible {
  outline: 2px solid #4ff6ff;
  outline-offset: 3px;
}

#mainArea {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

#map.map-init-error__wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #f8fafc;
  font-family: system-ui, sans-serif;
}

.map-init-error {
  max-width: 480px;
  padding: 18px 22px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-align: center;
  line-height: 1.5;
}

#toolbar-mount,
#tilevalidation-mount,
#registerpanel-mount {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#toolbar-mount {
  top: 12px;
  left: 16px;
  right: 16px;
  height: 64px;
  pointer-events: auto;
}

#tilevalidation-mount,
#registerpanel-mount {
  pointer-events: auto;
}

.toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font-family: system-ui, sans-serif;
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn { padding: 6px 10px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; }
.btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.note { font-size: 13px; color: #475569; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color:#3730a3; }

.logo-pin--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.logo-pin--recovering {
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8));
}

.logo-pin--dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.65);
  background: #60a5fa;
  border: 2px solid #1e3a8a;
  transform-origin: 50% 100%;
}

.logo-pin--dot.logo-pin--dot-red {
  background: #f87171;
  border-color: #991b1b;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.85);
}

.logo-pin--dot.logo-pin--dot-blue {
  background: #38bdf8;
  border-color: #0ea5e9;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.75);
}

@media (max-width: 640px) {
  #app.panel-open {
    grid-template-columns: minmax(260px, 80vw) 1fr;
  }
  #panelToggle {
    letter-spacing: 0.2em;
  }
}
