/* Gamevault — GameZone-inspired layout */

@font-face {
  font-family: Poppins;
  font-weight: 400;
  font-display: swap;
  src: local("Poppins"), local("Poppins-Regular");
}

:root {
  --yellow: #fff20c;
  --yellow-soft: #ffe999;
  --yellow-chip: #fff9ad;
  --yellow-border: #dcc33d;
  --orange: #eb4500;
  --orange-btn: #e94300;
  --orange-deep: #b13300;
  --gold: #ffcb15;
  --text: #23272f;
  --text-dark: #0d121b;
  --muted: #666;
  --blue: #0073dd;
  --teal: #00c9a9;
  --purple: #7321f9;
  --white: #fff;
  --gray-bg: #f2f2f2;
  --border: #e6e6e6;
  --font: Poppins, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 62.5%;
  -webkit-text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1.4rem;
  color: var(--text);
  background: var(--gray-bg);
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; border: 0; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
p, h1, h2, h3, h4, h5 { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#page { width: 100%; flex: 1 0 auto; }

/* Header */
.site-header {
  position: relative;
  z-index: 50;
  width: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-in {
  max-width: 1205px;
  margin: 0 auto;
  height: 5rem;
  min-height: 50px;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.logo-icon {
  width: 35px !important;
  height: 35px !important;
  max-width: 48px;
  max-height: 48px;
  flex: 0 0 35px;
  display: block;
  overflow: hidden;
}

.logo-text {
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: -.2px;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffb730 10%, #f2641b 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.field-container {
  position: relative;
  width: 50%;
  max-width: 36rem;
  height: 3.5rem;
  margin-left: auto;
}

.field {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0 38px 0 18px;
  background: #e6e6e6;
  border-radius: 2.8rem;
  box-shadow: 0 8px 15px rgba(75, 72, 72, .1);
  font-size: 16px;
  color: var(--text);
}

.field:focus {
  outline: none;
  box-shadow: 0 9px 20px rgba(75, 72, 72, .3);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  padding: 6px;
  cursor: pointer;
  color: #8a8a8a;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(94vw, 380px);
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
  z-index: 60;
}

.search-suggest[hidden] { display: none !important; }

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.suggest-item:hover,
.suggest-item.is-active { background: #f3effc; }

.suggest-item img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
}

.suggest-item strong {
  display: block;
  font-weight: 500;
  font-size: 1.4rem;
}

.suggest-item span span {
  display: block;
  color: #888;
  font-size: 1.2rem;
}

/* Home — GameZone joy portal */
.page-home { background: var(--yellow); }

.page-home .site-header {
  background: var(--orange);
  border: 0;
  border-bottom: 3px solid #ffcb1b;
}

.page-home .header-in {
  height: 50px;
  min-height: 50px;
  justify-content: center;
  padding: 0 12px;
}

.page-home .field-container { display: none; }

.page-home .logo-icon {
  width: 35px !important;
  height: 35px !important;
  flex: 0 0 35px;
}

.page-home .logo-text {
  font-size: 29px;
  letter-spacing: -1px;
  background: linear-gradient(#fff9a0, #ffcb15);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 0 var(--orange-deep));
}

.joy-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7px 8px 24px;
}

.joy-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  grid-auto-flow: row dense;
}

.joy-tile {
  display: block;
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  background: var(--yellow-soft);
  border: 3px solid white;
  border-radius: 14px;
  box-shadow: 0 1px 4px #74590c66;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}

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

.joy-featured {
  grid-column: 7 / span 2;
  grid-row: 1 / span 2;
}

.joy-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 6px 7px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  background: linear-gradient(transparent, #000c);
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: hover) {
  .joy-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #74590c88;
  }
  .joy-tile:hover .joy-title { opacity: 1; }
}

@media (hover: none) {
  .joy-title { opacity: 1; }
}

.joy-ad { margin: 22px 0; }

.joy-ad .ads-box {
  background: #fffbea;
  padding: 8px 0;
  margin: 0;
  border-radius: 10px;
}

.ads-box { width: 100%; margin: 12px 0; text-align: center; }

.ad-label {
  font-size: 11px;
  line-height: 22px;
  color: #655d42;
  text-align: center;
  margin: 0;
}

.ad-demo-box {
  height: 120px;
  max-width: 728px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #e3b72d;
  border-radius: 8px;
  color: #8a7040;
  font-size: 13px;
  background: repeating-linear-gradient(45deg, #fffbea, #fffbea 10px, #fff3c4 10px, #fff3c4 20px);
}

.joy-browse {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.joy-browse a {
  padding: 12px 20px;
  background: var(--orange-btn);
  color: #fff;
  border-radius: 24px;
  font-weight: 700;
}

.joy-about {
  max-width: 800px;
  margin: 30px auto 8px;
  text-align: center;
  color: #493700;
  line-height: 1.8;
  padding: 0 7px;
}

.joy-about h2 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 900;
}

.joy-search {
  display: flex;
  max-width: 440px;
  margin: 20px auto;
  gap: 8px;
  position: relative;
}

.joy-search input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  border: 2px solid #e3b72d;
  border-radius: 12px;
  background: white;
}

.joy-search button {
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--orange-btn);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.joy-categories {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.joy-categories a {
  background: var(--yellow-chip);
  border: 1px solid var(--yellow-border);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.page-home .site-footer {
  background: var(--orange-btn);
  color: #fff;
}

.page-home .site-footer a,
.page-home .footer-copy { color: #fff; }

/* Inner pages (category/search) — tile grid on gray */
.wrap {
  width: 100%;
  max-width: 1205px;
  margin: 0 auto;
  padding: 0 12px;
}

.sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 10px;
  padding-bottom: 10px;
  border-bottom: .5px solid silver;
}

.sec-title h1,
.sec-title h2 {
  font-weight: 900;
  font-size: 20px;
  line-height: 1.25;
  color: var(--text-dark);
}

.game-box {
  list-style: none;
  margin: 0;
  padding: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 1rem;
}

.tile { list-style: none; min-width: 0; }

.tile a {
  display: block;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: .3rem solid #fff;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}

.tile-img { display: block; aspect-ratio: 1 / 1; }

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

.tile-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 6px 5px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .7));
}

.tile-big {
  grid-column: span 2;
  grid-row: span 2;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 2.4rem 0 2rem;
}

.load-more,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 152px;
  min-height: 40px;
  padding: 0 26px;
  border-radius: 46px;
  border: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(122deg, #fecc03, #f79a1d);
  box-shadow: 3px 10px 18px rgba(247, 154, 29, .3);
}

.btn-primary {
  background: linear-gradient(122deg, #fecc03, #f79a1d);
  color: #fff;
}

.btn-secondary {
  background: rgba(0, 201, 169, .08);
  border: 1px solid #00a890;
  color: #222;
  box-shadow: none;
}

.btn-ghost {
  background: #b4bfd2;
  box-shadow: none;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 12px;
  color: var(--muted);
}

/* Detail page */
.page-detail { background: var(--blue); }

.page-detail .site-footer a,
.page-detail .footer-copy { color: rgba(255, 255, 255, .9); }

.detail { width: 100%; }

#info-card {
  background: #fff;
  padding: 2rem 0 .6rem;
}

.app-baseinfo {
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
}

.app-icon {
  width: 8.5rem;
  height: 8.5rem;
  flex: 0 0 auto;
  margin-right: 1.2rem;
  border-radius: 20%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
  object-fit: cover;
}

.app-info { min-width: 0; flex: 1; }

.app-title {
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 3rem;
  color: #000;
  overflow-wrap: anywhere;
}

.app-developer {
  font-size: 1.4rem;
  line-height: 2.2rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grade {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .3rem;
}

.grade-num {
  font-size: 1.4rem;
  font-weight: 500;
  color: #f4b73f;
}

.app-intro {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: .6rem 1.2rem 0;
  border-top: 1px solid #e6e6e6;
  display: grid;
}

.app-intro li {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  padding: 0 10px;
}

.info-key {
  font-size: 1.4rem;
  font-weight: 500;
  color: #000;
  padding: 10px 0;
}

.info-value {
  font-size: 1.4rem;
  color: #666;
  padding: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#screenshots {
  padding: 1.2rem 0 1.2rem 1.2rem;
}

#screenshots h2,
#similar h2 {
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 2.8rem;
  color: #fff;
  margin-bottom: 8px;
}

.shots-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-right: 1.2rem;
}

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

.shot {
  flex: 0 0 auto;
  height: 250px;
  min-width: 140px;
  border-radius: 8px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.shot img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

#app-reviews,
#download-store {
  background: #fff;
  padding: 1.6rem 1.2rem 2rem;
}

#app-reviews h2,
#download-store h2 {
  font-size: 1.8rem;
  font-weight: 500;
  color: #000;
  margin: 0 0 8px;
}

#app-reviews p {
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 2.6rem;
  color: #666;
  overflow-wrap: anywhere;
}

