:root {
  color-scheme: dark;
  --bg: #090a0d;
  --panel: #14161b;
  --panel-strong: #1d2027;
  --text: #f6f1e7;
  --muted: #aaa397;
  --gold: #d7a64b;
  --line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Myanmar", "Myanmar Text", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, input, select { font: inherit; }
.shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 13, 0.95);
  backdrop-filter: blur(14px);
}

.topbar-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 360px) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
}

.brand { display: flex; gap: 10px; align-items: center; font-weight: 900; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(215, 166, 75, 0.5);
  border-radius: 8px;
  background: #1e1508;
  color: var(--gold);
}

.site-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.main-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.main-nav a {
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 11px;
}

.main-nav a.active,
.main-nav a:hover { color: var(--gold); background: rgba(215, 166, 75, 0.1); }

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 13px;
}

.mobile-search-toggle,
.mobile-home-categories {
  display: none;
}

.language-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
}

.button {
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #1b1307;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.hero,
.carousel {
  min-height: 360px;
  display: grid;
  align-items: end;
  margin: 22px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-position: center;
  background-size: cover;
}

.hero-content,
.carousel-content {
  padding: 110px 28px 28px;
  background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.84));
}

.eyebrow { margin-bottom: 8px; color: var(--gold); font-weight: 900; }
.hero h1, .carousel h1 { max-width: 720px; margin: 0 0 10px; font-size: clamp(34px, 6vw, 64px); line-height: 1; }
.hero p, .carousel p { max-width: 620px; margin: 0 0 18px; color: var(--muted); }

.carousel {
  position: relative;
  display: block;
  min-height: 390px;
}

.carousel-stage {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  transition: opacity 360ms ease;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 40px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 34px;
  cursor: pointer;
}

.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.carousel-dots button {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.carousel-dots button.active {
  width: 24px;
  background: var(--gold);
}

.category-board,
.notice-bar,
.section,
.ranking,
.details,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.category-board { padding: 16px; margin-bottom: 14px; }
.category-board-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--gold);
  padding: 0 0 12px;
  font-weight: 900;
  cursor: pointer;
}
.category-groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.category-groups.collapsed .category-group:nth-child(n + 4) { display: none; }
.category-parent { display: block; margin-bottom: 8px; font-weight: 900; }
.category-children { display: flex; flex-wrap: wrap; gap: 8px; }
.category-children a, .pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
}
.pill.active { color: var(--gold); border-color: rgba(215, 166, 75, 0.6); }

.notice-bar { display: flex; gap: 10px; margin-bottom: 20px; padding: 12px 14px; color: var(--muted); overflow: hidden; }
.notice-bar span { color: var(--gold); font-weight: 900; }
.notice-track-wrap { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.notice-track { display: inline-flex; gap: 38px; min-width: 100%; animation: notice-marquee linear infinite; }
.notice-track a, .notice-track span { color: var(--muted); font-weight: 600; }

@keyframes notice-marquee {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.section { margin-bottom: 20px; padding: 16px; }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 14px; }
.section h2, .ranking h2 { margin: 0; font-size: 23px; }
.section-head p { margin: 5px 0 0; color: var(--muted); }
.more { color: var(--gold); font-weight: 900; }
.filters { display: flex; gap: 8px; overflow-x: auto; }

.poster-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.poster-card { min-width: 0; }
.poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: #242832;
}
.poster img, .poster video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 180ms ease; }
.poster-card:hover img, .poster-card:hover video { transform: scale(1.045); }
.video-preview.placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1c23 0%, #0d0e12 100%);
}
.video-preview.small { aspect-ratio: 3/4; border-radius: 6px; }
.corner, .score {
  position: absolute;
  border-radius: 6px;
  background: rgba(0,0,0,0.72);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}
.corner { left: 8px; bottom: 8px; }
.score { right: 8px; top: 8px; color: var(--gold); }
.poster-info { padding: 9px 2px 0; }
.poster-info h3 {
  margin: 0 0 5px;
  overflow: hidden;
  min-height: 40px;
  font-size: 14px;
  line-height: 1.35;
}
.poster-info p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }

.rankings-side { position: sticky; top: 92px; display: grid; gap: 14px; }
.ranking { padding: 14px; }
.ranking h2 { margin-bottom: 10px; }
.rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.rank-row span { color: var(--gold); font-weight: 900; }
.rank-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rank-row em { color: var(--muted); font-style: normal; font-size: 12px; }

