/* HappyCade site styles (source: _studio/happycade-src/site.css, copied by _studio/tools/build-happycade.mjs) */
:root {
  --bg: #120e2b;
  --panel: #191338;
  --card: #221a4b;
  --line: #2f2565;
  --sun: #ffd23f;
  --sun-deep: #e8a800;
  --pop: #ff6b8b;
  --ink: #f4f1ff;
  --muted: #b9b1e6;
  --top-h: 64px;
  --side-w: 220px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh;
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgba(18, 14, 43, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none; min-height: 44px; min-width: 44px; }
.logo svg { width: 34px; height: 34px; }
.logo b { font-size: 24px; font-weight: 900; color: var(--sun); letter-spacing: -0.02em; text-shadow: 0 2px 0 var(--sun-deep); }
.search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.search input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); font: inherit; font-size: 16px; padding: 0 18px 0 44px;
}
.search input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 15px; top: 13px; width: 18px; height: 18px; opacity: 0.7; }
.top .count { flex: none; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* layout */
.shell { display: flex; }
.side {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  width: var(--side-w); flex: none; padding: 14px 10px 24px; border-right: 1px solid var(--line); background: var(--panel);
}
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 15px; }
.side a:hover { background: var(--card); color: var(--ink); }
.side a.on { background: var(--card); color: var(--ink); box-shadow: inset 3px 0 0 var(--sun); }
.side .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; }
.side .n { margin-left: auto; font-size: 13px; opacity: 0.7; }
main { flex: 1; min-width: 0; padding: 22px clamp(16px, 2.5vw, 32px) 40px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.row-head h2 { font-size: 21px; }
.row-head a { color: var(--sun); font-weight: 700; font-size: 15px; display: inline-block; padding: 14px 8px; margin: -14px -8px; }   /* bigger tap area, same look */

/* cards */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.card { display: block; position: relative; border-radius: 14px; overflow: hidden; background: var(--card); aspect-ratio: 16 / 9; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.card .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 9px; font-weight: 800; font-size: 15px;
  background: linear-gradient(transparent, rgba(10, 6, 30, 0.92)); opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s;
}
.card:hover img, .card:focus-visible img { transform: scale(1.05); }
.card:hover .name, .card:focus-visible .name { opacity: 1; transform: none; }
@media (hover: none) { .card .name { opacity: 1; transform: none; font-size: 14px; } }

/* home hero */
.hero { display: grid; gap: 14px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.hero .card:first-child { grid-row: span 2; }
.hero .card:first-child .name { opacity: 1; transform: none; font-size: 22px; padding: 40px 18px 14px; }
.hero .card:first-child .name small { display: block; font-weight: 600; font-size: 15px; color: var(--muted); margin-top: 4px; }
.tagline { color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.no-results { color: var(--muted); padding: 30px 0; display: none; }

/* game page */
.player { background: #0b0820; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.frame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--top-h) - 120px); background: #000; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.frame .start { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 8%; }
.frame .start[hidden] { display: none !important; }
.frame .start .shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame .start::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(8, 5, 25, 0.75)); }
.frame .start .btn-play { position: relative; z-index: 1; }
.btn-play {
  border: 0; cursor: pointer; font: inherit; font-weight: 900; font-size: 22px; color: #2a1a00;
  background: linear-gradient(180deg, #ffe27a, var(--sun)); padding: 14px 40px; border-radius: 999px;
  box-shadow: 0 5px 0 var(--sun-deep), 0 12px 24px rgba(0, 0, 0, 0.4);
}
.btn-play:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sun-deep); }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); flex-wrap: wrap; }
.bar h1 { font-size: 20px; }
.tag { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--card); color: var(--muted); }
a.tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }   /* the category link beside a game's name: easy to tap */
.bar .sp { flex: 1; }
.btn-ghost { border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; padding: 9px 14px; min-height: 44px; border-radius: 10px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.btn-ghost svg { width: 16px; height: 16px; }
.about { background: var(--panel); border-radius: 16px; padding: 18px 20px; margin-top: 18px; line-height: 1.55; max-width: 900px; }
.about p { margin: 0 0 10px; }
.about .small { color: var(--muted); font-size: 14px; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 20px 16px 30px; text-align: center; }
footer a { text-decoration: underline; display: inline-block; padding: 14px 6px; margin: -14px -6px; }   /* bigger tap area, same look */

/* phones and small tablets */
@media (max-width: 860px) {
  :root { --top-h: 58px; }
  .top { gap: 10px; }
  .logo b { font-size: 20px; }
  .top .count { display: none; }
  .shell { display: block; }
  .side {
    position: sticky; top: var(--top-h); z-index: 15; height: auto; width: auto; display: flex; gap: 6px; overflow-x: auto;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side a { flex: none; padding: 0 14px; min-height: 44px; font-size: 14px; background: var(--card); }
  .side a.on { box-shadow: inset 0 -3px 0 var(--sun); }
  .side hr, .side .n { display: none; }
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .hero .card:first-child { grid-column: span 2; grid-row: auto; }
  .frame { max-height: none; }
}
/* phones held sideways: keep the whole picture, and its Play now button, on the first screen */
@media (max-width: 860px) and (orientation: landscape) {
  .frame { min-height: 150px; max-height: calc(100vh - var(--top-h) - 92px); max-height: calc(100svh - var(--top-h) - 92px); }
}
@media (max-width: 520px) {
  .logo b { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero .card:first-child .name { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .card img, .card .name { transition: none; } }
