/* Mulwith Home: the house app. Same family as Games HQ (dark, warm accent), built for one hand on a phone. */
:root {
  --bg: #0b0d12;
  --card: #161a23;
  --card-2: #1d2230;
  --line: rgba(255,255,255,.07);
  --text: #f3f4f7;
  --muted: #9aa1b2;
  --faint: #6b7286;
  --accent: #ff5a3d;
  --accent-2: #ffb23d;
  --good: #3ddc97;
  --warn: #ffb23d;
  --bad: #ff5a5f;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --gutter: 16px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* A remote, not a page: quick repeated taps must stay taps (no double-tap zoom), and no selecting or long-press menus. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, .pad, .keys, .acts, .rv { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 var(--body); }
body { min-height: 100dvh; overscroll-behavior-y: contain; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }

#app { max-width: 560px; margin: 0 auto; padding: calc(var(--top) + 18px) var(--gutter) calc(var(--bottom) + 104px); }

/* ---------- headings ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.hello h1 { font: 800 30px/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
.hello p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.me { width: 38px; height: 38px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center;
  font: 700 15px var(--display); color: var(--muted); flex: none; }
h2 { font: 700 13px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 26px 4px 10px; }
h2:first-child { margin-top: 6px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.card + .card { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 52px; width: 100%; text-align: left; }
.list > * + * { border-top: 1px solid var(--line); }
.list .val { color: var(--muted); font-size: 15px; text-align: right; }
.chev { width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2.4; stroke-linecap: round; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 16px; font-weight: 650; font-size: 16px; background: var(--card-2); transition: transform .12s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d05; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.chips .btn { min-height: 46px; padding: 0 10px; font-size: 15px; }
.chips .btn.span { grid-column: 1 / -1; }
.link { color: var(--accent-2); font-weight: 600; }

/* ---------- requests ---------- */
.ask { background: linear-gradient(160deg, rgba(255,90,61,.16), rgba(255,178,61,.08) 60%, var(--card)); border-color: rgba(255,178,61,.28); }
.ask.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 3px var(--accent-2); } }
.ask h3 { font: 750 19px/1.25 var(--display); margin: 0 0 4px; }
.ask p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- avatars ---------- */
.avs { display: flex; flex: none; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 750 17px var(--display); color: #10131a;
  border: 2px solid var(--card); background: var(--c, #888); }
.av + .av { margin-left: -12px; }
.av.sm + .av.sm { margin-left: -7px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- now playing ---------- */
.now { display: flex; gap: 14px; align-items: center; }
.now img, .now .noart { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--card-2); flex: none; }
.now .t { font: 750 18px/1.2 var(--display); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--good); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.idle { color: var(--muted); display: flex; align-items: center; gap: 12px; }

/* ---------- children ---------- */
.kids { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kid { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; width: 100%; }
.kid:active { transform: scale(.98); }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.07) 0); }
.ring > div { width: 76px; height: 76px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.ring .av { width: 58px; height: 58px; font-size: 24px; border: 0; }
.kid b { font: 750 18px var(--display); }
.kid .left { font-size: 14px; font-weight: 650; color: var(--accent-2); }
.kid .left.rest { color: var(--faint); }
.kid small { color: var(--faint); font-size: 12.5px; }

/* ---------- switches & steppers ---------- */
.switch { width: 51px; height: 31px; border-radius: 16px; background: rgba(255,255,255,.16); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.step { display: flex; align-items: center; gap: 4px; flex: none; }
.step button { width: 36px; height: 36px; border-radius: 12px; background: var(--card-2); font-size: 20px; font-weight: 600; line-height: 1; }
.step b { min-width: 76px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.seg { display: flex; background: var(--card-2); border-radius: 12px; padding: 3px; margin: 0 0 12px; }
.seg button { flex: 1; min-height: 36px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ---------- week ---------- */
.chart { position: relative; margin-top: 14px; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 110px;
  border-bottom: 1px solid var(--line); }
.bars button { height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.bars i { display: block; width: 100%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--c); }
.bars i.zero { background: rgba(255,255,255,.08); }
.bars button[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--text); }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 6px; font-size: 10.5px; color: var(--faint); text-align: center; }
.days .today { color: var(--text); font-weight: 700; }
.tip { margin-top: 10px; font-size: 14px; color: var(--muted); min-height: 20px; }
.tip b { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.stats div b { display: block; font: 750 18px var(--display); white-space: nowrap; }
.stats div span { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.card > .stats:only-of-type { grid-template-columns: repeat(2, 1fr); }
.game { display: flex; align-items: center; gap: 12px; }
.game img, .game .noart { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; background: var(--card-2); flex: none; }

/* ---------- box ---------- */
.hero { display: flex; align-items: center; gap: 14px; }
.hero .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.hero .dot svg { width: 24px; height: 24px; fill: none; stroke: #10131a; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hero.ok .dot { background: var(--good); }
.hero.warn .dot { background: var(--warn); }
.hero h3 { font: 750 20px var(--display); margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.tile span { font-size: 13px; color: var(--faint); }
.tile b { display: block; font: 750 24px var(--display); margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 12.5px; }
.meter { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.meter i.warn { background: var(--warn); }
.meter i.bad { background: var(--bad); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.state i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.state.off i { background: var(--bad); }
.state.off { color: var(--bad); }
.ico { width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.ico svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pills span { background: var(--card-2); border-radius: 999px; padding: 5px 11px; font-size: 13px; color: var(--muted); }
.pills b { color: var(--text); font-weight: 650; }

/* ---------- sign in ---------- */
.gate { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; }
.gate .logo { width: 96px; height: 96px; margin: 0 auto 6px; border-radius: 24px; box-shadow: 0 18px 40px rgba(255,90,61,.25); }
.gate h1 { font: 800 34px var(--display); margin: 0; }
.gate p { margin: 0 auto; color: var(--muted); max-width: 320px; }
.field { display: block; text-align: left; margin-top: 4px; }
.field span { display: block; font-size: 13px; color: var(--faint); margin: 0 4px 6px; }
.field input { width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
  padding: 0 16px; font-size: 18px; }
.field input.code { letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; font-size: 24px; font-weight: 700; }
.howto { text-align: left; }
.howto ol { margin: 8px 0 0; padding-left: 22px; color: var(--muted); }
.howto li { margin: 6px 0; }
.howto svg { display: inline; width: 18px; height: 18px; vertical-align: -3px; stroke: var(--accent-2); fill: none; stroke-width: 2; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  padding: 8px 8px calc(var(--bottom) + 6px); background: rgba(14,16,22,.82); backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
.tabs button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
  font-size: 11px; font-weight: 600; color: var(--faint); position: relative; }
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent-2); }
.tabs .badge { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 11px; line-height: 18px; padding: 0 5px; }

/* ---------- sheet & toast ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow: auto;
  background: #141822; border-radius: 26px 26px 0 0; padding: 10px var(--gutter) calc(var(--bottom) + 20px);
  animation: up .28s cubic-bezier(.2,.9,.3,1); }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 0 auto 14px; }
.sheet h3 { font: 800 22px var(--display); margin: 0 0 4px; }
.sheet p { margin: 0 0 6px; color: var(--muted); }
.sheet .btn + .btn { margin-top: 8px; }
.qr { background: #fff; border-radius: 18px; padding: 14px; width: 200px; margin: 14px auto; }
.qr svg { width: 100%; height: auto; }
.bigcode { font: 800 34px var(--display); letter-spacing: .14em; text-align: center; font-variant-numeric: tabular-nums; margin: 6px 0; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 92px); transform: translate(-50%, 20px); opacity: 0; z-index: 30;
  background: #f3f4f7; color: #10131a; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; max-width: calc(100% - 32px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; color: var(--faint); padding: 18px 0 6px; font-size: 15px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent-2);
  animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- the house ---------- */
.banner { display: flex; align-items: center; gap: 10px; background: rgba(255,178,61,.12); border: 1px solid rgba(255,178,61,.3);
  color: var(--accent-2); border-radius: 16px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.room { padding: 0; overflow: hidden; }
.room + .room { margin-top: 12px; }
.room-top { position: relative; padding: 16px 16px 14px; display: flex; gap: 14px; align-items: center; min-height: 96px; }
.room-top .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(28px) saturate(1.4);
  opacity: .45; transform: scale(1.3); pointer-events: none; }
.room-top > :not(.bg) { position: relative; }
.room-top .pic { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--card-2); flex: none;
  display: grid; place-items: center; }
.room-top .pic svg { width: 28px; height: 28px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room-top .where { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.room-top .what { font: 750 19px/1.2 var(--display); margin-top: 2px; }
.room-top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.room-body { padding: 0 16px 16px; display: grid; gap: 10px; }
.sources { display: flex; gap: 8px; flex-wrap: wrap; }
.sources .btn { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 0 12px; font-size: 15px; }
.sources .btn[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d05; }
.sources .btn.off { flex: 0 0 auto; color: var(--muted); }
.vol { display: flex; align-items: center; gap: 12px; }
.vol button { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; flex: none; }
.vol button svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vol button[aria-pressed="true"] svg { stroke: var(--accent-2); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 40px; background: none; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-2) var(--p, 0%), rgba(255,255,255,.12) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--accent-2); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; }
.vol .n { width: 34px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }

/* ---------- the remote ---------- */
.pad { position: relative; width: min(72vw, 280px, 38vh); aspect-ratio: 1; margin: 18px auto 8px; border-radius: 50%;
  background: radial-gradient(circle, var(--card-2) 0 34%, #191e2a 35%); border: 1px solid var(--line); }
.pad button { position: absolute; display: grid; place-items: center; color: var(--muted); }
.pad button:active { color: var(--accent-2); }
.pad svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pad [data-key=up] { left: 33%; right: 33%; top: 0; height: 30%; }
.pad [data-key=down] { left: 33%; right: 33%; bottom: 0; height: 30%; }
.pad [data-key=left] { top: 33%; bottom: 33%; left: 0; width: 30%; }
.pad [data-key=right] { top: 33%; bottom: 33%; right: 0; width: 30%; }
.pad [data-key=select] { inset: 33%; border-radius: 50%; background: var(--card); box-shadow: 0 6px 18px rgba(0,0,0,.35);
  font: 750 16px var(--display); color: var(--text); }
.pad [data-key=select]:active { transform: scale(.96); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.keys .btn { min-height: 46px; padding: 0 8px; font-size: 15px; }
.keys .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.colours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.colours button { height: 14px; border-radius: 7px; }
.colours button:active { transform: scaleY(.8); }

/* ---------- settings ---------- */
.room-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.room-pick .btn[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d05; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint);
  background: var(--card-2); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px; }
.sheet .keys .btn + .btn, .sheet .sources .btn + .btn { margin-top: 0; }
/* The remote fills the screen so it never scrolls (house rule), even on an iPhone 7. */
.sheet.full { max-height: 100dvh; height: 100dvh; border-radius: 0; padding-top: calc(var(--top) + 8px); overflow: hidden;
  display: flex; flex-direction: column; }
.sheet.full::before { margin-bottom: 8px; }
.sheet.full .pad { width: min(72vw, 280px, 34vh); margin: 10px auto 4px; flex: none; }
.sheet.full .done { position: absolute; right: var(--gutter); top: calc(var(--top) + 18px); color: var(--accent-2); font-weight: 650; }

/* ---------- a room's own page: the living room's Harmony-style remote. Fills the screen, never scrolls. ---------- */
.rv { height: calc(100dvh - var(--top) - var(--bottom) - 30px); min-height: 520px; display: flex; flex-direction: column; gap: 12px; }
.rv-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.rv-title { text-align: center; min-width: 0; }
.rv-title b { display: block; font: 800 20px/1.2 var(--display); }
.rv-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.rv-icon, .rv-power, .rv-chip { height: 44px; min-width: 44px; border-radius: 14px; background: var(--card-2); display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; padding: 0 10px; font-size: 14px; font-weight: 650; }
.rv-icon svg, .rv-power svg, .rv-chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.rv-chip { color: var(--accent-2); }
.rv-power { color: var(--bad); }
.rv-power.armed { background: var(--bad); color: #fff; }
.rv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.rv-body .pad { width: min(68vw, 270px, 36vh); margin: 0 auto 4px; }
.rv-body .keys { margin-top: 12px; }
.rv-body.play { align-items: center; text-align: center; gap: 8px; }
.rv-play svg { width: 96px; height: 96px; margin: 0 auto 6px; fill: none; stroke: var(--accent-2); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; }
.rv-play b { display: block; font: 800 24px var(--display); }
.rv-play p { color: var(--muted); margin: 6px 0 0; }
.rv-vol { flex: none; }
.acts { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 12px; min-height: 0; }
.act { background: var(--card); border: 1px solid var(--line); border-radius: 24px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 12px; font: 750 17px/1.2 var(--display); text-align: center;
  transition: transform .12s; }
.act:active { transform: scale(.97); }
.act svg { width: 54px; height: 54px; fill: none; stroke: var(--accent-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.act.on { background: linear-gradient(150deg, rgba(255,90,61,.28), rgba(255,178,61,.14)); border-color: rgba(255,178,61,.5); }
.rv-off { color: var(--bad); flex: none; }
.rv-off svg { stroke: currentColor; }
.rv-off.armed { background: var(--bad); color: #fff; }
body.in-room #app { padding-bottom: calc(var(--bottom) + 12px); }

/* ---------- the living room remote: the Harmony's layout ---------- */
.hr { gap: 8px; }
.hr .hb { background: #1b2030; border-radius: 12px; color: var(--text); display: grid; place-items: center; font-weight: 700;
  font-size: 15px; letter-spacing: .01em; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.35);
  transition: transform .06s, background .1s; }
.hr .hb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hr .hb.down { transform: scale(.94); background: #2a3146; }
.hr .hb.dim { opacity: .28; pointer-events: none; }
.hr .hb.ghost { background: none; box-shadow: none; }
.hr-top { display: flex; justify-content: space-between; align-items: center; flex: none; height: 36px; }
.hr-top .rv-power { height: 34px; padding: 0 14px; border-radius: 17px; }
.hr-rooms { color: var(--muted); font-size: 14px; font-weight: 650; padding: 6px 4px; }
.hr-transport { display: grid; grid-template-columns: 1fr 64px 1fr; grid-template-rows: 38px 38px; gap: 6px 8px; flex: none; }
.hr-transport .tall { grid-row: span 1; }
.hr-transport .hb:nth-child(2) svg { width: 26px; height: 26px; fill: currentColor; }
.hr-small { display: flex; justify-content: space-around; flex: none; height: 30px; }
.hr-small .hb { width: 54px; }
.hr-small .hb svg { width: 20px; height: 20px; }
.hr-screen { flex: 1; min-height: 64px; border-radius: 16px; background: linear-gradient(160deg, #1f3550, #13202f 70%);
  border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; padding: 10px 12px; overflow: hidden; }
.hr-art { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.hr-what { flex: 1; min-width: 0; }
.hr-what b { display: block; font: 800 18px/1.15 var(--display); }
.hr-what small { display: block; color: #b8c6d8; font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hr-acts { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--accent-2); font-size: 12px;
  font-weight: 700; padding: 6px 8px; border-radius: 12px; background: rgba(0,0,0,.25); }
.hr-acts svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.hr-nums { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 5px; height: 100%; }
.hr-nums .hb { font-size: 17px; border-radius: 10px; }
.hr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: none; height: 38px; }
.hr-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: none; height: 38px; }
.hr-nav { display: grid; grid-template-columns: 60px 1fr 60px; gap: 10px; flex: none; height: min(176px, 27vh); }
.hr-rocker { display: grid; grid-template-rows: 1fr auto 1fr; background: #151a26; border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.hr-rocker .hb { border-radius: 0; background: none; box-shadow: none; font-size: 24px; font-weight: 500; }
.hr-rocker .hb.down { background: #2a3146; transform: none; }
.hr-rocker span { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.15; padding: 2px 0; }
.hr-rocker span i { display: block; font-style: normal; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.hr-dpad { position: relative; justify-self: center; height: 100%; aspect-ratio: 1; border-radius: 50%; touch-action: none;
  background: radial-gradient(circle, #151a26 0 33%, #1b2030 34%); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 3px 8px rgba(0,0,0,.4); }
.hr-dpad .hb { position: absolute; background: none; box-shadow: none; color: var(--muted); }
.hr-dpad .hb.down { background: rgba(255,255,255,.06); transform: none; }
.hr-dpad .u { left: 32%; right: 32%; top: 0; height: 32%; border-radius: 50% 50% 0 0 / 60% 60% 0 0; }
.hr-dpad .d { left: 32%; right: 32%; bottom: 0; height: 32%; border-radius: 0 0 50% 50% / 0 0 60% 60%; }
.hr-dpad .l { top: 32%; bottom: 32%; left: 0; width: 32%; border-radius: 50% 0 0 50% / 60% 0 0 60%; }
.hr-dpad .r { top: 32%; bottom: 32%; right: 0; width: 32%; border-radius: 0 50% 50% 0 / 0 60% 60% 0; }
.hr-dpad .ok { inset: 32%; border-radius: 50%; background: #0f131c; color: var(--text); font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.hr-dpad .ok.down { background: #2a3146; }
.hr-colours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; flex: none; height: 14px; padding: 0 6px; }
.hr-colours .hb { border-radius: 7px; height: 12px; }
.hr-colours .c-red { background: #e5484d; } .hr-colours .c-green { background: #30a46c; }
.hr-colours .c-yellow { background: #f5d90a; } .hr-colours .c-blue { background: #3e63dd; }
.hb .hap { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }
.hr label.hb { cursor: pointer; position: relative; }
.hr-dpad label.hb { position: absolute; }
/* A clear press: the button sinks and flashes warm on touch (held, it stays lit); the flash plays out even on the
   quickest tap. The iPhone's haptic tick is light and can't be made stronger from a web page, so this does the work. */
.hr .hb.down { transform: scale(.9); background: #3a3020; color: #fff; box-shadow: 0 0 0 2px rgba(255,178,61,.55), 0 0 18px rgba(255,178,61,.35); }
.hr .hb.hit { animation: hit .28s ease-out; }
@keyframes hit { 0% { background: rgba(255,178,61,.55); box-shadow: 0 0 0 3px rgba(255,178,61,.8), 0 0 24px rgba(255,178,61,.5); } }
.hr-rocker .hb.down, .hr-dpad .hb.down { background: rgba(255,178,61,.22); transform: none; box-shadow: none; }
.hr-rocker .hb.hit, .hr-dpad .hb.hit { animation: hit-soft .28s ease-out; }
@keyframes hit-soft { 0% { background: rgba(255,178,61,.45); } }
.hr-dpad .ok.down { background: #3a3020; transform: scale(.94); box-shadow: 0 0 0 2px rgba(255,178,61,.6), 0 0 18px rgba(255,178,61,.35); }
.hr-colours .hb.down { transform: scaleY(.7); filter: brightness(1.4); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .hr .hb.hit { animation: none !important; } }
/* No programme picture (Sky hasn't got one, or it failed): a plain tile with the activity's symbol instead. */
.hr-art.fallback, .room-top .pic.fallback { display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(255,90,61,.35), rgba(255,178,61,.18) 60%, rgba(255,255,255,.04)); }
.hr-art.fallback svg, .room-top .pic.fallback svg { width: 30px; height: 30px; fill: none; stroke: #ffd9a8; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
/* The screen: programme picture (16:9), channel logo, programme. */
.hr-screen { padding: 10px; gap: 12px; }
.hr-art.wide { width: auto; height: 100%; max-height: 104px; aspect-ratio: 16 / 9; border-radius: 10px; }
.hr-art.wide.fallback svg { width: 34px; height: 34px; }
.hr-what { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hr-what b { font: 800 17px/1.2 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hr-logo { height: 22px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; align-self: flex-start; }
.hr-chan { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b8c6d8; }
.hr-what small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; -webkit-line-clamp: unset; }
.hr-plex { font: 900 13px var(--display); letter-spacing: .12em; color: #e5a00d; }

/* ---------- Watch Apple TV: the Siri Remote, simplified ---------- */
.siri { gap: 12px; }
.siri-acts { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--card-2);
  color: var(--accent-2); font-size: 14px; font-weight: 650; }
.siri-acts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.siri-pad { position: relative; flex: none; align-self: center; width: min(78vw, 300px, 40vh); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2a3042, #1a1e2a 70%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(0,0,0,.45);
  touch-action: none; }
.siri-pad.dim { opacity: .3; pointer-events: none; }
.siri-pad i { position: absolute; color: rgba(255,255,255,.35); display: grid; place-items: center; pointer-events: none; }
.siri-pad i svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.siri-pad .u { top: 8%; left: 50%; transform: translateX(-50%); } .siri-pad .d { bottom: 8%; left: 50%; transform: translateX(-50%); }
.siri-pad .l { left: 8%; top: 50%; transform: translateY(-50%); } .siri-pad .r { right: 8%; top: 50%; transform: translateY(-50%); }
.siri-pad b { position: absolute; inset: 30%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); pointer-events: none; }
.siri-pad .hap { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.siri-pad.hit[data-flash="ok"] b { animation: hit-soft .3s ease-out; }
.siri-pad.hit[data-flash="up"] .u, .siri-pad.hit[data-flash="down"] .d, .siri-pad.hit[data-flash="left"] .l,
.siri-pad.hit[data-flash="right"] .r { animation: arrow .3s ease-out; }
@keyframes arrow { 0% { color: var(--accent-2); transform: translate(var(--tx, -50%), var(--ty, 0)) scale(1.4); } }
.siri-pad .u, .siri-pad .d { --tx: -50%; --ty: 0; } .siri-pad .l, .siri-pad .r { --tx: 0; --ty: -50%; }
.siri-pad.hit[data-flash] { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 2px rgba(255,178,61,.35), 0 6px 18px rgba(0,0,0,.45); }
.siri-keys { display: grid; grid-template-columns: 1fr 1fr 64px; grid-template-rows: 56px 56px; gap: 12px 14px; flex: none;
  width: min(100%, 320px); align-self: center; }
.siri-keys .round { border-radius: 28px; background: #1d2231; }
.siri-keys .round svg { width: 24px; height: 24px; }
.siri-vol { grid-column: 3; grid-row: 1 / span 2; border-radius: 32px; }
.siri-vol span { min-height: 0; }
/* Nothing playing: the activity's mark in the middle of the screen (the Apple logo for the Apple TV). */
.hr-idle { flex: 1; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.07), transparent 65%); border-radius: 12px; }
.hr-idle svg { width: 44px; height: 44px; fill: none; stroke: #ffd9a8; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 4px 14px rgba(255,178,61,.25)); }
.hr-idle.apple svg { width: 50px; height: 50px; stroke: none; color: #f3f4f7; filter: drop-shadow(0 4px 18px rgba(255,255,255,.18)); }
.hr-idle span { font: 700 14px var(--display); color: #b8c6d8; letter-spacing: .02em; }
/* The activity tiles' marks: the Sky wordmark and the Apple logo in place of line icons. */
.act svg.mark-sky { width: 92px; height: 44px; stroke: none; }
.act svg.mark-apple { width: 48px; height: 48px; stroke: none; fill: #f3f4f7; }
.hr-what em { font-style: normal; font-size: 14px; font-weight: 600; color: #e6ecf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-what b { -webkit-line-clamp: 2; }
/* Which app is open: a small, quiet mark in the screen's top-right corner. */
.hr-screen { position: relative; }
.hr-badge { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(230,236,245,.55); }
.hr-badge.plex svg { width: 14px; height: 14px; opacity: .85; display: block; }
/* Paused: the picture dims a little with a round pause badge in the middle. */
.hr-artwrap, .picwrap { position: relative; flex: none; height: 100%; display: flex; }
.picwrap { height: auto; }
.hr-artwrap .hr-art.wide { height: 100%; }
.hr-artwrap.paused .hr-art, .picwrap.paused .pic { filter: brightness(.6) saturate(.8); }
.pause-badge { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: rgba(10,12,18,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.55); }
.pause-badge::before, .pause-badge::after { content: ""; position: absolute; top: 11px; width: 4px; height: 16px; border-radius: 2px; background: #fff; }
.pause-badge::before { left: 13px; } .pause-badge::after { right: 13px; }
.picwrap .pause-badge { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.picwrap .pause-badge::before, .picwrap .pause-badge::after { top: 8px; width: 3px; height: 12px; }
.picwrap .pause-badge::before { left: 9px; } .picwrap .pause-badge::after { right: 9px; }
.hr-artwrap { height: 100%; max-height: 104px; align-self: center; }
