/* Subway Runner — mobile / tablet fixes (minimal, preserves original grid) */

html,
body {
  overflow-x: clip;
  max-width: 100%;
}

.site-root,
.site-body,
.game-list,
.section {
  max-width: 100%;
}

/* Game iframe: full width on tablet & mobile */
@media (max-width: 1210.9px) {
  .game-page-grid-d .game-wrapper,
  .game-page-grid-m .game-wrapper {
    width: 100% !important;
    max-width: 100%;
  }

  .game-page-grid-d .game-content,
  .game-page-grid-m .game-content {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 780.9px) {
  .game-page-grid-d,
  .game-page-grid-m {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .game-page-grid-d .game-wrapper,
  .game-page-grid-m .game-wrapper {
    height: auto !important;
    min-height: 0;
    overflow: hidden;
  }

  .game-page-grid-d .game-wrapper:not(.game-loaded),
  .game-page-grid-m .game-wrapper:not(.game-loaded) {
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
  }

  .game-wrapper:not(.game-loaded) #box_embed.game-overlay,
  .game-wrapper:not(.game-loaded) .game-overlay {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
  }

  .game-wrapper:not(.game-loaded) .game-play-text {
    display: none;
  }

  .game-wrapper:not(.game-loaded) .game-frame {
    grid-template-rows: var(--game-toolbar-h);
    height: auto;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
  }

  .game-wrapper:not(.game-loaded) .game-frame .add_more {
    display: none !important;
    min-height: 0 !important;
    aspect-ratio: unset !important;
  }

  .game-page-grid-d .game-wrapper.game-loaded,
  .game-page-grid-m .game-wrapper.game-loaded {
    min-height: 0;
    overflow: visible;
  }

  .game-wrapper .game-frame {
    width: 100%;
    min-height: 0;
    height: 100%;
  }

  .game-wrapper.game-loaded .game-frame {
    height: auto;
    grid-template-rows: auto auto;
  }

  .game-wrapper.game-loaded .game-frame .add_more {
    width: 100%;
    min-height: 200px;
    aspect-ratio: 4 / 3;
    max-height: none;
    height: auto;
  }

  .game-wrapper .game-frame iframe {
    min-height: 0;
    height: 100%;
  }

  .game-list {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Header */
@media (max-width: 767px) {
  .main-header {
    margin-bottom: 12px;
  }

  .main-header .flex.items-center.justify-between.h-25 {
    height: 64px;
  }

  .main-header .w-\[120px\].h-\[100px\],
  .main-header .flex.items-center.space-x-2 img {
    width: 72px !important;
    height: 56px !important;
  }

  .main-header .h-15,
  .main-header .md\:h-17 {
    height: 64px;
  }

  .site-root {
    margin-top: 8px;
  }
}

/* Nav menu */
.game-scroll-nav {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  padding-left: 4px;
  padding-right: 4px;
}

.game-scroll-nav .menu_item {
  font-size: 14px;
  padding: 6px 10px;
}

/* Game content + rating */
@media (max-width: 767px) {
  .game-description.game__content_wrap,
  article.game-description {
    padding: 20px 12px !important;
    margin-top: 16px;
  }

  .game-description h1 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .game__content_wrap {
    flex-direction: column;
    gap: 12px;
  }

  .infor_wrap,
  .rate_comment_box_wrap {
    width: 100% !important;
    max-width: 100%;
  }

  .rate_comment_box {
    padding: 12px;
  }

  .font-rate {
    flex-wrap: wrap;
    line-height: 1.4;
  }

  .ratings_row {
    flex-wrap: nowrap;
    align-items: center;
  }

  .ratings_stt {
    flex: 0 0 52px;
    font-size: 13px;
  }

  .ratings_progress {
    flex: 1;
    min-width: 0;
  }

  .ratings_progress_count {
    flex: 0 0 28px;
    text-align: right;
    font-size: 13px;
  }

  .game-content-body,
  .game__content {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .game-content-body img,
  .game__content img {
    max-width: 100% !important;
    height: auto !important;
  }

  .game-content-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .breadcrumbs_blog {
    font-size: 13px;
    flex-wrap: wrap;
  }
}

/* Game toolbar */
@media (max-width: 640px) {
  #header_game.header_game {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 48px;
    gap: 8px;
    padding: 8px 10px;
  }

  #header_game.header_game .game-item {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
  }

  #header_game.header_game .game-item img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  #header_game.header_game .game-title {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
  }

  #header_game.header_game .game-utility {
    flex: 0 0 auto;
    width: auto;
  }

  #header_game.header_game .game-share {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    width: auto;
  }

  #header_game.header_game .game-share button,
  #header_game.header_game .game-share a {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #header_game.header_game .game-share a[title="Play fullscreen"] {
    width: auto;
    min-width: 44px;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 999px;
    white-space: nowrap;
  }

  #header_game.header_game .game-share .like-text {
    margin: 0 4px 0 -2px;
    line-height: 34px;
    font-size: 12px;
    flex-shrink: 0;
  }

  #header_game.header_game .game-share button svg,
  #header_game.header_game .game-share a svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 400px) {
  #header_game.header_game .game-share a[title="Play fullscreen"] {
    display: none;
  }

  #header_game.header_game .game-title {
    font-size: 12px;
  }
}

