/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: #1e1e2e;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #cdd6f4;
}

/* ── Header ── */
header {
  background: #181825;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #313244;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1rem;
  font-weight: 600;
  color: #cdd6f4;
  white-space: nowrap;
}

/* ── Back link ── */
header a.back-link {
  color: #a6adc8;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid #45475a;
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

header a.back-link:hover {
  background: #313244;
  color: #cdd6f4;
}

/* ── Open link ── */
header a.open-link {
  color: #89b4fa;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid #89b4fa44;
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s;
}

header a.open-link:hover {
  background: #89b4fa22;
}

/* ── Device Switcher ── */
.device-switcher {
  display: flex;
  gap: 6px;
  background: #313244;
  padding: 4px;
  border-radius: 8px;
}

.device-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #a6adc8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.device-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.device-btn:hover {
  background: #45475a;
  color: #cdd6f4;
}

.device-btn.active {
  background: #89b4fa;
  color: #1e1e2e;
  font-weight: 600;
}

/* ── Size label ── */
.size-label {
  margin-left: auto;
  font-size: 0.75rem;
  color: #6c7086;
  white-space: nowrap;
}

/* ── Stage ── */
.stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow: auto;
}

/* ── Device Frame ── */
.device-frame {
  position: relative;
  background: #11111b;
  border-radius: 16px;
  box-shadow:
    0 0 0 2px #45475a,
    0 24px 64px rgba(0, 0, 0, 0.6);
  transition: width 0.4s cubic-bezier(.4, 0, .2, 1),
              height 0.4s cubic-bezier(.4, 0, .2, 1),
              border-radius 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Desktop */
.device-frame.desktop {
  width: 100%;
  max-width: 1280px;
  height: 720px;
  border-radius: 10px;
}

/* Tablet */
.device-frame.tablet {
  width: 768px;
  height: 1024px;
  border-radius: 20px;
}

/* Mobile */
.device-frame.mobile {
  width: 390px;
  height: 844px;
  border-radius: 40px;
}

/* Mobile notch */
.device-frame.mobile::before {
  content: '';
  display: block;
  width: 120px;
  height: 28px;
  background: #11111b;
  border-radius: 0 0 20px 20px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 2px 0 #45475a;
}

/* Tablet camera dot */
.device-frame.tablet::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: #45475a;
  border-radius: 50%;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

/* ── Mobile status bar ── */
.mobile-statusbar {
  display: none;
  background: #181825;
  padding: 10px 20px 6px;
  font-size: 0.7rem;
  color: #a6adc8;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.device-frame.mobile .mobile-statusbar {
  display: flex;
  padding-top: 36px;
}

/* ── iframe wrapper ── */
.iframe-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Blocked notice ── */
.blocked-notice {
  display: none;
  position: absolute;
  inset: 0;
  background: #1e1e2e;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #a6adc8;
  text-align: center;
  padding: 32px;
}

.blocked-notice.show {
  display: flex;
}

.blocked-notice svg {
  width: 52px;
  height: 52px;
  color: #6c7086;
}

.blocked-notice p {
  max-width: 360px;
  line-height: 1.7;
  font-size: 0.9rem;
}

.blocked-notice a {
  color: #89b4fa;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #89b4fa44;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background 0.2s;
}

.blocked-notice a:hover {
  background: #89b4fa22;
}
