/* Games: hero prompt card, genre chips, gallery grid, full-screen player */
.games-body { overflow-x: hidden; }

/* ---------- hero ---------- */
.g-hero { position: relative; display: grid; place-items: center; padding: 40px var(--pad) 26px; isolation: isolate; }
.g-hero-glow {
  position: absolute; inset: 0 0 -60px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 60% at 22% 30%, rgba(255, 191, 47, 0.13), transparent 70%),
    radial-gradient(ellipse 40% 55% at 80% 20%, rgba(255, 79, 109, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(124, 240, 255, 0.07), transparent 70%);
}
.g-hero-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 75%);
}
.g-hero-card {
  position: relative; width: min(1000px, 100%); padding: 34px 30px 22px; text-align: center;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.92), rgba(16, 16, 18, 0.92)); border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.g-eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.g-eyebrow .badge-new { margin: 0 6px 0 0; }
.g-hero h1 { margin: 14px 0 0; font-size: clamp(42px, 6.6vw, 94px); }
.g-hero h1 em { font-style: normal; color: var(--accent); }
.g-sub { margin: 14px auto 22px; max-width: 560px; color: var(--muted); font-size: 16px; }

.g-prompt {
  position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: stretch;
  padding: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.g-prompt:focus-within { border-color: rgba(255, 191, 47, 0.55); box-shadow: 0 0 0 4px rgba(255, 191, 47, 0.08); }
.g-art-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 112px; padding: 8px;
  border: 1.5px dashed var(--line-2); border-radius: 13px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; overflow: hidden;
}
.g-art-tile:hover, .g-art-tile[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }
.g-art-tile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.g-art-thumbs { display: flex; gap: 3px; }
.g-art-thumbs:empty { display: none; }
.g-art-thumbs img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#2a2a2e 0 25%, #1f1f22 0 50%) 0 0 / 10px 10px; }
.g-art-tile.has-art svg { display: none; }
.g-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.g-field textarea {
  width: 100%; min-height: 60px; flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font: 500 18px/1.4 var(--ui); padding: 6px 4px 0;
}
.g-field textarea::placeholder { color: var(--dim); }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.g-chip:hover { background: var(--surface-3); }
.g-chip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.g-chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.g-chip.ghost { background: transparent; color: var(--muted); }
.g-chip.ghost:hover { color: var(--text); }
.g-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); height: 34px; }
.g-seg button { border: 0; background: transparent; color: var(--muted); font: 800 14px/1 var(--display); letter-spacing: 0.05em; padding: 0 11px; border-radius: 7px; }
.g-seg button[aria-checked="true"] { background: var(--text); color: var(--bg); }
.g-seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.g-toggle { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px 0 6px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.g-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.g-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--surface-3); transition: background 0.15s; }
.g-switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.g-toggle input:checked + .g-switch { background: var(--accent); }
.g-toggle input:checked + .g-switch::after { transform: translateX(12px); background: var(--accent-ink); }
.g-toggle input:focus-visible + .g-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-go {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 170px; padding: 0 26px; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font: 900 24px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: 0 12px 34px rgba(255, 191, 47, 0.22); transition: background 0.15s, transform 0.1s;
}
.g-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.g-go:hover { background: var(--accent-hi); }
.g-go:active { transform: translateY(1px); }
.g-go:disabled { opacity: 0.7; cursor: progress; }