.download-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: .8rem;
}

.store-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: .7rem 4px;
  border-radius: 6px;
  border: 1px solid #00a890;
  background: rgba(0, 201, 169, .05);
  text-align: center;
}

.store-btn b {
  font-size: 1.5rem;
  font-weight: 500;
  color: #222;
}

.store-btn .sb-sub {
  font-size: 1.2rem;
  color: #808080;
  margin-top: 2px;
}

.store-btn.disable {
  opacity: .35;
  pointer-events: none;
}

#similar {
  padding: 1.6rem 1.2rem .4rem;
  margin-bottom: 1.6rem;
}

.recommend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 1rem 1.2rem 0;
  color: rgba(255, 255, 255, .85);
  font-size: 1.3rem;
}

.breadcrumb a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  width: 100%;
  padding: 2rem 12px 2.4rem;
}

.footer-in {
  max-width: 1105px;
  margin: 0 auto;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 28px;
}

.site-footer a {
  color: #6e6e6e;
  font-size: 1.6rem;
  line-height: 2.2em;
}

.footer-copy {
  margin-top: .8rem;
  color: #8a8a8a;
  font-size: 1.2rem;
  line-height: 1.55;
  text-align: center;
}

.sort-control select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .55rem 2rem .55rem .9rem;
  background: #fff;
}

