/* ======================= */
/* Base Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* ======================= */
/* Device Frame */
.device-frame {
  width: 90vw;
  max-width: 1280px;
  height: 95vh;
  border-radius: 3%;
  background: #000;
  box-shadow: 0 0 40px rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Notch & Speaker */
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  height: 30px;
  background: #000;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  z-index: 10;
}
.speaker {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: #222;
  border-radius: 3px;
  z-index: 11;
}

/* Side Buttons */
.side-button { position: absolute; background: #111; border-radius: 3px; }
.volume-up { top: 88px; left: -4px; width: 4px; height: 40px; }
.volume-down { top: 154px; left: -4px; width: 4px; height: 40px; }
.power { top: 121px; right: -4px; width: 4px; height: 77px; }

/* ======================= */
/* Glass Content */
.glass {
  flex: 1;
  padding: 70px 20px 100px; /* Adjusted bottom for dock */
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.05);
  text-align: center;
  overflow-y: auto;
}

/* Memoji Container */
.memoji-container {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 25px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.memoji-container video,
.memoji-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ======================= */
/* Text & Buttons */
h1 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.lead { font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.85); margin-bottom: 5px; }
.quote-author { font-size: 0.875rem; font-style: italic; color: rgba(255,255,255,0.6); margin-bottom: 25px; }

/* ======================= */
/* Dock */
.dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.07);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 14px 28px;
  display: flex;
  justify-content: center;
  z-index: 20;
}
.icon-links { display: flex; gap: 20px; }
.icon-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 75px;
  color: white;
  font-size: 28px;
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  transition: transform 0.2s, background 0.3s;
  text-decoration: none;
}
.icon-links a:hover { transform: scale(1.1); background: rgba(255,255,255,0.2); }
.icon-links i { font-size: 28px; margin-bottom: 4px; }
.icon-label { font-size: 0.75rem; text-align: center; color: rgba(255,255,255,0.9); display: block; }

/* ======================= */
/* Device Cards Grid */
.device-grid {
  display: grid;
  gap: 16px;
  justify-content: center;
  padding: 20px 0;
}
@media (min-width: 1025px) { .device-grid { grid-template-columns: repeat(4, auto); } }
@media (min-width: 601px) and (max-width: 1024px) { .device-grid { grid-template-columns: repeat(2, auto); } }
@media (max-width: 600px) { .device-grid { grid-template-columns: repeat(1, auto); } }

.device-card {
  width: 120px;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.device-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: 15px;
}
.device-card span { font-size: 0.875rem; color: #fff; font-weight: 600; }
.device-card:hover { transform: scale(1.05); background: rgba(255,255,255,0.15); }

/* ======================= */
/* Popups */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}
.popup-overlay.active { display: flex; }
.popup {
  background: rgba(0,0,0,0.85);
  padding: 30px;
  border-radius: 20px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  text-align: center;
  width: 320px;
}
.popup h2 { color: white; margin-bottom: 20px; }
.popup-buttons { display: flex; flex-direction: column; gap: 12px; }
.popup-btn {
  padding: 14px;
  border-radius: 15px;
  background: rgba(255,255,255,0.08);
  color: white;
  text-decoration: none;
  transition: background 0.3s;
}
.popup-btn:hover { background: rgba(255,255,255,0.18); }
.popup-close {
  margin-top: 15px;
  padding: 10px 22px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}
.popup-close:hover { background: rgba(255,255,255,0.25); }

/* ======================= */
/* iPad & Mac Adjustments */
@media (min-width: 601px) and (max-width: 1024px) {
  .device-frame { width: 90%; height: 90vh; border-radius: 40px; }
  .notch { width: 120px; height: 28px; border-radius: 14px; }
  .speaker, .side-button { display: none; }
  .dock { bottom: 20px; padding: 16px 30px; border-radius: 28px; }
  .icon-links a { width: 72px; height: 72px; font-size: 30px; }
}

@media (min-width: 1025px) {
  .device-frame { width: 90%; height: 90vh; border-radius: 12px; }
  .notch { width: 180px; height: 30px; border-radius: 0 0 12px 12px; }
  .speaker, .side-button { display: none; }
  .dock { bottom: 20px; padding: 18px 32px; border-radius: 30px; }
  .icon-links a { width: 75px; height: 75px; font-size: 32px; }
}

/* ======================= */
/* Back Button */
#back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 12px;
  z-index: 50;
}
