/* =========================================================================
   OofWiki — shared styles
   ========================================================================= */
:root {
  --bg: #0d0b1f;
  --bg-2: #15122e;
  --panel: #1c1840;
  --panel-2: #241f52;
  --line: rgba(255, 255, 255, .09);
  --text: #f4f2ff;
  --muted: #a9a3d6;
  --dim: #7c76ab;
  --accent: #ffd23f;      /* egg yolk */
  --accent-2: #ff4fa3;    /* bubblegum */
  --accent-3: #34e0ff;    /* cyan */
  --good: #3dff8b;
  --bad: #ff5c7a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 77, 255, .28), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 79, 163, .18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .2px; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 11, 31, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1030; font-size: 1.2rem; transform: rotate(-8deg);
  box-shadow: 0 4px 0 #b3246c, 0 8px 20px rgba(255, 79, 163, .35);
}
.brand span b { color: var(--accent); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--muted); font-weight: 800; padding: 8px 14px; border-radius: 999px; font-size: .95rem;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: var(--panel-2); border: 0; color: var(--text); border-radius: 10px; width: 42px; height: 42px; font-size: 1.3rem; cursor: pointer; }

/* ---------- Game hero + tabs ---------- */
.game-hero {
  position: relative; overflow: hidden;
  padding: 36px 0 0;
  background:
    radial-gradient(600px 300px at 85% 30%, rgba(255, 210, 63, .22), transparent 70%),
    linear-gradient(180deg, rgba(124, 77, 255, .18), transparent);
  border-bottom: 1px solid var(--line);
}
.game-hero .inner { display: flex; align-items: center; gap: 28px; }
.game-hero .logo { width: 240px; height: auto; max-height: 170px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5)); animation: float 5s ease-in-out infinite; }
.game-hero h1 { margin-bottom: .2em; }
.game-hero .tagline { color: var(--muted); font-size: 1.1rem; max-width: 620px; }
.crumbs { font-size: .85rem; color: var(--dim); margin-bottom: 8px; font-weight: 700; }
.crumbs a { color: var(--dim); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { background: var(--panel-2); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800; color: var(--muted); }
.pill.live { color: var(--good); border-color: rgba(61, 255, 139, .35); }
.pill.live::before { content: "●"; margin-right: 6px; animation: pulse 1.6s infinite; }

.tabs {
  display: flex; gap: 6px; margin-top: 26px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
          mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex-shrink: 0; padding: 12px 18px; border-radius: 14px 14px 0 0; color: var(--muted);
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0;
}
.tabs a:hover { color: var(--text); background: rgba(255, 255, 255, .04); text-decoration: none; }
.tabs a.active { color: var(--text); background: var(--bg); border-color: var(--line); position: relative; }
.tabs a.active::after { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Layout ---------- */
.page { padding: 32px 0 60px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
section { margin-bottom: 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--muted); font-weight: 700; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.panel h3 { margin-bottom: .6em; }
.intro { font-size: 1.05rem; color: #d8d4f7; }
.intro strong { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 14px; border: 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #1a1030;
  background: var(--accent); box-shadow: 0 5px 0 #c79a00; transition: transform .1s, box-shadow .1s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 7px 0 #c79a00; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c79a00; }
.btn.pink { background: var(--accent-2); color: #fff; box-shadow: 0 5px 0 #b3246c; }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: 0 5px 0 #0c0a1e; }

/* ---------- Quick-link tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
}
.tile:hover { transform: translateY(-4px) rotate(-.5deg); border-color: var(--accent); text-decoration: none; background: var(--panel-2); }
.tile .ico { font-size: 1.9rem; }
.tile b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.tile small { color: var(--muted); font-weight: 700; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat .v { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat .l { color: var(--muted); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 0 14px;
}
.search:focus-within { border-color: var(--accent-3); }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-weight: 700; padding: 12px 0; min-width: 0; }
.search input::placeholder { color: var(--dim); }
select.select {
  background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 14px;
  padding: 11px 14px; font: inherit; font-weight: 800; cursor: pointer;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  border: 2px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px;
  padding: 6px 14px; font-weight: 800; font-size: .88rem; cursor: pointer; transition: all .12s;
}
.chip:hover { color: var(--text); }
.chip.on { color: #120d26; background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }

/* ---------- Rarity ---------- */
.rarity { display: inline-block; font-weight: 900; font-size: .72rem; letter-spacing: .8px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #120d26; background: var(--c); }
.rarity.r-Secret { background: #111; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.rarity.r-Divine { background: linear-gradient(90deg, #fff9a8, #fbff3a, #ffd23f); box-shadow: 0 0 12px rgba(251, 255, 58, .6); }
.rarity.r-Eternal { background: linear-gradient(90deg, #ff3cf2, #9b5cff, #34e0ff); color: #fff; }
.rarity.r-Cosmic { color: #fff; }
.rarity.r-Event { color: #fff; }

/* ---------- Egg / pet cards ---------- */
.biome-block { margin-bottom: 34px; }
.biome-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.biome-title h2 { margin: 0; font-size: 1.6rem; }
.biome-title .emoji { font-size: 1.7rem; }
.biome-title .meta { color: var(--muted); font-weight: 800; font-size: .85rem; }
.biome-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line), transparent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card {
  --c: #fff;
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 10px 12px; border-radius: var(--radius); cursor: pointer;
  background:
    radial-gradient(120px 90px at 50% 35%, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 2px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  color: var(--text); font: inherit;
}
.card:hover, .card:focus-visible { transform: translateY(-5px) scale(1.02); border-color: var(--c); box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 30%, transparent); outline: none; }
.card .thumb { width: 100%; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 8px; }
.card .thumb img { max-height: 110px; width: auto; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); transition: transform .2s; }
.card:hover .thumb img { transform: scale(1.08) rotate(-3deg); }
.card .name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.2; margin: 6px 0 4px; }
.card .income { color: var(--good); font-weight: 900; font-size: .9rem; }
.card .pet-mini { position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; border-radius: 10px; background: rgba(0, 0, 0, .35); padding: 3px; }
.card .pet-mini img { width: 100%; height: 100%; object-fit: contain; }
.card.r-Divine, .card.r-Eternal { animation: glow 2.6s ease-in-out infinite; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); font-weight: 800; }
.empty .big { font-size: 3rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-family: var(--font-display); font-weight: 600; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; cursor: pointer; user-select: none; }
table.data th[data-sort]:hover { color: var(--text); }
table.data th.sorted::after { content: " ▾"; color: var(--accent); }
table.data th.sorted.asc::after { content: " ▴"; }
table.data tr:hover td { background: rgba(255, 255, 255, .03); }
table.data td.num { font-variant-numeric: tabular-nums; font-weight: 800; }
table.data td .cell-pet { display: flex; align-items: center; gap: 10px; font-weight: 800; }
table.data td .cell-pet img { width: 40px; height: 40px; object-fit: contain; }
table.data tbody tr { cursor: pointer; }
.income-cell { color: var(--good); }

/* ---------- Codes ---------- */
.code-status {
  display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 210, 63, .14), rgba(255, 79, 163, .12));
  border: 2px dashed rgba(255, 210, 63, .45);
}
.code-status .big { font-size: 3rem; line-height: 1; }
.code-status h3 { margin: 0 0 4px; }
.code-list { display: grid; gap: 10px; }
.code-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.code-row code { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; font-weight: 800; background: var(--bg); border: 2px dashed var(--accent); color: var(--accent); padding: 6px 12px; border-radius: 10px; }
.code-row .reward { flex: 1; font-weight: 700; color: #d8d4f7; }
.code-row.expired code { border-color: var(--dim); color: var(--dim); text-decoration: line-through; }
.copy-btn { background: var(--accent-3); color: #06202a; border: 0; font-weight: 900; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.steps li::before { content: counter(s); flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--accent); color: #1a1030; }
.reward-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.reward-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.reward-card .i { font-size: 2rem; }
.reward-card b { display: block; font-family: var(--font-display); font-size: 1.1rem; margin: 4px 0; }
.reward-card span { color: var(--muted); font-size: .92rem; }

/* ---------- Biomes path ---------- */
.path { display: grid; gap: 14px; }
.biome-row {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; position: relative;
}
.biome-row .num { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem; background: var(--panel-2); position: relative; }
.biome-row .num small { position: absolute; bottom: -6px; right: -6px; background: var(--accent); color: #1a1030; font-family: var(--font-display); font-weight: 700; font-size: .75rem; border-radius: 8px; padding: 1px 6px; }
.biome-row h3 { margin: 0 0 2px; }
.biome-row p { margin: 0; color: var(--muted); font-size: .95rem; }
.biome-row .req { text-align: right; }
.biome-row .req b { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--accent-3); }
.biome-row .req span { color: var(--dim); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; }
.biome-row .guard { font-size: .85rem; font-weight: 800; color: var(--accent-2); margin-top: 4px; }

/* ---------- Mutations ---------- */
.mut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mut { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.mut img { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.mut .x { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.mut h3 { margin: 0; }
.mut p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field label { display: block; font-weight: 900; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.field input, .field select { width: 100%; background: var(--bg); color: var(--text); border: 2px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; font-weight: 800; }
.field input:focus, .field select:focus { border-color: var(--accent-3); outline: 0; }
.calc-result { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 18px; border-radius: 16px; background: var(--bg); border: 2px solid rgba(61, 255, 139, .35); }
.calc-result img { width: 80px; height: 80px; object-fit: contain; }
.calc-result .out { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--good); line-height: 1; }
.formula { font-family: ui-monospace, Consolas, monospace; background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .9rem; color: var(--accent-3); overflow-x: auto; }

/* ---------- Item cards (trails/treadmills) ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.item { --c: #fff; text-align: center; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: var(--radius); padding: 14px; }
.item img { height: 90px; width: auto; margin: 0 auto 8px; object-fit: contain; }
.item b { display: block; font-family: var(--font-display); font-weight: 600; margin: 6px 0 2px; }
.item .boost { color: var(--accent-3); font-weight: 900; }
.item .price { color: var(--accent); font-weight: 900; font-size: .9rem; }

/* ---------- Updates timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2), var(--accent-3)); }
.upd { position: relative; margin-bottom: 22px; }
.upd::before { content: ""; position: absolute; left: -26px; top: 18px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 14px var(--accent); }
.upd .tag { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.upd blockquote { margin: 8px 0 12px; padding: 10px 14px; border-left: 4px solid var(--accent-2); background: rgba(255, 79, 163, .08); border-radius: 0 10px 10px 0; color: #e6e2ff; font-style: italic; }
.upd ul { margin: 0; padding-left: 20px; color: #d8d4f7; }
.upd li { margin-bottom: 4px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 3, 15, .72); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-bg.open { display: flex; animation: fade .15s; }
.modal { --c: #fff; position: relative; width: min(560px, 100%); max-height: 90vh; overflow: auto; border-radius: 24px; padding: 26px; background: radial-gradient(300px 200px at 50% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), var(--panel); border: 2px solid var(--c); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: pop .2s; }
.modal .close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--panel-2); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.modal .pics { display: flex; justify-content: center; align-items: end; gap: 16px; margin: 6px 0 12px; }
.modal .pics img { height: 150px; width: auto; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.modal .pics img.egg { height: 100px; }
.modal h2 { text-align: center; margin-bottom: 6px; }
.modal .center { text-align: center; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.kv div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.kv span { display: block; font-size: .75rem; font-weight: 900; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
.kv b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }

/* ---------- Ads ----------
   Sizes reserve space up-front so nothing jumps when an ad loads (CLS).
   .ad-leaderboard  top banner — desktop/tablet only (on phones content comes first)
   .ad-inline       in-content, between sections — all screens
   .ad-infeed       inside long lists — all screens
   .ad-sidebar      300×600 sticky sidebar — wide desktop only
   .ad-mobile       extra in-content slot shown only on phones (replaces top banner) */
.ad-slot {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 10px, transparent 10px 20px), var(--bg-2);
  border: 1px dashed var(--line); color: var(--dim); font-size: .75rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  overflow: hidden; margin: 0 auto; clear: both;
}
.ad-slot::before { content: "Advertisement"; position: absolute; top: 4px; left: 8px; font-size: .62rem; opacity: .7; }
.ad-slot.has-ad { background: transparent; border: 0; }
.ad-slot.has-ad::before { opacity: .5; }
.ad-slot[hidden] { display: none; }
.ad-leaderboard { min-height: 90px; width: 100%; max-width: 970px; margin: 22px auto 0; }
.ad-inline, .ad-infeed { min-height: 250px; width: 100%; margin: 34px 0; }
.ad-sidebar { min-height: 600px; width: 300px; }
.ad-mobile { display: none; }

/* ---------- Home ---------- */
.home-hero { padding: 64px 0 40px; text-align: center; position: relative; }
.home-hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); margin-bottom: .2em; }
.home-hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero p { color: var(--muted); font-size: 1.2rem; max-width: 640px; margin: 0 auto 26px; }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floaters img { position: absolute; width: 70px; opacity: .85; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.game-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.game-card {
  position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; color: var(--text);
  background: var(--panel); border: 2px solid var(--line); transition: transform .18s, border-color .18s, box-shadow .18s;
}
.game-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 16px 40px rgba(255, 210, 63, .18); text-decoration: none; }
.game-card .art { height: 180px; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, rgba(255, 210, 63, .35), transparent 60%), linear-gradient(135deg, #3a1f7a, #1d4d7a); position: relative; }
.game-card .art img { max-height: 150px; width: auto; }
.game-card .body { padding: 16px 18px 18px; }
.game-card h3 { font-size: 1.4rem; margin-bottom: 4px; }
.game-card .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.game-card .links span { background: var(--panel-2); padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.game-card.soon { opacity: .55; pointer-events: none; }
.game-card.soon .art { background: repeating-linear-gradient(45deg, #1c1840 0 14px, #211c4a 14px 28px); font-size: 3rem; }
.badge-new { position: absolute; top: 12px; left: 12px; background: var(--accent-2); color: #fff; font-weight: 900; font-size: .72rem; padding: 4px 10px; border-radius: 999px; letter-spacing: .6px; }

.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.content { min-width: 0; }

/* ---------- Prose pages ---------- */
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 20px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 34px 0; color: var(--dim); font-size: .9rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.site-footer a { color: var(--muted); font-weight: 700; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer .fine { margin-top: 18px; font-size: .8rem; line-height: 1.5; }

/* ---------- Animations ---------- */
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 0 22px color-mix(in srgb, var(--c) 55%, transparent); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .layout, .two-col { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar { position: static; }
  .ad-sidebar { display: none; }   /* would just stack below content next to the footer ad */
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); padding: 10px 16px 16px; border-bottom: 1px solid var(--line); }
  .main-nav.open { display: flex; }
  .game-hero .inner { flex-direction: column; text-align: center; gap: 10px; }
  .game-hero .logo { width: 120px; max-height: 90px; }
  .game-hero { padding-top: 18px; }
  .game-hero h1 { font-size: 1.9rem; }
  .game-hero .tagline { font-size: .98rem; }
  .game-hero .pill-row .pill:not(.live) { display: none; }
  .tabs { display: none; }
  .section-switch { display: block; }
  .ad-leaderboard { display: none; }
  .ad-mobile { display: flex; min-height: 280px; margin: 26px 0; }
  .ad-inline, .ad-infeed { min-height: 280px; }
  .sidebar .panel { display: none; }
  .game-hero .tagline { margin: 0 auto; }
  .pill-row { justify-content: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .card .thumb img { max-height: 84px; }
  .biome-row { grid-template-columns: 48px 1fr; }
  .biome-row .num { width: 48px; height: 48px; font-size: 1.4rem; }
  .biome-row .req { grid-column: 2; text-align: left; }
  .code-status { flex-direction: column; text-align: center; }
  .code-row { flex-wrap: wrap; }
  .floaters { display: none; }
}

/* ---------- Mobile section switcher + bottom sheet ---------- */
.logo-emoji { font-size: 7rem; line-height: 1; text-align: center; width: 200px !important; }
.section-switch { display: none; position: sticky; top: 64px; z-index: 40; background: rgba(13, 11, 31, .92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding: 8px 0; }
.sw-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 2px solid rgba(255, 210, 63, .45); color: var(--text); font: inherit;
  box-shadow: 0 4px 0 #0c0a1e;
}
.sw-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0c0a1e; }
.sw-ico { font-size: 1.6rem; width: 40px; height: 40px; display: grid; place-items: center; background: var(--bg); border-radius: 10px; flex-shrink: 0; }
.sw-txt { flex: 1; min-width: 0; line-height: 1.15; }
.sw-txt small { display: block; color: var(--dim); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-txt b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.sw-more { font-weight: 900; font-size: .8rem; color: #1a1030; background: var(--accent); padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.sheet-bg { position: fixed; inset: 0; z-index: 120; background: rgba(5, 3, 15, .7); backdrop-filter: blur(4px); display: none; align-items: flex-end; }
.sheet-bg.open { display: flex; animation: fade .15s; }
.sheet { width: 100%; max-height: 88vh; overflow: auto; background: var(--panel); border-radius: 24px 24px 0 0; border-top: 2px solid var(--accent); padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: slideup .22s ease-out; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-family: var(--font-display); font-size: 1.2rem; }
.sheet-x { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--panel-2); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-grid a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; min-height: 86px; padding: 10px 6px;
  border-radius: 16px; background: var(--bg-2); border: 2px solid var(--line); color: var(--text); font-weight: 800; font-size: .86rem; line-height: 1.15;
}
.sheet-grid a span { font-size: 1.7rem; }
.sheet-grid a.on { border-color: var(--accent); background: rgba(255, 210, 63, .12); color: var(--accent); }
.sheet-grid a:hover { text-decoration: none; border-color: var(--accent-3); }
.sheet-games { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-games small { width: 100%; color: var(--dim); font-weight: 900; text-transform: uppercase; font-size: .72rem; letter-spacing: .6px; }
.sheet-games a { background: var(--bg-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 800; font-size: .88rem; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
@keyframes slideup { from { transform: translateY(100%); } }

/* ---------- Prev / next ---------- */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.prev-next a { display: block; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); color: var(--text); }
.prev-next a:hover { border-color: var(--accent); text-decoration: none; }
.prev-next a.nx { text-align: right; }
.prev-next small { display: block; color: var(--dim); font-weight: 900; font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; }
.prev-next b { font-family: var(--font-display); font-weight: 600; }

/* ---------- Generic game engine bits ---------- */
.swatch { width: 96px; height: 96px; border-radius: 50%; margin: 6px auto 10px; box-shadow: 0 0 26px color-mix(in srgb, var(--c) 60%, transparent), inset 0 -8px 16px rgba(0,0,0,.35), inset 0 6px 12px rgba(255,255,255,.35); background: var(--g, var(--c)); }
.card .swatch { width: 84px; height: 84px; }
.card .sub { color: var(--muted); font-weight: 800; font-size: .8rem; }
.status { font-size: .72rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .6px; }
.status.ok { background: rgba(61, 255, 139, .15); color: var(--good); }
.status.soon { background: rgba(255, 210, 63, .15); color: var(--accent); }
.status.event { background: rgba(255, 79, 163, .15); color: var(--accent-2); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.shot div { padding: 12px 14px; }
.shot b { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.shot p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.diff { font-weight: 900; }
.diff-Easy { color: #3dff8b; } .diff-Medium { color: #ffd23f; } .diff-Hard { color: #ff9a2e; } .diff-VeryHard { color: #ff3d73; } .diff-Expert { color: #c84dff; }
.callout { border-left: 4px solid var(--accent); background: rgba(255, 210, 63, .08); border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 0 0 18px; color: #e6e2ff; }
.callout.warn { border-color: var(--bad); background: rgba(255, 92, 122, .08); }
.content > section:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .section-switch { display: block; }
  .sheet-grid a { min-height: 80px; }
}
@media (min-width: 761px) {
  .sheet-bg { display: none !important; }
}
details.faq { border-top: 1px solid var(--line); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 800; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: "+"; color: var(--accent); font-weight: 900; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 8px 0 0; }
.card .thumb .swatch { margin: 0 auto; }
.side-links { display: grid; gap: 4px; }
.side-links a { font-weight: 800; padding: 6px 10px; border-radius: 10px; color: var(--accent-3); }
.side-links a.on { background: var(--panel-2); color: var(--text); }
.side-links a:hover { background: var(--panel-2); text-decoration: none; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.game-card .art-ride-a-pet { background: radial-gradient(circle at 50% 60%, rgba(61, 255, 139, .35), transparent 60%), linear-gradient(135deg, #1f5a3a, #1d4d7a); }
.game-card .art-speed-keyboard-escape { background: radial-gradient(circle at 50% 60%, rgba(255, 154, 46, .35), transparent 60%), linear-gradient(135deg, #5a2e1f, #3a1f7a); }
.game-card .art-speed-keyboard-escape img { max-height: 170px; border-radius: 14px; }
.code-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.code-hub-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); color: var(--text); }
.code-hub-item:hover { border-color: var(--accent); text-decoration: none; }
.code-hub-item .gi { font-size: 1.8rem; }
.code-hub-item .gn { flex: 1; min-width: 0; }
.code-hub-item .gn b { display: block; font-family: var(--font-display); font-weight: 600; }
.code-hub-item .gn small { color: var(--muted); font-weight: 800; }
.code-hub-item code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: var(--accent); border: 2px dashed var(--accent); padding: 3px 8px; border-radius: 8px; }
.code-hub-item .go { color: var(--accent); font-weight: 900; font-size: 1.2rem; }

@media (min-width: 761px) {
  .tabs { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; row-gap: 0; }
  .tabs a { padding: 11px 15px; }
}
.gen-sections { display: contents; }

/* ---------- Item pages (one per pet / egg / item) ---------- */
.item-hero { border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); background: radial-gradient(420px 220px at 20% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), linear-gradient(180deg, var(--panel), var(--bg-2)); }
.item-top { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; }
.item-pics { display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-height: 180px; }
.item-pics img { max-height: 210px; width: auto; filter: drop-shadow(0 12px 22px rgba(0,0,0,.5)); }
.item-pics img.egg { max-height: 120px; }
.item-chips { margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item-top .kv { margin-top: 8px; }
a.card { text-decoration: none; }
.card .name a { color: inherit; }
.card .name a:hover { text-decoration: underline; }
table.data td a { color: var(--text); }
@media (max-width: 760px) { .item-top { grid-template-columns: 1fr; } .item-pics { min-height: 0; } .item-pics img { max-height: 160px; } }
.kv i.v-good { font-style: normal; color: var(--good); }

/* game icons from Roblox (square) + cover art on home cards */
.game-hero .logo.logo-icon { width: 170px; height: 170px; max-height: none; border-radius: 34px; object-fit: cover; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 14px 30px rgba(0, 0, 0, .45); filter: none; }
@media (max-width: 720px) { .game-hero .logo.logo-icon { width: 92px; height: 92px; border-radius: 20px; } }
.game-card .art.cover { padding: 0; overflow: hidden; }
.game-card .art.cover > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; transition: transform .35s; }
.game-card:hover .art.cover > img.bg { transform: scale(1.05); }
.game-card .art.cover > img.ic { position: absolute; left: 14px; bottom: 12px; width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 6px 16px rgba(0, 0, 0, .5); z-index: 1; }
.game-card .art.cover .badge-new { z-index: 2; }
.stat-bars { display: grid; gap: 7px; margin-top: 4px; }
.stat-bar { display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: 10px; font-weight: 800; font-size: .88rem; }
.stat-bar .track { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.stat-bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c, #34e0ff), #fff); }
.stat-bar .num { text-align: right; }

/* games dropdown in the header (scales to any number of games) */
.main-nav { align-items: center; }
.main-nav .cur-game { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm { position: relative; }
.gm-btn { background: var(--panel-2); border: 0; color: var(--text); font: inherit; font-weight: 800; font-size: .95rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.gm-btn:hover, .gm.open .gm-btn { background: var(--accent); color: #1a1030; }
.gm-panel { display: none; position: absolute; right: 0; top: calc(100% + 10px); width: 540px; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); z-index: 80; }
.gm.open .gm-panel { display: grid; }
.main-nav .gm-panel a.gm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text); font-size: .92rem; }
.gm-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--panel-2); flex-shrink: 0; font-size: 1.2rem; }
.gm-ic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .main-nav { align-items: stretch; max-height: calc(100vh - 64px); overflow-y: auto; }
  .main-nav .cur-game { max-width: none; }
  .gm-btn { display: none; }
  .gm-panel { display: grid; position: static; width: auto; box-shadow: none; border: 0; padding: 6px 0 0; background: none; }
}
.code-hub-item code { min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* copied codes — ✓ remembered per browser */
.code-row { transition: border-color .2s; }
.code-row.copied { border-color: rgba(61, 255, 139, .45); }
.code-row.copied code { border-color: var(--good); color: var(--good); }
.code-row code .ck { display: inline-block; user-select: none; margin-right: 7px; font-weight: 900; animation: ck-pop .3s ease-out; }
@keyframes ck-pop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.copy-btn { min-width: 74px; transition: background .2s, color .2s; }
.copy-btn.done { background: var(--panel-2); color: var(--good); box-shadow: inset 0 0 0 2px rgba(61, 255, 139, .45); }
@media (prefers-reduced-motion: reduce) { .code-row code .ck { animation: none; } }

/* ad slots: invisible until ad unit IDs are configured (or when previewing locally) */
html:not(.ads-manual) .ad-slot { display: none !important; }
/* AdSense couldn't fill a slot → collapse it instead of leaving an empty box */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }
