/* play.motionvolt.com: dark, mobile-first. Brand tokens from motionvolt.com (style.css --dl-color-*) and the favicon yellow. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #121111;
  --bg-2: #191818;
  --surface: #221f1e;
  --surface-2: #2c2826;
  --line: #3a3532;
  --text: #f6f2ee;
  --muted: #b3aca6;
  --faint: #857e78;
  --accent: #fec210;          /* favicon yellow: primary actions */
  --accent-ink: #191818;
  --orange: #e65103;          /* --dl-color-theme-primary2 */
  --orange-2: #ff6a1a;
  --lite: #2ec5ce;            /* --dl-color-turquoise-default */
  --proto: #d6b1ff;           /* --dl-color-purple-800 */
  --danger: #ff6b6b;
  --star: #fec210;
  --radius: 14px;
  --radius-sm: 8px;
  --gutter: 16px;
  --max: 1200px;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
main { flex: 1; }

/* ---------- header / footer ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.brand .play-tag { font-weight: 800; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 999px; padding: 2px 9px; }
.header-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.header-link:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; color: var(--faint); font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 20px; padding-bottom: 28px; }
.site-footer a { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font: 600 0.95rem var(--font); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffd34d; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 44px; padding: 0; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; }
.badge-lite { background: rgb(46 197 206 / 0.16); color: var(--lite); }
.badge-prototype { background: rgb(214 177 255 / 0.16); color: var(--proto); }
.badge-new { background: var(--orange); color: #fff; }
.badge-updated { background: var(--surface-2); color: var(--muted); }
.badge-hidden { background: #4a2a2a; color: #ffb3b3; }

/* ---------- featured block (documents/12) ---------- */
.featured { display: grid; gap: 14px; margin: 20px 0 8px; grid-template-columns: 1fr; }
.featured .tile-hero { grid-column: 1 / -1; }
.featured .large-pair { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) {
  .featured { grid-template-columns: 2fr 1fr; }
  .featured .tile-hero { grid-column: auto; }
  .featured .large-pair { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
.tile { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); text-decoration: none; display: block; isolation: isolate; box-shadow: var(--shadow); }
.tile img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.03); }
.tile .tile-body { position: absolute; inset: auto 0 0 0; padding: 14px; background: linear-gradient(transparent, rgb(0 0 0 / 0.85) 45%); display: grid; gap: 4px; }
.tile .tile-title { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.tile .tile-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.tile-hero .tile-body { padding: 20px; }
.tile-hero .tile-title { font-size: clamp(1.3rem, 3vw, 2rem); }
.tile-hero .tile-desc { color: #e6e0db; max-width: 52ch; font-size: 0.95rem; }
.tile-hero .btn { justify-self: start; margin-top: 6px; }
.featured .large-pair .tile img { height: 100%; }
@media (min-width: 900px) { .featured .large-pair .tile img { aspect-ratio: auto; } }
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } .tile:hover img { transform: none; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.2rem; }

.medium-row { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .medium-row { grid-template-columns: repeat(4, 1fr); } }

.scroll-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 70%); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.scroll-row > * { scroll-snap-align: start; }
@media (min-width: 720px) { .scroll-row { grid-auto-columns: minmax(240px, 300px); } }

