/* MadKid Games Hub — mobile-first responsive styles */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(at 20% 0%, #1f1147 0%, #0a0a1a 55%, #050510 100%);
  color: #e8e8f5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: #8ab4ff; }

.app { max-width: 1400px; margin: 0 auto; padding: 16px; }

/* ---------- Header (pro) ---------- */
.header {
  position: sticky;
  top: 8px;
  z-index: 50;
  padding: 10px 16px;
  background:
    linear-gradient(180deg, rgba(22,12,50,.82), rgba(16,10,35,.72));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  margin-bottom: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.04) inset,
    0 10px 30px rgba(0,0,0,.35),
    0 0 0 1px rgba(167,139,255,.04);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 52px;
}

/* ── Brand ─────────────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
  transition: background .15s ease;
  min-width: 0;
}
.brand:hover { background: rgba(255,255,255,.04); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(18,156,240,.35));
  transition: transform .2s ease;
}
.brand:hover .brand-mark { transform: translateY(-1px) rotate(-3deg); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text {
  display: flex; flex-direction: column; min-width: 0; line-height: 1.15;
}
.brand-name {
  font-size: 16px; font-weight: 800; letter-spacing: .2px;
  background: linear-gradient(90deg,#ffb3e1 0%,#c7b6ff 50%,#7db7ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand-dot {
  display: inline-block;
  margin: 0 4px;
  color: #ff6dd6;
  -webkit-text-fill-color: #ff6dd6;
  opacity: .9;
  transform: translateY(-1px);
}
.brand-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #9aa0c0; font-weight: 500;
  letter-spacing: .02em;
  margin-top: 1px;
}
.brand-stat strong {
  color: #e8e8f5; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.brand-sep { opacity: .5; }

/* ---------- Coin Wallet (header) — whole pill is a button ---------- */
.coin-wallet {
  display: inline-flex; align-items: stretch;
  background: linear-gradient(135deg, rgba(255,212,59,.14), rgba(255,156,59,.08));
  border: 1px solid rgba(255,212,59,.28);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 3px 12px rgba(255,180,60,.16), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.coin-wallet:disabled { opacity: .6; cursor: progress; }
.coin-wallet:active:not(:disabled) { transform: translateY(1px); }
.coin-wallet:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,180,60,.25); }
.coin-wallet.is-empty {
  border-color: rgba(255,120,120,.45);
  box-shadow: 0 4px 14px rgba(255,100,100,.2), inset 0 1px 0 rgba(255,255,255,.08);
  animation: coin-wallet-nudge 2.4s ease-in-out infinite;
}
@keyframes coin-wallet-nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.coin-wallet-balance {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 8px;
  font-weight: 700; color: #ffe27a; white-space: nowrap;
}
.coin-wallet-icon {
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(255,200,60,.55));
}
.coin-wallet-count {
  font-size: 16px; font-variant-numeric: tabular-nums;
  min-width: 14px; text-align: center;
  color: #fff7d0;
  font-weight: 800;
}
.coin-wallet-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: rgba(255, 230, 150, .72); font-weight: 700;
}
.coin-wallet-earn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd43b, #ff9c3b);
  color: #1a1030;
  font-weight: 800; font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,156,60,.35);
  transition: filter .15s ease, transform .08s ease;
}
.coin-wallet-earn:hover:not(:disabled) { filter: brightness(1.08); }
.coin-wallet-earn:active:not(:disabled) { transform: translateY(1px); }
.coin-wallet-earn:disabled { opacity: .6; cursor: progress; }
.coin-wallet-earn-plus { font-size: 15px; line-height: 1; margin-top: -1px; }

