@font-face { font-family: Atkinson; src: url(atkinson-400.woff2) format("woff2"); font-weight: 400; font-display: swap }
@font-face { font-family: Atkinson; src: url(atkinson-700.woff2) format("woff2"); font-weight: 700; font-display: swap }

:root { --bg: #14181C; --text: #F4F6F8; --soft: #C3CBD3; --key: #2A323A; --line: #65727E; --accent: #FFC247; --demo: 40px }
* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; background: var(--bg) }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Atkinson, Verdana, sans-serif; -webkit-tap-highlight-color: transparent }
button, .main { font: inherit; font-weight: 700; color: var(--text); background: var(--key); border: 0; border-radius: 18px; padding: 0; touch-action: manipulation; cursor: pointer }
.main { background: var(--accent); color: var(--bg) }
button:active, .main:active { filter: brightness(.85) }
:focus-visible { outline: 4px solid #7BD3FF; outline-offset: 3px }
h1, h2, p { margin: 0 }
i { font-style: normal; color: var(--soft) }

/* Le bandeau Démo reste au-dessus de tout, voile compris. */
#demo { position: fixed; z-index: 3; inset: 0 0 auto; height: calc(var(--demo) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); border-radius: 0; background: #7BD3FF; color: var(--bg); font-size: 17px }

#app { max-width: 480px; min-height: 100dvh; margin: 0 auto; padding: calc(var(--demo) + 16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px }
section { display: flex; flex-direction: column; gap: 12px }
#title { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere }
#artist { font-size: 22px; line-height: 1.2; color: var(--soft); margin-top: -10px }
h2 { font-size: 24px; line-height: 1.2 }

.bar { height: 10px; border-radius: 5px; background: #3A444D; overflow: hidden }
#fill { height: 100%; width: 0; background: var(--text) }
.times { display: flex; justify-content: space-between; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums }
.keys { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 12px }
.keys button { min-height: 72px; display: grid; place-items: center }
.keys svg { width: 40px; height: 40px; fill: currentColor }
#play:not(.playing) .pause, #play.playing .listen { display: none }
.volume { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; text-align: center }
.volume button { min-height: 64px; font-size: 38px; line-height: 1 }
.volume i { display: block; font-size: 20px; line-height: 1.1 }
.volume b { font-size: 34px; line-height: 1.1 }

#silence p { font-size: 22px; line-height: 1.35 }
#openMusic { display: grid; place-items: center; min-height: 88px; font-size: 26px; text-decoration: none }

#rooms { display: flex; flex-direction: column; gap: 10px }
.room { width: 100%; min-height: 80px; padding: 8px 18px; border: 3px solid var(--line); background: var(--bg); display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left }
.room .name { display: block; font-size: 27px; line-height: 1.1 }
.room .link { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 17px; font-weight: 400; line-height: 1.1 }
.room .link::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor }
.room .status { font-size: 22px }
.room.ok .link::before { background: #4CD964; border-color: #4CD964 }
.room.on { background: var(--accent); border-color: var(--accent); color: var(--bg) }
.room.on .link::before { background: #0B6B2E; border-color: #0B6B2E }
.room:not(.ok) { color: var(--soft) }

#nowifi { position: fixed; z-index: 2; inset: 0; padding: 24px; background: rgba(84, 90, 96, .94); display: grid; place-items: center }
#connect { width: 100%; max-width: 440px; min-height: 150px; padding: 20px; border-radius: 24px; font-size: 32px; line-height: 1.2 }

dialog { width: calc(100% - 32px); max-width: 440px; border: 0; border-radius: 24px; padding: 24px; background: #F4F6F8; color: var(--bg) }
dialog[open] { display: flex; flex-direction: column; gap: 14px }
dialog::backdrop { background: rgba(0, 0, 0, .6) }
dialog p, dialog label { font-size: 20px }
dialog label { display: flex; align-items: center; justify-content: space-between; min-height: 48px }
dialog input { width: 28px; height: 28px }
#close { min-height: 64px; font-size: 24px }