/* Responsive */
@media (max-width: 999px) {
  .joy-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .joy-featured { grid-column: 5 / span 2; }
}

@media (max-width: 600px) {
  .joy-shell { padding: 7px 7px 20px; }
  .joy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .joy-featured { grid-column: 2 / span 2; }
  .joy-tile { border-radius: 12px; }
  .joy-about h2 { font-size: 21px; }
  .joy-browse a {
    padding: 10px 14px;
    font-size: 12px;
  }
  .download-group { grid-template-columns: 1fr; }
}

@media (min-width: 600px) {
  .game-box {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
  }
  .recommend-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .header-in {
    padding: 0 50px;
    height: 6rem;
  }
  .logo-icon {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px;
    max-width: 40px;
    max-height: 40px;
  }
  .page-home .logo-icon {
    width: 35px !important;
    height: 35px !important;
    flex: 0 0 35px;
  }
  .logo-text { font-size: 2.6rem; }
  .field-container { height: 3.8rem; }
  .wrap { padding: 0 50px; }
  .game-box { grid-template-columns: repeat(8, minmax(0, 1fr)); }

  .detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 15px;
  }

  #info-card {
    border-radius: 4px 4px 0 0;
    padding: 2rem 2rem .6rem;
  }

  #screenshots h2,
  #similar h2 { color: #fff; }

  .page-detail #app-reviews,
  .page-detail #download-store {
    border-radius: 0 0 4px 4px;
  }

  .tile a {
    transition: transform .4s cubic-bezier(.175, .885, .32, 1.275);
  }
  .tile a:hover { transform: scale(1.08); z-index: 5; }
}
