/*
Theme Name: Tro Choi Mien Phi
Theme URI: https://trochoimienphi.org
Author: TroChoiMienPhi.org
Description: Giao diện cổng trò chơi trực tuyến tối ưu cho máy tính và điện thoại.
Version: 1.5.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: trochoimienphi
*/

:root {
  --tmf-bg: #080913;
  --tmf-panel: #111321;
  --tmf-panel-2: #181a2b;
  --tmf-text: #f7f7fb;
  --tmf-muted: #9da1b5;
  --tmf-purple: #7357ff;
  --tmf-cyan: #27d7ce;
  --tmf-pink: #ff4f8b;
  --tmf-border: rgba(255,255,255,.08);
  --tmf-shadow: 0 20px 70px rgba(0,0,0,.36);
  --tmf-radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% -10%, rgba(115,87,255,.15), transparent 32rem),
    var(--tmf-bg);
  color: var(--tmf-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }

.tmf-shell { min-height: 100vh; padding-left: 76px; }
.tmf-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: 76px; padding: 12px;
  background: rgba(13,14,26,.96); border-right: 1px solid var(--tmf-border);
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  overflow:hidden; backdrop-filter: blur(20px); transition:width .24s ease, transform .24s ease;
}
.tmf-sidebar.is-expanded { width:260px; box-shadow:24px 0 60px rgba(0,0,0,.38); }
.tmf-sidebar-scroll { min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:none; }
.tmf-sidebar-scroll::-webkit-scrollbar { display:none; }
.tmf-sidebar-group { display:flex; flex-direction:column; gap:5px; }
.tmf-sidebar-separator { height:1px; margin:10px 6px; background:var(--tmf-border); }
.tmf-sidebar-categories { padding-bottom:12px; }
.tmf-sidebar-backdrop { display:none; }
.tmf-sidebar-toggle { flex:0 0 46px; margin-bottom:2px; }
.tmf-side-icon {
  flex:0 0 30px; width:30px; height:30px; display:grid; place-items:center;
  font-size:19px; line-height:1; text-align:center;
}
.tmf-side-label {
  min-width:0; max-width:0; opacity:0; overflow:hidden; white-space:nowrap;
  font-size:13px; font-weight:800; transition:max-width .2s ease, opacity .16s ease;
}
.tmf-sidebar.is-expanded .tmf-side-label { max-width:174px; opacity:1; }
.tmf-sidebar.is-expanded .tmf-side-link { gap:11px; }
.tmf-sidebar.is-expanded .tmf-sidebar-toggle { color:#fff; }
.tmf-sidebar.is-expanded .tmf-sidebar-toggle .tmf-side-icon { transform:none; }
.tmf-sidebar-toggle .tmf-side-icon { transition:transform .22s ease; }
.tmf-sidebar-categories .tmf-side-icon { font-size:17px; }
.tmf-sidebar-categories .tmf-side-link { min-height:42px; height:42px; }
.tmf-sidebar-categories .tmf-side-label { color:#c0c3d3; font-weight:700; }
.tmf-sidebar-categories .tmf-side-link:hover .tmf-side-label { color:#fff; }
.tmf-sidebar .tmf-side-link:focus-visible { outline:2px solid var(--tmf-purple); outline-offset:-2px; }
.tmf-sidebar .tmf-side-link[aria-expanded="true"] { background:#24273c; color:#fff; }
body.tmf-menu-open { overflow:hidden; }
.tmf-brand-mark {
  width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center; object-fit: contain; padding: 3px;
  background: linear-gradient(145deg, var(--tmf-purple), #9e63ff);
  box-shadow: 0 10px 28px rgba(115,87,255,.42);
}
.tmf-side-link {
  width: 100%; height: 46px; min-height:46px; padding:0 10px; border: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content:flex-start;
  color: #a8abbe; background: transparent; font-family: inherit; cursor: pointer; transition: .2s ease; position: relative;
}
.tmf-side-link:hover, .tmf-side-link.is-active { color: white; background: #24273c; }
.tmf-side-link.is-active::before { content:""; position:absolute; left:-12px; width:4px; height:24px; border-radius:0 6px 6px 0; background:var(--tmf-purple); }

.tmf-header {
  position: sticky; top: 0; z-index: 50; height: 74px; padding: 0 28px;
  display: grid; grid-template-columns: minmax(180px, 310px) minmax(260px, 620px) auto;
  align-items: center; gap: 24px;
  background: rgba(11,12,23,.88); border-bottom: 1px solid var(--tmf-border); backdrop-filter: blur(22px);
}
.tmf-logo { display:flex; align-items:center; gap:12px; font-size:19px; font-weight:900; letter-spacing:-.04em; white-space:nowrap; }
.tmf-logo small { color:var(--tmf-cyan); font-size:11px; display:block; letter-spacing:.14em; text-transform:uppercase; margin-top:2px; }
.tmf-search { position:relative; }
.tmf-search input {
  width:100%; height:46px; border:1px solid transparent; outline:0; border-radius:16px;
  color:white; background:#24263a; padding:0 52px 0 19px;
  transition:.2s ease;
}
.tmf-search input:focus { border-color:rgba(115,87,255,.85); box-shadow:0 0 0 4px rgba(115,87,255,.13); background:#2a2c43; }
.tmf-search button { position:absolute; right:6px; top:6px; width:34px; height:34px; border:0; border-radius:11px; background:transparent; color:#b4b6c7; cursor:pointer; }
.tmf-search-results { position:absolute; top:53px; left:0; right:0; z-index:80; display:none; max-height:430px; overflow:auto; padding:8px; border:1px solid var(--tmf-border); border-radius:16px; background:#171929; box-shadow:var(--tmf-shadow); }
.tmf-search-results.is-visible { display:block; }
.tmf-search-results a { display:grid; grid-template-columns:54px 1fr; gap:11px; align-items:center; padding:8px; border-radius:11px; }
.tmf-search-results a:hover { background:#24273c; }
.tmf-search-results img { width:54px; height:42px; border-radius:9px; object-fit:cover; }
.tmf-search-results span span, .tmf-search-results a > span { display:flex; flex-direction:column; min-width:0; }
.tmf-search-results strong { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tmf-search-results small { margin-top:3px; color:var(--tmf-muted); font-size:11px; }
.tmf-search-empty { display:block; padding:18px; color:var(--tmf-muted); text-align:center; }
.tmf-header-actions { display:flex; align-items:center; gap:10px; justify-content:flex-end; }
.tmf-pill-button { border:1px solid var(--tmf-border); border-radius:14px; background:#202237; color:white; padding:11px 16px; font-weight:750; cursor:pointer; transition:.2s ease; }
.tmf-pill-button:hover { background:#2b2e49; transform:translateY(-1px); }
.tmf-pill-button.is-primary { background:var(--tmf-purple); border-color:transparent; box-shadow:0 10px 28px rgba(115,87,255,.24); }
.tmf-mobile-menu { display:none; }

.tmf-main { padding: 24px 28px 54px; max-width: 1720px; margin: 0 auto; }
.tmf-home-intro { margin:2px 0 18px; }
.tmf-home-intro h1 { margin:0; font-size:clamp(25px,3vw,38px); letter-spacing:-.055em; }
.tmf-home-intro p { margin:7px 0 0; color:var(--tmf-muted); font-size:14px; }
.tmf-chips { display:flex; gap:10px; overflow:auto; padding-bottom:8px; scrollbar-width:none; }
.tmf-chips::-webkit-scrollbar { display:none; }
.tmf-chip { flex:0 0 auto; border:1px solid var(--tmf-border); background:#161829; color:#c9cbda; border-radius:999px; padding:10px 15px; cursor:pointer; font-weight:750; transition:.2s ease; }
.tmf-chip:hover, .tmf-chip.is-active { color:white; border-color:transparent; background:linear-gradient(135deg,var(--tmf-purple),#9061ff); box-shadow:0 8px 24px rgba(115,87,255,.2); }

.tmf-topics { display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); gap:12px; margin-top:18px; overflow:auto; scrollbar-width:none; }
.tmf-topics::-webkit-scrollbar { display:none; }
.tmf-topic { min-height:112px; position:relative; overflow:hidden; border-radius:16px; padding:18px; display:flex; flex-direction:column; justify-content:flex-end; isolation:isolate; border:1px solid rgba(255,255,255,.05); transition:.22s ease; }
.tmf-topic:hover { transform:translateY(-3px); box-shadow:0 16px 34px rgba(0,0,0,.26); }
.tmf-topic::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(0deg,rgba(7,8,15,.85),rgba(7,8,15,.04)); }
.tmf-topic img { position:absolute; inset:0; z-index:-2; width:100%; height:100%; object-fit:cover; filter:saturate(1.1); }
.tmf-topic span { font-size:11px; color:rgba(255,255,255,.76); font-weight:800; }
.tmf-topic b { font-size:15px; margin-top:3px; letter-spacing:-.025em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tmf-topic-1 { background:linear-gradient(130deg,#145d78,#24295b); }
.tmf-topic-2 { background:linear-gradient(130deg,#8b2d66,#3c1a57); }
.tmf-topic-3 { background:linear-gradient(130deg,#1c7772,#22485e); }
.tmf-topic-4 { background:linear-gradient(130deg,#79572b,#3a2431); }
.tmf-topic-5 { background:linear-gradient(130deg,#4c6f2b,#183f47); }
.tmf-showcase { margin-top:18px; min-height:128px; padding:22px 26px; border:1px solid var(--tmf-border); border-radius:20px; display:flex; align-items:center; justify-content:space-between; gap:24px; background:linear-gradient(100deg,#1d2344,#15172a 60%,#202047); box-shadow:inset 0 1px rgba(255,255,255,.04); }
.tmf-showcase-copy { display:flex; flex-direction:column; gap:6px; }
.tmf-showcase-copy strong { font-size:25px; line-height:1.05; letter-spacing:-.055em; }
.tmf-showcase-copy small { color:var(--tmf-muted); font-size:12px; }
.tmf-showcase-pills { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.tmf-showcase-pills span { padding:10px 13px; border-radius:12px; color:#d5d7e3; font-size:12px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.06); }
.tmf-game-section { margin-top:30px; }
.tmf-game-section .tmf-section-head { align-items:center; }
.tmf-game-section .tmf-section-head h2 { font-size:22px; }
.tmf-see-all { color:#b9bce0; font-size:13px; font-weight:800; white-space:nowrap; }
.tmf-see-all b { font-size:21px; vertical-align:-1px; margin-left:3px; }
.tmf-see-all:hover { color:white; }
.tmf-row-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
.tmf-category-game-section .tmf-section-head h2 a { transition:color .18s ease; }
.tmf-category-game-section .tmf-section-head h2 a:hover { color:#b7aaff; }
.tmf-category-game-row {
  display:grid; grid-auto-flow:column; grid-auto-columns:clamp(170px,16vw,240px); grid-template-columns:none;
  gap:14px; overflow-x:auto; overscroll-behavior-inline:contain; scroll-snap-type:x proximity;
  padding:2px 2px 14px; margin:0 -2px; scrollbar-width:thin; scrollbar-color:#343750 transparent;
}
.tmf-category-game-row::-webkit-scrollbar { height:5px; }
.tmf-category-game-row::-webkit-scrollbar-track { background:transparent; }
.tmf-category-game-row::-webkit-scrollbar-thumb { background:#343750; border-radius:999px; }
.tmf-category-game-row .tmf-card { scroll-snap-align:start; }

.tmf-home-seo {
  margin-top:44px; padding:clamp(24px,4vw,42px); border:1px solid var(--tmf-border); border-radius:24px;
  background:linear-gradient(135deg,rgba(115,87,255,.12),rgba(17,19,33,.94) 48%,rgba(39,215,206,.07));
  box-shadow:inset 0 1px rgba(255,255,255,.04);
}
.tmf-home-seo-copy { max-width:880px; }
.tmf-home-seo h2 { margin:8px 0 12px; font-size:clamp(26px,3vw,38px); line-height:1.12; letter-spacing:-.05em; }
.tmf-home-seo-copy p { margin:0; color:#c5c8d7; line-height:1.75; }
.tmf-home-seo-features { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:24px; }
.tmf-home-seo-features div { padding:17px 18px; border:1px solid var(--tmf-border); border-radius:15px; background:rgba(255,255,255,.035); }
.tmf-home-seo-features strong, .tmf-home-seo-features span { display:block; }
.tmf-home-seo-features strong { margin-bottom:5px; font-size:14px; }
.tmf-home-seo-features span { color:var(--tmf-muted); font-size:13px; line-height:1.55; }
.tmf-home-seo-links { margin:22px 0 0; color:var(--tmf-muted); font-size:13px; line-height:1.8; }
.tmf-home-seo-links strong { color:#d9dbe7; }
.tmf-home-seo-links a { color:#b9adff; text-decoration:underline; text-decoration-color:rgba(185,173,255,.35); text-underline-offset:3px; }
.tmf-home-seo-links a:hover { color:#fff; }

.tmf-hero { margin-top:22px; display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr); gap:16px; }
.tmf-feature {
  position:relative; min-height:390px; overflow:hidden; border-radius:28px; background:#181a27;
  box-shadow:var(--tmf-shadow); isolation:isolate;
}
.tmf-feature::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(5,6,12,.94) 4%,rgba(5,6,12,.45) 54%,rgba(5,6,12,.06)); z-index:-1; }
.tmf-feature-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; filter:saturate(1.08); }
.tmf-feature-content { max-width:570px; padding:54px 48px; }
.tmf-eyebrow { color:var(--tmf-cyan); text-transform:uppercase; font-size:12px; font-weight:900; letter-spacing:.18em; }
.tmf-feature h1 { margin:13px 0 14px; font-size:clamp(34px,4.6vw,66px); line-height:.96; letter-spacing:-.065em; }
.tmf-feature p { margin:0 0 26px; color:#d2d4df; max-width:470px; font-size:16px; line-height:1.7; }
.tmf-play { display:inline-flex; align-items:center; gap:9px; background:white; color:#10111b; font-weight:900; padding:13px 19px; border-radius:15px; box-shadow:0 12px 36px rgba(0,0,0,.25); transition:.2s ease; }
.tmf-play:hover { transform:translateY(-2px) scale(1.01); }
.tmf-side-promos { display:grid; grid-template-rows:1fr 1fr; gap:16px; }
.tmf-promo { position:relative; overflow:hidden; border-radius:24px; min-height:185px; padding:24px; display:flex; align-items:flex-end; background:var(--tmf-panel); isolation:isolate; }
.tmf-promo::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(0deg,rgba(7,8,15,.92),rgba(7,8,15,.08)); }
.tmf-promo img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.tmf-promo strong { font-size:20px; letter-spacing:-.03em; }

.tmf-section { margin-top:34px; }
.tmf-section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:15px; }
.tmf-section h2 { margin:0; font-size:24px; letter-spacing:-.045em; }
.tmf-section-head span { color:var(--tmf-muted); font-size:14px; }
.tmf-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:16px; }
.tmf-card { min-width:0; }
.tmf-card-link { display:block; border-radius:18px; transition:.22s ease; }
.tmf-card-link:hover { transform:translateY(-5px); }
.tmf-thumb { aspect-ratio:16/10; border-radius:18px; overflow:hidden; position:relative; background:#202238; border:1px solid var(--tmf-border); box-shadow:0 14px 34px rgba(0,0,0,.16); }
.tmf-thumb img { width:100%; height:100%; object-fit:cover; transition:transform .35s ease; }
.tmf-card-link:hover .tmf-thumb img { transform:scale(1.055); }
.tmf-card-badge { position:absolute; top:9px; left:9px; padding:5px 8px; border-radius:8px; background:rgba(8,9,19,.78); backdrop-filter:blur(8px); font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.tmf-card-play { position:absolute; right:10px; bottom:10px; width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:white; color:#141521; opacity:0; transform:translateY(6px); transition:.2s ease; font-size:13px; }
.tmf-card-link:hover .tmf-card-play { opacity:1; transform:none; }
.tmf-card h3 { margin:10px 2px 4px; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tmf-card-meta { margin:0 2px; font-size:12px; color:var(--tmf-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tmf-empty { display:none; text-align:center; color:var(--tmf-muted); padding:80px 20px; }

.tmf-game-page { padding:22px 28px 50px; max-width:1500px; margin:0 auto; }
.tmf-game-top { display:flex; justify-content:space-between; gap:15px; align-items:center; margin-bottom:16px; }
.tmf-game-top a { color:#c5c7d5; font-weight:750; }
.tmf-game-actions { display:flex; gap:10px; }
.tmf-game-stage { background:#03040a; border:1px solid var(--tmf-border); border-radius:24px; overflow:hidden; min-height:min(76vh,860px); box-shadow:var(--tmf-shadow); position:relative; }
.tmf-game-stage iframe { width:100%; height:min(76vh,860px); min-height:620px; display:block; border:0; background:#03040a; }
.tmf-game-cover { position:absolute; inset:0; overflow:hidden; display:grid; place-items:center; isolation:isolate; }
.tmf-game-cover > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; filter:saturate(1.05); }
.tmf-game-cover-shade { position:absolute; inset:0; z-index:-1; background:radial-gradient(circle,rgba(8,9,19,.22),rgba(8,9,19,.9)); backdrop-filter:blur(4px); }
.tmf-game-launch { max-width:520px; padding:30px; display:flex; flex-direction:column; align-items:center; text-align:center; }
.tmf-game-launch strong { margin:9px 0 22px; font-size:clamp(28px,4vw,52px); line-height:1; letter-spacing:-.06em; text-shadow:0 8px 30px #000; }
.tmf-game-launch button { border:0; border-radius:16px; padding:14px 24px; color:#11121b; background:white; font-weight:950; cursor:pointer; box-shadow:0 16px 42px rgba(0,0,0,.34); transition:.2s ease; }
.tmf-game-launch button:hover { transform:translateY(-2px) scale(1.02); }
.tmf-game-launch small { margin-top:13px; color:#d6d8e5; }
.tmf-pill-button.is-active { color:#fff; background:#5a45c8; }
.tmf-game-info { display:grid; grid-template-columns:1fr auto; gap:28px; align-items:start; padding-top:24px; }
.tmf-game-info h1 { margin:0 0 8px; letter-spacing:-.05em; }
.tmf-game-info p { color:var(--tmf-muted); line-height:1.7; margin:0; }
.tmf-game-info-actions { display:flex; flex-direction:column; gap:10px; align-items:stretch; }
.tmf-text-button { padding:7px; border:0; color:var(--tmf-muted); background:transparent; cursor:pointer; font-size:12px; }
.tmf-text-button:hover { color:white; }
.tmf-game-stats { display:flex; flex-wrap:wrap; gap:9px; margin-top:15px; }
.tmf-game-stats span { padding:8px 10px; border:1px solid var(--tmf-border); border-radius:10px; color:#c8cad8; background:#151725; font-size:12px; }
.tmf-game-details { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:28px; }
.tmf-detail-card { padding:22px; border:1px solid var(--tmf-border); border-radius:18px; background:var(--tmf-panel); }
.tmf-detail-card h2 { margin:0 0 10px; font-size:19px; }
.tmf-detail-card p { margin:0; color:var(--tmf-muted); line-height:1.75; }
.tmf-related { margin-top:34px; }

.tmf-breadcrumb { display:flex; align-items:center; gap:8px; margin:0 0 18px; color:var(--tmf-muted); font-size:12px; white-space:nowrap; overflow:hidden; }
.tmf-breadcrumb a:hover { color:white; }
.tmf-breadcrumb strong { color:#d7d9e5; overflow:hidden; text-overflow:ellipsis; }
.tmf-listing-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:22px; }
.tmf-listing-head h1 { margin:7px 0 8px; font-size:clamp(30px,4vw,50px); letter-spacing:-.06em; }
.tmf-listing-head p { max-width:740px; margin:0; color:var(--tmf-muted); line-height:1.65; }
.tmf-result-count { flex:0 0 auto; padding:10px 13px; border:1px solid var(--tmf-border); border-radius:12px; color:#c5c7d5; background:#151725; font-size:12px; }
.tmf-category-links { margin-bottom:22px; }
.tmf-archive-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
.tmf-pagination { margin-top:34px; }
.tmf-pagination .nav-links { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; }
.tmf-pagination .page-numbers { min-width:40px; height:40px; padding:0 12px; display:grid; place-items:center; border:1px solid var(--tmf-border); border-radius:11px; color:#c8cad8; background:#151725; }
.tmf-pagination .page-numbers.current, .tmf-pagination .page-numbers:hover { color:white; border-color:transparent; background:var(--tmf-purple); }
.tmf-empty-state { padding:80px 24px; text-align:center; border:1px solid var(--tmf-border); border-radius:20px; background:var(--tmf-panel); }
.tmf-empty-state h2 { margin:0 0 10px; }
.tmf-empty-state p { color:var(--tmf-muted); }
.tmf-content-page { max-width:1040px; }
.tmf-content-card { padding:clamp(26px,5vw,60px); border:1px solid var(--tmf-border); border-radius:24px; background:var(--tmf-panel); box-shadow:var(--tmf-shadow); }
.tmf-content-card h1 { margin:8px 0 24px; font-size:clamp(32px,5vw,54px); letter-spacing:-.06em; }
.tmf-prose { color:#cdd0dc; font-size:16px; line-height:1.8; }
.tmf-prose h2 { margin:34px 0 10px; color:white; }
.tmf-prose a { color:#9f8dff; text-decoration:underline; }
.tmf-prose ul { padding-left:22px; }
[hidden] { display:none !important; }

.tmf-footer { border-top:1px solid var(--tmf-border); padding:28px; color:var(--tmf-muted); display:flex; justify-content:space-between; gap:20px; font-size:13px; }
.tmf-footer nav { display:flex; flex-wrap:wrap; gap:18px; }
.tmf-toast { position:fixed; z-index:100; right:86px; bottom:24px; background:#25283d; border:1px solid var(--tmf-border); border-radius:14px; padding:13px 17px; box-shadow:var(--tmf-shadow); opacity:0; transform:translateY(12px); pointer-events:none; transition:.2s ease; }
.tmf-toast.is-visible { opacity:1; transform:none; }
.tmf-back-to-top {
  position:fixed; z-index:99; right:24px; bottom:24px; width:48px; height:48px; padding:0;
  display:grid; place-items:center; border:1px solid rgba(255,255,255,.16); border-radius:15px;
  color:#fff; background:linear-gradient(145deg,var(--tmf-purple),#8c63ff); box-shadow:0 14px 34px rgba(0,0,0,.38);
  cursor:pointer; opacity:0; visibility:hidden; pointer-events:none; transform:translateY(14px) scale(.92);
  transition:opacity .2s ease, visibility .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tmf-back-to-top.is-visible { opacity:1; visibility:visible; pointer-events:auto; transform:none; }
.tmf-back-to-top:hover { transform:translateY(-3px); box-shadow:0 18px 38px rgba(115,87,255,.34); }
.tmf-back-to-top:focus-visible { outline:3px solid rgba(39,215,206,.72); outline-offset:3px; }

@media (max-width:1280px) { .tmf-grid, .tmf-archive-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } .tmf-header { grid-template-columns:230px minmax(250px,1fr) auto; } }
@media (max-width:980px) { .tmf-hero { grid-template-columns:1fr; } .tmf-side-promos { grid-template-columns:1fr 1fr; grid-template-rows:none; } .tmf-feature { min-height:340px; } .tmf-feature-content { padding:44px 34px; } .tmf-header { grid-template-columns:auto 1fr auto; } .tmf-logo > span:not(.tmf-brand-mark) { display:none; } .tmf-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:720px) {
  .tmf-shell { padding-left:0; }
  .tmf-sidebar, .tmf-sidebar.is-expanded {
    inset:0 auto 0 0; width:min(86vw,300px); height:100dvh; padding:12px;
    transform:translateX(-102%); box-shadow:24px 0 60px rgba(0,0,0,.48);
  }
  .tmf-sidebar.is-expanded { transform:translateX(0); }
  .tmf-sidebar .tmf-side-label { max-width:200px; opacity:1; }
  .tmf-sidebar .tmf-side-link { gap:11px; }
  .tmf-sidebar-backdrop {
    display:block; position:fixed; inset:0; z-index:55; border:0; padding:0;
    background:rgba(2,3,9,.68); opacity:0; visibility:hidden; pointer-events:none; transition:.2s ease;
  }
  .tmf-sidebar-backdrop.is-visible { opacity:1; visibility:visible; pointer-events:auto; }
  .tmf-side-link.is-active::before { left:-12px; top:auto; width:4px; height:24px; border-radius:0 6px 6px 0; }
  .tmf-header {
    height:auto; min-height:64px; padding:10px 12px; grid-template-columns:40px minmax(0,1fr) 40px;
    grid-template-areas:"tmf-menu tmf-search tmf-logo"; gap:8px;
  }
  .tmf-logo { grid-area:tmf-logo; justify-content:flex-end; font-size:15px; }
  .tmf-logo .tmf-brand-mark { display:grid; width:38px; height:38px; border-radius:12px; }
  .tmf-search { grid-area:tmf-search; min-width:0; }
  .tmf-search input { height:40px; padding:0 40px 0 12px; border-radius:12px; font-size:12px; }
  .tmf-search button { top:5px; right:5px; width:30px; height:30px; }
  .tmf-header-actions { display:contents; }
  .tmf-header-actions .tmf-pill-button:not(.tmf-mobile-menu) { display:none; }
  .tmf-mobile-menu { grid-area:tmf-menu; display:grid; width:40px; height:40px; padding:0; place-items:center; }
  .tmf-main, .tmf-game-page { padding:18px 15px 36px; }
  .tmf-home-intro { margin-bottom:16px; }
  .tmf-feature { min-height:430px; }
  .tmf-feature::after { background:linear-gradient(0deg,rgba(5,6,12,.96) 5%,rgba(5,6,12,.1) 92%); }
  .tmf-feature-content { position:absolute; inset:auto 0 0; padding:28px 24px; }
  .tmf-feature h1 { font-size:38px; }
  .tmf-feature p { font-size:14px; line-height:1.55; }
  .tmf-side-promos { grid-template-columns:1fr 1fr; }
  .tmf-topics { grid-template-columns:repeat(5,150px); margin-right:-15px; }
  .tmf-topic { min-height:104px; }
  .tmf-showcase { align-items:flex-start; flex-direction:column; padding:20px; }
  .tmf-showcase-pills { justify-content:flex-start; }
  .tmf-showcase-copy strong { font-size:22px; }
  .tmf-row-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tmf-category-game-row { grid-auto-columns:minmax(150px,46vw); gap:12px; margin-right:-15px; padding-bottom:10px; scrollbar-width:none; }
  .tmf-category-game-row::-webkit-scrollbar { display:none; }
  .tmf-promo { min-height:140px; padding:16px; }
  .tmf-promo strong { font-size:15px; }
  .tmf-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .tmf-thumb { border-radius:15px; aspect-ratio:1/1; }
  .tmf-card-play { display:none; }
  .tmf-game-stage, .tmf-game-stage iframe { min-height:72vh; height:72vh; border-radius:16px; }
  .tmf-game-info { grid-template-columns:1fr; }
  .tmf-game-details { grid-template-columns:1fr; }
  .tmf-game-launch { padding:22px; }
  .tmf-game-launch strong { font-size:32px; }
  .tmf-listing-head { align-items:flex-start; flex-direction:column; }
  .tmf-result-count { align-self:flex-start; }
  .tmf-archive-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tmf-content-card { border-radius:18px; }
  .tmf-home-seo { margin-top:34px; padding:22px 18px; border-radius:18px; }
  .tmf-home-seo-features { grid-template-columns:1fr; }
  .tmf-back-to-top { right:14px; bottom:16px; width:46px; height:46px; border-radius:14px; }
  .tmf-toast { right:70px; bottom:17px; max-width:calc(100vw - 86px); }
  .tmf-footer { flex-direction:column; padding:24px 16px 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  .tmf-back-to-top { transition:none; }
}
