:root {
  --bg: #121212;
  --bar: #272727;
  --nav: #2e2e2e;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --bar-height: 56px;
  --nav-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Barre du haut */
.app-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--bar-height) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: var(--bar);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px rgba(0, 0, 0, 0.14);
}

.app-bar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.0125em;
}

@media (min-width: 960px) {
  :root {
    --bar-height: 64px;
  }
}

/* Liste des webcams */
.webcams {
  padding: calc(var(--bar-height) + var(--safe-top) + 20px) 12px
    calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

.webcam h2 {
  margin: 0;
  padding-bottom: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 40px;
  background: #000;
}

.frame iframe,
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.frame img {
  object-fit: contain;
}

.offline {
  position: fixed;
  top: calc(var(--bar-height) + var(--safe-top));
  inset-inline: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 16px;
  background: #b00020;
  font-size: 0.85rem;
  text-align: center;
}

/* Navigation du bas */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav);
  box-shadow: 0 -2px 4px -1px rgba(0, 0, 0, 0.2), 0 -4px 5px rgba(0, 0, 0, 0.14);
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 80px;
  max-width: 168px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.bottom-nav button[aria-pressed="true"] {
  color: var(--text);
}

.bottom-nav button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -4px;
}
