/* Moka Games — H5 Mobile-First Style (centered on desktop, full-bleed on mobile) */

:root {
  --bg-0: #0f1226;
  --bg-1: #161a35;
  --bg-2: #1d2147;
  --bg-card: #1a1e3d;
  --bg-page: #0a0d1f;       /* H5 page background (slightly darker than cards) */
  --border: #2a2f5b;
  --text: #e7e9ff;
  --text-dim: #9aa0c8;
  --text-mute: #6b6f99;
  --accent: #ff5e7e;
  --accent-2: #ffb84d;
  --accent-3: #4ecdc4;
  --accent-4: #a78bfa;
  --gradient-1: linear-gradient(135deg, #ff5e7e 0%, #ffb84d 100%);
  --gradient-2: linear-gradient(135deg, #4ecdc4 0%, #a78bfa 100%);
  --shadow-1: 0 4px 14px rgba(0,0,0,.3);
  --shadow-2: 0 10px 30px rgba(0,0,0,.4);
  --radius: 14px;
  --radius-sm: 8px;
  --h5-w: 480px;            /* H5 max width on desktop */
  --header-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-size: 14px;
  /* Center the H5 "phone" on desktop */
  display: flex;
  justify-content: center;
}
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

/* H5 frame — the "phone" container that holds the entire site */
.h5 {
  width: 100%;
  max-width: var(--h5-w);
  min-height: 100vh;
  background: var(--bg-0);
  position: relative;
  padding-bottom: 24px;
  box-shadow: 0 0 60px rgba(0,0,0,.5);
}

/* ============ HEADER (H5 style — slim, fixed top) ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 18, 38, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--gradient-1);
  border-radius: 8px;
  display: grid; place-items: center;
  color: white; font-size: 15px; font-weight: 900;
  box-shadow: 0 3px 10px rgba(255, 94, 126, .35);
}
.logo-text { background: var(--gradient-1); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-h5 { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all .15s ease;
}
.nav-pill:hover, .nav-pill.active { color: var(--text); background: var(--bg-2); }
.nav-pill.hot { color: var(--accent-2); }
.nav-pill.hot.active { background: var(--gradient-1); color: white; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-dim);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

/* ============ AD SLOTS ============ */
.ad-top {
  display: flex;
  justify-content: center;
  padding: 10px 12px 0;
}
.ad-slot {
  background: var(--bg-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: .04em;
  text-align: center;
  position: relative;
  margin: 12px;
  width: calc(100% - 24px);
}
.ad-slot::before {
  content: 'AD';
  position: absolute;
  top: 5px; left: 7px;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--text-mute);
  opacity: .6;
}
.ad-slot-inner { padding: 4px 10px; }
.ad-slot-label { display: block; opacity: .6; font-size: 10px; }

/* Size variants — give the slot a minimum height that matches the served ad */
.ad-slot.size-320-50, .ad-slot.size-300-50 { min-height: 50px; }
.ad-slot.size-300-75 { min-height: 75px; }
.ad-slot.size-320-100 { min-height: 100px; }
.ad-slot.size-auto { min-height: 50px; }

/* ============ HERO BANNER (H5 carousel-feel) ============ */
.hero {
  margin: 12px 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gradient-1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  cursor: pointer;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%);
}
.hero .tag {
  position: absolute;
  top: 14px; left: 14px;
  padding: 3px 9px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  z-index: 1;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.hero p {
  font-size: 12px;
  opacity: .9;
  margin-bottom: 12px;
  max-width: 280px;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.hero .play-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: white;
  color: var(--bg-0);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}
.hero-dots {
  position: absolute;
  bottom: 8px; right: 14px;
  display: flex; gap: 4px;
  z-index: 1;
}
.hero-dot {
  width: 5px; height: 5px;
  background: rgba(255,255,255,.4);
  border-radius: 50%;
}
.hero-dot.active { background: white; }

/* ============ SECTIONS ============ */
.section { padding: 18px 12px 4px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.section-title .accent { color: var(--accent-2); }
.section-sub {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ============ GAME GRID (2-col H5) ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.game-card:active { transform: scale(.97); }
.game-card:hover { border-color: var(--accent-4); }
.game-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-1);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.game-thumb .thumb-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.game-thumb .thumb-fallback {
  font-size: 44px;
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--bg-2);
}
.game-thumb .badge {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 6px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  z-index: 2;
}
.game-thumb .badge.hot { background: var(--accent); }
.game-thumb .badge.new { background: var(--accent-3); color: var(--bg-0); }
.game-info { padding: 8px 10px 10px; }
.game-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
}
.game-meta .rating { color: var(--accent-2); font-weight: 700; }

/* Hot row (horizontal scroll) */
.hot-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -12px;
  padding: 0 12px 4px;
  scrollbar-width: none;
}
.hot-row::-webkit-scrollbar { display: none; }
.hot-row .game-card { flex: 0 0 140px; }
.hot-row .game-thumb { aspect-ratio: 4 / 3; }

.empty { padding: 40px 12px; text-align: center; color: var(--text-mute); font-size: 13px; }

