/* ==========================================================================
   ScreenFix Pro – iOS 27 Liquid Glass Design System
   iPhone 13 Pro Max (428 x 926) – Notch & Thumb-Reach Ergonomie
   ========================================================================== */

:root {
  --bg: #000000;
  --glass-base: rgba(14, 18, 28, 0.65);
  --glass-strong: rgba(20, 26, 42, 0.85);
  --glass-active: rgba(0, 240, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-specular: rgba(255, 255, 255, 0.28);
  --glass-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--glass-border) inset;

  --accent-cyan: #00f0ff;
  --accent-purple: #7000ff;
  --accent-pink: #ff007f;
  --accent-amber: #ffb300;
  --accent-gradient: linear-gradient(135deg, #00f0ff 0%, #7000ff 100%);
  --danger-gradient: linear-gradient(135deg, #ff0055 0%, #ff5500 100%);

  --text-main: #f5f5f7;
  --text-muted: #8e8e93;
  --text-dim: #636366;

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  color: var(--text-main);
  touch-action: manipulation;
}

#screenCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #000000;
}

/* ==========================================================================
   Liquid Glass HUD (Floating Modal)
   ========================================================================== */
.hud-container {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: max(20px, var(--sat));
  padding-bottom: max(20px, var(--sab));
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  transition: opacity 0.35s var(--spring), transform 0.35s var(--spring), visibility 0.35s;
}

.hud-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.94) translateY(12px);
}

.glass-card {
  width: 100%;
  max-width: 414px; /* Perfectly sized for iPhone 13 Pro Max */
  max-height: calc(100vh - max(40px, var(--sat) + var(--sab)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--glass-base);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--glass-shadow);
  position: relative;
}

/* Glass specular light bar on top edge */
.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-specular), transparent);
}

.card-header {
  text-align: center;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
  margin-bottom: 8px;
}

.card-header h1 {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #ffffff 40%, #c4c4cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tip Box (Hardware tuned) */
.tip-box {
  background: rgba(255, 179, 0, 0.08);
  border: 1px solid rgba(255, 179, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.tip-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tip-box ul {
  list-style: none;
  font-size: 11.5px;
  color: #d1d1d6;
  line-height: 1.5;
}

.tip-box li::before {
  content: "• ";
  color: var(--accent-amber);
  font-weight: bold;
}

.section-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Mode Grid */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s var(--spring);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.mode-btn:active {
  transform: scale(0.96);
}

.mode-btn.active {
  background: var(--glass-active);
  border-color: rgba(0, 240, 255, 0.65);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25) inset, 0 4px 16px rgba(0, 240, 255, 0.2);
}

.mode-btn .icon {
  font-size: 18px;
}

.mode-btn .name {
  font-size: 13px;
  font-weight: 650;
}

.mode-btn .desc {
  font-size: 10px;
  color: var(--text-muted);
}

/* Timer Selector */
.timer-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.time-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 650;
  color: #d1d1d6;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}

.time-btn:active {
  transform: scale(0.95);
}

.time-btn.active {
  background: rgba(112, 0, 255, 0.28);
  border-color: rgba(112, 0, 255, 0.75);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(112, 0, 255, 0.35) inset, 0 4px 16px rgba(112, 0, 255, 0.25);
}

/* Action Bar */
.action-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 8px 26px rgba(0, 240, 255, 0.35);
  cursor: pointer;
  transition: transform 0.15s var(--spring), filter 0.15s ease;
}

.primary-btn:active {
  transform: scale(0.97);
  filter: brightness(1.2);
}

.primary-btn.running {
  background: var(--danger-gradient);
  box-shadow: 0 8px 26px rgba(255, 0, 85, 0.4);
}

.secondary-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s var(--spring);
}

.secondary-link-btn:active {
  background: rgba(0, 240, 255, 0.16);
  transform: scale(0.98);
}

.footer-hint {
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

/* ==========================================================================
   Floating Status Capsule (Daumen-Ergonomie auf 6,7" Display)
   ========================================================================== */
.status-pill {
  position: fixed;
  bottom: max(18px, calc(var(--sab) + 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 16, 24, 0.85);
  backdrop-filter: blur(30px) saturate(210%);
  -webkit-backdrop-filter: blur(30px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 650;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: opacity 0.35s var(--spring), transform 0.35s var(--spring), visibility 0.35s;
  cursor: pointer;
}

.status-pill:active {
  transform: translateX(-50%) scale(0.96);
}

.status-pill.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px) scale(0.9);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse-glow 1.4s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-glow {
  0% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.7; }
}

.status-pill .sep {
  color: rgba(255, 255, 255, 0.22);
}

#pillCloseBtn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.8;
}
