:root{
  --bg:#060a11;
  --surface:#0e1724;
  --surface-2:#162235;
  --surface-3:#1d2b40;
  --text:#f7f9fc;
  --muted:#9fb0c6;
  --line:rgba(255,255,255,.13);
  --focus:#ffd84a;
  --cyan:#5ce1f4;
  --green:#55e39a;
  --red:#ff6174;
  --purple:#9b7cff;
  --safe-x:clamp(54px,4.2vw,92px);
  --safe-y:clamp(34px,3.4vh,58px);
  --radius:28px;
  --focus-ring:0 0 0 6px var(--focus),0 18px 42px rgba(0,0,0,.42);
}

*{box-sizing:border-box}
html,body{
  margin:0;
  width:100%;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:Arial,"Segoe UI",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
body{
  min-height:100vh;
  overflow-x:hidden;
  background:
    linear-gradient(145deg,rgba(22,48,76,.38),transparent 34%),
    linear-gradient(180deg,#09101b 0%,#060a11 62%,#05080d 100%);
}
button,input,textarea{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,textarea:focus-visible{outline:none}
h1,h2,h3,p{margin-top:0}

.shell{
  width:min(1840px,100%);
  min-height:100vh;
  margin:0 auto;
  padding:var(--safe-y) var(--safe-x) 34px;
  display:flex;
  flex-direction:column;
}

.tv-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:42px;
  min-height:180px;
}
.brand-block{min-width:0}
.eyebrow{
  margin:0 0 10px;
  color:var(--cyan);
  font-size:clamp(16px,1.05vw,22px);
  line-height:1.2;
  font-weight:900;
  letter-spacing:.18em;
}
h1{
  margin-bottom:10px;
  font-size:clamp(58px,5.1vw,94px);
  line-height:.98;
  letter-spacing:-.04em;
}
.muted{
  margin:0;
  color:var(--muted);
  font-size:clamp(21px,1.35vw,28px);
  line-height:1.35;
}
.header-status{
  min-width:420px;
  text-align:right;
}
.clock{
  font-size:clamp(56px,4.7vw,84px);
  line-height:.95;
  font-weight:900;
  letter-spacing:-.035em;
  font-variant-numeric:tabular-nums;
}
.status-pills{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}
.status-pill{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#0c1521;
  color:var(--muted);
  font-size:16px;
  font-weight:700;
}
.device-line.connected{color:#7cf0ab}
.dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:#64748b;
  flex:0 0 auto;
}
.dot.online{background:var(--green)}
.dot.offline{background:var(--red)}

.apps-section{
  margin-top:34px;
  flex:1 0 auto;
}
.section-heading{
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:30px;
  margin-bottom:16px;
}
.section-heading .eyebrow{margin:0}
.remote-hint{
  margin:0;
  color:#7f92aa;
  font-size:clamp(16px,1vw,20px);
  font-weight:700;
}

.app-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
}
.app-card{
  min-width:0;
  min-height:390px;
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-end;
  padding:30px 32px 28px;
  border:2px solid rgba(255,255,255,.10);
  border-radius:32px;
  color:var(--text);
  text-align:left;
  background:var(--surface);
  transition:transform .12s ease,border-color .12s ease,background .12s ease;
}
.app-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.85;
}
.app-tv::before{background:linear-gradient(145deg,rgba(19,135,204,.33),transparent 52%)}
.app-youtube::before{background:linear-gradient(145deg,rgba(205,46,72,.32),transparent 52%)}
.app-game::before{background:linear-gradient(145deg,rgba(116,81,210,.34),transparent 52%)}
.app-card>*{position:relative;z-index:1}
.card-kicker{
  position:absolute;
  top:26px;
  left:30px;
  color:rgba(255,255,255,.78);
  font-size:15px;
  font-weight:900;
  letter-spacing:.16em;
}
.app-icon{
  margin-bottom:auto;
  padding-top:50px;
  font-size:clamp(74px,5.2vw,106px);
  line-height:1;
  font-weight:900;
}
.app-title{
  display:block;
  font-size:clamp(42px,3.35vw,64px);
  line-height:1.02;
  font-weight:900;
  letter-spacing:-.035em;
}
.app-desc{
  display:block;
  margin-top:12px;
  color:#becbda;
  font-size:clamp(19px,1.25vw,25px);
  line-height:1.35;
  font-weight:700;
}
.card-action{
  display:block;
  margin-top:20px;
  color:rgba(255,255,255,.72);
  font-size:14px;
  font-weight:900;
  letter-spacing:.1em;
}
.focusable:focus,
.focusable.focus-visible{
  outline:none!important;
  border-color:var(--focus)!important;
  box-shadow:var(--focus-ring);
  transform:scale(1.035);
  z-index:20;
}
.app-card:focus{
  background:var(--surface-2);
}
.app-card:focus .card-action{color:var(--focus)}

