/* Shared styles for every funloop.studio page except the generated privacy policies.
   Tokens are the existing site's palette; .theme-runecage swaps them for one page. */
:root {
  --canvas: #E7EFDA;
  --surface: #E5E5D4;
  --surface-sunk: #D6D3C2;
  --ink: #2F2F2A;
  --ink-muted: #6B6A5E;
  --accent: #4A6640;
  --accent-ink: #F4F7EE;
  --line: rgba(107,142,93,.28);
  --line-strong: rgba(107,142,93,.5);
  --glow: rgba(107,142,93,.30);
  --radius: 14px;
  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #23281F;
    --surface: #2E3428;
    --surface-sunk: #1C201A;
    --ink: #E5E5DB;
    --ink-muted: #A8AC9C;
    --accent: #A8C79A;
    --accent-ink: #1C201A;
  }
}

/* Runecage page: ember on near-black, from the icon and the feature graphic. Dark in both schemes. */
.theme-runecage {
  --canvas: #121015;
  --surface: #1D1A21;
  --surface-sunk: #0B0A0D;
  --ink: #EDE4D6;
  --ink-muted: #A79C8E;
  --accent: #E0873A;
  --accent-ink: #1A1008;
  --line: rgba(224,135,58,.22);
  --line-strong: rgba(224,135,58,.45);
  --glow: rgba(224,135,58,.28);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---- Top bar (game pages) ---- */
.topbar { border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 3.6rem; }
.topbar .home { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 650; font-size: .95rem; }
.topbar .home img { height: 1.6rem; width: auto; }
.topbar nav { display: flex; gap: 1.2rem; font-size: .92rem; }
.topbar nav a { color: var(--ink-muted); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }

/* ---- Studio hero ---- */
header.hero {
  background: radial-gradient(120% 90% at 50% -10%, var(--glow), transparent 60%), var(--canvas);
  border-bottom: 1px solid var(--line);
  padding: 4rem 0 3.2rem;
  text-align: center;
}
.brand { display: inline-block; margin-bottom: 1.2rem; }
.brand img { display: block; height: 5.5rem; width: auto; max-width: 100%; }
h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1.08; margin: 0 0 1rem; letter-spacing: -.02em; }
.lede { font-size: clamp(1.05rem, 2.6vw, 1.25rem); color: var(--ink-muted); max-width: 36rem; margin: 0 auto; }

section.wrap { padding-top: 3.2rem; padding-bottom: 3.2rem; }
section.wrap + section.wrap { padding-top: 0; }
h2 { font-size: 1.5rem; margin: 0 0 1.5rem; letter-spacing: -.01em; }

/* ---- Game cards (home) ---- */
.games { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.game-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.game-card .art { aspect-ratio: 1024 / 500; display: block; width: 100%; object-fit: cover; }
.game-card .body { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.2rem 1.3rem 1.3rem; align-items: start; }
.game-card .icon { width: 4.5rem; height: 4.5rem; border-radius: 22%; margin-top: -2.6rem; border: 3px solid var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.game-card h3 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.game-card h3 a { color: var(--ink); text-decoration: none; }
.game-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card links to the game page */
.game-card .tag { margin: .35rem 0 0; color: var(--ink-muted); font-size: .95rem; line-height: 1.5; }
.game-card .foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: .3rem; }
.game-card .more { font-size: .9rem; font-weight: 650; color: var(--accent); }
.game-card .play { position: relative; z-index: 1; } /* above the card's stretched link */
.game-card.rc { background: #1D1A21; border-color: rgba(224,135,58,.3); }
.game-card.rc h3 a { color: #EDE4D6; }
.game-card.rc .tag { color: #A79C8E; }
.game-card.rc .more { color: #E0873A; }
.game-card.rc .icon { border-color: #1D1A21; }

/* ---- Google Play badge (mock: the real page uses Google's official badge artwork) ---- */
.gp {
  display: inline-flex; align-items: center; gap: .6rem;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #A6A6A6; border-radius: 9px;
  padding: .4rem .95rem .4rem .7rem; line-height: 1.1;
}
.gp svg { width: 1.45rem; height: 1.6rem; flex: none; }
.gp small { display: block; font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; }
.gp b { display: block; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.gp.soon { background: transparent; color: var(--ink-muted); border: 1px dashed var(--line-strong); cursor: default; }
.gp.soon svg { opacity: .55; }
.gp.soon b { font-size: 1rem; }
.game-card.rc .gp.soon { color: #A79C8E; border-color: rgba(224,135,58,.45); }

/* ---- Game page hero ---- */
.game-hero {
  background: radial-gradient(110% 100% at 80% -20%, var(--glow), transparent 60%), var(--canvas);
  border-bottom: 1px solid var(--line);
  padding: 3.2rem 0 3rem;
}
.game-hero .wrap { display: grid; grid-template-columns: 1fr minmax(0, 27rem); gap: 2.5rem; align-items: center; }
.game-hero .title { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.1rem; }
.game-hero .title img { width: 5.5rem; height: 5.5rem; border-radius: 22%; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.game-hero h1 { font-family: var(--display); margin: 0; }
.game-hero .sub { margin: .2rem 0 0; color: var(--ink-muted); font-size: .95rem; }
.game-hero .lede { margin: 0 0 1.6rem; text-align: left; }
.game-hero .feature { border-radius: var(--radius); border: 1px solid var(--line); display: block; width: 100%; height: auto; box-shadow: 0 12px 34px rgba(0,0,0,.18); }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; }
.chip { padding: .3rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-muted); }
.theme-runecage h1, .theme-runecage h2 { font-family: var(--display); letter-spacing: .01em; }

/* ---- Features ---- */
.features { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.25rem; }
.card h3 { margin: 0 0 .45rem; font-size: 1.05rem; display: flex; align-items: center; gap: .55rem; }
.card p { margin: 0; color: var(--ink-muted); font-size: .95rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }

/* ---- Screenshots ---- */
.shots { display: grid; gap: 1rem; }
.shots img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.shots.portrait { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.shots.landscape { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots.portrait.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .shots.portrait, .shots.landscape {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem;
    margin: 0 -1.25rem; padding: 0 1.25rem .6rem;
  }
  .shots img { scroll-snap-align: start; flex: none; }
  .shots.portrait img { width: 62%; }
  .shots.landscape img { width: 86%; }
}

/* ---- Panels, buttons, footer ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.6rem; }
.panel p { margin: 0 0 1rem; color: var(--ink-muted); }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; padding: .7rem 1.3rem; border-radius: 999px; font-weight: 650; font-size: .95rem; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.prose { max-width: 42rem; color: var(--ink-muted); }
.prose p { margin: 0 0 1rem; }

footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3.5rem; font-size: .9rem; color: var(--ink-muted); }
footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
footer .lang { margin-bottom: 1rem; }
footer .lang a { color: var(--ink); }
footer .lang [aria-current] { color: var(--ink-muted); font-weight: 650; }

@media (max-width: 760px) {
  header.hero { padding: 3rem 0 2.5rem; }
  .brand img { height: 4.2rem; }
  section.wrap { padding-top: 2.4rem; padding-bottom: 2.4rem; }
  section.wrap + section.wrap { padding-top: 0; }
  .game-hero { padding: 2rem 0 2.2rem; }
  .game-hero .wrap { grid-template-columns: 1fr; gap: 1.6rem; }
  .game-hero .title img { width: 4.2rem; height: 4.2rem; }
  .topbar nav { gap: .9rem; font-size: .85rem; }
}
