:root {
  color-scheme: light;
  --page: #f0f4fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #778196;
  --line: #e8edf5;
  --navy: #080d22;
  --accent: #dc3545;
  --soft: #f8fafd;
}

* { box-sizing: border-box; }
/* Loại bỏ viền/tô sáng mặc định của trình duyệt khi chạm các nút trên điện thoại. */
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus, a:focus, [role="button"]:focus,
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: none !important;
  box-shadow: none;
}
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.site-header {
  width: min(100% - 30px, 920px);
  min-height: 66px;
  margin: 18px auto 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(28, 43, 72, .035);
}
.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 3px 10px rgba(8,13,34,.16), inset 0 -2px 0 rgba(220,53,69,.65);
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.brand-copy { min-width: 0; }
.brand-name { font-size: 14px; font-weight: 850; letter-spacing: .045em; line-height: 1.25; }
.brand-name span { color: var(--accent); }
.brand-subtitle { margin-top: 3px; font-size: 11px; color: var(--muted); }
.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #687286;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #25ad74; box-shadow: 0 0 0 3px rgba(37,173,116,.11); }
.page-shell { width: min(100% - 30px, 920px); margin: 0 auto; }
.list-intro { padding: 25px 4px 17px; }
.eyebrow { color: #8791a5; font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.list-intro h1 { margin: 7px 0 5px; color: #0d1427; font-size: clamp(22px, 5vw, 28px); line-height: 1.15; letter-spacing: -.045em; font-weight: 800; }
.list-intro p { margin: 0; color: #7d879a; font-size: 12px; line-height: 1.55; }
.resource-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.resource-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 6px 20px rgba(30, 48, 82, .04);
  animation: card-in .22s ease-out both;
  transition: transform .16s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.resource-card:hover { transform: translateY(-1px); }
.resource-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-icon-wrap { width: 56px; height: 56px; flex: 0 0 56px; position: relative; overflow: hidden; border-radius: 15px; background: #f0f2f7; box-shadow: 0 3px 8px rgba(14,25,52,.11); }
.app-icon { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: #101629; color: #fff; font-weight: 900; font-size: 24px; }
.app-fallback[hidden] { display: none; }
.resource-heading { min-width: 0; flex: 1; }
.resource-title { margin: 0; overflow-wrap: anywhere; color: #151b2b; font-size: 15px; font-weight: 800; letter-spacing: -.018em; line-height: 1.28; }
.resource-subline { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: #8a93a5; font-size: 9px; line-height: 1.3; }
.category-chip, .file-chip { max-width: 100%; padding: 4px 7px; border-radius: 6px; background: #f4f6fa; color: #657086; font-size: 8px; line-height: 1; font-weight: 800; letter-spacing: .035em; overflow-wrap: anywhere; }
.file-chip { background: #fff0f1; color: #c72b3d; }
.available-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid #dcefe6; border-radius: 7px; color: #28835f; font-size: 8px; line-height: 1; font-weight: 850; letter-spacing: .03em; white-space: nowrap; }
.available-chip::before { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; background: #2caa78; }
.metadata-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.meta-box { min-width: 0; min-height: 49px; padding: 9px 8px 8px; background: #f8fafd; border: 1px solid #f3f5f9; border-radius: 10px; }
.meta-label { display: block; margin-bottom: 5px; color: #929bad; font-size: 8px; line-height: 1.1; letter-spacing: .035em; }
.meta-value { display: block; overflow: hidden; color: #30394b; font-size: 10px; line-height: 1.25; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.info-panel { margin-top: 11px; padding: 12px; border: 1px solid #f0f3f8; border-radius: 12px; background: #f9fafc; }
.info-label { margin-bottom: 6px; color: #8b95a7; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.info-text { margin: 0; color: #586276; font-size: 11px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.info-panel.requirements { background: #fff; max-width: 72%; }
.download-row { margin-top: 13px; display: flex; flex-wrap: nowrap; gap: 9px; align-items: center; width: 100%; }
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  flex: 1 1 294px;
  min-height: 43px;
  cursor: pointer;
  font-family: inherit;
  padding: 11px 16px;
  border: 1px solid var(--navy);
  border-radius: 12px;
  background: var(--navy);
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 9px rgba(8,13,34,.09);
  transition: transform .14s ease, background-color .14s ease;
}
.download-btn:hover { background: #1b2544; }
.download-btn:active { transform: scale(.985); }
.download-btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.download-btn.disabled { background: #939aab; border-color: #939aab; pointer-events: none; }
.getkey-btn { display: inline-flex; flex: 0 0 auto; min-width: 98px; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 11px 15px; border: 1px solid #d8deeb; border-radius: 12px; background: #fff; color: #18213a; text-decoration: none; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; appearance: none; -webkit-appearance: none; -webkit-tap-highlight-color: transparent; transition: background-color .14s ease, transform .14s ease; }
.getkey-btn:hover { background: #f2f5fb; border-color: #abb8d0; }
.getkey-btn:active { transform: scale(.985); }
.unavailable-chip { color: #8a93a5; border-color: #e8edf5; }
.download-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(10,15,30,.62);
  opacity: 1;
  isolation: isolate;
  contain: paint;
  -webkit-tap-highlight-color: transparent;
}
.download-modal-backdrop[hidden] { display: none; }
.download-modal-backdrop.is-opening { animation: modal-fade-in .18s ease-out both; }
.download-modal-backdrop.is-closing { animation: modal-fade-out .16s ease-in both; pointer-events: none; }
.download-modal {
  position: relative;
  width: min(100%, 510px);
  max-height: min(88vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(4,10,25,.22);
  transform: translate3d(0,0,0);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.download-modal-backdrop.is-opening .download-modal { animation: modal-enter .22s cubic-bezier(.2,.75,.25,1) both; }
.download-modal-backdrop.is-closing .download-modal { animation: modal-exit .16s ease-in both; }
.modal-close { position: absolute; top: 12px; right: 13px; display: grid; place-items: center; width: 35px; height: 35px; border: 0; border-radius: 10px; background: #f0f3f8; color: #4c566c; font-size: 25px; line-height: 1; cursor: pointer; }
.modal-kicker { margin: 0 42px 15px 0; color: #8791a5; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.modal-app-heading { display: flex; align-items: center; gap: 12px; padding-right: 25px; margin-bottom: 15px; min-width: 0; }
.modal-app-icon { width: 54px; height: 54px; flex: 0 0 54px; overflow: hidden; border-radius: 13px; background: #eef2f8; }
.modal-app-icon .app-icon, .modal-app-icon .app-fallback { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.modal-app-copy { min-width: 0; }
.modal-app-heading h2 { margin: 0; color: #171e30; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.modal-app-heading p { margin: 5px 0 0; color: #8791a5; font-size: 11px; }
.modal-image-frame { position: relative; width: 100%; height: clamp(125px, 42vw, 220px); margin: 12px 0 16px; overflow: hidden; border-radius: 13px; border: 1px solid #eef1f6; background: #f8fafd; }
.modal-detail-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.modal-detail-image[hidden] { display: none; }
.modal-image-fallback { width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; color: #8791a5; font-size: 12px; text-align: center; }
.modal-image-fallback[hidden] { display: none; }
.modal-info-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid #edf0f5; border-bottom: 1px solid #edf0f5; color: #7d879a; font-size: 11px; }
.modal-info-row strong { color: #283249; text-align: right; }
.modal-info-block { margin-top: 13px; padding: 12px; border: 1px solid #edf0f5; border-radius: 12px; background: #f9fafc; }
.modal-info-block p { margin: 0; color: #586276; font-size: 12px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.modal-question { margin-top: 18px; color: #222b40; font-size: 13px; font-weight: 750; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions button { flex: 1; min-height: 43px; padding: 10px 12px; border-radius: 11px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.modal-cancel { border: 1px solid #e3e7ef; background: #fff; color: #616c82; }
.modal-confirm { border: 1px solid #080d22; background: #080d22; color: #fff; }
.modal-confirm:disabled { opacity: .5; cursor: not-allowed; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-enter { from { opacity: 0; transform: translate3d(0,10px,0) scale(.985); } to { opacity: 1; transform: translate3d(0,0,0) scale(1); } }
@keyframes modal-exit { from { opacity: 1; transform: translate3d(0,0,0) scale(1); } to { opacity: 0; transform: translate3d(0,6px,0) scale(.99); } }
.site-footer { padding: 18px 0 25px; color: #8b95a7; text-align: center; font-size: 10px; }
.footer-separator { padding: 0 5px; color: #c0c7d3; }
.state-panel { display: flex; min-height: 120px; align-items: center; justify-content: center; gap: 10px; padding: 20px; border: 1px solid #fff; border-radius: 18px; background: #fff; color: #788398; font-size: 12px; }
.state-panel.error { color: #bd3040; }
.loader { width: 17px; height: 17px; border: 2px solid #e5e9f1; border-top-color: #101629; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 700px) {
  .site-header { margin-top: 24px; padding: 12px 18px; }
  .page-shell { width: min(100% - 48px, 920px); }
  .list-intro { padding-top: 30px; padding-bottom: 19px; }
  .resource-card { padding: 18px; border-radius: 23px; }
  .resource-title { font-size: 17px; }
  .app-icon-wrap { width: 60px; height: 60px; flex-basis: 60px; }
  .meta-box { padding: 10px 11px; }
  .meta-label { font-size: 9px; }
  .meta-value { font-size: 11px; }
  .info-text { font-size: 12px; }
}
@media (max-width: 380px) {
  .site-header, .page-shell { width: calc(100% - 20px); }
  .resource-card { padding: 12px; border-radius: 18px; }
  .app-icon-wrap { width: 48px; height: 48px; flex-basis: 48px; border-radius: 12px; }
  .resource-title { font-size: 13px; }
  .available-chip { padding: 4px 5px; font-size: 7px; }
  .metadata-grid { gap: 5px; }
  .meta-box { min-height: 46px; padding: 8px 6px; }
  .meta-label { font-size: 7px; }
  .meta-value { font-size: 9px; }
  .info-panel.requirements { max-width: 100%; }
  .download-btn { width: auto; min-width: 0; flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .getkey-btn { flex: 0 0 98px; padding-left: 10px; padding-right: 10px; }
  .download-modal { padding: 20px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== TTCHEAT detail polish: mostly composited transforms/opacity for mobile ===== */
body {
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(220, 53, 69, .055), transparent 32%),
    radial-gradient(ellipse at 100% 18%, rgba(64, 92, 150, .07), transparent 29%),
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 38%);
}
.site-header {
  position: relative;
  overflow: hidden;
  border-color: rgba(255,255,255,.98);
  box-shadow: 0 7px 22px rgba(28, 43, 72, .055), 0 1px 0 rgba(255,255,255,.9) inset;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #e78b94 36%, #d9dfed 72%, transparent);
  opacity: .75;
  pointer-events: none;
}
.brand-mark { position: relative; overflow: hidden; }
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -30% auto -30% -65%;
  width: 42%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
  animation: brand-glint 1s ease-out .35s both;
  pointer-events: none;
}
@keyframes brand-glint {
  from { transform: translateX(0) skewX(-22deg); }
  to { transform: translateX(430%) skewX(-22deg); }
}
.status-dot { position: relative; }
.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(37,173,116,.5);
  border-radius: 50%;
  animation: status-ring 2.8s ease-out 1.2s infinite;
  pointer-events: none;
}
@keyframes status-ring {
  0% { transform: scale(.7); opacity: .7; }
  100% { transform: scale(1.8); opacity: 0; }
}
.list-intro h1 { position: relative; }
.list-intro h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 11px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, #ee8b94 58%, #e7ebf3 100%);
}
.resource-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255,255,255,.98);
  box-shadow: 0 6px 20px rgba(30, 48, 82, .045), 0 1px 0 rgba(255,255,255,.95) inset;
  transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease;
}
.resource-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 16px;
  width: 34%;
  height: 3px;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, var(--accent), #eea1a8, rgba(238,161,168,0));
  transform-origin: left center;
  transition: width .22s ease, opacity .22s ease;
  opacity: .78;
  pointer-events: none;
}
.meta-box { transition: border-color .16s ease, background-color .16s ease; }
.app-icon-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 24%, rgba(255,255,255,.3) 48%, transparent 70%);
  transform: translateX(-125%);
  pointer-events: none;
}
.download-btn, .getkey-btn { position: relative; overflow: hidden; }
.download-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.17) 48%, transparent 72%);
  transform: translateX(-125%);
  pointer-events: none;
}
.getkey-btn { border-color: #e1e5ef; box-shadow: 0 3px 8px rgba(8,13,34,.025); }
.getkey-btn span { display: inline-block; transition: transform .16s ease; }
.modal-confirm, .modal-cancel, .modal-close { transition: transform .14s ease, background-color .14s ease; }
.back-to-top {
  position: fixed;
  z-index: 900;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 15px;
  background: var(--navy);
  color: white;
  box-shadow: 0 8px 22px rgba(8,13,34,.2);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0,8px,0) scale(.96);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top svg { width: 19px; height: 19px; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translate3d(0,0,0) scale(1); pointer-events: auto; }
.back-to-top:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .resource-card:hover {
    transform: translateY(-2px);
    border-color: #e5eaf3;
    box-shadow: 0 12px 28px rgba(30,48,82,.085), 0 1px 0 #fff inset;
  }
  .resource-card:hover::before { width: calc(100% - 32px); opacity: 1; }
  .meta-box:hover { background: #fff; border-color: #e5eaf4; }
  .app-icon-wrap:hover::after { animation: icon-glint .55s ease-out both; }
  .download-btn:hover::after { animation: button-glint .55s ease-out both; }
  .getkey-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(8,13,34,.07); }
  .getkey-btn:hover span { transform: translate(2px,-1px); }
  .modal-confirm:hover { background: #1b2544; }
  .modal-cancel:hover, .modal-close:hover { background: #e9edf5; }
}
@keyframes icon-glint {
  from { transform: translateX(-125%); }
  to { transform: translateX(125%); }
}
@keyframes button-glint {
  from { transform: translateX(-125%); }
  to { transform: translateX(125%); }
}
@media (max-width: 380px) {
  .back-to-top { width: 41px; height: 41px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark::after, .status-dot::after { animation: none !important; }
  .resource-card, .resource-card::before, .app-icon-wrap::after, .download-btn::after,
  .getkey-btn, .getkey-btn span, .back-to-top { transition: none !important; }
}
