/*
 * Night Theater C-end H5 · shared styles
 * Android 4.4 · 640x480 landscape · no external fonts/CDN.
 * Uses only widely-supported CSS (float/absolute). No grid/flex/var()/calc.
 *
 * Type ramp (the only sizes allowed): 13 15 16 18 22 26  (12 = badges only)
 * Target ramp: every OK-activatable control is >= 44px tall (40 for .nt-btn-sm,
 * video HUD pads). The device has no pointer, so focus visibility is a
 * first-order requirement: .nt-focus must stay paint-cheap (outline only).
 */

* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0d0d10;
  color: #eee;
  font: 15px/1.45 Arial, Helvetica, "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

/* Real-device hedge: if the browser chrome eats height, never clip the nav. */
html.nt-small, html.nt-small body { overflow: auto; }

/* Fixed 640x480 stage, centred both ways WITHOUT a CSS transform - a transform
   would black out the Android 4.4 native video surface. The shell's native page
   zoom fits the width; on a 1:1 screen the 4:3 surplus is split top/bottom
   instead of piling up under the content. Background matches html/body so the
   surplus reads as page, not a black band. */
#stage {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-left: auto;
  margin-right: auto;
  margin-top: -240px;
  width: 640px;
  height: 480px;
  background: #0d0d10;
  overflow: hidden;
}

/* Scrollable content area (leaves room for the bottom nav). */
.scroll {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 48px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
}
.scroll.no-nav { bottom: 0; }

