/* wordgamesfree — left sidebar menu + right content. Mobile-first, no external fonts/libs */
@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2") format("woff2"),
    url("../fonts/segoe-semilight.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2") format("woff2"),
    url("../fonts/segoe-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2") format("woff2"),
    url("../fonts/segoe-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2") format("woff2"),
    url("../fonts/segoe-bold.woff2") format("woff2");
}

:root {
  --font: "Segoe Sans", "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --g: #2a7d45;
  --g-dark: #1f6b39;
  --g-soft: #e8f5ec;
  --y: #f2c94c;
  --ink: #1d2a22;
  --mute: #5b6b61;
  --line: #dfe8e2;
  --bg: #f6faf7;
  --card: #fff;
  --r: 14px;
  --sh: 0 2px 8px rgba(20, 60, 35, .08);
  --side: 250px;
}

* {
  box-sizing: border-box
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg)
}

img {
  max-width: 100%;
  height: auto;
  display: block
}

a {
  color: var(--g-dark);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700
}

b, strong {
  font-weight: 700
}

h1 {
  font-size: 1.7rem
}

h2 {
  font-size: 1.35rem
}

h3 {
  font-size: 1.1rem
}

.skip {
  position: absolute;
  left: -999px
}

.skip:focus {
  left: 8px;
  top: 8px;
  background: #fff;
  padding: 8px;
  z-index: 99
}

/* layout: sidebar (menu) + content */
.shell {
  display: block
}

.side {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  min-height: 56px
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--g);
  display: flex;
  align-items: center;
  gap: 8px
}

.logo:hover {
  text-decoration: none
}

.logo img {
  width: 100%;
  max-width: 210px;
  height: auto
}

.menu-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.side-body {
  display: none;
  padding: 0 14px 14px;
  max-height: calc(100vh - 56px);
  overflow-y: auto
}

.side-body.open {
  display: block
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: .95rem;
  margin: 4px 0 10px
}

.side-h {
  margin: 14px 0 4px;
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mute)
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--ink);
  font-weight: 600;
  border-radius: 10px
}

.nav a:hover, .nav a[aria-current] {
  background: var(--g-soft);
  text-decoration: none;
  color: var(--g-dark)
}

.content {
  min-width: 0;
  padding: 0 14px
}

.btn {
  display: inline-block;
  background: var(--g);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer
}

.btn:hover {
  background: var(--g-dark);
  text-decoration: none
}

.btn.alt {
  background: #fff;
  color: var(--g-dark);
  border: 1px solid var(--g)
}

/* tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px
}

.tile {
  display: block;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
  color: var(--ink);
  transition: transform .15s
}

.tile:hover {
  transform: translateY(-2px);
  text-decoration: none
}

.thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  background: var(--g-soft);
  overflow: hidden
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--y);
  color: #3b2f00;
  font-size: .72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px
}

.tile .name {
  display: block;
  font-weight: 700;
  padding: 8px 10px 0;
  font-size: .98rem
}

.tile .name:last-child {
  padding-bottom: 10px
}

section.block {
  margin: 24px 0
}

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px
}

.row-head h2 {
  margin: 0
}

.more {
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap
}

.hero {
  display: grid;
  gap: 12px
}

.hero-title {
  background: linear-gradient(135deg, #3d7a3a, #2c5f2a);
  color: #fff;
  border-radius: var(--r);
  padding: 20px;
  margin: 16px 0
}

.hero-title h1 {
  margin: 0 0 6px
}

.hero-title p {
  margin: 0
}

/* text blocks */
.prose, .sec {
  background: var(--card);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh);
  margin: 16px 0
}

.prose h1, .prose h2, .prose h3, .prose h4, .sec h2 {
  font-weight: 700;
  color: var(--ink)
}

.prose h2, .sec h2 {
  margin-top: 1.1em
}

.prose h3, .prose h4 {
  margin: 1em 0 .4em
}

.prose h2:first-child, .sec h2:first-child {
  margin-top: 0
}

.prose ul, .prose ol, .sec ul, .sec ol {
  padding-left: 1.2em
}

