:root {
  --bg: #0f172a;
  --panel: rgba(255, 255, 255, 0.08);
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --accent: #60a5fa;
  --accent-2: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  /* Фон: картинка + текущие градиенты (градиенты поверх изображения) */
  background-image: radial-gradient(
      900px 500px at 20% 0%,
      rgba(96, 165, 250, 0.25),
      transparent
    ),
    radial-gradient(
      700px 400px at 90% 30%,
      rgba(52, 211, 153, 0.18),
      transparent
    ),
    url("./bmvl.jpg");
  background-size: auto, auto, cover;
  background-position: 20% 0%, 90% 30%, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-color: var(--bg);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 28px 16px;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
}

.buttons {
  width: min(520px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  order: 2; /* Чтобы именно панель кнопок была в самом низу */
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.tour-frame-wrap {
  width: min(640px, calc(100vw - 32px));
  position: fixed;
  top: 30px;
  right: 30px;
  order: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  z-index: 1;
  opacity: 0;
  transition: opacity 220ms ease;
}

.tour-frame-wrap:hover {
  opacity: 1;
}

.tour-frame {
  display: block;
  width: 640px;
  height: 320px;
  max-width: 100%;
  border: 0;
}

.tour-frame-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.tour-frame-fullscreen-btn:hover {
  background: rgba(96, 165, 250, 0.35);
}

.tour-frame-wrap:fullscreen,
.tour-frame-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  top: 0;
  right: 0;
  border-radius: 0;
  opacity: 1;
}

.tour-frame-wrap:fullscreen .tour-frame,
.tour-frame-wrap:-webkit-full-screen .tour-frame {
  width: 100vw;
  height: 100vh;
  max-width: none;
}

.radio-widget-frame-wrap {
  width: 320px;
  height: 240px;
  position: fixed;
  right: 30px;
  bottom: 30px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  background: rgba(15, 23, 42, 0.25);
  z-index: 2;
}

.radio-widget-frame {
  display: block;
  width: 320px;
  height: 240px;
  border: 0;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.45);
}

.btn:active {
  transform: translateY(0px);
}

.output {
  width: min(520px, 100%);
  order: 1; /* Выше кнопок */
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.analog-clock-wrap {
  position: fixed;
  top: 14px;
  left: 14px;
  transform: none;
  z-index: 1;
  pointer-events: auto;
}

.analog-clock-link {
  display: block;
  text-decoration: none;
}

.analog-clock {
  width: clamp(180px, 28vmin, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  border: 0;
  background: transparent;
  backdrop-filter: blur(4px);
  box-shadow: none;
}

.clock-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84%;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  z-index: 1;
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  border-radius: 999px;
  z-index: 2;
}

.hand--hour {
  width: 8px;
  height: 28%;
  background: rgba(255, 255, 255, 0.7);
}

.hand--minute {
  width: 6px;
  height: 36%;
  background: rgba(255, 255, 255, 0.7);
}

.hand--second {
  width: 3px;
  height: 42%;
  background: #f43f5e;
}

.clock-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.3);
  transform: translate(-50%, -50%);
  z-index: 3;
}