/* ============ DETAIL PAGE (H5) ============ */
.detail-page { padding: 12px 12px 0; }
.detail-cover-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
}
.detail-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-content .crumbs {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.detail-content h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 4px 0 8px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.detail-content .desc {
  color: var(--text-dim);
  margin: 10px 0 12px;
  line-height: 1.7;
  font-size: 13px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag-chip {
  padding: 4px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
}
.btn-row { display: flex; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex: 1;
}
.btn-primary { background: var(--gradient-1); color: white; }
.btn-primary:hover { color: white; transform: translateY(-1px); }
.btn-ghost { background: var(--bg-1); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }

.detail-stats {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.detail-stat { text-align: center; }
.detail-stat .v { font-size: 14px; font-weight: 800; }
.detail-stat .k { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ============ COMMENTS SECTION ============ */
.comments { padding: 8px 12px 0; }
.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0 12px;
}
.comments-title { font-size: 16px; font-weight: 800; }
.comments-title .count { color: var(--text-mute); font-weight: 600; font-size: 13px; margin-left: 6px; }
.comments-rate {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.comments-rate .big {
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.comments-rate .stars { color: var(--accent-2); margin: 4px 0; font-size: 14px; }
.comments-rate .total { font-size: 11px; color: var(--text-mute); }

.comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: 0; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  letter-spacing: -.02em;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.comment-name { font-size: 13px; font-weight: 700; }
.comment-date { font-size: 10px; color: var(--text-mute); }
.comment-stars { color: var(--accent-2); font-size: 11px; margin-left: auto; }
.comment-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  word-wrap: break-word;
}
.comment-stats {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-mute);
}
.comment-stat { display: inline-flex; align-items: center; gap: 3px; }
.comment-pinned {
  display: inline-block;
  padding: 1px 5px;
  background: var(--gradient-2);
  color: white;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: 1px;
}
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
}
.comment-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 8px;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent-4); }
.comment-form .form-row { display: flex; align-items: center; gap: 8px; }
.comment-form .form-row .stars-input { color: var(--accent-2); font-size: 16px; letter-spacing: 2px; }
.comment-form .form-row .btn { flex: 0 0 auto; padding: 8px 14px; font-size: 12px; }

/* ============ PLAY PAGE (H5) ============ */
.play-page { padding: 12px 12px 0; }
.play-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.play-toolbar h1 { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-frame-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  margin-bottom: 12px;
}
.play-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.play-related h2 { font-size: 14px; font-weight: 700; margin: 16px 0 10px; }

/* ============ PROSE / LEGAL (H5) ============ */
.prose { padding: 18px 16px 24px; }
.prose h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.prose h2 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; color: var(--text); }
.prose p { color: var(--text-dim); margin-bottom: 10px; line-height: 1.7; font-size: 13px; }
.prose ul, .prose ol { color: var(--text-dim); margin: 0 0 12px 20px; line-height: 1.7; font-size: 13px; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose a { color: var(--accent-4); }
.prose-meta { color: var(--text-mute); font-size: 11px; margin-bottom: 18px; }

/* ============ RESPONSIVE (H5 — already mobile-first) ============ */
@media (max-width: 480px) {
  .h5 { box-shadow: none; }
  body { display: block; }
}
@media (min-width: 481px) {
  body { padding: 20px 0; }
  .h5 { border-radius: 24px; overflow: hidden; min-height: calc(100vh - 40px); }
}

/* ============ CONTACT FORM ============ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.contact-form .field { display: flex; flex-direction: column; gap: 5px; }
.contact-form .field > span {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { border-color: var(--accent-4); }
.contact-form textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.contact-form .contact-submit { align-self: stretch; margin-top: 4px; }

/* ============ NATIVE IN-FEED ADS (mixed into game / comment lists) ============ */
/* Ad card — looks like a game card, blends into the 2-col grid */
.game-card.ad-card {
  border: 1px dashed var(--accent-2);
  background: linear-gradient(135deg, rgba(255, 94, 126, .07), rgba(255, 184, 77, .07));
  position: relative;
}
.game-card.ad-card:hover { border-style: solid; }
.game-card.ad-card .ad-thumb-bg {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 56px;
  text-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.game-card.ad-card .ad-tag {
  position: absolute;
  top: 6px; right: 6px;
  padding: 2px 6px;
  background: var(--accent-2);
  color: var(--bg-0);
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: .05em;
  z-index: 2;
}
.game-card.ad-card .ad-meta-text {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 10px;
}

/* Ad comment — looks like a user comment, blends into the comment list */
.comment.ad-comment {
  background: linear-gradient(90deg, rgba(255, 184, 77, .06), transparent 60%);
  border-left: 3px solid var(--accent-2);
  padding-left: 12px;
  margin: 4px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.comment.ad-comment .comment-pinned {
  background: var(--accent-2) !important;
  color: var(--bg-0) !important;
}
.comment.ad-comment .comment-name { color: var(--accent-2); }

/* In-prose ad (for legal/contact pages where no list exists) */
.prose-ad {
  display: block;
  margin: 20px 0;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.prose-ad-label {
  display: block;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--text-mute);
  margin-bottom: 8px;
  opacity: .7;
}
.prose-ad-slot {
  min-height: 50px;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 12px;
}
.prose-ad-slot .gpt-frame { display: inline-block; }

/* ============ FOOTER (simple — privacy / terms / contact) ============ */
.footer {
  margin-top: 18px;
  padding: 20px 16px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}
.footer-links a:hover { color: var(--text); }
.footer-links .dot { color: var(--text-mute); font-size: 10px; }
.footer-copy {
  color: var(--text-mute);
  font-size: 11px;
  line-height: 1.6;
}
