:root {
  color-scheme: light;
  --paper: #fff8f0;
  --paper-deep: #f0e4d4;
  --ink: #2c2c2c;
  --muted: #786c67;
  --wine: #bc221d;
  --wine-dark: #851b1c;
  --gold: #ffcf0f;
  --gold-soft: #edc26f;
  --line: #e5d8c8;
  --green: #78d1a0;
  font-family: Montserrat, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { display: grid; grid-template-rows: 82px minmax(0, 1fr); min-height: 100vh; }
.topbar {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 28px;
  padding: 10px 30px; background: var(--paper); border-bottom: 3px solid var(--wine);
  box-shadow: 0 4px 18px rgba(53, 25, 17, .08);
}
.brand { display: flex; align-items: center; flex: 0 0 180px; height: 58px; }
.brand img { display: block; width: 168px; max-height: 56px; object-fit: contain; object-position: left center; }
.topbar-title { display: grid; gap: 2px; min-width: 0; }
.topbar-eyebrow { color: var(--wine); font-size: 9px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.topbar-name { color: #3b3432; font: 600 17px/1.2 Cinzel, Georgia, serif; }
.game-link {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; margin-left: auto;
  padding: 0 17px; border: 1px solid var(--wine); border-radius: 999px; background: var(--wine);
  box-shadow: 0 3px 0 #8b1b18, 0 6px 14px rgba(124, 26, 22, .15);
  color: white; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.game-link:hover { transform: translateY(-1px); background: #a51d19; box-shadow: 0 4px 0 #7d1917, 0 8px 18px rgba(124,26,22,.19); }
.external-arrow { color: var(--gold); font-size: 14px; }
.app-body { display: grid; grid-template-columns: 304px minmax(0, 1fr); min-height: 0; }
.sidebar {
  position: relative; z-index: 2; display: flex; flex-direction: column; gap: 24px;
  min-width: 0; padding: 25px 19px 19px; background: var(--paper);
  border-right: 1px solid #e8ddd0;
}
.places { display: grid; gap: 14px; }
.sidebar-heading { display: flex; align-items: center; gap: 11px; padding: 0 9px; }
.sidebar-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #e4c483; border-radius: 50%; color: var(--wine); font-size: 17px; }
.section-label { margin: 0; color: var(--wine); font-size: 9px; font-weight: 700; letter-spacing: .17em; line-height: 1.4; text-transform: uppercase; }
.sidebar-heading h2 { margin: 3px 0 0; color: #3a302b; font: 600 17px/1.15 Cinzel, Georgia, serif; }
.scene-list { display: grid; gap: 6px; }
.scene {
  position: relative; width: 100%; border: 1px solid transparent; border-radius: 10px;
  background: transparent; padding: 11px 13px; text-align: left; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.scene:hover { background: #f4ece2; }
.scene:focus-visible, .small-button:focus-visible, .start-button:focus-visible, .game-link:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.scene.active { border-color: #e3c8a6; background: linear-gradient(100deg,#f7ead8,#fcf4e9); }
.scene.active::before { position: absolute; inset: 10px auto 10px -1px; width: 3px; border-radius: 4px; background: var(--wine); content: ""; }
.scene-name { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; color: #372f2c; font-size: 12px; font-weight: 700; }
.scene-subtitle { display: block; margin-top: 3px; color: #857a72; font-size: 10px; line-height: 1.4; }
.live-tag { padding: 2px 6px; border-radius: 20px; background: #f9e4de; color: var(--wine); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.follow-card { margin-top: auto; padding: 15px 14px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; box-shadow: 0 5px 18px rgba(79,50,35,.045); }
.section-heading { display: flex; align-items: center; gap: 8px; }
.mini-icon { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #f7ede2; color: var(--wine); font-size: 15px; }
.follow-copy { margin: 10px 0 12px; color: #776e68; font-size: 10px; line-height: 1.55; }
.name-form { display: flex; gap: 7px; }
.name-form input { flex: 1; min-width: 0; height: 35px; border: 1px solid #dfd1c0; border-radius: 7px; background: #fff; padding: 0 9px; color: #322b27; font-size: 11px; }
.name-form input::placeholder { color: #9a8f86; }
.name-form input:focus { border-color: var(--wine); outline: 2px solid rgba(188,34,29,.1); }
.small-button { min-width: 40px; border: 0; border-radius: 7px; background: var(--wine); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.toggle-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; color: #453b36; font-size: 10px; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 31px; height: 18px; padding: 3px; border-radius: 99px; background: #d8cec3; transition: background .18s; }
.toggle-track span { display: block; width: 12px; height: 12px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .18s, background .18s; }
.toggle-row input:checked + .toggle-track { background: var(--wine); }
.toggle-row input:checked + .toggle-track span { transform: translateX(13px); background: var(--gold); }
.toggle-row input:focus-visible + .toggle-track { outline: 2px solid var(--wine); outline-offset: 2px; }
.follow-status { min-height: 0; margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.follow-status:empty { display: none; }
.follow-status.ok { color: #348557; }
.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; color: #877d74; font-size: 9px; }
.sidebar-live { display: flex; align-items: center; gap: 7px; }
.live-indicator { width: 7px; height: 7px; border-radius: 50%; background: #65ae7e; box-shadow: 0 0 7px #65ae7e70; }
.season-tag { color: var(--wine); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.main-content { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; padding: 48px 28px 55px; isolation: isolate; background: #2c1718; }
.scene-image, .main-shade { position: absolute; z-index: -2; inset: 0; }
.scene-image { background: url("assets/puy-du-mystere-castle.webp") center 43% / cover no-repeat; transform: scale(1.015); }
.main-shade { z-index: -1; background:
  linear-gradient(90deg, rgba(37,13,15,.40), rgba(57,15,20,.56) 50%, rgba(31,12,17,.69)),
  linear-gradient(180deg, rgba(31,12,17,.22), rgba(24,9,13,.54)); }
.player-wrap { width: min(100%, 480px); }
.player-card {
  position: relative; padding: 30px 34px 23px; overflow: hidden;
  border: 1px solid rgba(255,207,15,.46); border-radius: 17px;
  background: linear-gradient(155deg, rgba(22,16,18,.86), rgba(18,12,15,.92));
  box-shadow: 0 25px 70px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.06);
  color: #fff8f0; text-align: center; backdrop-filter: blur(15px);
}
.player-card::before { position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg,transparent,var(--gold),transparent); content: ""; }
.card-topline { display: flex; justify-content: center; align-items: center; gap: 11px; color: #d5c9be; font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.ornament { color: var(--gold); font-size: 10px; }
.scene-kicker { margin: 28px 0 7px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
h1 { margin: 0; color: #fff9f0; font: 600 clamp(25px, 4vw, 34px)/1.22 Cinzel, Georgia, serif; text-wrap: balance; }
.status-line { min-height: 39px; margin: 12px auto 20px; max-width: 350px; color: #d5c7c1; font: 400 12px/1.65 Lora, Georgia, serif; }
.state-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 7px 13px; border: 1px solid #ffffff20; border-radius: 99px; background: #fff1; color: #e7d9cd; font-size: 9px; font-weight: 700; }
.state-badge.show { border-color: #efb5ab70; background: #bc221d30; color: #ffd3c9; }
.state-badge.wait { background: #ffffff0d; color: #d1c4bd; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.5s ease infinite; }
.state-badge.wait .state-dot { animation: none; }
@keyframes pulse { 50% { opacity: .32; } }
.start-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 47px; padding: 0 24px;
  border: 2px solid var(--gold); border-radius: 99px; background: var(--wine);
  box-shadow: 0 3px 0 #711918, 0 9px 25px rgba(188,34,29,.28);
  color: #fff8f0; font: 600 12px Cinzel, Georgia, serif; cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.start-button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 4px 0 #711918, 0 12px 28px rgba(188,34,29,.34); }
.play-symbol { color: var(--gold); font-size: 10px; }
.player-controls { text-align: left; }
.now-playing { display: flex; align-items: center; gap: 12px; min-height: 37px; margin: 4px 0 12px; }
.now-playing p { margin: 0; color: #fff6eb; font-size: 11px; font-weight: 600; }
.sound-bars { display: inline-flex; align-items: center; gap: 2px; height: 15px; color: var(--gold); }
.sound-bars i { width: 2px; height: 5px; border-radius: 2px; background: currentColor; animation: equalize .7s ease-in-out infinite alternate; }
.sound-bars i:nth-child(2) { animation-delay: .18s; height: 11px; }.sound-bars i:nth-child(3) { animation-delay: .35s; height: 8px; }.sound-bars i:nth-child(4) { animation-delay: .1s; height: 4px; }
@keyframes equalize { to { transform: scaleY(.35); } }
.progress-track { height: 4px; overflow: hidden; border-radius: 9px; background: #ffffff27; }
#progress { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--wine),var(--gold)); transition: width .25s linear; }
.time-row { display: flex; justify-content: space-between; margin-top: 6px; color: #c5b7ae; font-size: 9px; font-variant-numeric: tabular-nums; }
.volume-row { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: #d8ccc4; font-size: 10px; }
.volume-icon { color: var(--gold); font-size: 16px; }
.volume-row input { flex: 1; height: 4px; accent-color: var(--gold); cursor: pointer; }
.card-divider { height: 1px; margin: 21px 0 14px; background: linear-gradient(90deg,transparent,#ffffff2d,transparent); }
.connection-status { margin: 0; color: #d4c9c1; font-size: 9px; }
.connection-status.ok { color: #c3efd2; }.connection-status.ko { color: #e1c4bb; }
.connection-status.ok::before { content: "● "; color: #75d29d; }.connection-status.ko::before { content: "● "; color: #ed8578; }
.demo-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 17px; padding-top: 14px; border-top: 1px dashed #ffffff35; }
.demo-controls .small-button { padding: 8px 10px; }
.player-caption { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; color: #fff2e3; font: 600 9px Cinzel, Georgia, serif; letter-spacing: .13em; text-transform: uppercase; text-shadow: 0 1px 5px #0008; }
.caption-rule { width: 28px; height: 1px; background: var(--gold); }
.disclaimer { margin: 14px 0 0; color: #f4e8da; font-size: 8px; text-align: center; text-shadow: 0 1px 5px #0008; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 780px) {
  .app-shell { grid-template-rows: 70px minmax(0,1fr); }
  .topbar { gap: 12px; padding: 8px 14px; }
  .brand { flex-basis: 125px; height: 48px; }.brand img { width: 124px; max-height: 46px; }
  .topbar-eyebrow { font-size: 7px; letter-spacing: .1em; }.topbar-name { font-size: 12px; }
  .game-link { min-height: 35px; gap: 6px; padding: 0 11px; font-size: 8px; }
  .app-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(490px,1fr); }
  .sidebar { gap: 13px; padding: 14px 14px 13px; border-right: 0; border-bottom: 1px solid #e8ddd0; }
  .sidebar-heading { display: none; }
  .places { gap: 8px; }
  .scene-list { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 4px; scrollbar-width: thin; }
  .scene { flex: 0 0 165px; min-height: 55px; border-color: #e8ddd0; background: rgba(255,255,255,.58); }
  .scene.active { border-color: #dbb78d; }
  .follow-card { margin-top: 0; padding: 11px 12px; }
  .follow-copy { margin: 7px 0 9px; }
  .sidebar-bottom { display: none; }
  .main-content { min-height: 490px; padding: 30px 14px 34px; }
  .scene-image { background-position: 54% center; }
  .main-shade { background: linear-gradient(90deg,rgba(37,13,15,.49),rgba(45,13,18,.7)),linear-gradient(180deg,rgba(31,12,17,.25),rgba(24,9,13,.58)); }
  .player-card { padding: 26px 21px 21px; }
  .scene-kicker { margin-top: 23px; }
}
@media (max-width: 390px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .brand { flex-basis: 102px; }.brand img { width: 104px; }
  .topbar-name { font-size: 10px; }.game-link { padding-inline: 8px; font-size: 7px; }
  .scene { flex-basis: 150px; }.player-card { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
