/* Torr.se playground — shared styles (switcher, header sizing, bell) */

/* Let the fixed header grow with the new weather card (production clamps it to 30vh) */
body.pg #header-container {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.pg #weather-display {
  overflow: visible;
}

/* ---------- Alert bell ---------- */
.pg-bell {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}
.pg-bell:hover { opacity: 1; transform: rotate(-12deg) scale(1.1); }
.pg-bell.active { opacity: 1; color: #fbbf24; }
.pg-bell.active svg { fill: currentColor; }

/* ---------- Variant switcher ---------- */
#pg-switcher {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  color: #e2e8f0;
  animation: pg-sw-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
}
@keyframes pg-sw-in { from { opacity: 0; transform: translate(-50%, 20px); } }

#pg-switcher a { color: inherit; text-decoration: none; }
.pg-sw-home {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s;
}
.pg-sw-home:hover { background: rgba(255, 255, 255, 0.18); }

.pg-sw-tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; padding: 2px; }
.pg-sw-tabs a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.pg-sw-tabs a b {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); font-size: 10px;
}
.pg-sw-tabs a:hover { background: rgba(255, 255, 255, 0.1); }
.pg-sw-tabs a.active { background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.pg-sw-tabs a.active b { background: rgba(255, 255, 255, 0.25); }

.pg-sw-rain {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
  white-space: nowrap;
}
.pg-sw-rain:hover { background: rgba(255, 255, 255, 0.14); }
.pg-sw-rain i {
  width: 26px; height: 15px; border-radius: 999px; background: rgba(255, 255, 255, 0.2);
  position: relative; transition: background 0.2s;
}
.pg-sw-rain i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.pg-sw-rain.on { color: #7dd3fc; }
.pg-sw-rain.on i { background: #0ea5e9; }
.pg-sw-rain.on i::after { transform: translateX(11px); }

.pg-sw-theme {
  width: 32px; height: 32px; display: grid; place-items: center; border: 0; padding: 0;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fde68a; cursor: pointer;
  transition: background 0.2s, transform 0.3s;
}
.pg-sw-theme:hover { background: rgba(255, 255, 255, 0.18); transform: rotate(-20deg); }
.pg-sw-theme .moon { display: none; }
[data-theme="dark"] .pg-sw-theme { color: #c7d2fe; }
[data-theme="dark"] .pg-sw-theme .sun { display: none; }
[data-theme="dark"] .pg-sw-theme .moon { display: block; }

@media (max-width: 600px) {
  #pg-switcher { bottom: 10px; font-size: 11px; gap: 4px; padding: 4px; }
  .pg-sw-tabs a { padding: 6px 8px; }
  .pg-sw-tabs a span { display: none; }
  .pg-sw-rain span { display: none; }
  .pg-sw-home, .pg-sw-theme { width: 28px; height: 28px; }
}

/* Shared micro animations */
@keyframes pg-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pg-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pg-pulse-ring { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes pg-draw { from { stroke-dashoffset: var(--len, 1200); } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  body.pg * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