.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 22px; }
.player-box { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #030303; }
.player-box.landscape { aspect-ratio: 16 / 9; }
.player-box.portrait { aspect-ratio: 9 / 16; max-height: 80vh; margin: 0 auto; max-width: 430px; }
.player-box iframe, .player-box video { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; }
.player-box .player-notice { display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 24px; text-align: center; color: var(--muted); }

.fullscreen-btn { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; transition: background 150ms; }
.fullscreen-btn:hover { background: var(--panel-strong); }
@media (max-width: 680px) {
  .fullscreen-btn { position: sticky; bottom: 12px; z-index: 20; background: var(--gold); color: #111; padding: 14px; }
}

.mobile-player-modal { display: none; }
@media (max-width: 768px) {
  .mobile-player-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  .mobile-player-inner {
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-player-inner .player-box {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .mobile-player-inner .player-box.portrait {
    aspect-ratio: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    width: 100%;
    height: 100%;
  }
  .mobile-player-inner video,
  .mobile-player-inner iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
    background: #000;
  }
  .mobile-player-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 100000;
    height: 38px;
    padding: 0 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
  }
  body.player-modal-open { overflow: hidden; }
}

.player-box .player-notice.error { color: #e05555; }
video, iframe { display: block; width: 100%; border: 0; }
.details { margin-top: 16px; padding: 16px; }
.details h1 { margin: 0 0 10px; font-size: 30px; }
.meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 13px; }
.crew { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.crew div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--muted); }
.crew strong { display: block; margin-bottom: 4px; color: var(--text); }
.empty { padding: 18px; color: var(--muted); }
.muted { color: var(--muted); }
.footer { margin-top: 30px; border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); }

.bottom-nav {
  display: none;
}

.ad-slot {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
}

.ad-slot a,
.ad-slot div {
  display: block;
  overflow: hidden;
  min-height: 72px;
  border: 1px solid rgba(215, 166, 75, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(215, 166, 75, 0.16), rgba(255, 255, 255, 0.04));
}

.ad-slot img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.ad-slot strong {
  display: block;
  padding: 18px;
  color: var(--gold);
}

.page-hero.compact,
.detail-page,
.support-card,
.my-profile,
.my-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-hero.compact {
  min-height: 160px;
  margin: 22px 0 16px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(215, 166, 75, 0.16), rgba(9, 10, 13, 0.12)),
    var(--panel);
}

.page-hero.compact h1,
.detail-page h1,
.support-card h1,
.my-profile h1 {
  margin: 0 0 8px;
}

.page-hero.compact p,
.detail-page .lead,
.support-card p,
.my-profile p {
  margin: 0;
  color: var(--muted);
}

.promo-grid,
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.promo-card,
.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.promo-card img,
.game-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #242832;
}

.promo-card div,
.game-card div {
  padding: 14px;
}

.promo-card h3,
.game-card h3,
.record-card h3 {
  margin: 0 0 7px;
}

.promo-card p,
.game-card p,
.record-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.promo-card span,
.game-card span {
  color: var(--gold);
  font-weight: 900;
}

.detail-page {
  margin-top: 14px;
  padding: 18px;
}

.detail-page > img {
  display: block;
  width: 100%;
  max-height: 420px;
  margin-bottom: 18px;
  border-radius: 8px;
  object-fit: cover;
}

.rich-text {
  margin: 16px 0;
  color: var(--text);
  white-space: pre-wrap;
}

.back-link {
  display: inline-flex;
  margin-top: 22px;
  color: var(--gold);
  font-weight: 900;
}

.my-profile {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 22px 0 14px;
  padding: 18px;
}

.avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(215, 166, 75, 0.5);
  border-radius: 8px;
  background: #1e1508;
  color: var(--gold);
  font-weight: 900;
}

.my-menu {
  overflow: hidden;
  margin-bottom: 18px;
}

.my-menu a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
}

.my-menu a:last-child {
  border-bottom: 0;
}

.my-menu em {
  color: var(--muted);
  font-style: normal;
}

.language-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.language-modal {
  width: min(340px, 100%);
  border: 1px solid rgba(215, 166, 75, 0.24);
  border-radius: 8px;
  background: #15161b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.language-modal h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.language-modal-options {
  display: grid;
  gap: 8px;
}