@media (max-width: 540px) {
  .game-page-grid-m .game-wrapper .game-frame,
  .game-page-grid-d .game-wrapper .game-frame {
    min-height: 0;
  }

  .game-wrapper:not(.game-loaded) {
    --game-toolbar-h: 48px;
  }

  .game-wrapper.game-loaded .game-frame .add_more {
    min-height: 180px;
    aspect-ratio: 4 / 3;
  }

  .game-wrapper .game-frame iframe {
    min-height: 0;
    height: 100%;
  }
}

/* Footer */
@media (max-width: 767px) {
  .heygamefooter-wrapper {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .heygamefooter-left img {
    max-width: 180px;
    height: auto;
  }
}

.header-logo-wrap {
  width: 120px;
  height: 100px;
}

.header-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 767px) {
  .header-logo-wrap {
    width: 72px;
    height: 56px;
  }
}

/* Game fullscreen — iframe / game frame only, not whole page */
#iframehtml5:fullscreen,
#iframehtml5:-webkit-full-screen,
#box_embed2:fullscreen,
#box_embed2:-webkit-full-screen,
#game_wrap:fullscreen,
#game_wrap:-webkit-full-screen,
#iframehtml5_wrap:fullscreen,
#iframehtml5_wrap:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  background: var(--black-23, #000);
}

#box_embed2:fullscreen,
#box_embed2:-webkit-full-screen,
#game_wrap:fullscreen,
#game_wrap:-webkit-full-screen {
  display: flex !important;
  flex-direction: column;
  border-radius: 0;
  box-shadow: none;
}

#box_embed2:fullscreen .add_more,
#box_embed2:-webkit-full-screen .add_more,
#game_wrap:fullscreen .add_more,
#game_wrap:-webkit-full-screen .add_more,
#iframehtml5_wrap:fullscreen,
#iframehtml5_wrap:-webkit-full-screen {
  flex: 1 1 auto;
  width: 100% !important;
  height: auto !important;
  min-height: 0;
}

#box_embed2:fullscreen iframe,
#box_embed2:-webkit-full-screen iframe,
#game_wrap:fullscreen iframe,
#game_wrap:-webkit-full-screen iframe,
#iframehtml5:fullscreen,
#iframehtml5:-webkit-full-screen,
#iframehtml5_wrap:fullscreen iframe,
#iframehtml5_wrap:-webkit-full-screen iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  border: 0;
}

#box_embed2:fullscreen #header_game,
#box_embed2:-webkit-full-screen #header_game,
#game_wrap:fullscreen #header_game,
#game_wrap:-webkit-full-screen #header_game {
  flex: 0 0 auto;
  width: 100%;
}

/* Static pages (page.html layout) */
@media (max-width: 767px) {
  .CategoryGames_game_section__PIqhm {
    padding-right: 8px !important;
  }

  .CategoryGames_game_section__PIqhm .thumb-dis {
    padding-left: 8px !important;
  }

  .home-title {
    font-size: 1.5rem;
    line-height: 1.25;
  }
}

/* FAQ accordion (game detail) — <details>, avoids Tailwind .collapse conflict */
.game-faq-section {
  margin-top: 24px;
}

.game-faq-title {
  color: var(--white-15, #fff);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
}

.game-faq-accordion.faq-content {
  gap: 12px;
  margin-bottom: 0;
}

.game-faq-accordion .faq-item {
  padding: 0 !important;
  margin-bottom: 0;
}

.game-faq-accordion .faq-question {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--white-15, #fff);
  list-style: none;
}

.game-faq-accordion .faq-question::-webkit-details-marker {
  display: none;
}

.game-faq-accordion .faq-question-text {
  flex: 1;
  min-width: 0;
}

.game-faq-accordion .faq-chevron {
  flex-shrink: 0;
  color: var(--cyan-6, #00bfe8);
  transition: transform 0.25s ease;
}

.game-faq-accordion .faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.game-faq-accordion .faq-answer {
  padding: 0 20px 16px;
  color: #fffc;
}

.game-faq-accordion .faq-answer p {
  margin: 0;
}

.game-faq-accordion .faq-item[open] {
  background: var(--white-2, rgba(255, 255, 255, 0.08)) !important;
  border-color: var(--cyan-4, rgba(0, 191, 232, 0.45)) !important;
}

.game-faq-accordion .faq-item[open]:before {
  transform: scaleX(1);
}

.game-faq-accordion .faq-item:hover {
  transform: none;
}

.genre-category-card {
  background-color: var(--blue-33, #020c17);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 1rem;
  backdrop-filter: blur(4px);
}

.genre-category-card__link {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  text-decoration: none;
}

.genre-category-card__icon {
  width: 80px;
  height: 80px;
  object-fit: cover;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
