/* Paradise Line: nền tối, viền xanh neon như máy Paradise Game */
:root {
  color-scheme: dark;
  --bg: #0A0F0C;
  --surface: #121915;
  --surface-2: #0F1512;
  --line: #2A3A31;
  --line-2: #1C2721;
  --ink: #E8F2EC;
  --soft: #C6D8CD;
  --muted: #9DB3A6;
  --dim: #7E9588;
  --neon: #39FF88;
  --neon-soft: rgba(57,255,136,0.14);
  --glow: rgba(57,255,136,0.38);
  --on-neon: #04140A;
  --water: #5FB8FF;
  --warn: #FFB020;
  --bad: #FF6B60;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.app { height: 100%; max-width: 480px; margin: 0 auto; position: relative; }
.root { height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 14px; }

.brand { font-weight: 800; letter-spacing: 2px; color: var(--neon); text-shadow: 0 0 10px var(--glow); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; font-size: 21px; font-weight: 700; }
.sub { font-size: 12.5px; color: var(--muted); }
.ok { color: var(--neon); }
.back { width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.title { font-size: 16px; font-weight: 700; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.start { justify-content: flex-start; }
.big { font-size: 42px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tag { font-size: 11.5px; font-weight: 800; letter-spacing: .8px; }

.card { border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.lit { border-color: var(--neon); box-shadow: 0 0 16px var(--glow); }
.card.hot { border-color: var(--warn); box-shadow: 0 0 14px rgba(255,176,32,.25); }
.card.blue { border-color: var(--water); }
.card.bad { border-color: var(--bad); }
.card.flat { background: var(--surface-2); }
.tap { text-align: left; color: var(--ink); width: 100%; }

.clockrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.clock { font-size: 40px; font-weight: 800; letter-spacing: 1px; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #F0FFF6, #5CFF9C 45%, #12C48A); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #0B6B3E) drop-shadow(0 1px 0 #074830) drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.pill { height: 30px; padding: 0 10px; border-radius: 15px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.weather { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.wtemp { font-size: 28px; font-weight: 800; background: linear-gradient(180deg, #FFF6DA, #FFC84A 45%, #FF7A2E); -webkit-background-clip: text; background-clip: text; color: transparent; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--line); background: transparent; color: var(--soft); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { border-color: var(--neon); background: var(--neon-soft); color: var(--neon); font-weight: 700; box-shadow: 0 0 12px var(--glow); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.tile { min-height: 116px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-size: 15px; font-weight: 700; position: relative; }
.tile .dot { width: 54px; height: 54px; border-radius: 27px; display: flex; align-items: center; justify-content: center; background: #1C2721; color: var(--dim); transition: all .2s; }
.tile small { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.tile[aria-pressed="true"] { border-color: var(--neon); background: var(--neon-soft); box-shadow: 0 0 18px var(--glow); }
.tile[aria-pressed="true"] .dot { background: var(--neon); color: var(--on-neon); box-shadow: 0 0 18px var(--glow); }
.tile[aria-pressed="true"] small { color: var(--neon); }
.busy { opacity: .55; pointer-events: none; }

.seg { height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: transparent; color: var(--soft); font-weight: 700; font-size: 14px; }
.seg[aria-pressed="true"] { border-color: var(--neon); background: var(--neon-soft); color: var(--neon); }
.seg.solid[aria-pressed="true"] { background: var(--neon); color: var(--on-neon); box-shadow: 0 0 14px var(--glow); }
.btn { height: 50px; border-radius: 15px; border: none; background: var(--neon); color: var(--on-neon); font-weight: 800; font-size: 15px; box-shadow: 0 0 16px var(--glow); width: 100%; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--soft); box-shadow: none; font-weight: 700; }
.btn.warn { background: var(--warn); color: #1A1000; box-shadow: none; }
.btn.danger { background: transparent; border: 1.5px solid var(--bad); color: var(--bad); box-shadow: none; }
.btn.small { height: 40px; font-size: 13.5px; width: auto; padding: 0 14px; }
.btn:disabled { background: var(--surface-2); color: #6B8075; border: 1.5px solid var(--line); box-shadow: none; }

.switch { width: 58px; height: 34px; border-radius: 17px; border: 1.5px solid var(--line); background: var(--bg); padding: 3px; display: flex; flex: none; }
.switch span { width: 26px; height: 26px; border-radius: 13px; background: var(--dim); transition: transform .2s; }
.switch[aria-checked="true"] { border-color: var(--neon); background: var(--neon-soft); }
.switch[aria-checked="true"] span { background: var(--neon); transform: translateX(24px); }
.switch.hot[aria-checked="true"] { border-color: var(--warn); background: rgba(255,176,32,.15); }
.switch.hot[aria-checked="true"] span { background: var(--warn); }

.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span:first-child { font-size: 12px; color: var(--muted); }
.stat span:last-child { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lr { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.lr:first-of-type { border-top: none; }
.lr span:first-child { color: var(--soft); }
.badge { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.badge.g { background: var(--neon-soft); color: var(--neon); }
.badge.r { background: rgba(255,107,96,.16); color: var(--bad); }
.badge.y { background: rgba(255,176,32,.16); color: var(--warn); }
.badge.b { background: rgba(95,184,255,.16); color: var(--water); }
.note { border-radius: 14px; background: rgba(57,255,136,.08); padding: 12px 14px; font-size: 12.5px; line-height: 1.5; color: var(--soft); }

.ring { position: relative; width: 196px; height: 196px; align-self: center; }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-size: 20px; }
.tank { width: 80px; height: 116px; border-radius: 14px; border: 2px solid var(--water); position: relative; overflow: hidden; background: var(--bg); flex: none; }
.tank i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(95,184,255,.38); transition: height .6s; }
.fanbtn { width: 128px; height: 128px; border-radius: 64px; border: 2px solid var(--line); background: var(--bg); color: var(--dim); display: flex; align-items: center; justify-content: center; align-self: center; }
.fanbtn[aria-pressed="true"] { border-color: var(--neon); background: var(--neon); color: var(--on-neon); box-shadow: 0 0 28px var(--glow); }
.spin { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--soft); }
.field input, .field select { height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font-size: 16px; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--neon); outline: none; box-shadow: 0 0 10px var(--glow); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 14px; color: var(--soft); }
.checks input { width: 18px; height: 18px; accent-color: var(--neon); }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; }
.code { font-size: 34px; font-weight: 800; letter-spacing: 6px; text-align: center; color: var(--neon); font-variant-numeric: tabular-nums; user-select: all; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; line-height: 1.6; }

.nav { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--line-2); background: #0D1310; padding-bottom: env(safe-area-inset-bottom); }
.nav button { height: 62px; border: none; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; }
.nav button[aria-current="page"] { color: var(--neon); font-weight: 700; }
.nb { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.conn { font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.conn i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }

.toast { position: fixed; left: 50%; transform: translate(-50%, 10px); bottom: calc(80px + env(safe-area-inset-bottom)); width: min(448px, calc(100% - 32px)); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #FFD9D5; color: #4A0A05; }

@media (prefers-reduced-motion: reduce) { .spin { animation: none !important; } * { transition: none !important; } }
.badge{white-space:nowrap;flex:none}