.g-pop {
  position: absolute; left: 136px; top: calc(100% + 8px); z-index: 30; width: min(560px, calc(100% - 148px));
  padding: 10px; background: #19191c; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
}
.g-opt { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; align-items: center; padding: 9px 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; color: var(--text); }
.g-opt:hover { background: var(--surface-2); }
.g-opt[aria-selected="true"] { border-color: rgba(255, 191, 47, 0.5); background: rgba(255, 191, 47, 0.06); }
.g-opt .ico { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: 20px; }
.g-opt .ico svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.g-opt strong { font-size: 14px; }
.g-opt small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.g-art-pop { left: 0; width: min(520px, 100%); display: block; }
.g-pop-head { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 10px; }
.g-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--surface-2); cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 600; min-width: 0; }
.g-slot:hover, .g-slot:focus-within { border-color: var(--accent); }
.g-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.g-slot .pv { width: 100%; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; background: repeating-conic-gradient(#2a2a2e 0 25%, #222225 0 50%) 0 0 / 12px 12px; overflow: hidden; color: var(--dim); font-size: 24px; }
.g-slot .pv img { width: 100%; height: 100%; object-fit: contain; }
.g-slot small { color: var(--muted); font-weight: 500; font-size: 11px; }
.g-slot .rm { position: absolute; top: 4px; right: 4px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 15px; line-height: 1; }

.g-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; margin: 16px 0 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--dim); }
.g-steps li { display: inline-flex; align-items: center; gap: 7px; }
.g-steps li i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); display: grid; place-items: center; }
.g-steps li.on { color: var(--text); }
.g-steps li.on i { border-color: var(--accent); border-top-color: transparent; animation: gspin 0.8s linear infinite; }
.g-steps li.done { color: var(--text); }
.g-steps li.done i { border-color: var(--accent); background: var(--accent); }
.g-steps li.done i::after { content: ''; width: 6px; height: 3px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(0.5px, -0.5px); }
.g-steps .g-step-note { flex-basis: 100%; justify-content: center; color: var(--muted); font-weight: 500; }
.g-steps .g-step-note:empty { display: none; }
@keyframes gspin { to { transform: rotate(360deg); } }
.g-free { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.g-free svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.link { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

/* ---------- gallery ---------- */
.g-gallery { margin-top: 18px; }
.g-filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 16px; margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }
.g-filter::-webkit-scrollbar { display: none; }
.g-filter button {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.g-filter button:hover { color: var(--text); background: var(--surface); }
.g-filter button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.g-filter button .n { margin-left: 6px; font-size: 11px; opacity: 0.6; }

.g-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.g-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color 0.15s, transform 0.2s; }
.g-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.g-thumb { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: #000; overflow: hidden; cursor: pointer; }
.g-thumb video, .g-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2, .7, .2, 1); }
.g-card:hover .g-thumb video, .g-card:hover .g-thumb img { transform: scale(1.04); }
.g-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 30%); pointer-events: none; }
.g-badge { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); font-size: 11px; font-weight: 700; color: #fff; }
.g-badge svg { width: 11px; height: 11px; fill: none; stroke: var(--accent); stroke-width: 2.4; }
.g-badge.d3 { left: auto; right: 10px; background: var(--accent); color: var(--accent-ink); letter-spacing: 0.04em; }
.g-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 13px 14px; min-width: 0; }
.g-meta > div { min-width: 0; }
.g-meta h3 { margin: 0; font: 800 20px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-meta span { color: var(--muted); font-size: 13px; }
.g-play { flex: none; height: 34px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); font-weight: 700; font-size: 13.5px; transition: background 0.15s; }
.g-card:hover .g-play, .g-play:hover { background: var(--accent); color: var(--accent-ink); }
.g-card .rm { position: absolute; right: 8px; top: 8px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 16px; }
.g-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- player ---------- */
.g-player { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr); background: radial-gradient(ellipse 60% 80% at 40% 50%, #17150f 0%, #0a0a0b 70%); }
.g-player[hidden] { display: none; }
.g-pl-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.g-pl-name { min-width: 0; flex: 1; }
.g-pl-name h2 { margin: 0; font: 900 24px/1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-pl-name p { margin: 3px 0 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; }
/* narrow phones: the check mark stays, the word is kept for screen readers only */
@media (max-width: 420px) { .g-tested-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
.g-tested { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; }
.g-tested svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.g-pl-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.g-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); flex: none; }
.g-icon:hover { background: var(--surface-2); }
.g-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-icon .mute { display: none; }
.g-icon[aria-pressed="false"] .mute { display: inline; }
.g-icon[aria-pressed="false"] .wave { display: none; }
.g-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.g-btn:hover { background: var(--surface-2); }
.g-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.g-btn.accent:hover { background: var(--accent-hi); }
.g-btn:disabled { opacity: 0.6; cursor: progress; }
.g-pl-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 0; }
.g-stage { position: relative; min-height: 0; min-width: 0; padding: 14px; }
.g-pl-side { min-height: 0; overflow: auto; padding: 18px 18px 24px; border-left: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #333 transparent; }
.g-pl-side h3 { margin: 18px 0 8px; font: 800 18px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.g-pl-side h3:first-child { margin-top: 0; }
.g-pl-side p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.g-pl-side p.theme { color: var(--text); font-size: 15px; }
.g-cast { display: grid; gap: 6px; }
.g-cast div { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; background: var(--surface); }
.g-cast canvas, .g-cast img { width: 44px; height: 44px; object-fit: contain; }
.g-cast strong { display: block; font-size: 14px; }
.g-cast small { color: var(--muted); font-size: 12px; }
.g-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.g-notes li { display: flex; gap: 7px; }
.g-notes li::before { content: '✓'; color: var(--accent); font-weight: 700; }
.g-notes li.bad::before { content: '!'; color: var(--hot); }
.g-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.g-kv dt { color: var(--muted); }
.g-kv dd { margin: 0; }
.g-remix { width: 100%; margin-top: 14px; }

@media (max-width: 1100px) {
  .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-pl-body { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 860px) {
  .g-pl-body { grid-template-columns: minmax(0, 1fr); }
  .g-pl-side { display: none; }
}
@media (max-width: 760px) {
  .g-hero { padding: 18px 12px 16px; }
  .g-hero-card { padding: 22px 14px 16px; border-radius: 20px; }
  .g-hero h1 { font-size: clamp(38px, 11.5vw, 56px); margin-top: 10px; }
  .g-sub { font-size: 14.5px; margin: 10px auto 16px; }
  .g-prompt { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .g-art-tile { flex-direction: row; min-height: 44px; justify-content: flex-start; padding: 6px 12px; order: 2; }
  .g-art-tile svg { width: 20px; height: 20px; }
  .g-field { order: 1; }
  .g-field textarea { font-size: 16px; min-height: 64px; }
  .g-go { order: 3; min-height: 54px; width: 100%; }
  .g-pop { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; z-index: 80; grid-template-columns: minmax(0, 1fr); max-height: 72vh; overflow: auto; border-radius: 18px; box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.7); }
  .g-slots { gap: 6px; }
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g-meta { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .g-meta h3 { font-size: 17px; }
  .g-play { width: 100%; }
  .g-pl-top { padding: 8px 10px; gap: 8px; }
  .g-pl-name h2 { font-size: 19px; }
  .g-pl-actions { gap: 4px; }
  .g-btn { width: 40px; padding: 0; justify-content: center; }
  .g-btn span { display: none; }
  .g-icon, .g-btn { width: 38px; height: 38px; }
  .g-stage { padding: 8px; }
}
@media (max-width: 400px) {
  .g-chips { gap: 6px; }
  .g-chip, .g-toggle, .g-seg { height: 32px; font-size: 12.5px; }
  .g-chip.ghost { display: none; }
  .g-pl-name p { font-size: 11.5px; }
  #pl-restart { display: none; }
}

.games-main .g-hero { padding-top: 22px; }

/* ---------- manual remix (side panel; a bottom sheet on phones) ---------- */
.g-rx { display: grid; gap: 10px; margin-top: 4px; }
.g-rx label { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.g-rx input[type="text"], .g-rx select { width: 100%; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 14px; }
.g-rx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-rx .g-seg { height: 36px; width: 100%; }
.g-rx .g-seg button { flex: 1; font: 600 13px/1 var(--ui); letter-spacing: 0; }
.g-rx-check { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 13.5px !important; }
.g-rx-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.rx-btn { display: none; }
@media (max-width: 860px) {
  .rx-btn { display: inline-flex; }
  .g-pl-side.open { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; max-height: 78vh; background: #121214; border: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.7); }
}
