/* Menu pauzy pod Esc: ekran główny, opcje i potwierdzenie wyjścia
   (public/js/ui/pause-menu.js). */

#pm-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 10, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  font-family: "Oswald", "Segoe UI", system-ui, sans-serif;
  color: #eee;
  user-select: none;
}

#pm-root.hidden { display: none !important; }
.pm-screen.hidden,
.pm-tabpanel.hidden { display: none !important; }

.pm-frame {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 34px 40px 30px;
  background: linear-gradient(180deg, rgba(22, 19, 17, .94), rgba(10, 10, 12, .95));
  border: 1px solid rgba(255, 120, 30, .18);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .4);
}

.pm-frame { overflow-x: hidden; }
.pm-frame::-webkit-scrollbar { width: 10px; }
.pm-frame::-webkit-scrollbar-track { background: transparent; }
.pm-frame::-webkit-scrollbar-thumb {
  background: rgba(255, 120, 30, .35);
  border-radius: 10px;
}

/* ---- ekran główny ---- */

.pm-title {
  font-size: clamp(30px, 4.2vw, 46px);   /* mieści się w ramce ekranu głównego (wcześniej wychodził poza nią) */
  letter-spacing: clamp(5px, 1vw, 9px);
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  color: #ff7a1e;
  text-shadow: 0 0 30px rgba(255, 120, 30, .35);
}

.pm-subtitle {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  letter-spacing: .55em;
  text-transform: uppercase;
  color: #c9c2bb;
  opacity: .7;
}

/* teleport: firma i maszyny — duże ikony, podpis pod spodem */
.pm-travel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.pm-travel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  font: 600 14px/1.1 "Oswald", "Segoe UI", system-ui, sans-serif;
  color: #eee;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.pm-travel-btn:hover:not(:disabled) {
  border-color: #ff7a1e;
  color: #ffb27a;
  background: rgba(255, 120, 30, .08);
}

.pm-travel-btn:disabled { opacity: .35; cursor: default; }
.pm-travel-icon { font-size: 30px; line-height: 1; }

.pm-main-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 34px;
}

/* ---- przyciski ---- */

.pm-btn {
  width: 100%;
  padding: 14px 18px;
  font: 600 17px/1.2 "Oswald", "Segoe UI", system-ui, sans-serif;
  color: #eee;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.pm-btn:hover {
  border-color: #ff7a1e;
  color: #ffb27a;
  background: rgba(255, 120, 30, .08);
}

.pm-btn:focus-visible {
  outline: 2px solid #ff7a1e;
  outline-offset: 2px;
}

.pm-btn:active { transform: translateY(1px); }

.pm-btn-primary {
  border-color: rgba(255, 120, 30, .55);
  color: #ffb27a;
  background: rgba(255, 120, 30, .1);
}

.pm-btn-primary:hover { background: rgba(255, 120, 30, .16); }

.pm-btn-danger {
  border-color: rgba(255, 86, 60, .5);
  color: #ff8f7a;
}

.pm-btn-danger:hover {
  border-color: #ff563c;
  color: #ffb3a2;
  background: rgba(255, 86, 60, .1);
}

.pm-btn-small {
  width: auto;
  padding: 10px 16px;
  font-size: 14px;
}

.pm-btn-ghost {
  color: #bdb6ae;
  background: transparent;
  border-color: rgba(255, 255, 255, .12);
}

/* ---- ekran opcji ---- */

.pm-heading {
  margin-bottom: 20px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ff7a1e;
}

.pm-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.pm-tab {
  flex: 1;
  padding: 10px 8px;
  font: 600 14px/1.2 "Oswald", "Segoe UI", system-ui, sans-serif;
  color: #9e9892;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.pm-tab:hover { color: #ffb27a; }

.pm-tab.on {
  color: #ff7a1e;
  border-bottom-color: #ff7a1e;
}

.pm-tab:focus-visible {
  outline: 2px solid #ff7a1e;
  outline-offset: -2px;
}

.pm-tabpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 40px;
}

.pm-label {
  flex: 1 1 auto;
  font-size: 15px;
  color: #ddd6cf;
}

.pm-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pm-hint {
  margin-top: -6px;
  text-align: right;
  font-size: 12px;
  color: #8f8982;
}

/* ---- segmenty ---- */

.pm-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pm-segment {
  min-width: 44px;
  padding: 7px 11px;
  font: 600 13px/1 "Oswald", "Segoe UI", system-ui, sans-serif;
  color: #b9b2aa;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.pm-segment:hover {
  color: #ffb27a;
  border-color: rgba(255, 120, 30, .55);
}

.pm-segment.on {
  color: #ffb27a;
  border-color: #ff7a1e;
  background: rgba(255, 120, 30, .16);
  box-shadow: inset 0 0 10px rgba(255, 120, 30, .12);
}

.pm-segment:focus-visible {
  outline: 2px solid #ff7a1e;
  outline-offset: 2px;
}

/* ---- suwaki ---- */

.pm-range {
  width: 190px;
  max-width: 100%;
  height: 22px;
  accent-color: #ff7a1e;
  background: transparent;
  cursor: pointer;
}

.pm-range:focus-visible {
  outline: 2px solid rgba(255, 120, 30, .6);
  outline-offset: 3px;
  border-radius: 4px;
}

.pm-value {
  display: inline-block;
  min-width: 56px;
  text-align: right;
  font: 600 14px/1 "Oswald", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #ffb27a;
}

/* ---- przełącznik ---- */

.pm-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.pm-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.pm-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background .15s, border-color .15s;
}

.pm-switch-track::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfc9c2;
  transition: transform .15s, background .15s;
}

.pm-switch input:checked + .pm-switch-track {
  background: rgba(255, 120, 30, .32);
  border-color: #ff7a1e;
}

.pm-switch input:checked + .pm-switch-track::after {
  transform: translateX(22px);
  background: #ff7a1e;
}

.pm-switch input:focus-visible + .pm-switch-track {
  outline: 2px solid #ff7a1e;
  outline-offset: 2px;
}

/* ---- stopka opcji ---- */

.pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* ---- potwierdzenie ---- */

.pm-confirm {
  text-align: center;
  padding: 10px 0 4px;
}

.pm-confirm .pm-heading { margin-bottom: 26px; }

.pm-confirm-actions {
  display: flex;
  gap: 12px;
}

.pm-confirm-actions .pm-btn { flex: 1; }

/* ---- wąskie ekrany ---- */

@media (max-width: 560px) {
  .pm-frame { padding: 24px 18px 22px; }

  .pm-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pm-control { justify-content: flex-start; }

  .pm-segments { justify-content: flex-start; }

  .pm-range { flex: 1 1 auto; width: auto; min-width: 140px; }

  .pm-hint { text-align: left; }

  .pm-footer,
  .pm-confirm-actions { flex-direction: column; }

  .pm-btn-small { width: 100%; }
}

/* Demolition Town: pasy ostrzegawcze nad ramką, tytuł z obrysem jak logo */
.pm-frame { position: relative; border: 3px solid #231f1c; border-radius: 18px; padding-top: 44px; }
.pm-frame::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-radius: 15px 15px 0 0;
  background: repeating-linear-gradient(-45deg, #ff7a1e 0 14px, #231f1c 14px 28px); }
.pm-title { font-weight: 700; letter-spacing: clamp(2px, .5vw, 5px); -webkit-text-stroke: 2px #231f1c; paint-order: stroke fill; }
.pm-btn-primary { color: #231f1c; background: #ff7a1e; border-color: #231f1c; }
.pm-btn-primary:hover { background: #ffd54a; }
