/* watch.valdeze.ch — the host and guest pages, after the design canvas (Main, GuestLive, GuestIntermission). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #0D0E11;
  --header: #101216;
  --panel: #15171C;
  --line: #23262E;
  --line-2: #2A2E37;
  --field: #0F1115;
  --btn: #1C1F26;
  --btn-line: #2F333D;
  --btn-2: #2A2E37;
  --btn-2-line: #3A3F4A;
  --text: #ECEAE4;
  --muted: #A3A7B0;
  --soft: #C3C6CE;
  --dim: #4A505C;
  --stage: #050608;
  --accent: #F5B544;
  --accent-ink: #1B1407;
  --gold-bg: #2A2213;
  --gold: #F5D08A;
  --gold-line: #4A3A18;
  --blue: #8AB4F8;
  --blue-soft: #B5CEFB;
  --blue-bg: #18223A;
  --blue-line: #2B3A57;
  --glass: rgba(13, 14, 17, 0.86);
  --display: "Space Grotesk", system-ui, sans-serif;
  --gutter: 32px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 20px;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.5; }
input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Header */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter); padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--header);
}
.top-left, .top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand span { color: var(--text); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.sep { width: 1px; height: 28px; background: var(--line-2); }
.roomname { display: flex; flex-direction: column; min-width: 0; }
.roomname .lbl { font-size: 12px; line-height: 16px; color: var(--muted); }
.roomname .val { font-weight: 600; overflow-wrap: anywhere; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; line-height: 16px; font-weight: 600;
}
.pill .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.pill-gold { background: var(--gold-bg); color: var(--gold); gap: 6px; }
.pill-gold .dot, .pill-live .dot { background: var(--accent); }
.pill-live { background: var(--gold-bg); color: var(--gold); }
.pill-blue { background: var(--blue-bg); color: var(--blue-soft); }
.pill-grey { background: #1C1F26; color: var(--muted); }
.pill-grey .dot { background: var(--dim); }
.pill .pause { display: none; flex: 0 0 auto; }
.pill-pause .pause { display: block; }
.pill-pause .dot { display: none; }

.avatars { display: flex; align-items: center; }
.avatars .av { border: 2px solid var(--header); }
.avatars .av + .av { margin-left: -8px; }
.av {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.c0 { background: #5A4520; color: #F5D08A; } .n0 { color: #F5D08A; }
.c1 { background: #33426A; color: #DCE6FB; } .n1 { color: #B5CEFB; }
.c2 { background: #2C4A45; color: #C9EDE4; } .n2 { color: #A8E0D2; }
.c3 { background: #4A3553; color: #EBD3F3; } .n3 { color: #E3C7F0; }
.c4 { background: #4F3427; color: #F6D9CB; } .n4 { color: #F2B79C; }
.c5 { background: #384A2B; color: #DCEBC9; } .n5 { color: #C4E2A3; }
.av-more { background: var(--btn-2); color: var(--muted); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--btn-2-line); background: transparent; font-weight: 500;
}
.btn-outline:hover { background: var(--btn); }

/* Layout */
.layout {
  flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px;
  padding: 24px var(--gutter) 32px; padding-bottom: max(32px, env(safe-area-inset-bottom));
  width: 100%; max-width: 1640px; margin: 0 auto;
}
.stagecol { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }

/* The TV */
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--stage); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage:fullscreen { border-radius: 0; border: none; aspect-ratio: auto; }
.stage-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 24px;
}
.stage-title { font-family: var(--display); font-size: 24px; line-height: 32px; font-weight: 600; }
.stage-sub { color: var(--muted); }

.badge-tl, .badge-bl {
  position: absolute; display: flex; align-items: center; gap: 8px; background: var(--glass);
  font-size: 13px; line-height: 18px; z-index: 2; max-width: calc(100% - 88px);
}
.badge-tl { left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.badge-live { border: 1px solid var(--gold-line); color: var(--gold); }
.badge-live .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); flex: 0 0 auto; }
.badge-private { border: 1px solid var(--blue-line); color: var(--blue-soft); }
.badge-private svg { flex: 0 0 auto; }
.badge-bl { left: 16px; bottom: 16px; color: var(--muted); }
.badge-small { padding: 4px 10px; border-radius: 8px; font-size: 12px; line-height: 16px; }
.badge-round { padding: 6px 12px; border-radius: 999px; }

.icon-btn {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--btn-line);
  background: var(--btn); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #232730; }
.icon-btn-dark { border-color: var(--btn-2-line); background: var(--btn-2); }
.fs-btn { position: absolute; right: 12px; bottom: 12px; background: var(--glass); z-index: 3; }
.unmute {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px;
  border: none; background: var(--accent); color: var(--accent-ink); font-weight: 600;
}

.floats {
  position: absolute; right: 28px; bottom: 84px; display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px; z-index: 2; pointer-events: none;
}
.float {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px;
  background: var(--glass); font-size: 12px; line-height: 16px;
  animation: float-in 220ms ease-out, float-out 600ms ease-in 3.4s forwards;
}
.float .av { width: 24px; height: 24px; }
@keyframes float-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes float-out { to { opacity: 0; transform: translateY(-6px); } }

/* Intermission and other cards over the stage */
.intermission {
  position: absolute; inset: 0; background: #0A0C11; display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.stripes {
  position: absolute; left: 0; right: 0; height: 28px; opacity: 0.9;
  background: repeating-linear-gradient(90deg, #15181F 0 18px, transparent 18px 36px);
}
.stripes-top { top: 0; } .stripes-bottom { bottom: 0; }
.intermission-body {
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 48px 24px;
  max-width: 560px;
}
.pause-ring {
  width: 72px; height: 72px; border-radius: 999px; border: 2px solid #3B4F78; color: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
}
.intermission h1 {
  margin: 0; font-family: var(--display); font-size: 48px; line-height: 52px; font-weight: 700;
  letter-spacing: -0.02em;
}
.intermission p { margin: 0; color: var(--soft); font-size: 17px; line-height: 26px; text-wrap: pretty; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--blue-soft); font-weight: 500; }
.dots { display: flex; gap: 6px; }
.wp-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--blue); animation: wp-wait 1.4s ease-in-out infinite; }
.wp-dot-2 { animation-delay: 0.2s; } .wp-dot-3 { animation-delay: 0.4s; }
@keyframes wp-wait { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Viewing mode */
.vm-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px;
}
.vm-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 420px; }
.switch {
  position: relative; flex: 0 0 auto; width: 76px; height: 44px; border-radius: 999px; padding: 0;
  border: 1px solid #4A505C; background: var(--btn-2);
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 36px; height: 36px; border-radius: 999px; background: var(--muted);
  transition: left 160ms ease;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .knob { left: 35px; background: var(--accent-ink); }
.vm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vm-title { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 24px; }
.vm-help { color: var(--muted); }
.vm-guests { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* Remote */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.card-head { display: flex; flex-direction: column; gap: 2px; }
.card-title { font-family: var(--display); font-weight: 600; font-size: 15px; }
.card-sub { color: var(--muted); font-size: 13px; line-height: 18px; }
.dpad {
  align-self: center; width: 192px; height: 192px; border-radius: 999px; background: var(--btn);
  border: 1px solid var(--line-2); display: grid; grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px); gap: 4px; align-content: center; justify-content: center;
}
.dpad-btn {
  width: 56px; height: 56px; border-radius: 12px; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none;
}
.dpad-btn:hover { background: #232730; }
.dpad-btn:active, .dpad-btn.is-down { background: var(--btn-2); }
.dpad .up { grid-column: 2; grid-row: 1; } .dpad .left { grid-column: 1; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; } .dpad .down { grid-column: 2; grid-row: 3; }
.dpad-ok {
  grid-column: 2; grid-row: 2; width: 56px; height: 56px; border-radius: 999px; border: 1px solid var(--btn-2-line);
  background: var(--btn-2); font-weight: 600; font-size: 14px;
}
.dpad-ok:active, .dpad-ok.is-down { background: #353a45; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 8px;
  border-radius: 10px; border: 1px solid var(--btn-line); background: var(--btn); font-weight: 500;
  user-select: none; -webkit-user-select: none;
}
.btn:hover { background: #232730; }
.btn:active, .btn.is-down { background: var(--btn-2); }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--gold); }
.transport { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 0 0; }
.round-btn {
  width: 52px; height: 52px; border-radius: 999px; border: 1px solid var(--btn-line); background: var(--btn);
  display: flex; align-items: center; justify-content: center;
}
.round-btn:active, .round-btn.is-down { background: var(--btn-2); }
.play-btn {
  width: 72px; height: 72px; border-radius: 999px; border: none; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.play-btn:active, .play-btn.is-down { filter: brightness(0.9); }
.vol-readout { color: var(--muted); font-size: 13px; line-height: 18px; text-align: center; margin-top: -4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field-lbl { font-size: 13px; line-height: 18px; color: var(--muted); }
input[type="text"] {
  height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--btn-line); background: var(--field);
  color: var(--text); outline: none; min-width: 0; font-size: 16px;
}
input[type="text"]:focus { border-color: #4A5160; }
.btn-dark {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--btn-2-line); background: var(--btn-2); font-weight: 600;
}
.btn-dark:hover { background: #323743; }
.btn-accent {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 14px;
  border-radius: 10px; border: none; background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.btn-accent:hover { filter: brightness(1.05); }
.btn-wide { width: 100%; }
.hr { height: 1px; background: var(--line); }

/* Guest's own sound */
.nowbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px;
}
.now { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.now-lbl { font-size: 12px; line-height: 16px; color: var(--muted); }
.now-title { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.myvol { display: flex; align-items: center; gap: 12px; }
.myvol-slider { display: flex; flex-direction: column; gap: 2px; }
.myvol-slider label { font-size: 12px; line-height: 16px; color: var(--muted); }
.myvol-slider input { width: 160px; accent-color: var(--accent); }
#mute-btn .ico-off { display: none; }
#mute-btn[aria-pressed="true"] .ico-on { display: none; }
#mute-btn[aria-pressed="true"] .ico-off { display: block; }
#mute-btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold-line); }

/* Invite */
.invite-item { display: flex; flex-direction: column; gap: 6px; }
.invite-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; line-height: 18px; }
.link-row { display: flex; gap: 8px; }
.link-box {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--field);
  border: 1px solid var(--btn-line); display: flex; align-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; user-select: all; -webkit-user-select: all;
}
.link-row button { flex: 0 0 auto; }

/* People */
.people { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.people-head { display: flex; align-items: center; justify-content: space-between; }
.count { color: var(--muted); font-size: 13px; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.people-list li { display: flex; align-items: center; gap: 10px; }
.people-list .pname { flex: 1 1 auto; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.people-list .pstate { color: var(--muted); font-size: 13px; }
.people-list .ptag {
  padding: 2px 8px; border-radius: 999px; background: var(--gold-bg); color: var(--gold); font-size: 12px;
  line-height: 16px; font-weight: 600; white-space: nowrap;
}

/* Chat */
.chat { flex: 1 1 auto; min-height: 340px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600;
  font-size: 15px;
}
.chat-log {
  flex: 1 1 0; min-height: 160px; max-height: 520px; overflow-y: auto; list-style: none; margin: 0;
  padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain;
}
.chat-log li:first-child { margin-top: auto; }
.chat-log .msg { display: flex; flex-direction: column; gap: 2px; }
.chat-log .who { font-size: 13px; line-height: 18px; font-weight: 600; }
.chat-log .what { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-log .sys { color: var(--muted); font-size: 13px; line-height: 18px; text-align: center; }
.react-row { display: flex; gap: 8px; padding: 0 20px 12px; }
.react-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--btn-line); background: var(--btn);
  display: flex; align-items: center; justify-content: center;
}
.react-btn:hover { background: #232730; }
.react-btn:active { transform: scale(0.94); }
.chat-form { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); margin: 0; }
.chat-form input { flex: 1 1 auto; }

/* Dialogs and notices */
.modal {
  position: fixed; inset: 0; z-index: 20; background: rgba(5, 6, 8, 0.72); display: flex; align-items: center;
  justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px; margin: 0;
}
.modal-card h2 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 28px; }
.modal-card p { margin: 0 0 4px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.modal-actions .btn { padding: 0 14px; }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 30; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: #262A33;
  border: 1px solid var(--btn-2-line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Landing and missing */
.lost {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; text-align: center; padding: 24px 16px;
}
.lost h1 { margin: 12px 0 0; font-family: var(--display); font-size: 32px; line-height: 40px; }
.lost p { margin: 0; color: var(--muted); font-size: 16px; }
.brand-big span { font-size: 24px; }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .top { gap: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .top-left, .top-right { gap: 10px 12px; }
  .layout { gap: 16px; padding-top: 16px; }
  .sep { display: none; }
  .brand span { font-size: 16px; }
  .badge-tl { left: 10px; top: 10px; padding: 4px 10px; font-size: 12px; line-height: 16px; max-width: calc(100% - 20px); }
  .badge-bl { left: 10px; bottom: 10px; }
  .badge-round { padding: 4px 10px; font-size: 12px; line-height: 16px; }
  .fs-btn { right: 8px; bottom: 8px; width: 40px; height: 40px; }
  /* On a small stage the corners are taken by badges: sound goes in the middle */
  .unmute { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
  .floats { right: 12px; bottom: 60px; }
  .intermission-body { gap: 10px; padding: 32px 16px; }
  .intermission h1 { font-size: 30px; line-height: 34px; }
  .intermission p { font-size: 14px; line-height: 20px; }
  .pause-ring { width: 48px; height: 48px; }
  .pause-ring svg { width: 20px; height: 20px; }
  .stage-title { font-size: 18px; line-height: 24px; }
  .chat { min-height: 300px; }
  .chat-log { max-height: 50vh; }
  .vm-left { flex-basis: 100%; }
  .myvol-slider input { width: 120px; }
}
@media (max-width: 420px) {
  .intermission .waiting, .intermission p { display: none; }
  .badge-private { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .wp-dot { animation: none; opacity: 0.7; }
  .float { animation: none; }
  .switch .knob { transition: none; }
}
