/* Page chrome around the Compose canvas: the loading, unsupported and failed screens.
 * Colors are the dark EmberPalette (app/src/main/java/com/lukr99/workout/ui/theme/EmberPalette.kt);
 * change them there first and mirror them here. */
:root {
  --background: #0F0D0C;
  --surface-raised: #25211E;
  --border: #342E2A;
  --text-primary: #F6F2ED;
  --text-secondary: #BDB3A9;
  --primary: #F97316;
  --primary-light: #FB8B3D;
  --on-primary: #1C0B00;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}

[hidden] { display: none !important; }

/* A fixed, non-scrolling page: no rubber-band bounce or pull-to-refresh around the canvas. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--background);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  position: fixed;
  inset: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Compose sizes the canvas itself (inline width and height). Compose handles every touch, so the
 * browser must not pan, zoom, select text or show the long-press callout on it. */
#ember {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
  background: radial-gradient(ellipse at 50% 40%, var(--surface-raised), var(--background) 70%);
  text-align: center;
  transition: opacity 280ms ease-out;
}
.screen.leaving { opacity: 0; pointer-events: none; }
.screen h1 {
  margin: 20px 0 4px;
  font: 700 1.6rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
}
.screen p { margin: 4px 0; max-width: 32em; color: var(--text-secondary); }
.screen .small { font-size: 0.875rem; }
.screen a { color: var(--text-primary); }

/* The dumbbell from the launcher icon, gently breathing while the app loads. Five bars: outer
 * plate, inner plate, handle, inner plate, outer plate. */
.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
}
.mark i {
  display: block;
  background: var(--primary);
  border-radius: 1px;
}
.mark i:nth-child(1), .mark i:nth-child(5) { width: 9px; height: 56px; background: var(--primary-light); }
.mark i:nth-child(2), .mark i:nth-child(4) { width: 9px; height: 40px; margin: 0 2px; }
.mark i:nth-child(3) { width: 42px; height: 8px; }
.mark i:nth-child(1) { margin-right: 2px; }
.mark i:nth-child(5) { margin-left: 2px; }
#boot .mark { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-4px) scale(1.06); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #boot .mark { animation: none; }
  .screen { transition: none; }
}

.button {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 22px;
  background: var(--primary);
  color: var(--on-primary);
  font: 700 1rem system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

/* "A new version is ready" pill, above the home indicator. */
.update {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-raised);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.update .button { margin: 0; }

#safe-area-probe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