/* ---------- Top bar ---------- */
.topbar {
  height: 48px;
  line-height: 48px;
  margin: -12px -14px 12px;
  padding: 0 12px;
  background: #16161c;
  border-bottom: 1px solid #26262e;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}
.topbar .back {
  float: left;
  color: #9ecbff;
  font-weight: normal;
  font-size: 18px;
  padding: 0 12px 0 4px;
  margin: 0 4px 0 -4px;
  cursor: pointer;
}
.topbar .tb-title { float: left; }
.topbar .tb-right { float: right; font-size: 13px; color: #bbb; font-weight: normal; }

/* ---------- Generic buttons ---------- */
.nt-btn {
  display: inline-block;
  height: 44px;
  line-height: 44px;
  padding: 0 18px;
  margin: 0 8px 0 0;
  border: 1px solid #4a4a55;
  border-radius: 5px;
  background: #23232b;
  color: #eee;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.nt-btn-primary {
  border-color: #ff3d7f;
  background: #d21f5c;
  color: #fff;
  font-weight: bold;
}
.nt-btn-gold { border-color: #b8860b; background: #6b4e00; color: #ffd766; }
.nt-btn-block { display: block; width: 100%; margin: 0 0 8px; box-sizing: border-box; }
.nt-btn[disabled], .nt-btn.disabled { opacity: .45; }
.nt-btn-sm { height: 40px; line-height: 40px; padding: 0 12px; font-size: 15px; }

/* ---------- Bottom nav ---------- */
#nt-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: #141419;
  border-top: 1px solid #2a2a33;
  z-index: 20;
}
.nt-nav-item {
  float: left;
  width: 160px;
  height: 48px;
  text-align: center;
  color: #9a9aa5;
  text-decoration: none;
  font-size: 13px;
  line-height: 18px;
}
.nt-nav-item .nt-nav-ic { display: block; font-size: 22px; line-height: 26px; margin-top: 4px; }
.nt-nav-item.on { color: #ff5c8a; border-top: 3px solid #ff3d7f; height: 45px; }

/* ---------- Cards / grids ---------- */
/* 3 columns x 204px = the full 612px content width. Whole pixels only:
   Android 4.4 rounds fractional float widths inconsistently and wraps. */
.grid2 { overflow: hidden; }
.card {
  background: #17171d;
  border: 1px solid #26262e;
  border-radius: 6px;
  overflow: hidden;
}
.cover {
  width: 100%;
  height: 0;
  padding-bottom: 75%; /* 4:3 */
  background: #23232b center center no-repeat;
  background-size: cover;
  position: relative;
}
.cover .ph {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  text-align: center; line-height: 140px;
  font-size: 26px; font-weight: bold; color: #3a3a44;
}
.cover.nt-img-on .ph { display: none; }
.cover .badge {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; padding: 3px 6px; border-radius: 3px;
}
.cover .badge.free { background: #1f7a3d; }
.cover .badge.lock { background: #7a1f3d; }
.card .meta { padding: 7px 8px 9px; }
.card .meta .t {
  font-size: 15px; color: #eee; font-weight: bold;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .meta .s { font-size: 13px; color: #8a8a95; margin-top: 3px; }

/* poster item (float grid) */
.poster {
  float: left;
  width: 204px;
  padding: 0 4px 10px;
  box-sizing: border-box;
}
.poster .card { cursor: pointer; }

/* ---------- Lists ---------- */
.list-item {
  overflow: hidden;
  padding: 10px 2px;
  border-bottom: 1px solid #26262e;
}
.list-item .li-cover {
  float: left; width: 96px; height: 72px;
  background: #23232b center center no-repeat; background-size: cover;
  border-radius: 4px; margin-right: 10px;
}
.list-item .li-body { overflow: hidden; }
.list-item .li-title { font-size: 15px; color: #eee; font-weight: bold; }
.list-item .li-sub { font-size: 13px; color: #8a8a95; margin-top: 4px; }
.list-item .li-right { float: right; text-align: right; color: #8a8a95; font-size: 13px; }
/* Own line + 12px padding = a 44px band a D-pad can actually land on. */
.li-del {
  display: block; text-align: right;
  padding: 12px 8px; margin: 4px -8px -8px 0;
  color: #ff6b6b; font-size: 15px; cursor: pointer;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #9a9aa5; margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; line-height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  background: #1c1c22; border: 1px solid #3a3a44; border-radius: 5px;
  color: #eee; font-size: 16px;
}
.field input:focus { border-color: #ff3d7f; outline: 2px solid #ff3d7f; }
.field.rel { position: relative; }
.form-err { color: #ff6b6b; font-size: 13px; min-height: 18px; margin: -6px 0 10px; }

/* ---------- Section headers ---------- */
.sec-h {
  font-size: 16px; font-weight: bold; color: #fff; margin: 14px 0 8px;
  border-left: 4px solid #ff3d7f; padding-left: 8px; line-height: 20px;
}
.sec-h:first-child { margin-top: 2px; }
.muted { color: #8a8a95; font-size: 13px; }
.center { text-align: center; }
.pill {
  display: inline-block; padding: 12px 14px; margin: 0 8px 8px 0;
  border: 1px solid #33333c; border-radius: 16px;
  background: #1c1c22; color: #bbb; font-size: 15px; cursor: pointer;
  box-sizing: border-box;
}
.pill.on { border-color: #ff3d7f; background: #3a1526; color: #ff8fb0; }

/* ---------- Tabs ---------- */
.tabs { overflow: hidden; margin: 0 0 12px; border-bottom: 1px solid #26262e; }
.tab {
  float: left; width: 50%; text-align: center;
  height: 44px; line-height: 44px; color: #9a9aa5; font-size: 15px; cursor: pointer;
}
.tab.on { color: #ff5c8a; border-bottom: 3px solid #ff3d7f; font-weight: bold; }

/* ---------- Asset summary ---------- */
.asset {
  overflow: hidden; padding: 12px; margin-bottom: 12px;
  background: linear-gradient(135deg,#241a2e,#16161c);
  border: 1px solid #2c2c36; border-radius: 8px;
}
.asset .coins { font-size: 26px; font-weight: bold; color: #ffd766; }
.asset .coins small { font-size: 13px; color: #b9a15a; font-weight: normal; margin-left: 4px; }
.asset .vip { font-size: 13px; color: #cbb2ff; margin-top: 4px; }

/* ---------- Empty / loading states ---------- */
.empty { text-align: center; color: #8a8a95; padding: 36px 20px; font-size: 15px; }
.empty .ic { display: block; font-size: 26px; color: #3a3a44; margin-bottom: 6px; }
.retry { margin-top: 14px; }

/* ---------- Toast ---------- */
.nt-toast {
  position: absolute; left: 50%; bottom: 70px;
  -webkit-transform: translateX(-50%); transform: translateX(-50%);
  max-width: 80%;
  background: rgba(0,0,0,.86); color: #fff;
  padding: 10px 14px; border-radius: 6px; font-size: 15px;
  z-index: 90; display: none; text-align: center;
}

/* ---------- Modal ---------- */
.nt-modal { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 100; }
.nt-modal-mask { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.72); }
.nt-modal-box {
  position: absolute; left: 50%; top: 50%;
  width: 380px; margin: -110px 0 0 -190px;
  background: #1b1b22; border: 1px solid #33333c; border-radius: 10px;
  padding: 18px 18px 14px; box-sizing: border-box;
}
.nt-modal-title { font-size: 18px; font-weight: bold; color: #fff; margin-bottom: 10px; text-align: center; }
.nt-modal-body { font-size: 15px; color: #eee; margin-bottom: 16px; }
.nt-modal-body p { margin: 0 0 8px; }
.nt-modal-actions { text-align: center; }
.nt-modal-actions .nt-btn { float: none; margin: 0 5px; }

/* price line inside unlock modal */
.price-line { text-align: center; font-size: 22px; color: #ffd766; font-weight: bold; margin: 6px 0 2px; }
.price-line small { font-size: 13px; color: #b9a15a; font-weight: normal; }
.vip-note { text-align: center; font-size: 13px; color: #cbb2ff; margin-bottom: 6px; }

/* ---------- Loading spinner ---------- */
.nt-loading { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 95; background: rgba(0,0,0,.35); display: none; }
.nt-spinner {
  position: absolute; left: 50%; top: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid #3a3a44; border-top-color: #ff3d7f; border-radius: 50%;
  -webkit-animation: nt-spin 1s linear infinite; animation: nt-spin 1s linear infinite;
}
@-webkit-keyframes nt-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes nt-spin { to { transform: rotate(360deg); } }

/* ---------- Portal app cards ---------- */
.app-card {
  overflow: hidden; margin-bottom: 12px; padding: 14px;
  background: #17171d; border: 1px solid #26262e; border-radius: 10px; cursor: pointer;
}
.app-card .app-ic {
  float: left; width: 56px; height: 56px; border-radius: 12px; margin-right: 12px;
  background: #2a2a33 center center no-repeat; background-size: cover;
  text-align: center; line-height: 56px; font-size: 26px; color: #fff;
}
.app-card .app-body { overflow: hidden; padding-top: 4px; }
.app-card .app-name { font-size: 18px; font-weight: bold; color: #fff; }
.app-card .app-sub { font-size: 13px; color: #8a8a95; margin-top: 4px; }
.brand { text-align: center; padding: 18px 0 8px; }
.brand .logo { font-size: 26px; font-weight: bold; color: #fff; letter-spacing: 1px; }
.brand .logo em { color: #ff5c8a; font-style: normal; }
.brand .tag { font-size: 12px; color: #6a6a75; letter-spacing: 3px; margin-top: 4px; }

/* ---------- Focus ring (the only pointer on this device) ----------
   outline costs no layout and no compositing layer, which is what makes it
   affordable on a Cortex-A9. box-shadow / filter / transform are banned here. */
.nt-focus { outline: 3px solid #ffffff; }
#stage .nt-focus, #nt-modal .nt-focus { border-color: #ff3d7f; }
/* Over the video the white ring alone can vanish into a bright frame. */
#stage .nt-focus.nt-focus-pad { background: #3a1526; }