.sec h3 {
  margin: 1em 0 .2em
}

.crumbs {
  font-size: .88rem;
  color: var(--mute);
  margin: 14px 0 10px
}

.crumbs a {
  color: var(--mute)
}

/* game page */
.player {
  background: #102016;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh)
}

.player .frame {
  height: 520px;
  background: #102016
}

/* FIXED size: does not change with content */
.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block
}

.player .tools {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  flex-wrap: wrap
}

.player .tools .sp {
  flex: 1
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0
}

.chip {
  background: var(--g-soft);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .85rem;
  font-weight: 600
}

.rating {
  color: #8a6d00;
  font-weight: 700
}

.info-table {
  width: 100%;
  border-collapse: collapse
}

.info-table th {
  text-align: left;
  width: 38%;
  color: var(--mute);
  font-weight: 600
}

.info-table th, .info-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top
}

/* forms */
.form label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px
}

.form input, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit
}

.form textarea {
  min-height: 140px
}

/* pagination */
.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 22px 0;
  flex-wrap: wrap
}

.pager a, .pager span {
  min-width: 38px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600
}

.pager .cur {
  background: var(--g);
  border-color: var(--g);
  color: #fff
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin: 32px -14px 0;
  padding: 20px 14px;
  background: #fff;
  color: var(--mute);
  font-size: .92rem
}

.site-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.ad-slot {
  margin: 14px auto;
  text-align: center
}

@media(min-width:700px) {
  h1 {
    font-size: 2.1rem
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
  }

  .hero {
    grid-template-columns: 1.4fr 1fr
  }

  .hero .minis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px
  }

  .player .frame {
    height: 600px
  }
}

/* desktop: menu fixed on the left, content on the right */
@media(min-width:1000px) {
  .shell {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr)
  }

  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    overflow-y: auto
  }

  .side-top {
    padding: 16px 16px 8px
  }

  .menu-btn {
    display: none
  }

  .side-body {
    display: block;
    padding: 0 12px 16px;
    max-height: none;
    overflow: visible
  }

  .content {
    padding: 0 24px
  }

  .site-footer {
    margin: 32px -24px 0;
    padding: 20px 24px
  }

  .grid {
    grid-template-columns: repeat(4, 1fr)
  }
}

@media(min-width:1500px) {
  .grid {
    grid-template-columns: repeat(5, 1fr)
  }
}

/* How to Play (numbered cards) + FAQs (accordion) */
.guide, .faqs {
  margin: 40px 0
}

.sec-title {
  text-align: center;
  text-transform: uppercase;
  font-size: 1.45rem;
  margin: 0 0 1.3rem
}

.sec-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--g);
  border-radius: 2px;
  margin: 10px auto 0
}

.steps {
  list-style: none;
  counter-reset: s;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr
}

.steps li {
  counter-increment: s;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px
}

.steps li::before {
  content: counter(s);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--g);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px
}

.steps li strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 2px
}

.tips {
  background: var(--g-soft);
  border-radius: var(--r);
  padding: 14px 22px;
  margin-top: 16px
}

.tips h3 {
  margin: 0 0 4px
}

.tips ul {
  margin: 0;
  padding-left: 1.2em
}

.faq-list {
  max-width: 780px;
  margin: 0 auto
}

details.faq {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  padding: 0 20px
}

details.faq>summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-weight: 700;
  cursor: pointer
}

details.faq>summary::-webkit-details-marker {
  display: none
}

details.faq>summary::after {
  content: "+";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef1f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--mute)
}

details.faq[open]>summary::after {
  content: "\2212"
}

details.faq>div {
  padding: 0 0 16px
}

@media(min-width:700px) {
  .steps {
    grid-template-columns: repeat(2, 1fr)
  }

  .steps li:last-child:nth-child(odd) {
    grid-column: 1/-1;
    justify-self: center;
    width: calc(50% - 8px)
  }
}

/* ===== Game page: full-screen app layout (top bar + player + right rail) ===== */
.gbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo tools""title title";
  align-items: center;
  gap: 4px 12px;
  padding: 8px 14px
}

