:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --ink: #101820;
  --muted: #6b7280;
  --line: #e4e8ee;
  --brand: #0f766e;
  --brand-dark: #0b423e;
  --accent: #f5b942;
  --shadow: 0 16px 36px rgba(16, 24, 32, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }

.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 900;
  color: var(--brand-dark);
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-logo-only {
  margin: 0 auto;
}

.brand-logo-only img {
  width: 36px;
  height: 36px;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 10px 10px 28px;
}

.home-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.home-tab {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.06);
}

.home-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  border-color: transparent;
}

.home-tab strong { font-size: 1rem; }
.home-tab span { color: inherit; opacity: 0.75; font-size: 0.82rem; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
}

.section-head p,
.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h1,
.article-page h1,
.video-details h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

.section-head h1 { font-size: clamp(1.8rem, 6vw, 3.2rem); }

.mini-search {
  width: min(330px, 48vw);
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.chip.is-active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}

.article-grid,
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.article-card,
.game-card,
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.game-card a {
  display: block;
  height: 100%;
}

.article-thumb,
.game-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #dfe8ef, #f9fafb);
}

.article-card-body,
.game-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.article-card h2,
.article-card h3,
.game-card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.22;
}

.article-card p,
.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.btn-quiet {
  background: #eef4f3;
  color: var(--brand-dark);
}

.game-art {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 85%, #111 15%), color-mix(in srgb, var(--game-accent) 30%, #fff 70%));
}

.game-art::after {
  content: "";
  position: absolute;
  inset: auto -20% -42% -20%;
  height: 70%;
  background: radial-gradient(circle, rgba(255,255,255,0.42), transparent 68%);
}

.game-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  filter: saturate(1.08) contrast(1.02);
}

.game-icon {
  position: relative;
  z-index: 1;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--game-accent);
  font-weight: 950;
  box-shadow: 0 12px 26px rgba(0,0,0,0.22);
}

.play-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #101820;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.ad-wide,
.feed-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 64px;
  margin: 10px 0;
  overflow: hidden;
}

.feed-ad {
  min-height: 280px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-ad {
  min-height: 42px;
  margin: 6px 0;
}

.smartlink-slot {
  min-height: 42px;
}

.smartlink-ad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(320px, 100%);
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
}

.ad-break {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(5, 8, 12, 0.62);
}

.ad-break-box {
  position: relative;
  width: min(342px, 100%);
  min-height: 334px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 10px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3);
}

.ad-break-box button {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-weight: 900;
}

.claim-popup {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 10, 18, 0.58);
}

.claim-card {
  position: relative;
  width: min(340px, 100%);
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  color: #101820;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.claim-card strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.claim-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.claim-badge {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.claim-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 950;
}

.claim-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-weight: 900;
}

.mobile-sticky-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  min-height: 58px;
  padding: 4px 28px 4px 4px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.mobile-sticky-ad button {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
}

body.has-sticky-ad { padding-bottom: 66px; }

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.article-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 16px 14px 36px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--brand);
  font-weight: 900;
}

.article-meta {
  margin: 8px 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
}

.article-content {
  color: #202a33;
  font-size: 1.04rem;
  line-height: 1.78;
}

.article-content p { margin: 0 0 18px; }
.small-title { font-size: 1.1rem; }
.compact-list { display: grid; gap: 8px; }

.compact-item {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.video-card {
  display: grid;
  gap: 0;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame > div,
.video-frame iframe {
  width: 100%;
  height: 100%;
}

.video-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

body[data-page="game-player"] {
  overflow: hidden;
  background: #000;
  padding: 0;
  touch-action: none;
}

.fullscreen-game {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr) max-content;
  background: #000;
  overflow: hidden;
}

.fullscreen-game iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  overflow: hidden;
}

.game-ad-top,
.game-ad-bottom {
  min-height: 50px;
  max-height: 96px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #050505;
  overflow: hidden;
}

.game-loading-strip {
  position: absolute;
  left: 50%;
  top: 62px;
  z-index: 12;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 96px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: #111;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(0,0,0,0.32);
}

.game-loading-strip[hidden] { display: none; }

.game-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 18px;
  background: rgba(0,0,0,0.92);
  color: #fff;
  text-align: center;
}

.game-loader strong {
  font-size: clamp(1.8rem, 8vw, 3.4rem);
}

.game-back {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 8px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 0.82rem;
  font-weight: 900;
}

.game-ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
}

.game-ad-box {
  position: relative;
  min-height: 290px;
  width: min(340px, calc(100% - 28px));
  display: grid;
  place-items: center;
  padding: 28px 10px 10px;
  border-radius: 8px;
  background: #fff;
}

.game-ad-box button {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
}

.skeleton {
  min-height: 260px;
  border-radius: 8px;
  background: linear-gradient(100deg, #edf1f5 20%, #f8fafc 45%, #edf1f5 70%);
}

@media (max-width: 1000px) {
  .article-grid,
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .article-grid,
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini-search { width: 100%; }
  .section-head { align-items: stretch; flex-direction: column; }
  .article-card p,
  .game-card p { display: none; }
  .article-card-body,
  .game-card-body { padding: 10px; }
  .article-card h2,
  .article-card h3,
  .game-card h2 { font-size: 0.96rem; }
  .home-tab { min-height: 64px; padding: 10px 8px; }
  .home-tab span { font-size: 0.74rem; }
  .video-details { align-items: stretch; flex-direction: column; }
  .feed-ad {
    grid-column: 1 / -1;
    min-height: 268px;
  }
  .game-card { box-shadow: 0 10px 22px rgba(16,24,32,0.08); }
  .game-art { aspect-ratio: 1 / 0.78; }
  .game-icon {
    width: 54px;
    height: 54px;
    font-size: 0.9rem;
  }
  .meta-line { font-size: 0.68rem; }
  .play-pill {
    min-height: 26px;
    padding: 4px 9px;
  }
  .game-ad-top,
  .game-ad-bottom { min-height: 50px; }
}

@media (max-width: 380px) {
  .home-tab strong { font-size: 0.9rem; }
  .game-art span { width: 52px; height: 52px; }
}