.quick-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding-top:26px;
}
.quick-label{
  color:#71859e;
  font-size:16px;
  font-weight:800;
}
.quick-buttons{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:12px;
}
.sys-btn,.back-btn,.btn{
  min-height:68px;
  padding:0 24px;
  border:2px solid var(--line);
  border-radius:18px;
  background:#101a28;
  color:var(--text);
  font-size:20px;
  font-weight:850;
}
.sys-btn small{margin-left:8px;color:var(--muted)}
.sys-btn:focus,.back-btn:focus,.btn:focus{
  background:#1a2739;
}

.app-panel{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
  overflow:auto;
  padding:var(--safe-y) var(--safe-x) 44px;
  background:linear-gradient(180deg,#09111c 0%,#060a11 100%);
}
.app-panel.open{display:block}
.panel-top{
  position:sticky;
  top:0;
  z-index:30;
  min-height:112px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:26px;
  padding:0 0 20px;
  background:#09111c;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.back-btn{
  min-width:180px;
  min-height:74px;
  text-align:left;
}
.panel-heading{min-width:0}
.panel-heading .eyebrow{margin-bottom:4px}
h2{
  margin:0;
  font-size:clamp(38px,3.1vw,58px);
  line-height:1.05;
  letter-spacing:-.03em;
}
.panel-clock{
  min-width:130px;
  text-align:right;
  font-size:38px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}
.panel-body{padding-top:24px;padding-bottom:36px}

/* TV */
.tv-layout{
  display:grid;
  grid-template-columns:minmax(0,1.72fr) minmax(360px,.65fr);
  gap:24px;
  align-items:start;
}
.player-card,.side-card,.youtube-card,.game-card{
  border:2px solid var(--line);
  border-radius:28px;
  background:#0d1724;
}
.player-card{padding:20px}
.side-card{padding:22px}
.side-card h3{
  margin-bottom:18px;
  font-size:27px;
}
.video-player{
  width:100%;
  aspect-ratio:16/9;
  display:block;
  background:#000;
  border-radius:20px;
}
.status{
  margin-top:14px;
  padding:14px 18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#111c2a;
  color:#b9c7d7;
  font-size:18px;
  line-height:1.4;
}
.channel-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}
.channel-btn{
  min-height:78px;
  padding:0 12px;
  text-align:center;
  font-size:23px;
}
.channel-btn.active{
  border-color:#fff;
  background:#19334c;
}
.channel-btn.active::after{
  content:"ĐANG XEM";
  display:block;
  margin-top:4px;
  color:var(--cyan);
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
}
.tool-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:14px;
}
.tool-row input,.tool-row textarea{flex:1 1 260px}
input,textarea{
  border:2px solid var(--line);
  border-radius:16px;
  background:#0b1420;
  color:var(--text);
  outline:none;
  padding:0 16px;
  font-size:19px;
}
input{min-height:68px}
textarea{
  width:100%;
  min-height:136px;
  padding:16px;
  resize:vertical;
}
input:focus,textarea:focus{
  border-color:var(--focus);
  box-shadow:0 0 0 5px rgba(255,216,74,.22);
}
.btn.primary{
  border-color:#2a86c8;
  background:#14679f;
}
.playlist-tools{
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line);
}
.custom-channel-list{
  display:grid;
  gap:10px;
  max-height:32vh;
  overflow:auto;
  margin-top:12px;
}