.gbar .logo {
  grid-area: logo
}

.gtitle {
  grid-area: title;
  min-width: 0;
  text-align: center
}

.gtools {
  grid-area: tools;
  display: flex;
  gap: 8px
}

.gtitle .crumbs {
  margin: 0;
  font-size: .76rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.gtitle h1 {
  font-size: 1.05rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ic {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink)
}

.ic:hover {
  background: var(--g-soft)
}

.ic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round
}

.ic[aria-pressed="true"] {
  color: #d6336c
}

.ic[aria-pressed="true"] svg {
  fill: #d6336c
}

.play-shell {
  display: grid;
  gap: 14px;
  padding: 12px
}

/* Stage = cột: iframe game chiếm phần còn lại, dải ads 728x90 (nếu bật) nằm ngay dưới.
   container-type để ẩn ads khi khung game hẹp hơn 728px (tablet dọc / mobile). */
.stage {
  position: relative;
  height: 72vh;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  container-type: inline-size
}

.stage iframe {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: var(--r);
  background: linear-gradient(135deg, #e4f0e1, #f4f7e8)
}

.stage .ads-728x90 {
  flex: none
}

.stage .ads-728x90 .ads {
  margin: 0
}

@container (max-width: 743px) {
  .stage .ads-728x90 {
    display: none
  }
}

.stage .cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px
}

.stage .cover img {
  width: min(320px, 70%);
  height: auto;
  border-radius: 16px;
  box-shadow: var(--sh)
}

.cname {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 6px 0 2px
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0
}

.rail-h {
  font-weight: 700;
  font-size: 1rem;
  margin: 18px 2px 12px
}

.rail details.faq {
  margin: 0
}

.rail .steps {
  grid-template-columns: 1fr;
  gap: 10px
}

.rail .steps li, .rail .steps li:last-child:nth-child(odd) {
  padding: 10px 14px;
  background: var(--g-soft);
  border: 0;
  width: auto;
  justify-self: stretch
}

.rail .steps li::before {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: .85rem;
  margin-bottom: 6px
}

.rail .tips {
  padding: 10px 14px
}

.rail .grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px
}

.tile.plain {
  background: transparent;
  box-shadow: none
}

.tile.plain .thumb {
  border-radius: 12px
}

.tile.plain .name {
  padding: 6px 2px 0;
  font-size: .9rem
}

.rail-meta {
  font-size: .85rem;
  color: var(--mute);
  margin: 4px 2px 0
}

.gfoot {
  margin: 0
}

@media(min-width:700px) {
  .gbar {
    grid-template-columns: 1fr minmax(0, 2fr) 1fr;
    grid-template-areas: "logo title tools";
    min-height: 62px
  }

  .gtools {
    justify-self: end
  }

  .gtitle h1 {
    font-size: 1.1rem
  }
}

@media(min-width:1000px) {
  .play-shell {
    grid-template-columns: minmax(0, 1fr) 360px;
    height: calc(100vh - 62px);
    padding: 12px 14px
  }

  .stage {
    height: 100%
  }

  .rail {
    overflow-y: auto;
    height: 100%;
    padding-right: 2px
  }
}

/* About card: breadcrumb + category chip */
.crumbs span:last-child, .crumbs [aria-current] {
  color: var(--ink);
  font-weight: 700
}

.rail .crumbs {
  margin: 2px 0 8px;
  font-size: .95rem
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px
}

.chip-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 600;
  color: var(--ink);
  background: #fff
}

.chip-btn:hover {
  background: var(--g-soft);
  text-decoration: none
}

.about-text {
  margin-top: 8px
}

.about-text:empty {
  display: none
}

.about-text img {
  max-width: 100%;
  height: auto;
}

/* Game page: footer links live at the bottom of the right column; desktop page never scrolls */
.rail-foot {
  margin-top: auto;
  padding: 14px 2px 4px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--mute)
}

.rail-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 6px
}

.rail-foot p {
  margin: 0
}