/* Brief pulse applied to the whole app when the coin count changes. */
.app.coin-flash .coin-wallet-count {
  animation: coin-count-pop .45s ease;
}
.app.coin-flash .coin-wallet {
  box-shadow: 0 8px 24px rgba(255,200,60,.45), inset 0 1px 0 rgba(255,255,255,.08);
}
@keyframes coin-count-pop {
  0%   { transform: scale(1);   color: #fff7d0; }
  40%  { transform: scale(1.35); color: #fff; text-shadow: 0 0 12px rgba(255,220,80,.9); }
  100% { transform: scale(1);   color: #fff7d0; }
}

/* ---------- Search (pro) ---------- */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  justify-self: center;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: #9aa0c0;
  pointer-events: none;
  display: inline-flex;
}
.search {
  width: 100%; padding: 9px 40px 9px 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(8,6,22,.55);
  color: #fff; font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search::placeholder { color: #7f83a3; }
.search:hover { border-color: rgba(255,255,255,.16); }
.search:focus {
  border-color: #a78bff;
  background: rgba(20,10,40,.78);
  box-shadow: 0 0 0 3px rgba(167,139,255,.18);
}
.search-kbd {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 700; color: #b5b5d0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.search-clear {
  position: absolute;
  right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #e8e8f5; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0;
  transition: background .15s ease;
}
.search-clear:hover { background: rgba(255,255,255,.15); }

/* ---------- Category bar ---------- */
.cat-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 4px 14px;
  margin: 0 -4px 16px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.cat-bar::-webkit-scrollbar { height: 6px; }
.cat-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.cat-btn {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); color: #e4e4f5;
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.cat-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.cat-btn.active { background: linear-gradient(90deg,#7948ff,#ff55b8); color: #fff; border-color: transparent; box-shadow: 0 4px 18px rgba(121,72,255,.45); }
.count { background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.cat-btn.active .count { background: rgba(255,255,255,.2); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; } }

.game-card {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: rgba(167,139,255,.5); box-shadow: 0 10px 30px rgba(0,0,0,.35); }

.thumb-btn {
  position: relative; aspect-ratio: 1 / 1;
  border: 0; padding: 0; cursor: pointer;
  background: #111127; overflow: hidden;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.thumb-btn:hover img { transform: scale(1.06); }
.thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg,#6a4bff,#ff55b8);
}
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%);
  opacity: 0; transition: opacity .15s ease;
  pointer-events: none;
}
.thumb-btn:hover .play-overlay,
.thumb-btn:focus .play-overlay { opacity: 1; }

.game-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.game-meta h3 {
  margin: 0; font-size: 13.5px; line-height: 1.3;
  color: #ececff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em;
}
.card-actions { display: flex; gap: 6px; }
.btn {
  flex: 1; padding: 7px 10px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(90deg,#7948ff,#ff55b8); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: rgba(255,255,255,.08); color: #e4e4f5; border-color: rgba(255,255,255,.12); }
.btn-ghost:hover { background: rgba(255,255,255,.15); }

.empty { padding: 60px 20px; text-align: center; color: #9999b8; }
.loading { padding: 24px; text-align: center; color: #9999b8; font-size: 13px; }

.footer { text-align: center; color: #8080a0; font-size: 12px; padding: 30px 10px 14px; }
.footer .tiny { font-size: 10.5px; color: #606078; margin-top: 4px; }
.footer a { color: #a78bff; text-decoration: none; }
.footer a:hover { color: #ffb3e1; text-decoration: underline; }
.footer .sep { color: #555577; margin: 0 4px; }

/* ---------- Ads ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 90px;
  margin: 14px 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
/* Test-mode ribbon so nobody mistakes a test ad for a live impression. */
.ad-slot-test {
  outline: 1px dashed rgba(255, 212, 59, 0.55);
  outline-offset: -1px;
  padding: 10px;
  background: rgba(255, 212, 59, 0.03);
}
/* GPT test slot lives inside .ad-slot-test and is a fixed 300×250 div. */
.ad-slot-test > div[id^="gadz-gpt-"] {
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  overflow: hidden;
}
.ad-test-badge {
  position: absolute; top: 6px; right: 8px; z-index: 2;
  background: #ffd43b; color: #1a1030;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.ad-slot-placeholder {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.03),
    rgba(255,255,255,.03) 10px,
    rgba(255,255,255,.06) 10px,
    rgba(255,255,255,.06) 20px
  );
  border: 1px dashed rgba(255,255,255,.15);
  color: #9999b8; font-size: 12px;
  gap: 10px; padding: 14px;
  flex-wrap: wrap; text-align: center;
}

/* Skeleton shown in reserved ad space until IntersectionObserver loads the ad */
.ad-skeleton {
  width: 100%;
  height: 90px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.08) 50%,
    rgba(255,255,255,.04) 100%
  );
  background-size: 200% 100%;
  animation: ad-shimmer 1.6s ease-in-out infinite;
}
@keyframes ad-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ad-chip {
  background: rgba(167,139,255,.2);
  color: #caaaff;
  padding: 2px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.ad-hint { opacity: .8; }
.grid-ad-span { grid-column: 1 / -1; }

/* ---------- Full-screen ad loading popup ---------- */
.ad-loading-backdrop {
  /* Sit above every other overlay so it can't be buried while an ad fetches. */
  z-index: 1100;
  background: rgba(5, 5, 15, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.ad-loading-modal {
  width: auto; max-width: 360px;
  padding: 28px 32px 26px;
  text-align: center;
  background: linear-gradient(160deg, #1a1233 0%, #241646 100%);
  border: 1px solid rgba(167,139,255,.35);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
  animation: coins-modal-in .25s ease both;
}
.ad-loading-spinner {
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.ad-loading-title {
  margin: 4px 0 6px;
  font-size: 16px; font-weight: 700; letter-spacing: .02em;
  color: #fff;
}
.ad-loading-body {
  margin: 0;
  color: #b5b5d0; font-size: 13px; line-height: 1.5;
}

/* ---------- Consent Banner ---------- */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px;
  background: rgba(10,10,30,.92);
  border-top: 1px solid rgba(167,139,255,.35);
  backdrop-filter: blur(14px);
  z-index: 250;
  box-shadow: 0 -12px 40px rgba(0,0,0,.55);
  animation: consent-slide .3s ease;
}
@keyframes consent-slide {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.consent-body {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
}
.consent-text { flex: 1 1 320px; min-width: 260px; }
.consent-text strong { color: #ffb3e1; display: block; margin-bottom: 4px; font-size: 14.5px; }
.consent-text p { margin: 0; font-size: 13px; color: #d8d8ec; line-height: 1.5; }
.consent-text a { color: #a78bff; }
.consent-actions { display: flex; gap: 10px; flex-shrink: 0; }
.consent-actions .btn { padding: 9px 18px; flex: 0 0 auto; font-size: 13px; }

@media (max-width: 540px) {
  .consent-body { flex-direction: column; align-items: stretch; }
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1; }
}

/* Mock ad (dev preview) */
.mock-ad-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  animation: fade .15s ease;
  padding: 16px;
}
.mock-ad {
  width: 100%; max-width: 360px;
  background: linear-gradient(135deg,#1a1233,#2a1a55);
  border: 1px solid rgba(167,139,255,.4);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.mock-ad-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: #caaaff;
  margin-bottom: 12px;
}
.mock-ad-body {
  color: #e4e4f5; font-size: 15px;
  margin-bottom: 14px;
  min-height: 250px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  border-radius: 10px;
  padding: 8px;
  overflow: hidden;
}
.mock-ad-body > div[id^="gadz-gpt-modal-"] {
  display: flex; align-items: center; justify-content: center;
}
.mock-ad-timer {
  color: #fff; font-size: 28px; font-weight: 700;
  margin: 12px 0;
}
.mock-ad-timer span { color: #ff55b8; }
.mock-ad .btn { padding: 10px 18px; flex: 0 1 auto; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  z-index: 100;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #121226;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  width: 100%; max-width: 1100px;
  max-height: 95vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal.player { max-width: 1200px; }

/* ---------- Full-viewport game player (no modal / no backdrop) ---------- */
.game-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 900;
  animation: fade .18s ease;
}
.game-view:fullscreen,
.game-view:-webkit-full-screen {
  width: 100vw; height: 100vh;
}
.game-view-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(16,10,35,.92), rgba(16,10,35,.82));
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.game-view-title {
  margin: 0;
  font-size: 15px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.game-view-actions { display: flex; gap: 8px; flex-shrink: 0; }
.game-view-actions .btn {
  padding: 6px 12px; font-size: 14px; line-height: 1;
  min-width: 36px;
}
.game-view-iframe {
  flex: 1 1 auto;
  width: 100%; height: 100%;
  border: 0; display: block;
  background: #000;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  gap: 10px;
}
.modal-head h2 {
  margin: 0; font-size: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-actions .btn { flex: 0 0 auto; padding: 7px 12px; }

.iframe-wrap {
  flex: 1;
  background: #000;
  position: relative;
  min-height: 60vh;
}
.iframe-wrap iframe { width: 100%; height: 100%; border: 0; display: block; position: absolute; inset: 0; }

/* ---------- Out-of-Coins modal ---------- */
.modal.coins-modal {
  max-width: 440px;
  padding: 28px 24px 20px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,212,59,.18), transparent 60%),
    #141428;
  border: 1px solid rgba(255,212,59,.28);
  box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,212,59,.06);
  animation: coins-modal-in .25s cubic-bezier(.18,.9,.32,1.12);
}
@keyframes coins-modal-in {
  0%   { opacity: 0; transform: translateY(10px) scale(.96); }
  100% { opacity: 1; transform: translateY(0)    scale(1);   }
}
.coins-modal-icon {
  font-size: 56px;
  margin-bottom: 6px;
  filter: drop-shadow(0 6px 14px rgba(255,200,60,.55));
  animation: coins-icon-spin 1.4s ease-in-out infinite alternate;
}
@keyframes coins-icon-spin {
  from { transform: rotate(-6deg) translateY(0); }
  to   { transform: rotate(6deg)  translateY(-3px); }
}
.modal.coins-modal h2 {
  margin: 0 0 10px;
  font-size: 22px;
  background: linear-gradient(90deg, #ffd43b, #ff9c3b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.coins-modal-body {
  margin: 0 0 18px;
  font-size: 14.5px; line-height: 1.55;
  color: #d5d5e8;
}
.coins-modal-game { color: #ffd089; font-style: normal; font-weight: 600; }
.coins-modal-actions {
  display: flex; gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.coins-modal-actions .btn { padding: 10px 16px; min-width: 110px; font-size: 14px; }
.coins-modal-watch {
  background: linear-gradient(135deg, #ffd43b, #ff9c3b);
  color: #1a1030;
  border: 0;
  box-shadow: 0 6px 18px rgba(255,156,60,.35);
}
.coins-modal-watch:hover:not(:disabled) { filter: brightness(1.06); }
.coins-modal-watch:disabled { opacity: .7; cursor: progress; }
.coins-modal-fine {
  margin: 0;
  font-size: 11px; color: #7e7ea0;
  line-height: 1.5;
}

/* ---------- Embed modal ---------- */
.embed-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; color: #b5b5d0; }
.field textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; padding: 10px; border-radius: 8px;
  background: #0a0a1a; color: #dcdcff;
  border: 1px solid rgba(255,255,255,.1);
  resize: vertical;
}
.field input[type="number"], .url-row input {
  padding: 9px 12px; border-radius: 8px;
  background: #0a0a1a; color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
}
.sizes { display: flex; align-items: center; gap: 8px; }
.sizes input { width: 100px; }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; }

/* ---------- Mobile tweaks ---------- */
/* ---------- Header responsive: stack to two rows on tablet/phone ---- */
@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: auto auto;
    grid-template-areas: "brand wallet" "search search";
    row-gap: 10px;
    column-gap: 10px;
  }
  .brand       { grid-area: brand; }
  .coin-wallet { grid-area: wallet; justify-self: end; }
  .search-wrap { grid-area: search; max-width: 100%; justify-self: stretch; }
  .search-kbd  { display: none; }
}

@media (max-width: 540px) {
  .app { padding: 10px; }
  .header { padding: 10px 12px; border-radius: 14px; top: 6px; }
  .header-inner { row-gap: 8px; column-gap: 8px; min-height: 44px; }
  .brand { padding: 2px 6px 2px 2px; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 14.5px; }
  .brand-tag { font-size: 11px; }
  .brand-sep, .brand-stat:last-child { display: none; }
  .search { padding: 8px 12px 8px 32px; font-size: 13.5px; }
  .search-icon { left: 10px; }
  .coin-wallet-balance { padding: 4px 8px 4px 6px; gap: 6px; }
  .coin-wallet-count { font-size: 15px; }
  .coin-wallet-label { display: none; }
  .coin-wallet-earn { padding: 4px 10px; font-size: 11.5px; }
  .coin-wallet-earn-plus { font-size: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .game-meta h3 { font-size: 12.5px; }
  .btn { padding: 6px 8px; font-size: 11.5px; }
  .modal-head h2 { font-size: 14px; }
  .iframe-wrap { min-height: 70vh; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Landscape phone — prioritize game viewport */
@media (max-height: 500px) and (orientation: landscape) {
  .iframe-wrap { min-height: calc(100vh - 60px); }
  .modal { max-height: 100vh; border-radius: 0; }
}