/* ---------- game grid / cards ---------- */
.controls-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: 600 0.85rem var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
select.sort { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: 600 0.85rem var(--font); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color 0.15s; }
.card:hover { border-color: var(--line); }
.card .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.card .card-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card .card-meta { display: flex; gap: 12px; align-items: center; color: var(--faint); font-size: 0.85rem; flex-wrap: wrap; }
.stars { color: var(--star); font-weight: 700; }
.ctrl-icons { display: inline-flex; gap: 4px; }
.ctrl-icons svg { width: 16px; height: 16px; opacity: 0.7; }
.store-icons { display: inline-flex; gap: 6px; align-items: center; }
.store-icons svg { width: 15px; height: 15px; opacity: 0.85; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 220px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.empty-state { color: var(--muted); padding: 32px 0; text-align: center; }

/* ---------- play page ---------- */
.play-head { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.play-head h1 { font-size: clamp(1.2rem, 3vw, 1.6rem); margin: 0; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.notice { border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 12px; font-size: 0.9rem; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.notice-proto { background: rgb(214 177 255 / 0.1); color: #e8d9ff; }
.notice-desktop { background: rgb(254 194 16 / 0.1); color: #ffe7a3; }
.notice button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1.2rem; line-height: 1; min-width: 32px; min-height: 32px; }

.stage { position: relative; display: flex; justify-content: center; background: #000; border-radius: var(--radius); overflow: hidden; }
.frame-box { position: relative; width: 100%; max-height: calc(100dvh - 190px); aspect-ratio: var(--ar, 16 / 9); margin: 0 auto; }
.frame-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #000 center / cover no-repeat; transition: opacity 0.3s; }
.loading::after { content: ""; width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgb(255 255 255 / 0.2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.loading.done { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fullscreen (real API) and pseudo-fullscreen (iPhone fallback) */
.stage:fullscreen { border-radius: 0; align-items: center; background: #000; }
.stage:fullscreen .frame-box { max-height: 100dvh; max-width: calc(100dvh * var(--ar-num, 1.7778)); }
.stage.pseudo-fs { position: fixed; inset: 0; z-index: 100; border-radius: 0; align-items: center; height: 100dvh; }
.stage.pseudo-fs .frame-box { max-height: 100dvh; max-width: calc(100dvh * var(--ar-num, 1.7778)); }
.fs-exit { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 5; background: rgb(0 0 0 / 0.6); color: #fff; border: 1px solid rgb(255 255 255 / 0.3); border-radius: 999px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.rotate-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgb(0 0 0 / 0.7); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; z-index: 5; }
body.no-scroll { overflow: hidden; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 0; }
.toolbar .spacer { flex: 1; }
.controls-hint { color: var(--faint); font-size: 0.85rem; display: flex; gap: 6px; align-items: center; }

.panel { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.panel h2 { margin: 0 0 8px; font-size: 1.05rem; }
.panel p { margin: 0 0 10px; color: var(--muted); }

/* rating */
.rating .star-row { display: inline-flex; gap: 2px; }
.rating .star-row button { background: none; border: 0; font-size: 1.9rem; line-height: 1; color: var(--line); cursor: pointer; padding: 2px 3px; min-width: 40px; min-height: 44px; }
.rating .star-row button.on { color: var(--star); }
.rating .star-row button:disabled { cursor: not-allowed; }
.rating textarea { width: 100%; min-height: 76px; resize: vertical; margin-top: 8px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; font: 0.95rem var(--font); }
.rating .rating-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.rating .hint { color: var(--faint); font-size: 0.8rem; }
.reviews ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.reviews li { display: grid; gap: 4px; }
.reviews li + li { border-top: 1px solid var(--line); padding-top: 12px; }
.reviews p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-stars { color: var(--accent); letter-spacing: 2px; font-size: 0.9rem; }
.rating .rating-public { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.rating .rating-public input { margin-top: 2px; accent-color: var(--accent); }
.rating .status { font-size: 0.9rem; color: var(--muted); }
.rating .status.ok { color: #9be39b; }
.rating .status.err { color: var(--danger); }

/* full-game panel + promo strip */
.fullgame { display: grid; gap: 12px; grid-template-columns: auto 1fr; align-items: center; background: linear-gradient(135deg, rgb(230 81 3 / 0.18), rgb(140 48 245 / 0.14)); border: 1px solid rgb(230 81 3 / 0.35); }
.fullgame .mg-icon { width: 72px; height: 72px; border-radius: 18px; }
.fullgame .fg-text h2 { margin: 0 0 2px; }
.fullgame .fg-text p { margin: 0; }
.fullgame .store-buttons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) { .fullgame { grid-template-columns: auto 1fr auto; } .fullgame .store-buttons { grid-column: auto; } }

.promo-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
@media (min-width: 900px) { .promo-strip { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } }
.promo-item { display: grid; gap: 6px; justify-items: center; text-align: center; text-decoration: none; padding: 8px 4px; border-radius: var(--radius-sm); }
.promo-item:hover { background: var(--surface-2); }
.promo-item .title { font-size: 0.85rem; font-weight: 600; line-height: 1.2; }
.mg-icon { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; background: var(--surface-2); }
.mg-letter { display: grid; place-items: center; font-weight: 800; font-size: 2rem; color: var(--accent-ink); background: var(--accent); }

/* In the page flow under the toolbar, never floating over the game. */
.toast { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 12px; align-items: center; margin: 0 0 12px; }
.toast .toast-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; }
.toast .close { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; min-width: 32px; min-height: 32px; }

/* bookmark popover / sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.55); z-index: 80; display: grid; align-items: end; justify-items: center; }
@media (min-width: 720px) { .sheet-backdrop { align-items: center; } }
.sheet { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 20px; width: min(100%, 440px); box-shadow: var(--shadow); }
@media (min-width: 720px) { .sheet { border-radius: 18px; } }
.sheet h2 { margin: 0 0 6px; font-size: 1.1rem; }
.sheet p { margin: 0 0 10px; color: var(--muted); }
.sheet kbd { background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font: 600 0.9rem var(--font); color: var(--text); }
.sheet .sheet-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.prose { max-width: 70ch; }
.prose h1 { font-size: 1.8rem; }
.prose h2 { font-size: 1.15rem; margin-top: 1.6em; }
.prose p, .prose li { color: #ddd6d0; }
.raterid { font-family: ui-monospace, monospace; background: var(--surface); padding: 2px 6px; border-radius: 6px; }

/* Official store badges: App Store and Google Play badges carry their own black plate; Steam's logo is black on transparent. */
.store-badge-link { display: inline-flex; border-radius: 9px; }
.store-badge { height: 44px; width: auto; }
.store-badge-steam { background: #fff; border-radius: 9px; padding: 6px 12px; box-sizing: border-box; }

/* Phones: the hero's text sits under the image instead of over it, so nothing gets clipped. */
@media (max-width: 719px) {
  .tile-hero .tile-body { position: static; background: var(--surface); padding: 14px 16px 16px; }
  .tile-hero img { height: auto; border-radius: var(--radius) var(--radius) 0 0; }
  .large-pair .tile .tile-body { padding: 10px; }
  .large-pair .tile .tile-title { font-size: 0.95rem; }
}

/* ---------- stamps ("Experimental", "Halloween Special", …) ---------- */
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
  padding: 5px 9px; border-radius: 6px; border: 2px solid currentColor;
  background: rgb(18 17 17 / 0.82); color: var(--text);
  transform: rotate(-2deg); box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
}
.stamp:nth-child(2n) { transform: rotate(1.5deg); }
.stamp-experimental { color: #d6b1ff; border-style: dashed; }
.stamp-halloween { color: #ff8a1f; background: rgb(28 12 2 / 0.88); }
.stamp-christmas { color: #ff5a5a; }
.stamp-winter { color: #9fdcff; }
.stamp-valentines { color: #ff7aa8; }
.stamp-easter { color: #c9f27a; }
.stamp-spring { color: #ffb1e6; }
.stamp-summer { color: #fec210; }
.stamp-autumn { color: #e8a33d; }
.stamp-custom { color: #f6f2ee; }
/* On thumbnails: top-left corner, above the image */
.stamps-overlay { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; pointer-events: none; }
.thumb { position: relative; }
.play-head .stamps { margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .stamp, .stamp:nth-child(2n) { transform: none; } }

/* ---------- front page with only a few games ---------- */
.large-pair.large-count-1 { grid-template-rows: 1fr; }
.tile-soon { display: grid; place-items: center; min-height: 180px; background: linear-gradient(135deg, rgb(140 48 245 / 0.18), rgb(230 81 3 / 0.14)); border: 2px dashed var(--line); box-shadow: none; }
.tile-soon .soon-body { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 20px; }
.tile-soon .soon-emoji { font-size: 2rem; }
.tile-soon p { margin: 0; color: var(--muted); font-size: 0.9rem; max-width: 30ch; }
/* Until the side column appears (≥ 900px), a lone side tile spans the full width. */
@media (max-width: 899px) {
  .large-pair.large-count-1 { grid-template-columns: 1fr; }
}

.tile-hero .stamp { font-size: 0.85rem; padding: 6px 11px; }
.tile-hero .stamps-overlay { top: 14px; left: 14px; }

/* Phones: side tiles stack full width with their text under the image (stamps never cover titles). */
@media (max-width: 719px) {
  .featured .large-pair { grid-template-columns: 1fr; }
  .large-pair .tile .tile-body { position: static; background: var(--surface); padding: 12px 14px 14px; }
  .featured .large-pair .tile img { height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius) var(--radius) 0 0; }
  .large-pair .tile .tile-title { font-size: 1.05rem; }
  .stamp { font-size: 0.66rem; padding: 4px 7px; }
  .tile-hero .stamp { font-size: 0.75rem; padding: 5px 9px; }
}
.badge-mini { background: rgb(254 194 16 / 0.16); color: var(--accent); }
.badge-online { background: rgb(56 189 248 / 0.16); color: #38bdf8; }

/* Front page: games first; compact bookmark and the short description in the header. */
.featured { margin-top: 20px; }
.site-header .bookmark-btn.compact { min-height: 34px; padding: 0 12px; }
@media (max-width: 479px) {
  .site-header .header-link { display: none; } /* the footer links there too */
}

/* Smaller tiles and cards: compact stamps on one line, so they cover as little of the thumbnail as possible. */
.tile-large .stamp, .tile-medium .stamp, .card .stamp { font-size: 0.6rem; padding: 3px 6px; border-width: 1.5px; letter-spacing: 0.04em; }
.tile-large .stamps-overlay, .tile-medium .stamps-overlay, .card .stamps-overlay { top: 8px; left: 8px; right: 8px; gap: 4px; }

/* ---------- No overlays on thumbnails ----------
   The picture is always shown whole, at exactly 16:9, with nothing on top: stamps, badges, title and Play button
   sit below it on every screen size. Any 16:9 image works as a thumbnail; no safe areas to design around.
   (Overrides the earlier overlay rules above.) */
.tile { display: flex; flex-direction: column; background: var(--surface); }
.tile img,
.featured .large-pair .tile img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; flex: none; border-radius: 0; transform: none; }
.tile:hover img { transform: none; filter: brightness(1.08); }
.tile .tile-body,
.tile-hero .tile-body,
.large-pair .tile .tile-body { position: static; inset: auto; background: none; padding: 12px 14px 14px; flex: 1; display: grid; gap: 6px; align-content: start; }
.tile-hero .tile-body { padding: 16px 20px 20px; gap: 8px; }
.tile-hero .tile-desc { color: var(--muted); }
.stamps-overlay { position: static; }
.card-body .stamps, .tile-body .stamps { margin-bottom: 2px; }
@media (min-width: 900px) {
  .featured { align-items: start; }
  .featured .large-pair { grid-template-rows: auto; align-content: start; }
}

/* ---------- Tile & card info panel (final layout) ----------
   Under each picture: one row of chips (stamps + badges, all the same pill style), then the title with a Play
   affordance on the right, an optional description, and a quiet "★ 4.2 · 1.2k plays" line. */
.tile, .card { border: 1px solid var(--line); background: var(--surface); transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; box-shadow: none; }
.tile:hover, .card:hover { transform: translateY(-2px); border-color: #4a443f; box-shadow: var(--shadow); }
.tile:hover img, .card:hover img { filter: none; }
.tile:focus-visible, .card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tile, .card { transition: none; } .tile:hover, .card:hover { transform: none; } }

.tile .tile-body { padding: 12px 14px 14px; gap: 8px; }
.tile-hero .tile-body { padding: 16px 20px 18px; gap: 10px; }
.card .card-body { padding: 12px 14px 14px; gap: 8px; }

/* Chips: stamps and badges share one look. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.chips .stamp, .chips .badge, .play-head .stamp, .play-head .badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; margin: 0;
  border-radius: 999px; border: 1px solid transparent; transform: none; box-shadow: none;
  font: 700 0.66rem/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.chips .stamp, .play-head .stamp { background: color-mix(in srgb, currentColor 13%, transparent); border-color: color-mix(in srgb, currentColor 35%, transparent); }
.chips .stamp-experimental, .play-head .stamp-experimental { border-style: dashed; border-color: color-mix(in srgb, currentColor 60%, transparent); }
.chips .badge-new, .play-head .badge-new { background: var(--orange); color: #fff; }
.chips .badge-updated { background: var(--surface-2); color: var(--muted); }
.chips .badge-hidden, .play-head .badge-hidden { background: #3f2626; color: #ffb3b3; }

/* Title row with the Play affordance */
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tile-text { display: grid; gap: 4px; min-width: 0; }
.tile .tile-title { font-size: 1.02rem; font-weight: 800; line-height: 1.25; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-hero .tile-title { font-size: clamp(1.3rem, 2.4vw, 1.75rem); white-space: normal; letter-spacing: -0.01em; }
.tile-hero .tile-desc { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; max-width: 60ch; }

/* Meta line: "★ 4.2 · 1.2k plays · ⌨ · stores" */
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; color: var(--faint); font-size: 0.82rem; }
.meta-line > * { display: inline-flex; align-items: center; }
.meta-line > * + *::before { content: "·"; margin: 0 8px; color: var(--line); }
.card h3 { margin: 0; font-size: 1.02rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }


/* "More games on the way" tile matches the others */
.tile-soon { border: 1px dashed var(--line); }
.tile-soon:hover { transform: none; box-shadow: none; }

/* ---------- Play: big and green ---------- */

/* ---------- Links, section heads, footer (final) ---------- */
a { text-underline-offset: 3px; }
.header-link, .site-footer a, .back-link { text-decoration: none; transition: color 0.15s; }
.header-link:hover, .site-footer a:hover, .back-link:hover { color: var(--text); text-decoration: underline; }
.section-head { margin: 40px 0 14px; }
.section-head h2 { font-size: 1.15rem; letter-spacing: -0.01em; }

.promo-item { padding: 10px 6px; border-radius: 14px; transition: background 0.15s; }
.promo-item .title { color: var(--muted); font-weight: 600; }
.promo-item:hover .title { color: var(--text); }
.promo-item .mg-icon { box-shadow: 0 4px 14px rgb(0 0 0 / 0.35); transition: transform 0.15s; }
.promo-item:hover .mg-icon { transform: translateY(-2px); }

.site-footer { margin-top: 28px; border-top: 0; background: var(--bg-2); }
.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; align-items: center; gap: 10px 24px; }
.site-footer span { margin-right: auto; }

/* ---------- Play page (final layout) ---------- */
.play-head { display: flex; align-items: center; gap: 14px; padding: 18px 0 14px; }
.back-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 1.1rem; transition: background 0.15s; }
.back-btn:hover { background: var(--surface-2); }
.play-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.play-title h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -0.015em; line-height: 1.15; }

/* The game and its toolbar are one unit */
.player { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.player .stage { border-radius: 0; }
.player .toolbar { background: var(--surface); padding: 10px 12px; margin: 0; border-top: 1px solid var(--line); gap: 10px; }
.player .toolbar .btn { background: var(--surface-2); }
.player .toolbar .btn:hover { background: #38332f; }

.notice { margin-bottom: 14px; }

/* Below the game: two columns on desktop */
.play-grid { display: grid; gap: 16px; margin-top: 18px; align-items: start; }
@media (min-width: 900px) { .play-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } .play-grid.no-side { grid-template-columns: minmax(0, 1fr); max-width: 760px; } }
.play-main, .play-side { display: grid; gap: 16px; min-width: 0; }
.play-grid .panel { margin: 0; border: 1px solid var(--line); padding: 18px; }
.panel h2 { font-size: 1rem; letter-spacing: -0.005em; margin: 0 0 10px; }
.about p { margin: 0 0 10px; color: #ddd6d0; }
.about .controls-line { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 0.85rem; }
.about .controls-line .ctrl-icons svg { width: 18px; height: 18px; }

/* Get the full game: stacked in the side column */
.play-side .fullgame { grid-template-columns: auto 1fr; }
.play-side .fullgame .store-buttons { grid-column: 1 / -1; }
.play-side .fullgame h2 { margin: 0 0 2px; }
.play-side .fullgame .mg-icon { width: 64px; height: 64px; border-radius: 16px; }

/* "Our full games" in the side column: icon grid */
.play-side .promo-strip { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; }
.play-side .promo-item .mg-icon { width: 64px; height: 64px; border-radius: 16px; }

/* Rating */
.rating .star-row { gap: 4px; }
.rating .star-row button { font-size: 2.3rem; min-width: 46px; min-height: 50px; color: #3d3733; transition: color 0.12s, transform 0.12s; }
.rating .star-row button.on { color: var(--star); }
.rating .star-row button:not(:disabled):hover { transform: scale(1.12); }
.rating textarea { margin-top: 12px; background: var(--bg); }
.rating .rating-foot { margin-top: 10px; }
.toast { border-radius: var(--radius); margin: 14px 0 0; }
.play-head { flex-wrap: nowrap; align-items: flex-start; }
.play-head .back-btn { margin-top: 2px; }
.player .toolbar { flex-wrap: nowrap; }

/* =====================================================================================
   Game-site look: each game's own colours glow around it, a rounded display font,
   soft brand light behind the page, and tiles that react.
   ===================================================================================== */
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
:root { --display: "Fredoka", "Inter", system-ui, sans-serif; --radius: 18px; }

/* Page: soft purple/orange light and a faint dot grid instead of flat black */
body {
  background:
    radial-gradient(1100px 560px at 8% -8%, rgb(140 48 245 / 0.18), transparent 62%),
    radial-gradient(900px 520px at 105% 6%, rgb(230 81 3 / 0.15), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgb(46 197 206 / 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1.2px); background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.site-header { background: rgb(18 17 17 / 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: rgb(255 255 255 / 0.06); }

/* Display font for titles, headings and the big buttons */
.tile .tile-title, .play-title h1, .section-head h2, .panel h2, .card h3, .tile-soon .tile-title, .prose h1, .prose h2, .empty-state h1, .btn-play {
  font-family: var(--display); font-weight: 600; letter-spacing: 0;
}
.tile-hero .tile-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; }
.tile .tile-title { font-size: 1.18rem; }
.play-title h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.section-head h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: linear-gradient(var(--accent), var(--orange)); }

/* Tiles: the card sits on a soft glow made from the game's own thumbnail */
.tile, .tile:hover { position: relative; overflow: visible; background: none; border: 0; box-shadow: none; transform: none; isolation: isolate; text-decoration: none; }
.tile-glow {
  position: absolute; inset: 14% 6% -3%; z-index: 0; border-radius: var(--radius);
  background: var(--thumb) center / cover; filter: blur(30px) saturate(1.8); opacity: 0.32;
  transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
}
.tile-card {
  position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: rgb(34 31 30 / 0.92); border: 1px solid rgb(255 255 255 / 0.08); border-radius: var(--radius);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), border-color 0.22s;
}
.tile:hover .tile-card { transform: translateY(-4px); border-color: rgb(255 255 255 / 0.18); }
.tile:hover .tile-glow { opacity: 0.75; transform: translateY(2px) scale(1.02); }
.tile:active .tile-card { transform: translateY(-1px) scale(0.995); }
.tile img { transition: filter 0.22s; }
.tile:hover img { filter: brightness(1.06) saturate(1.08); }
.tile.tile-soon { background: linear-gradient(135deg, rgb(140 48 245 / 0.18), rgb(230 81 3 / 0.14)); border: 1.5px dashed rgb(255 255 255 / 0.14); border-radius: var(--radius); overflow: hidden; }

/* Featured block: the hero game's art, blurred, lights the area behind it */
.featured { position: relative; isolation: isolate; margin-top: 28px; }
.ambient {
  position: absolute; inset: -60px -40px auto; height: 620px; z-index: -1; pointer-events: none;
  background: var(--thumb) center / cover; filter: blur(80px) saturate(1.6); opacity: 0.38;
  mask-image: radial-gradient(closest-side, #000 55%, transparent);
}

/* Green Play: a quick shine on hover */
.btn-play { position: relative; overflow: hidden; }
.btn-play::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.45) 50%, transparent 70%);
  transition: transform 0.7s ease;
}
.tile:hover .btn-play::after { transform: translateX(130%); }
@media (prefers-reduced-motion: reduce) {
  .tile-card, .tile-glow, .btn-play::after { transition: none; }
  .tile:hover .tile-card, .tile:hover .tile-glow { transform: none; }
}

/* Chips a touch rounder and brighter */
.chips .stamp, .chips .badge, .play-head .stamp, .play-head .badge { height: 24px; padding: 0 10px; font-size: 0.68rem; }

/* Play page: the game's art glows behind the player */
.player-wrap { position: relative; isolation: isolate; }
.player-wrap .ambient { inset: -40px -30px; height: auto; opacity: 0.45; mask-image: radial-gradient(closest-side, #000 60%, transparent); }
.player { border-color: rgb(255 255 255 / 0.1); border-radius: var(--radius); }
.play-grid .panel, .panel { background: rgb(34 31 30 / 0.9); border: 1px solid rgb(255 255 255 / 0.08); border-radius: var(--radius); }
.promo-item .mg-icon { border-radius: 22%; }
.tile.tile-hero .tile-title { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; }

/* Glows extend past their boxes; never let them cause sideways scrolling. */
html, body { overflow-x: clip; }

/* Front page: what the site is, right under the header */
.site-intro p { margin: 0 auto; padding-top: 18px; padding-bottom: 4px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.5em; row-gap: 4px; text-align: center; line-height: 1.4; }
.site-intro .lead { color: var(--muted); font-family: var(--display); font-weight: 500; font-size: clamp(0.9rem, 0.82rem + 0.4vw, 1.05rem); text-wrap: balance; }
.site-intro .sub { color: rgb(254 194 16 / 0.75); font-weight: 500; font-size: clamp(0.82rem, 0.78rem + 0.25vw, 0.92rem); }

/* Site description: one quiet centered line right above the footer */
.site-about { margin-top: 28px; background: var(--bg-2); border-bottom: 1px solid rgb(255 255 255 / 0.05); }
.site-about + .site-footer { margin-top: 0; }
.site-about p {
  margin: 0 auto; padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.4em;
  text-align: center; color: var(--faint); font-size: 0.74rem; font-style: italic; line-height: 1.5; letter-spacing: 0.01em;
}

/* YouTube channel pill next to "Our full games" */
.section-head { align-items: center; }
.yt-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.1);
  color: var(--text); font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.yt-link svg { width: 22px; height: 22px; flex: none; }
.yt-link:hover { background: rgb(255 0 51 / 0.14); border-color: rgb(255 0 51 / 0.4); }
.panel-foot { margin-top: 12px; }

/* Title card in place of a missing thumbnail (hidden games being tested) */
.thumb-card {
  width: 100%; aspect-ratio: 16 / 9; flex: none; display: grid; place-items: center; padding: 8%;
  background: radial-gradient(rgb(255 255 255 / 0.08) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--thumb);
}
.thumb-card span {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 7cqi, 3.2rem); line-height: 1.05; text-align: center;
  color: #fff; text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
.tile-card, .card .thumb { container-type: inline-size; }
.card .thumb .thumb-card { height: 100%; }

/* Play page: keep everything around a running game static and cheap, so the game gets every frame.
   No blur filters, backdrop blur, masks or running animations here: Safari and phones redraw those
   on every frame the game draws. The glow behind the player is a plain gradient in the art's colour. */
.play-page { background-attachment: scroll; }
.play-page::before { display: none; }
.play-page .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-2); }
.player-wrap .ambient {
  filter: none; mask-image: none; -webkit-mask-image: none; opacity: 1;
  background: radial-gradient(closest-side, var(--glow, rgb(140 48 245 / 0.4)), transparent);
}

/* No rounded clipping over the game: a rounded mask around a constantly redrawn frame costs Safari and
   phones an extra pass on every game frame. The game area is square; the toolbar keeps the rounded corners.
   svh, not dvh: the frame must not resize while a phone's toolbars slide in and out. */
.player { overflow: visible; border-radius: 0 0 var(--radius) var(--radius); }
.player .stage, .stage { overflow: visible; border-radius: 0; }
.player .toolbar { border-radius: 0 0 var(--radius) var(--radius); }
.frame-box { max-height: calc(100svh - 190px); }

/* Share panel (portal/js/share.js): QR code, copy link, messengers */
.sheet-share { width: min(100%, 460px); }
.share-qr { display: flex; gap: 16px; align-items: center; margin: 6px 0 14px; }
.share-qr img { flex: none; border-radius: 10px; background: #fff; }
.share-qr p { margin: 0; }
.share-copy { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url { flex: 1; min-width: 0; background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; font: 500 0.85rem var(--font); }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.share-links .btn { background: var(--surface-2); }
.share-links svg, .share-copy svg { width: 18px; height: 18px; }
.share-whatsapp svg { color: #25d366; }
.share-facebook svg { color: #1877f2; }
@media (max-width: 479px) { .share-qr img { width: 120px; height: 120px; } }

/* Player toolbar on phones: Fullscreen, Share and Bookmark in one row. Fullscreen shows only its icon,
   and the other labels shorten with "…" rather than push the row wider than the screen. */
.player .toolbar .btn { min-width: 0; }
.player .toolbar .btn .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) {
  .player .toolbar .fs-btn .label { display: none; }
  .player .toolbar .fs-btn { padding: 0 11px; }
}

/* Share bar under the game, and crowns (portal/js/share.js, crowns.js). Static: the only motion is a
   one-time pop when a crown is earned. */
.share-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin-top: 10px; padding: 7px 8px 7px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgb(254 194 16 / 0.13), rgb(230 81 3 / 0.08)); border: 1px solid rgb(254 194 16 / 0.3);
}
.share-bar-text { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; min-width: 0; }
.share-bar-text svg { width: 22px; height: 22px; flex: none; }
.share-bar-actions { display: flex; gap: 8px; }
.share-bar .btn { min-height: 38px; padding: 0 16px; font-family: var(--display); font-size: 0.95rem; font-weight: 600; }
.share-btn .label-short { display: none; }
.btn-share { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-share:hover { background: #ffd23f; color: var(--accent-ink); }
.share-bar .bookmark-btn { background: var(--orange); color: #fff; border-color: transparent; } /* brand orange beside the yellow Share */
.share-bar .bookmark-btn:hover { background: var(--orange-2); color: #fff; }
@media (max-width: 599px) {
  .share-bar { padding: 8px 10px; }
  .share-bar-text { font-size: 0.82rem; }
  .share-bar-actions { width: 100%; }
  .share-bar-actions .btn { flex: 1; justify-content: center; padding: 0 12px; }
  .share-bar .share-btn .label-long { display: none; }
  .share-bar .share-btn .label-short { display: inline; }
}
.play-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crown-row { display: inline-flex; gap: 2px; }
.crown-row svg { width: 28px; height: 28px; display: block; filter: drop-shadow(0 2px 5px rgb(254 194 16 / 0.4)); }
.crown-new svg { animation: crown-pop 0.7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes crown-pop { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .crown-new svg { animation: none; } }
.crowned .player { border-color: rgb(254 194 16 / 0.55); box-shadow: 0 0 0 1px rgb(254 194 16 / 0.15), var(--shadow); }
.crowned .play-head h1 { color: #ffe7a3; }
.badge-crowns { display: inline-flex; align-items: center; gap: 3px; background: rgb(254 194 16 / 0.16); color: var(--accent); }
.badge-crowns svg { width: 14px; height: 14px; }
.rate-share { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rate-share p { margin: 0; color: var(--text); }
.rate-share .btn { min-height: 44px; padding: 0 18px; font-family: var(--display); font-weight: 600; }

/* Rating before it unlocks: one line with the countdown, no stars yet; they fade in once usable */
.rating .rating-lock { display: none; align-items: center; gap: 10px; margin: 2px 0 0; color: var(--muted); }
.rating .rating-lock svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.rating[data-state="locked"] .rating-lock { display: flex; }
.rating[data-state="locked"] .star-row, .rating[data-state="locked"] textarea, .rating[data-state="locked"] .rating-foot, .rating[data-state="locked"] .rating-public { display: none; }
.rating[data-state="open"] .star-row { animation: rating-in 0.35s ease both; }
@keyframes rating-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rating[data-state="open"] .star-row { animation: none; } }

/* Line under the "Our full games" heading on the front page */
.section-sub { margin: -6px 0 14px; color: var(--muted); font-size: 0.92rem; }

/* Games with orientation "any" (e.g. Domino Chain): on an upright phone the frame takes a tall, phone-like shape
   instead of a thin 16:9 strip; in fullscreen they fill the whole screen whichever way it's held. */
@media (max-width: 767px) and (orientation: portrait) {
  .frame-box.frame-any { aspect-ratio: auto; height: min(calc(100svh - 160px), 170vw); max-height: none; }
}
.stage:fullscreen .frame-box.frame-any, .stage.pseudo-fs .frame-box.frame-any { aspect-ratio: auto; width: 100%; height: 100dvh; max-width: none; max-height: none; }

/* Filter buttons on phones: labels never break inside ("Mini games"); if the row is wider than the screen it
   scrolls sideways inside its pill instead of squeezing. */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; }

/* Smaller green Play buttons: the two side tiles of the featured block and every "All games" card */
.card .card-body { display: flex; flex-direction: column; flex: 1; } /* the Play row sits at the bottom of every card */
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.card-foot .btn-play-sm { margin-left: auto; }
.card:hover .btn-play::after { transform: translateX(130%); }

/* ---------- Play button (hero, side tiles, "All games" cards) ----------
   A round ▶ button, no words: deep green with some depth (soft gradient, light top edge, darker bottom edge), so it
   reads as a button without being the brightest thing on the page. On hover it lifts 1px and the shine sweeps once
   (the ::after rule above). */
:root { --play-top: #1a9a4c; --play-bottom: #12703a; --play-top-hover: #22ad57; --play-bottom-hover: #158043; }
.btn-play, .btn-play.btn-play-sm {
  position: relative; overflow: hidden; flex: none; display: grid; place-items: center;
  width: 60px; height: 60px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%;
  border: 0;
  background: linear-gradient(180deg, var(--play-top), var(--play-bottom)); color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), inset 0 -3px 0 rgb(0 0 0 / 0.2), 0 4px 12px rgb(0 0 0 / 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-play svg { width: 26px; height: 26px; margin-left: 2px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.25)); }
.btn-play.btn-play-sm { width: 44px; height: 44px; }
.btn-play.btn-play-sm svg { width: 19px; height: 19px; }
.btn-play::after { background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.28) 50%, transparent 70%); }
.tile:hover .btn-play, .card:hover .btn-play {
  background: linear-gradient(180deg, var(--play-top-hover), var(--play-bottom-hover));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.24), inset 0 -3px 0 rgb(0 0 0 / 0.2), 0 6px 16px rgb(22 163 74 / 0.25);
  transform: translateY(-1px);
}
.tile:active .btn-play, .card:active .btn-play { transform: translateY(1px); box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.3); }
@media (prefers-reduced-motion: reduce) { .tile:hover .btn-play, .card:hover .btn-play { transform: none; } }

/* Control icons (touch, mouse, keyboard, gamepad) on tiles and cards: big enough to read at a glance */
.meta-line .ctrl-icons { gap: 7px; color: var(--muted); }
.meta-line .ctrl-icons svg { width: 18px; height: 18px; opacity: 1; }
.ctrl-labels { flex-wrap: wrap; gap: 4px 12px; }
.ctrl-labels .ctrl { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; }
.meta-line .ctrl-labels svg { width: 16px; height: 16px; }

/* "All games" cards: on hover the game's own colours glow under the card, like the featured tiles. The card's
   look moves to .card-inner so the glow can sit behind it. */
.card, .card:hover { position: relative; overflow: visible; isolation: isolate; background: none; border: 0; box-shadow: none; }
.card-inner {
  position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover .card-inner { border-color: #4a443f; box-shadow: var(--shadow); }
.card-glow {
  position: absolute; inset: 14% 6% -3%; z-index: 0; border-radius: var(--radius); pointer-events: none;
  background: var(--thumb) center / cover; filter: blur(30px) saturate(1.8); opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.card:hover .card-glow { opacity: 0.7; transform: translateY(2px) scale(1.02); }
@media (prefers-reduced-motion: reduce) { .card-glow { transition: none; } .card:hover .card-glow { transform: none; } }

/* Password screen while testing (portal/js/gate.js): the page stays hidden until the password is entered */
html[data-locked] body > :not(.gate) { display: none; }
.gate { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.gate form {
  width: min(100%, 360px); display: grid; gap: 12px; text-align: center; padding: 28px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.gate img { height: 32px; width: auto; margin: 0 auto 6px; }
.gate h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.6rem; }
.gate p { margin: 0; color: var(--muted); }
.gate input {
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: 500 1rem var(--font); text-align: center;
}
.gate input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate .btn { min-height: 48px; font-size: 1rem; }
.gate .gate-err { color: var(--danger); min-height: 1.3em; font-size: 0.9rem; }

/* "Rate this game" in the title row; it opens the rating dialog over the page */
.rate-btn { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 600 0.95rem var(--display); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.rate-btn:hover { background: var(--surface-2); }
.rate-btn .rate-star { color: var(--star); font-size: 1.15rem; line-height: 1; }
.rate-btn .label-short { display: none; }
.rate-btn.ready { background: var(--accent); border-color: var(--accent); color: #1d1b19; }
.rate-btn.ready .rate-star { color: #1d1b19; }
@media (max-width: 479px) {
  .rate-btn { padding: 0 12px; }
  .rate-btn .label-long { display: none; }
  .rate-btn .label-short { display: inline; }
}

.sheet.rating { position: relative; width: min(100%, 460px); padding: 22px 22px 20px; text-align: left; }
.sheet.rating h2 { font-size: 1.35rem; margin: 0 0 10px; }
.rating .rating-game { margin: 0 0 2px; color: var(--muted); font-size: 0.85rem; padding-right: 40px; }
.rating .star-row { display: flex; justify-content: center; margin: 4px 0 2px; }
.rating .rating-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.rating .rating-close:hover { background: #38332f; }
.rating .rate-share { justify-content: center; text-align: center; }

/* Desktop: a full game's phone-store QR codes in a popup under its icon (promo.js phoneQr) */
.qr-pop { position: absolute; z-index: 70; width: 330px; max-width: calc(100vw - 24px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 12px; box-shadow: var(--shadow); }
.qr-pop h3 { margin: 0 36px 2px 0; font: 600 1.05rem var(--display); }
.qr-pop p { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.qr-pop-codes { display: flex; justify-content: center; gap: 14px; }
.qr-pop figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.qr-pop figure > img { display: block; width: 132px; height: 132px; border-radius: 10px; background: #fff; }
.qr-pop .store-badge { height: 40px; width: auto; clip-path: inset(1.5px round 6px); } /* the official badge files carry a thin grey outline; hide it here */
.qr-pop-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.qr-pop-close:hover { background: #38332f; }
.promo-item.qr-open { background: var(--surface-2); }

/* "More games" under the game on its play page: every other game as a small card. */
.more-games { margin-top: 4px; }
.more-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.card-small .card-body { padding: 8px 10px 10px; gap: 4px; }
.card-small h3 { font-size: 0.95rem; }
@media (max-width: 479px) { .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .card-small h3 { font-size: 0.88rem; } }

/* Square games (aspectRatio "1:1" in game.json): a square frame as big as the screen height allows, also on an
   upright phone (where "any" games would otherwise take a tall phone shape). Fullscreen still fills the screen. */
.frame-box.frame-square { width: min(100%, calc(100dvh - 150px)); max-height: none; aspect-ratio: 1 / 1; }
@media (max-width: 767px) and (orientation: portrait) {
  .frame-box.frame-any.frame-square { aspect-ratio: 1 / 1; height: auto; width: 100%; }
}