@media(min-width:1000px) {
  body.gpage {
    height: 100vh;
    height: 100dvh;
    overflow: hidden
  }

  .play-shell {
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px)
  }
}

/* FAQs inside one card: nested questions */
details.q {
  border-top: 1px solid var(--line)
}

details.q:first-child {
  border-top: 0
}

details.q>summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer
}

details.q>summary::-webkit-details-marker {
  display: none
}

details.q>summary::after {
  content: "+";
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef1f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute)
}

details.q[open]>summary::after {
  content: "\2212"
}

details.q>p {
  margin: 0 0 12px
}

/* Right column tiles: name overlaid on the bottom of the 16:9 image (like puzzlegamesaz.io) */
.tile.plain {
  position: relative;
  border-radius: 10px;
  overflow: hidden
}

.tile.plain .thumb {
  border-radius: 10px
}

.tile.plain .name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 8px 6px;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.rail .grid {
  gap: 12px
}

/* Homepage rows: horizontal carousel, 6 tiles visible on desktop, arrows, title links to the category */
.row-title {
  margin: 0 0 10px;
  font-size: 1.35rem
}

.row-title a {
  color: var(--ink)
}

.row-title a:hover {
  color: var(--g-dark);
  text-decoration: underline
}

.row-wrap {
  --gap: 14px;
  --n: 2.3;
  position: relative;
  container-type: inline-size
}

.track {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px
}

.track::-webkit-scrollbar {
  display: none
}

.track .tile {
  flex: 0 0 calc((100cqw - (var(--n) - 1) * var(--gap)) / var(--n));
  scroll-snap-align: start;
  background: transparent;
  box-shadow: none;
  border-radius: 12px
}

.track .tile .thumb {
  border-radius: 12px;
  box-shadow: var(--sh)
}

.track .tile .name {
  padding: 8px 2px 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.arrow {
  position: absolute;
  top: 40px;
  top: calc(((100cqw - (var(--n) - 1) * var(--gap)) / var(--n)) * 9 / 32);
  transform: translateY(-50%);
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink)
}

.arrow[hidden] {
  display: none
}

.arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round
}

.arrow.prev {
  left: -6px
}

.arrow.next {
  right: -6px
}

@media(hover:none) {
  .arrow {
    display: none
  }
}

@media(min-width:700px) {
  .row-wrap {
    --n: 4
  }
}

@media(min-width:1000px) {
  .row-wrap {
    --n: 6;
    --gap: 16px
  }
}

/* Top Games: exactly 10 (1 big + 9 small), no arrows; the name shows on the image on hover */
.top-grid {
  display: grid;
  gap: 14px
}

.top-tile {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--g-soft);
  box-shadow: var(--sh)
}

.top-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.top-tile.feature {
  aspect-ratio: 16/9
}

.top-minis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px
}

.top-minis .top-tile {
  aspect-ratio: 16/9
}

.top-tile .over {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 10px 8px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .2s
}

.top-tile:hover .over, .top-tile:focus-visible .over {
  opacity: 1
}

@media(hover:none) {
  .top-tile .over {
    opacity: 1
  }
}

.top-tile .tname {
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5)
}

.top-tile.feature .tname {
  font-size: 1.2rem
}

.top-tile .play {
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: .9rem;
  flex: none
}

@media(min-width:700px) {
  .top-tile .tname {
    font-size: .85rem
  }

  .top-tile.feature .tname {
    font-size: 1.35rem
  }
}

@media(min-width:1000px) {
  .top-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch
  }

  .top-minis {
    grid-template-rows: repeat(3, 1fr);
    gap: 14px
  }

  .top-minis .top-tile {
    aspect-ratio: auto;
    min-height: 0
  }

  .top-minis .top-tile img {
    position: absolute;
    inset: 0
  }
}

/* colour square before each category name in the left menu (colours taken from the owner's reference image) */
.dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #999
}

.dot-wordle {
  background: #6aaa64
}

.dot-guessing {
  background: #c9b458
}

