/* ─── Top Bar ─────────────────────────────────────────────── */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-bar-height);
  z-index: 2000;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--blue-border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  user-select: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.top-bar__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: background 0.15s, color 0.15s;
}

.top-bar__hamburger:hover {
  background: rgba(43, 58, 171, 0.35);
  color: var(--gold);
}

.top-bar__cross {
  height: 22px;
  width: 22px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.9;
}

.top-bar__spacer {
  flex: 1;
}

.top-bar__title {
  font-family: 'B612 Mono', ui-monospace, monospace;
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--gold);
  white-space: nowrap;
}

/* ─── Touch-only buttons (i-btn, clock-btn) ────────────────── */

.top-bar .top-bar__info-btn,
.top-bar .top-bar__clock-btn {
  display: none;
}

@media (pointer: coarse) {
  .top-bar .top-bar__info-btn,
  .top-bar .top-bar__clock-btn { display: flex; }
}

.top-bar__info-btn.active {
  background: rgba(43, 58, 171, 0.35);
  color: var(--gold);
}

/* ─── Clock overlay (tap clock-btn on touch) ───────────────── */

.top-bar__clock-overlay {
  position: fixed;
  top: var(--top-bar-height);
  right: 0;
  background: var(--bg-bar);
  border: 1px solid var(--blue-border);
  border-top: none;
  padding: 10px 18px;
  font-family: 'B612 Mono', monospace;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.1em;
  z-index: 2001;
  border-radius: 0 0 0 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ─── Side Menu ───────────────────────────────────────────── */

.side-menu {
  position: fixed;
  top: var(--top-bar-height);
  right: -320px;
  left: unset;
  width: 300px;
  bottom: 0;
  z-index: 1999;
  background: var(--bg-bar);
  border-left: 1px solid var(--blue-border);
  border-right: none;
  transition: right 0.2s ease;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}

.side-menu.open {
  right: 0;
}

.side-menu__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'B612 Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: not-allowed;
  transition: background 0.15s, color 0.15s;
}

.side-menu__btn:hover {
  background: rgba(43, 58, 171, 0.2);
  color: var(--gold);
}

.side-menu__btn-tag {
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.25);
  margin-left: auto;
}

.side-menu__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1998;
}

.side-menu__backdrop.open {
  display: block;
}

/* Root view — flex column to push reset btn to bottom */
.side-menu__root-view {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Content area for pushed views (plan panels etc.) */
.side-menu__content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Footer — reset data button */
.side-menu__footer {
  padding: 8px 14px;
  border-top: 1px solid var(--blue-border);
  min-height: 0;
}

.side-menu__btn--enabled {
  cursor: pointer;
}

.side-menu__spacer {
  flex: 1;
}

.side-menu__reset-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 18px;
  background: none;
  border: none;
  color: rgba(255, 80, 80, 0.55);
  font-family: 'B612 Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.side-menu__reset-btn:hover {
  background: rgba(200, 30, 30, 0.15);
  color: rgba(255, 100, 100, 0.9);
}

/* Confirm overlay inside side menu root view */
.side-menu__confirm {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 40, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  padding: 24px;
  border-radius: inherit;
}

.side-menu__confirm-msg {
  font-family: 'B612 Mono', ui-monospace, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.side-menu__confirm-msg strong {
  display: block;
  color: rgba(255, 100, 100, 0.9);
  font-size: 12px;
  margin-bottom: 4px;
}

.side-menu__confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.side-menu__confirm-yes,
.side-menu__confirm-no {
  flex: 1;
  padding: 8px 0;
  border-radius: 3px;
  font-family: 'B612 Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.15s;
}

.side-menu__confirm-yes {
  background: rgba(180, 30, 30, 0.6);
  border: 1px solid rgba(255, 80, 80, 0.4);
  color: rgba(255, 200, 200, 0.9);
}

.side-menu__confirm-yes:hover {
  background: rgba(200, 40, 40, 0.8);
}

.side-menu__confirm-no {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.side-menu__confirm-no:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Mobile: side menu as bottom sheet ────────────────────── */

@media (max-width: 640px) {
  .side-menu {
    right: 0;
    top: unset;
    bottom: -33vh;
    width: 100%;
    height: 33vh;
    border-left: none;
    border-top: 1px solid var(--blue-border);
    border-radius: 12px 12px 0 0;
    transition: bottom 0.25s ease;
    overflow-y: auto;
  }

  .side-menu.open {
    bottom: var(--bottom-bar-height);
    right: 0;
  }
}
