:root {
  --fundo: #0f1115;
  --card: #181b22;
  --card-2: #20242d;
  --linha: #2a2f3a;
  --texto: #f2f0ea;
  --suave: #9aa0ab;
  --apagado: #5f6672;
  --frio: #5ab3ff;
  --frio-escuro: #12324f;
  --quente: #ffb35a;
  --verde: #5fd39a;
  --vermelho: #ff6b6b;
  --raio: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fundo); color: var(--texto); }
body { overflow: hidden; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }

.painel {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  padding: 20px 26px 12px;
}

/* topo: relógio e clima */
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hora { font-size: 66px; font-weight: 250; letter-spacing: -3px; line-height: .9; font-variant-numeric: tabular-nums; }
.data { color: var(--suave); font-size: 20px; margin-top: 8px; }
.clima { display: flex; align-items: center; gap: 16px; text-align: right; }
.clima svg { width: 56px; height: 56px; color: var(--quente); }
.clima .graus { font-size: 46px; font-weight: 300; line-height: 1; }
.clima .info { color: var(--suave); font-size: 18px; margin-top: 6px; }

/* cartões */
.cartoes { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; min-height: 0; }
.cartao {
  background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-height: 0; position: relative;
}
.cartao-cab { display: flex; align-items: center; justify-content: space-between; }
.cartao-cab h2 { margin: 0; font-size: 26px; font-weight: 600; }
.cartao-cab .sub { color: var(--suave); font-size: 17px; margin-top: 4px; }

.liga {
  width: 68px; height: 68px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--linha);
  display: grid; place-items: center; transition: background .2s, color .2s, transform .1s;
}
.liga svg { width: 34px; height: 34px; }
.liga.on { background: var(--verde); color: #08140e; border-color: transparent; }
.liga:active { transform: scale(.94); }

/* ar */
.ar-centro { flex: 1; display: flex; align-items: center; justify-content: center; gap: 36px; min-height: 0; }
.redondo {
  width: 92px; height: 92px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--linha);
  font-size: 54px; font-weight: 300; line-height: 1; display: grid; place-items: center; transition: transform .1s;
}
.redondo:active { transform: scale(.92); background: var(--linha); }
.alvo { text-align: center; min-width: 210px; }
.alvo .num { font-size: 108px; font-weight: 200; line-height: 1; letter-spacing: -4px; font-variant-numeric: tabular-nums; color: var(--frio); }
.alvo .num sup { font-size: 40px; vertical-align: top; margin-left: 4px; letter-spacing: 0; position: relative; top: 14px; }
.alvo .rotulo { color: var(--suave); font-size: 18px; margin-top: 6px; }
.desligado .alvo .num { color: var(--apagado); }

