.effects-debug-dock {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: none;
}

.map-topbar {
  position: fixed;
  left: 50%;
  top: 12px;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(74px, 0.5fr) minmax(150px, 1fr) minmax(74px, 0.5fr);
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(560px, calc(100vw - 24px));
  min-height: 54px;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-admin-actions {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.map-topbar-btn {
  appearance: none;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(228, 232, 238, 0.96);
  color: #101317;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #5c6472;
  border-bottom: 2px solid #5c6472;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 42px;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  pointer-events: auto;
}

.map-topbar-info {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-top-color: #9fb5ff;
  border-left-color: #9fb5ff;
  border-right-color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent-dark);
}

.map-topbar-play {
  text-transform: lowercase;
}

.map-topbar-title {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--color-text);
  background: rgba(242, 238, 230, 0.94);
  border-top: 2px solid var(--color-line-light);
  border-left: 2px solid var(--color-line-light);
  border-right: 2px solid var(--color-line-dark);
  border-bottom: 2px solid var(--color-line-dark);
  box-shadow: var(--shadow-2);
  font-family: var(--font-ui);
  font-size: 42px;
  line-height: 1;
  text-align: center;
  text-shadow: 1px 1px 0 #fff, 2px 2px 0 rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  pointer-events: auto;
}

.map-topbar-btn.is-active,
.map-topbar-btn.is-live {
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.map-topbar-btn.is-start {
  background: var(--color-ui);
  color: var(--color-ui-text);
}

.map-topbar-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.effects-debug-actions,
.effects-debug-panel {
  pointer-events: auto;
}

.effects-debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.effects-debug-btn {
  appearance: none;
  min-height: 36px;
  padding: 8px 10px;
  background: rgba(228, 232, 238, 0.94);
  color: #101317;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #5c6472;
  border-bottom: 2px solid #5c6472;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.effects-debug-link {
  text-decoration: none;
}

.effects-debug-btn.is-active {
  background: #dfe7ff;
  border-top: 2px solid #5c6472;
  border-left: 2px solid #5c6472;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: none;
}

.effects-debug-panel {
  margin: 0;
  padding: 10px 12px;
  background: rgba(242, 238, 230, 0.96);
  color: #1d1a16;
  border-top: 2px solid #faf7f1;
  border-left: 2px solid #faf7f1;
  border-right: 2px solid #877c6e;
  border-bottom: 2px solid #877c6e;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .effects-debug-dock {
    right: 10px;
    bottom: calc(132px + env(safe-area-inset-bottom));
  }

  .map-topbar {
    left: 10px;
    right: 10px;
    top: calc(10px + env(safe-area-inset-top));
    width: auto;
    min-height: 46px;
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    gap: 8px;
    transform: none;
  }

  .map-topbar-btn {
    height: 38px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 15px;
    line-height: 38px;
  }

  .map-topbar-title {
    min-height: 46px;
    padding: 0 8px;
    font-size: 34px;
  }

  .map-admin-actions {
    top: calc(64px + env(safe-area-inset-top));
    right: 10px;
  }

  .effects-debug-btn {
    min-height: 34px;
    font-size: 15px;
  }
}
