/* Linkvue Remote web handset.
   Minimal: white page, one soft grey for every control, Linkvue's blue to teal only on OK.
   Built for older users: controls 64 to 76 px with space around them, a word under every control,
   large text, strong contrast. */

:root {
  --brand: linear-gradient(135deg, #1790CD 0%, #14B8A6 100%);
  --blue: #1790CD;
  --surface: #F2F4F7;
  --surface-press: #E1EAF3;
  --ink: #1D2939;
  --label: #475467;
  --quiet: #667085;
  --red: #D92D20;
  --green: #06BC83;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font: 400 17px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100svh;
  max-width: 440px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ top */

.top { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo {
  display: block;
  width: 90px;
  height: 30px;
  background: var(--brand);
  -webkit-mask: url(logo.png) left center / contain no-repeat;
  mask: url(logo.png) left center / contain no-repeat;
}

.power {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 24px;
  background: #FEF3F2;
  color: var(--red);
  font-size: 17px;
  font-weight: 600;
  transition: transform .1s, background-color .1s;
}
.power svg { width: 22px; height: 22px; stroke-width: 2.4; }
.power.pressed { transform: scale(.96); background: #FDE1DE; }

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--quiet);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: #98A2B3; }
.status.st-ok i { background: var(--green); }
.status.st-warn i { background: #F79009; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ------------------------------------------------------------------ remote */

.remote {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 18px;
  padding-bottom: 6px;
  animation: rise .45s var(--ease) both;
}
.remote.offline .disc, .remote.offline .row3 { opacity: .4; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* arrows and OK */
.disc {
  --d: min(300px, 80vw, 35svh);
  position: relative;
  width: var(--d);
  height: var(--d);
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}
.seg { position: absolute; inset: 0; color: var(--ink); transition: background-color .12s; }
.seg.up    { clip-path: polygon(50% 50%, 0 0, 100% 0); }
.seg.right { clip-path: polygon(50% 50%, 100% 0, 100% 100%); }
.seg.down  { clip-path: polygon(50% 50%, 100% 100%, 0 100%); }
.seg.left  { clip-path: polygon(50% 50%, 0 100%, 0 0); }
.seg svg { position: absolute; width: 34px; height: 34px; stroke-width: 2.4; }
.seg.up svg    { left: calc(50% - 17px); top: 9%; }
.seg.down svg  { left: calc(50% - 17px); bottom: 9%; transform: rotate(180deg); }
.seg.left svg  { top: calc(50% - 17px); left: 9%; transform: rotate(-90deg); }
.seg.right svg { top: calc(50% - 17px); right: 9%; transform: rotate(90deg); }
.seg.pressed { background: var(--surface-press); }

.ok {
  position: absolute;
  z-index: 2;
  inset: 31%;
  border-radius: 50%;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 8px 20px -8px rgba(23, 144, 205, .7);
  transition: transform .1s var(--ease), filter .1s;
}
.ok.pressed { transform: scale(.94); filter: brightness(.92); }

/* round keys with a word underneath */
.row3 { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; align-items: start; }
.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--label);
}
.dot {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: transform .1s, background-color .1s;
}
.key.pressed .dot { transform: scale(.94); background: var(--surface-press); }

/* volume and channel */
.col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.col.mid { gap: 18px; }
.col.mid .dot { width: 64px; height: 64px; }
.pill {
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 76px;
  height: 184px;
  border-radius: 38px;
  background: var(--surface);
  overflow: hidden;
}
.pill button { display: grid; place-items: center; color: var(--ink); transition: background-color .12s; }
.pill button + button { border-top: 1px solid #E4E7EC; }
.pill svg { width: 30px; height: 30px; stroke-width: 2.4; }
.pill .flip svg { transform: rotate(180deg); }
.pill button.pressed { background: var(--surface-press); }
.cap { font-size: 15px; font-weight: 500; color: var(--label); }

.leave {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--quiet);
}
.leave:active { background: var(--surface); }

/* ------------------------------------------------------------------ messages */

.message {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8px 14svh;
  animation: rise .4s var(--ease) both;
}
.message h1 { margin: 28px 0 10px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.message p { margin: 0; max-width: 28ch; font-size: 18px; color: var(--label); }

.art { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.art svg { width: 132px; height: 132px; }
.artBg { fill: #F2F7FB; }
.corner { stroke: url(#brandG); stroke-width: 4; }
.mark { fill: url(#brandG); stroke: none; }
.qr { animation: breathe 2.6s ease-in-out infinite; transform-origin: 60px 60px; }
@keyframes breathe { 50% { opacity: .55; } }
.spin { display: none; }
.art.busy .qr { opacity: 0; animation: none; }
.art.busy .spin {
  display: block;
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(23, 144, 205, .15);
  border-top-color: var(--blue);
  animation: turn .8s linear infinite;
}
.art.ended .corner { stroke: #98A2B3; }
.art.ended .mark { fill: #98A2B3; }
@keyframes turn { to { transform: rotate(360deg); } }

.primary, .secondary {
  width: 100%;
  max-width: 320px;
  height: 58px;
  border-radius: 29px;
  font-size: 18px;
  font-weight: 600;
}
.primary { margin-top: 28px; background: var(--brand); color: #FFFFFF; }
.primary.danger { background: var(--red); margin-top: 8px; }
.secondary { margin-top: 10px; color: var(--ink); background: var(--surface); }
.primary:active, .secondary:active { filter: brightness(.94); }

/* ------------------------------------------------------------------ sheets */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(16, 24, 40, .4);
  animation: fade .2s ease both;
}
.sheetBox {
  width: 100%;
  max-width: 440px;
  padding: 16px 24px calc(24px + env(safe-area-inset-bottom));
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  text-align: center;
  animation: up .3s var(--ease) both;
}
.sheetBox h2 { margin: 12px 0 8px; font-size: 22px; font-weight: 700; }
.sheetBox p { margin: 0 auto 8px; max-width: 30ch; font-size: 17px; color: var(--label); }
.sheetBox .primary, .sheetBox .secondary { max-width: none; }
.sheetHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.close { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.close svg { width: 22px; height: 22px; }

/* number keys laid out like a phone dial pad */
.dial { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 16px 28px; padding-bottom: 4px; }
.dial button {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 30px;
  font-weight: 500;
  display: grid;
  place-items: center;
  transition: transform .1s, background-color .1s;
}
.dial .del { background: none; color: var(--label); }
.dial button.pressed { transform: scale(.94); background: var(--surface-press); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