.opcoes { display: grid; gap: 8px; }
.opcoes .titulo { color: var(--suave); font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; }
.segmentos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg {
  height: 54px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--linha);
  font-size: 19px; color: var(--suave); transition: background .15s, color .15s;
}
.seg.ativo { background: var(--frio-escuro); color: var(--frio); border-color: #1f4f7a; font-weight: 600; }
.seg:active { transform: scale(.97); }

/* tv */
.tv-grade { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; min-height: 0; }
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; aspect-ratio: 1; max-height: 190px; justify-self: center; width: 100%; max-width: 190px; }
.dpad .seta, .dpad .ok { border-radius: 16px; background: var(--card-2); border: 1px solid var(--linha); display: grid; place-items: center; transition: transform .1s; }
.dpad .seta svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dpad .ok { background: var(--frio-escuro); color: var(--frio); border-color: #1f4f7a; font-weight: 700; font-size: 20px; }
.dpad button:active { transform: scale(.92); background: var(--linha); }
.tv-lado { display: grid; grid-template-rows: repeat(4, 1fr); gap: 8px; max-height: 190px; }
.tv-lado .botao { height: auto; min-height: 40px; font-size: 17px; }
.tv-lado .botao svg { width: 20px; height: 20px; }
.tv-vol { display: flex; align-items: center; justify-content: space-between; background: var(--card-2); border: 1px solid var(--linha); border-radius: 22px; padding: 10px; }
.tv-vol .redondo { width: 60px; height: 60px; font-size: 36px; background: var(--card); }
.tv-vol .meio { text-align: center; }
.tv-vol .meio .n { font-size: 30px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-vol .meio .r { color: var(--suave); font-size: 15px; margin-top: 4px; }
.botao {
  height: 54px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--linha);
  font-size: 19px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .1s;
}
.botao svg { width: 24px; height: 24px; }
.botao:active { transform: scale(.96); background: var(--linha); }
.botao.ativo { color: var(--quente); border-color: #5a4122; }

/* apps da TV */
.tv-apps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.app {
  height: 56px; border-radius: 14px; border: 0; font-size: 16px; padding: 0 6px; font-weight: 700; letter-spacing: .2px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff 8%), color-mix(in srgb, var(--c) 70%, #000 30%));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .1s, filter .2s;
}
.app { display: flex; align-items: center; justify-content: center; gap: 7px; }
.app svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app:active { transform: scale(.95); }
.app.abrindo { filter: brightness(1.25); }

/* aviso quando falta conectar uma conta */
.aviso { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; color: var(--suave); font-size: 19px; padding: 0 12px; }
.aviso .abrir-app { display: flex; align-items: center; gap: 14px; font-size: 24px; padding: 26px 36px; border-radius: 22px; }
.aviso .abrir-app svg { width: 30px; height: 30px; }
.aviso a { color: var(--fundo); background: var(--quente); text-decoration: none; font-weight: 600; padding: 18px 28px; border-radius: 18px; }

/* cenas */
.cenas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cena {
  height: 84px; border-radius: 22px; background: var(--card); border: 1px solid var(--linha);
  display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 22px; font-weight: 500;
  transition: transform .1s, background .2s;
}
.cena svg { width: 32px; height: 32px; color: var(--quente); }
.cena:active { transform: scale(.97); background: var(--card-2); }
.cena.rodando { background: var(--frio-escuro); border-color: #1f4f7a; }

.rodape { display: flex; justify-content: space-between; color: var(--apagado); font-size: 13px; }
.rodape a { color: var(--apagado); text-decoration: none; }

/* mensagem rápida */
.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #2b303b; color: var(--texto); padding: 16px 26px; border-radius: 16px; font-size: 18px;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 80vw; text-align: center;
}
.toast.ver { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: #4a2328; }

.carregando { opacity: .5; pointer-events: none; }

/* tablet em pé */
@media (orientation: portrait) {
  body { overflow: auto; }
  .painel { height: auto; min-height: 100vh; }
  .cartoes { grid-template-columns: 1fr; }
  .cenas { grid-template-columns: repeat(2, 1fr); }
  .cartao { min-height: 420px; }
}
@media (max-height: 720px) and (orientation: landscape) {
  .hora { font-size: 54px; }
  .alvo .num { font-size: 88px; }
  .cena { height: 70px; }
  .redondo { width: 80px; height: 80px; }
  .seg { height: 48px; }
  .botao { height: 54px; }
}

/* login */
.login { height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: min(420px, 100%); background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio); padding: 36px; display: grid; gap: 18px; }
.login h1 { margin: 0; font-size: 30px; font-weight: 600; }
.login p { margin: 0; color: var(--suave); }
.login input { font: inherit; font-size: 20px; padding: 18px; border-radius: 16px; border: 1px solid var(--linha); background: var(--card-2); color: var(--texto); width: 100%; }
.login button { height: 64px; border-radius: 16px; background: var(--frio); color: #06121d; font-size: 20px; font-weight: 600; }
.login .erro { color: var(--vermelho); }
.login .assina { text-align: center; color: var(--apagado); font-size: 13px; }
.login .assina a { color: var(--apagado); }