.dot-puzzle {
  background: #4cb44a
}

.dot-trivia {
  background: #6aa5e5
}

.dot-wordplay {
  background: #c88bdc
}

button, input, select, textarea {
  font-family: inherit
}

/* ads: anchors only, no demo boxes. The sticky banner shows on phones only and is hidden while empty */
.ad-sticky {
  display: none
}

@media(max-width:699px) {
  .ad-sticky {
    display: flex;
    justify-content: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .06)
  }

  .ad-sticky:empty {
    display: none
  }

  /* chừa chỗ để banner 320x50 không che nội dung cuối trang */
  body:has(.ad-sticky) {
    padding-bottom: calc(60px + env(safe-area-inset-bottom))
  }
}

.ad-slot:empty {
  margin: 0
}

/* Play Now button (a <button>, same look on every game) + iframe that replaces the cover */
button.btn {
  font-family: inherit;
  line-height: 1.2;
  appearance: none
}

.play-btn {
  padding: 12px 34px;
  font-size: 1.1rem
}


/* ---------- Ads (1000games ads_layout: .ads/.ads-margin/.ads-title) ---------- */
.ads {
  width: 100%;
  max-width: 100%;
  /* margin: 24px 0 */
}

.ads .ads {
  margin: 0
}

.ads-margin {
  width: fit-content;
  max-width: 100%;
  margin: auto
}

/* .ads-title: giữ nguyên CSS 1000games, chỉ đổi màu cho theme sáng (nền trắng) để nhãn hiện */
.ads-title {
  display: block;
  text-align: center;
  background: transparent;
  font-size: 11px;
  margin: 0;
  padding: 0;
  color: var(--mute);
  opacity: .6
}

.ad-sticky .ads {
  margin: 0
}

.ad-sticky .ads-title {
  display: none
}

/* sidebar: icon cho nav tính năng + ảnh danh mục/menu + đường kẻ ngăn cách */
.nav .ico {
  flex: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute)
}

.nav a[aria-current] .ico {
  color: var(--g-dark)
}

.nav .cat-ic {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  overflow: hidden;
}

.nav .cat-ic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.side-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 4px
}

/* nút xóa game khỏi Recently Played / Favorites (trang My Games) */
.tile .thumb {
  position: relative
}

.tile-x {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s
}

.tile:hover .tile-x, .tile-x:focus {
  opacity: 1
}

.tile-x svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round
}

@media(hover:none) {
  .tile-x {
    opacity: 1
  }
}

/* ===== Live search (kết quả chèn lên đầu <main>, ẩn phần còn lại) ===== */
main.searching> :not(.live-search) {
  display: none !important
}

.live-search {
  margin: 4rem 0 24px;
}

main[aria-busy="true"] .live-search {
  opacity: .55;
  transition: opacity .15s
}

.se-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 14px
}

.se-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600
}

.se-head h2 b {
  font-weight: 700
}

.se-ico {
  width: 20px;
  height: 20px;
  color: var(--mute);
  flex: none
}

.se-count {
  color: var(--g-dark);
  font-weight: 600;
  font-size: 1.05rem
}

.se-empty {
  text-align: center;
  padding: 40px 12px 28px
}

.se-badge {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e9ecea;
  color: var(--g-dark);
  margin-bottom: 14px
}

.se-badge svg {
  width: 28px;
  height: 28px
}

.se-empty h2 {
  font-size: 1.3rem;
  margin: 0 0 6px
}

.se-empty p {
  margin: 0;
  color: var(--mute);
  font-size: .95rem
}

.live-search .row-title {
  margin-top: 28px
}

/* Mobile: sidebar là thanh trên cùng -> khi đang search chỉ giữ ô input, ẩn menu để thấy kết quả */
@media(max-width:999px) {

  .side.searching .nav,
  .side.searching .side-h,
  .side.searching hr {
    display: none
  }
}

/* Quảng cáo 300x250 trong cột phải trang game */
.rail .ads-300x250 {
  flex: none
}

.rail .ads-300x250 .ads {
  margin: 0