/* YouTube */
.youtube-card{
  width:min(1500px,100%);
  margin:0 auto;
  padding:22px;
}
.youtube-frame{
  width:100%;
  aspect-ratio:16/9;
  display:block;
  border:0;
  border-radius:22px;
  background:#000;
}
.youtube-presets{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.yt-preset{
  min-height:84px;
  padding:0 18px;
  text-align:left;
  font-size:20px;
}
.recent-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.recent-chip{min-height:62px}

/* Games */
.game-card{
  width:min(1600px,100%);
  margin:0 auto;
  padding:22px;
}
.game-menu-note,.game-help{
  margin-bottom:18px;
  color:#a9b8ca;
  font-size:18px;
  line-height:1.45;
}
.game-select{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:20px;
}
.game-choice{
  min-height:126px;
  padding:18px 20px;
  text-align:left;
  font-size:25px;
}
.game-choice small{
  display:block;
  margin-top:8px;
  color:#9fb0c6;
  font-size:15px;
  line-height:1.3;
}
.game-hud{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:12px;
  color:#c2cfdd;
  font-size:20px;
  font-weight:800;
}
.game-stage{
  position:relative;
  min-height:560px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:2px solid var(--line);
  border-radius:24px;
  background:#02050a;
}
#gameCanvas{
  max-width:100%;
  max-height:68vh;
  background:#050b12;
}
.game-board-2048{
  display:grid;
  grid-template-columns:repeat(4,110px);
  gap:10px;
  padding:12px;
  border-radius:18px;
  background:#101820;
}
.tile2048{
  width:110px;
  height:110px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#223246;
  font-size:34px;
  font-weight:900;
}
.reaction-box{
  width:min(760px,90%);
  height:360px;
  display:grid;
  place-items:center;
  padding:30px;
  border-radius:24px;
  background:#142033;
  font-size:42px;
  font-weight:900;
  text-align:center;
}

.toast{
  position:fixed;
  left:50%;
  bottom:38px;
  z-index:999;
  min-width:320px;
  max-width:min(760px,80vw);
  padding:18px 24px;
  border:2px solid var(--line);
  border-radius:18px;
  background:#142238;
  color:#fff;
  font-size:20px;
  font-weight:800;
  text-align:center;
  opacity:0;
  transform:translate(-50%,120px);
  transition:.18s ease;
}
.toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

@media (min-width:1600px) and (min-height:850px){
  .app-card{min-height:420px}
  .game-stage{min-height:590px}
}