.language-option,
.language-cancel {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1014;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0 14px;
}

.language-option.active {
  border-color: rgba(215, 166, 75, 0.72);
  background: rgba(215, 166, 75, 0.14);
  color: var(--gold);
}

.language-cancel {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

.record-list,
.help-list,
.support-grid {
  display: grid;
  gap: 12px;
}

.record-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.record-card img {
  display: block;
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  object-fit: cover;
  background: #242832;
}

.help-list details,
.support-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
}

.help-list summary {
  color: var(--gold);
  cursor: pointer;
  font-weight: 900;
}

.help-list p {
  margin: 10px 0 0;
  color: var(--muted);
}

.support-card {
  margin-top: 22px;
  padding: 18px;
}

.support-grid a {
  display: grid;
  gap: 4px;
}

.support-grid span {
  color: var(--muted);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 1120px) {
  .topbar-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
  }

  .main-nav,
  .search {
    grid-column: 1 / -1;
  }

  .language-select {
    display: block !important;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    max-width: 132px;
    min-height: 40px;
    z-index: 99;
  }

  .category-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-layout, .watch-layout { grid-template-columns: 1fr; }
  .rankings-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .promo-grid, .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .player-box.portrait { width: 100vw; max-width: 100vw; height: calc(100vh - 140px); max-height: 82vh; margin-left: calc(50% - 50vw); border-radius: 0; background: #000; }
  .player-box.landscape { aspect-ratio: 16 / 9; }
  .player-box iframe, .player-box video { object-fit: contain; }

  body {
    padding-bottom: 76px;
  }

  .shell { width: min(100% - 22px, 1320px); }
  .topbar-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

  .compact-search-topbar .topbar-main {
    min-height: 58px;
    padding: 9px 0;
  }

  .home-topbar .main-nav {
    display: none;
  }

  .compact-search-topbar .mobile-search-toggle {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(215, 166, 75, 0.28);
    border-radius: 8px;
    background: rgba(215, 166, 75, 0.1);
    color: var(--gold);
    cursor: pointer;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .compact-search-topbar .mobile-search-toggle svg {
    width: 21px;
    height: 21px;
  }

  .compact-search-topbar .search {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .compact-search-topbar .topbar-main.search-open .search {
    display: grid;
  }

  .language-select {
    display: none !important;
    max-width: 116px;
    padding: 9px 8px;
    font-size: 14px;
  }

  .category-groups { grid-template-columns: 1fr; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .promo-grid, .game-grid { grid-template-columns: 1fr; }
  .rankings-side { grid-template-columns: 1fr; }
  .crew { grid-template-columns: 1fr; }
  .hero, .carousel { min-height: 300px; }
  .hero-content, .carousel-content { padding: 80px 18px 20px; }
  .carousel-arrow { width: 34px; height: 42px; font-size: 28px; }
  .home-topbar + main .carousel {
    margin-top: 14px;
  }

  .mobile-home-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: -2px 0 14px;
    padding: 2px 0 4px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .mobile-home-categories::-webkit-scrollbar {
    display: none;
  }

  .mobile-home-categories a {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    padding: 9px 12px;
  }

  .mobile-home-categories a.active,
  .mobile-home-categories a:hover {
    border-color: rgba(215, 166, 75, 0.45);
    background: rgba(215, 166, 75, 0.12);
    color: var(--gold);
  }

  .category-groups.collapsed .category-group:nth-child(n + 2) { display: none; }
  .notice-bar { align-items: center; }
  .section { padding: 12px; }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid rgba(215, 166, 75, 0.28);
    background: rgba(9, 10, 13, 0.97);
    backdrop-filter: blur(16px);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }

  .bottom-nav a {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    gap: 2px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
  }

  .bottom-nav a.active {
    background: rgba(215, 166, 75, 0.13);
    color: var(--gold);
  }

  .bottom-nav svg {
    width: 23px;
    height: 23px;
    color: currentColor;
  }

  .bottom-nav strong {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footer {
    padding-bottom: 84px;
  }

  .page-hero.compact {
    min-height: 130px;
    padding: 20px;
  }

  .detail-title-row,
  .record-card {
    grid-template-columns: 1fr;
  }

  .detail-title-row {
    display: grid;
  }

  .record-card img {
    width: 100%;
  }

  .ad-slot img {
    max-height: 128px;
  }
}
