/* Hématome - univers iPod (2001). Coque blanche, LCD rétroéclairé, molette. */

:root {
  --ip-body: #f4f4f2;
  --ip-body-edge: #c9c9c5;
  --ip-chrome: #b8bcc0;
  --ip-lcd: #cfe3e8;
  --ip-lcd-deep: #b7d2d9;
  --ip-ink: #10222a;
  --ip-ink-dim: #3f5a63;
  --ip-wheel: #e9e9e6;
  --ip-wheel-edge: #cfcfca;
  color-scheme: light;
}

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

body {
  min-height: 100dvh;
  background: linear-gradient(180deg, #e8e9eb 0%, #c4c7cc 55%, #9ea3aa 100%);
  font-family: "Pixelify Sans", "Chicago", "Geneva", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 30px 16px 110px;
}

.ip-caption {
  font-size: 20px;
  color: #3a3d42;
  text-align: center;
  letter-spacing: 0.02em;
}

.ip-caption span { font-size: 0.55em; vertical-align: super; }
.ip-caption b { font-weight: 600; }

/* -- Coque ------------------------------ */
.ip-device {
  width: min(400px, 100%);
  background: linear-gradient(160deg, #ffffff 0%, var(--ip-body) 55%, #e3e3df 100%);
  border: 2px solid var(--ip-body-edge);
  border-radius: 26px;
  padding: 26px 24px 34px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(0, 0, 0, 0.08),
    0 18px 40px rgba(20, 25, 35, 0.45);
}

/* -- Écran ------------------------------ */
.ip-screen {
  background: linear-gradient(180deg, var(--ip-lcd) 0%, var(--ip-lcd-deep) 100%);
  border: 3px solid #23282e;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(15, 30, 40, 0.35);
  color: var(--ip-ink);
  height: 330px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ip-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 2px solid var(--ip-ink);
  font-size: 15px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.ip-battery {
  width: 26px;
  height: 12px;
  border: 2px solid var(--ip-ink);
  border-radius: 2px;
  position: relative;
}

.ip-battery::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 2px;
  width: 3px;
  height: 4px;
  background: var(--ip-ink);
}

.ip-battery i {
  position: absolute;
  inset: 1px;
  right: 7px;
  background: var(--ip-ink);
}

/* Vues */
.ip-view {
  display: none;
  flex-grow: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ip-ink) transparent;
}

.ip-view.is-active { display: block; }

.ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 18px;
  color: var(--ip-ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ip-row.is-selected,
.ip-row:hover,
.ip-row:focus-visible {
  background: var(--ip-ink);
  color: var(--ip-lcd);
}

.ip-row:focus-visible { outline: 2px solid var(--ip-ink); outline-offset: -2px; }

/* Vues texte */
.ip-view h1, .ip-view h2 { font-size: 19px; font-weight: 600; }
.ip-h {
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--ip-ink-dim);
  margin-bottom: 8px;
}

.ip-view p { padding: 4px 12px; font-size: 16px; line-height: 1.5; }
.ip-view p strong { font-weight: 600; }

.ip-link { color: var(--ip-ink); font-weight: 600; }
.ip-link:hover, .ip-link:focus-visible { background: var(--ip-ink); color: var(--ip-lcd); text-decoration: none; }

.ip-stats { display: flex; gap: 8px; padding: 10px 12px; }

.ip-stats div {
  flex: 1;
  border: 2px solid var(--ip-ink);
  border-radius: 4px;
  padding: 6px;
  text-align: center;
}

.ip-stats dt { font-size: 11px; color: var(--ip-ink-dim); margin-bottom: 4px; }
.ip-stats dd { font-size: 18px; font-weight: 600; }

/* Lecture en cours */
#view-lecture { padding: 18px 16px; text-align: center; }
.ip-np-count { font-size: 13px; color: var(--ip-ink-dim); }
.ip-np-title { font-size: 21px; font-weight: 600; margin-top: 14px; }
.ip-np-artist { font-size: 17px; margin-top: 4px; }
.ip-np-album { font-size: 14px; color: var(--ip-ink-dim); margin-top: 4px; }

.ip-progress {
  margin: 22px 4px 6px;
  height: 12px;
  border: 2px solid var(--ip-ink);
  border-radius: 3px;
  overflow: hidden;
}

.ip-progress i {
  display: block;
  height: 100%;
  width: 13%;
  background: repeating-linear-gradient(90deg, var(--ip-ink) 0 4px, transparent 4px 6px);
  animation: ip-play 120s linear forwards;
}

@keyframes ip-play { to { width: 100%; } }

.ip-np-time {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ip-ink-dim);
  padding: 0 4px;
}

/* -- Molette ---------------------------- */
.ip-wheel {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 30px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--ip-wheel) 55%, var(--ip-wheel-edge) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

.ip-wheel-btn {
  position: absolute;
  background: none;
  border: none;
  color: #8d9096;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 10px 14px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: color 150ms ease-out, transform 100ms ease-out;
}

.ip-wheel-btn:hover { color: #4d5157; }
.ip-wheel-btn:active { transform: scale(0.92); }
.ip-wheel-btn:focus-visible { outline: 3px solid #4d78c8; outline-offset: 0; }

.ip-menu { top: 6px; left: 50%; transform: translateX(-50%); }
.ip-menu:active { transform: translateX(-50%) scale(0.92); }
.ip-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.ip-prev:active { transform: translateY(-50%) scale(0.92); }
.ip-next { right: 8px; top: 50%; transform: translateY(-50%); }
.ip-next:active { transform: translateY(-50%) scale(0.92); }
.ip-play { bottom: 6px; left: 50%; transform: translateX(-50%); }
.ip-play:active { transform: translateX(-50%) scale(0.92); }

.ip-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 38% 32%, #ffffff 0%, #dcdcd8 60%, #c6c6c1 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.14),
    0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.ip-center:active { box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2); }
.ip-center:focus-visible { outline: 3px solid #4d78c8; outline-offset: 2px; }

@media (max-width: 440px) {
  .ip-device { padding: 18px 16px 26px; }
  .ip-screen { height: 300px; }
  .ip-wheel { width: 190px; height: 190px; margin-top: 22px; }
  .ip-center { width: 72px; height: 72px; }
  .ip-caption { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .ip-progress i { animation: none; }
  .ip-wheel-btn { transition: none; }
}