@media (max-width:1350px){
  :root{--safe-x:44px;--safe-y:30px}
  .tv-header{min-height:150px}
  .header-status{min-width:350px}
  .app-card{min-height:320px;padding:26px}
  .app-grid{gap:18px}
  .game-select{grid-template-columns:repeat(3,minmax(0,1fr))}
  .youtube-presets{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:1050px){
  .tv-header{grid-template-columns:1fr;align-items:start;gap:18px}
  .header-status{text-align:left;min-width:0}
  .status-pills{justify-content:flex-start}
  .app-grid{grid-template-columns:1fr}
  .app-card{min-height:210px}
  .app-icon{position:absolute;right:28px;top:28px;padding:0;font-size:72px}
  .tv-layout{grid-template-columns:1fr}
  .quick-actions{align-items:flex-start;flex-direction:column}
  .quick-buttons{justify-content:flex-start}
}

@media (max-width:720px){
  :root{--safe-x:20px;--safe-y:20px}
  .section-heading{align-items:flex-start;flex-direction:column;gap:8px}
  .panel-top{grid-template-columns:auto 1fr}
  .panel-clock{display:none}
  .back-btn{min-width:auto}
  .game-select{grid-template-columns:repeat(2,minmax(0,1fr))}
  .channel-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .youtube-presets{grid-template-columns:1fr}
  .game-board-2048{grid-template-columns:repeat(4,70px)}
  .tile2048{width:70px;height:70px}
}


/* V7 television interaction modes */
[hidden]{display:none!important}
.sys-btn.active-setting{border-color:#4dbe86;background:#143226}
.tv-mode{overscroll-behavior:none}
.tv-mode.app-open{overflow:hidden}
.tv-mode .app-panel.open{overflow:hidden}
.tv-mode .panel-body{overflow:hidden}

/* TV app: one-screen remote layout */
.tv-screen{
  position:relative;
  height:calc(100vh - 170px);
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  gap:14px;
}
.tv-video-wrap{
  min-height:0;
  display:flex;
  flex-direction:column;
}
.tv-screen .video-player{
  flex:1 1 auto;
  min-height:0;
  width:100%;
  height:auto;
  aspect-ratio:auto;
  object-fit:contain;
  border:2px solid var(--line);
}
.tv-now-row{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding-top:10px;
}
.tv-now{
  min-width:0;
  color:#c6d3e1;
  font-size:20px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.btn.compact{min-height:52px;padding:0 18px;font-size:17px}
.channel-strip{
  display:grid;
  grid-template-columns:repeat(9,minmax(0,1fr));
  gap:10px;
}
.channel-strip .channel-btn{
  min-height:70px;
  font-size:21px;
}
.tv-advanced{
  position:fixed;
  z-index:80;
  left:var(--safe-x);
  right:var(--safe-x);
  bottom:var(--safe-y);
  max-height:56vh;
  overflow:auto;
  padding:22px;
  border:2px solid var(--focus);
  border-radius:24px;
  background:#0b1420;
  box-shadow:0 24px 70px rgba(0,0,0,.62);
}

/* YouTube: video first, remote controls below */
.youtube-screen{
  position:relative;
  height:calc(100vh - 170px);
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  gap:14px;
}
.youtube-screen .youtube-frame{
  min-height:0;
  height:100%;
  aspect-ratio:auto;
}
.youtube-control-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:stretch;
}
.youtube-control-row .youtube-presets{
  margin:0;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.youtube-control-row .yt-preset{min-height:72px}
.youtube-more{
  position:fixed;
  z-index:80;
  left:var(--safe-x);
  right:var(--safe-x);
  bottom:var(--safe-y);
  max-height:46vh;
  overflow:auto;
  padding:22px;
  border:2px solid var(--focus);
  border-radius:24px;
  background:#0b1420;
  box-shadow:0 24px 70px rgba(0,0,0,.62);
}

/* Selected game becomes the whole television surface */
body.game-running{overflow:hidden}
.app-panel.game-running{
  padding:0;
  overflow:hidden;
  background:#02050a;
}
.app-panel.game-running .panel-top{display:none}
.app-panel.game-running .panel-body{
  height:100vh;
  padding:0;
  overflow:hidden;
}
.app-panel.game-running .game-card{
  width:100vw;
  height:100vh;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  display:grid;
  grid-template-rows:58px minmax(0,1fr);
  background:#02050a;
}
.app-panel.game-running .game-menu-note,
.app-panel.game-running .game-select,
.app-panel.game-running .game-help{display:none}
.app-panel.game-running .game-hud{
  min-height:58px;
  margin:0;
  padding:0 26px;
  background:#08111c;
  border-bottom:1px solid var(--line);
  font-size:18px;
}
.app-panel.game-running .game-stage{
  min-height:0;
  height:calc(100vh - 58px);
  border:0;
  border-radius:0;
}
.app-panel.game-running #gameCanvas{
  width:auto;
  height:auto;
  max-width:100vw;
  max-height:calc(100vh - 58px);
}
.app-panel.game-running .reaction-box{
  width:min(900px,86vw);
  height:min(480px,64vh);
}
.app-panel.game-running .game-board-2048{
  transform:scale(1.15);
}

@media (max-width:1350px){
  .channel-strip{grid-template-columns:repeat(5,minmax(0,1fr))}
  .tv-screen,.youtube-screen{height:calc(100vh - 155px)}
}


/* V7.1 TV landscape home: keep the launcher console-like even when WebView reports ~960 CSS px */
@media (min-width:760px) and (orientation:landscape){
  :root{
    --safe-x:clamp(28px,3.2vw,64px);
    --safe-y:clamp(18px,2.4vh,34px);
    --focus-ring:0 0 0 7px var(--focus),0 16px 36px rgba(0,0,0,.46);
  }

  body.tv-mode{overflow:hidden}
  .shell{
    height:100vh;
    min-height:0;
    padding:var(--safe-y) var(--safe-x) 18px;
    overflow:hidden;
  }

  .tv-header{
    min-height:96px;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:28px;
  }
  .brand-block .eyebrow{margin-bottom:4px;font-size:13px}
  h1{margin-bottom:4px;font-size:clamp(38px,4.8vw,62px)}
  .muted{font-size:clamp(15px,1.55vw,20px)}
  .header-status{min-width:310px;text-align:right}
  .clock{font-size:clamp(40px,4.5vw,58px)}
  .status-pills{margin-top:8px;gap:7px;justify-content:flex-end}
  .status-pill{min-height:32px;padding:5px 10px;font-size:13px}

  .apps-section{
    margin-top:12px;
    flex:0 0 auto;
    min-height:0;
  }
  .section-heading{
    min-height:30px;
    margin-bottom:10px;
    gap:18px;
  }
  .section-heading .eyebrow{font-size:13px}
  .remote-hint{font-size:13px}

  .app-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:clamp(14px,1.8vw,24px);
  }
  .app-card{
    height:clamp(220px,44vh,360px);
    min-height:0 !important;
    padding:20px 22px 18px;
    border-radius:24px;
  }
  .card-kicker{top:18px;left:21px;font-size:11px}
  .app-icon{
    position:static !important;
    margin-bottom:auto;
    padding-top:34px !important;
    font-size:clamp(54px,6vw,82px) !important;
  }
  .app-title{font-size:clamp(28px,3.35vw,46px)}
  .app-desc{margin-top:7px;font-size:clamp(14px,1.55vw,19px)}
  .card-action{margin-top:10px;font-size:11px}
  .app-card:focus{
    transform:scale(1.06);
    z-index:25;
  }

  .quick-actions{
    display:block !important;
    padding-top:14px;
  }
  .quick-label{display:none}
  .quick-buttons{
    width:100%;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:9px;
  }
  .quick-buttons .sys-btn{
    min-width:0;
    min-height:52px;
    padding:0 10px;
    border-radius:14px;
    font-size:clamp(12px,1.25vw,16px);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .quick-buttons .sys-btn small{
    display:block;
    margin:2px 0 0;
    font-size:10px;
  }

  /* Override the generic tablet breakpoint: Android TV is landscape-first, not one-column mobile. */
  .tv-header{grid-template-columns:minmax(0,1fr) auto !important}
  .header-status{text-align:right !important;min-width:310px !important}
  .status-pills{justify-content:flex-end !important}
  .app-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
  .quick-actions{align-items:stretch !important;flex-direction:row !important}
  .quick-buttons{justify-content:stretch !important}
}

@media (min-width:760px) and (orientation:landscape) and (max-height:620px){
  .shell{padding-top:14px;padding-bottom:12px}
  .tv-header{min-height:82px}
  .brand-block .eyebrow,.remote-hint{display:none}
  h1{font-size:38px}
  .clock{font-size:40px}
  .status-pill{font-size:12px}
  .apps-section{margin-top:8px}
  .section-heading{min-height:24px;margin-bottom:7px}
  .app-card{height:clamp(205px,42vh,250px);padding:16px 18px 14px}
  .card-kicker{top:14px;left:17px}
  .app-icon{padding-top:26px !important;font-size:52px !important}
  .app-title{font-size:28px}
  .app-desc{font-size:14px}
  .card-action{margin-top:7px}
  .quick-actions{padding-top:10px}
  .quick-buttons .sys-btn{min-height:46px;font-size:12px}
}

@media (max-width:759px), (orientation:portrait){
  .app-grid{grid-template-columns:1fr}
}


/* V7.2 HTML5 TV Game Hub */
.app-panel[data-app="game"] .panel-body{
  height:calc(100vh - 138px);
  padding-top:14px;
  padding-bottom:14px;
  overflow:hidden;
}
.html5-game-hub{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:12px;
}
.html5-game-header{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  padding:0 4px;
}
.html5-game-header>div:first-child{min-width:0}
.html5-kicker{
  margin:0 0 4px;
  color:var(--cyan);
  font-size:12px;
  font-weight:900;
  letter-spacing:.14em;
}
.html5-game-header h3{
  margin:0;
  font-size:clamp(25px,2.2vw,36px);
  line-height:1.05;
}
.html5-game-header p:not(.html5-kicker){
  margin:5px 0 0;
  color:var(--muted);
  font-size:clamp(12px,1.05vw,16px);
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.html5-controller{
  flex:0 0 auto;
  min-width:118px;
  min-height:56px;
  display:grid;
  grid-template-columns:auto auto;
  grid-template-rows:auto auto;
  align-items:center;
  column-gap:8px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#101a28;
  font-size:20px;
}
.html5-controller strong{font-size:15px}
.html5-controller span{
  grid-column:2;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
}
.html5-game-grid{
  min-height:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));
  gap:12px;
}
.html5-game-card{
  min-width:0;
  min-height:0;
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-rows:minmax(72px,44%) minmax(0,1fr);
  padding:0;
  border:2px solid rgba(255,255,255,.12);
  border-radius:20px;
  background:#101923;
  color:var(--text);
  text-align:left;
  transition:transform .11s ease,border-color .11s ease,background .11s ease;
}
.html5-game-card.featured::after{
  content:"GẦN ĐÂY";
  position:absolute;
  top:10px;
  right:10px;
  z-index:4;
  padding:4px 7px;
  border-radius:999px;
  background:rgba(0,0,0,.52);
  color:#fff;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
}
.html5-cover{
  min-height:0;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:linear-gradient(145deg,#26394c,#0d1620);
}
.html5-cover::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,transparent 45%,rgba(0,0,0,.34));
}
.html5-icon{
  position:relative;
  z-index:2;
  font-size:clamp(40px,4.2vw,68px);
  filter:drop-shadow(0 8px 14px rgba(0,0,0,.38));
}
.html5-badge{
  position:absolute;
  left:10px;
  bottom:8px;
  z-index:3;
  padding:4px 7px;
  border-radius:999px;
  background:rgba(0,0,0,.5);
  color:#fff;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
}
.html5-game-card[data-theme="racing"] .html5-cover{background:linear-gradient(145deg,#174b72,#12202d 55%,#3c2415)}
.html5-game-card[data-theme="survival"] .html5-cover{background:linear-gradient(145deg,#5c2433,#21131b 58%,#101722)}
.html5-game-card[data-theme="cyber"] .html5-cover{background:linear-gradient(145deg,#513576,#16243a 58%,#122023)}
.html5-game-card[data-theme="adventure"] .html5-cover{background:linear-gradient(145deg,#285641,#172d27 56%,#243928)}
.html5-game-card[data-theme="retro"] .html5-cover{background:linear-gradient(145deg,#7b3b31,#39243b 50%,#10253e)}
.html5-game-card[data-theme="temple"] .html5-cover{background:linear-gradient(145deg,#78643d,#2f2b28 55%,#17232d)}
.html5-game-card[data-theme="rpg"] .html5-cover{background:linear-gradient(145deg,#56382e,#25202c 55%,#162231)}
.html5-info{
  min-height:0;
  display:flex;
  flex-direction:column;
  padding:10px 12px 9px;
}
.html5-info strong{
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:clamp(15px,1.35vw,21px);
  line-height:1.1;
}
.html5-genre{
  margin-top:3px;
  color:var(--cyan);
  font-size:10px;
  font-weight:850;
}
.html5-desc{
  margin-top:5px;
  color:#aebed0;
  font-size:clamp(10px,.9vw,13px);
  line-height:1.22;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.html5-play{
  margin-top:auto;
  padding-top:5px;
  color:var(--focus);
  font-size:9px;
  font-weight:900;
  letter-spacing:.07em;
}
.html5-game-card:focus{
  border-color:var(--focus)!important;
  box-shadow:0 0 0 6px var(--focus),0 18px 36px rgba(0,0,0,.5);
  transform:scale(1.045);
  background:#172536;
  z-index:15;
}
@media (min-width:760px) and (orientation:landscape) and (max-height:620px){
  .app-panel[data-app="game"] .panel-body{height:calc(100vh - 120px);padding-top:8px;padding-bottom:8px}
  .html5-game-hub{gap:8px}
  .html5-game-header{min-height:52px}
  .html5-game-header h3{font-size:24px}
  .html5-game-header p:not(.html5-kicker){font-size:11px}
  .html5-controller{min-height:46px}
  .html5-game-grid{gap:8px}
  .html5-game-card{border-radius:16px;grid-template-rows:minmax(58px,42%) minmax(0,1fr)}
  .html5-icon{font-size:38px}
  .html5-info{padding:7px 9px 6px}
  .html5-info strong{font-size:14px}
  .html5-desc{font-size:9px}
}
@media (max-width:759px), (orientation:portrait){
  .app-panel[data-app="game"] .panel-body{height:auto;overflow:auto}
  .html5-game-hub{height:auto;display:block}
  .html5-game-header{margin-bottom:12px}
  .html5-game-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none}
  .html5-game-card{min-height:220px}
}
