/* Infinite Craft: board (canvas) + list of discovered items. Mobile: board on top, list below; desktop: list on the right. */
.wpg-app--infinite-craft { padding: 10px !important; }
.wpg-ic { display: flex; flex-direction: column; gap: 10px; }
.wpg-ic-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Items: same look on the board, in the list and while dragged (the dragged copy lives in <body>). */
.wpg-ic-el, .wpg-ic-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 9px;
    border: 1px solid var(--tile-line, #d6dbe3); border-radius: 9px; background: var(--surface, #fff); color: var(--ink, #14181f);
    font-weight: 650; font-size: 15px; line-height: 1.25; white-space: nowrap; cursor: grab;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.wpg-ic-e { font-size: 1.12em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.wpg-ic-n { overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.wpg-ic-el { position: absolute; left: 0; top: 0; z-index: 1; touch-action: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 3px 10px rgba(15, 23, 42, .06); transition: box-shadow .15s, border-color .15s; }
.wpg-ic-el:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--tile-line)); }
.wpg-ic-float { position: fixed !important; z-index: 10050; pointer-events: none; cursor: grabbing; transform: scale(1.07); box-shadow: 0 14px 34px rgba(15, 23, 42, .22); border-color: var(--accent); font-family: inherit; }
.wpg-ic-el.is-over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.wpg-ic-el.is-mixing { opacity: .7; }
.wpg-ic-el.is-pop { animation: wpg-ic-pop .36s var(--ease); }
.wpg-ic-el.is-shake { animation: wpg-ic-shake .34s ease; }
.wpg-ic-el.is-gone { transition: opacity .18s, transform .18s; opacity: 0; transform: scale(.6); }
.wpg-ic-el.is-new { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .3), 0 6px 18px rgba(245, 158, 11, .25); z-index: 3; }
.wpg-ic-el.is-goal { animation: wpg-ic-pop .5s var(--ease) 2; border-color: var(--ok); }
.wpg-ic-badge {
    position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 2px 8px; border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f97316); color: #3b1d00; font-size: 11.5px; font-weight: 800; white-space: nowrap;
    pointer-events: none; animation: wpg-ic-rise .4s var(--ease);
}
.wpg-ic-spark {
    position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: #fbbf24;
    pointer-events: none; animation: wpg-ic-spark .8s ease-out forwards; transform: rotate(var(--a)) translateY(0);
}
.wpg-ic-spark:nth-child(odd) { background: var(--accent); width: 5px; height: 5px; }
.wpg-ic-el.is-hint, .wpg-ic-chip.is-hint { border-color: var(--accent); animation: wpg-ic-glow 1.3s ease-in-out infinite; }
.wpg-ic-el.is-hint.is-pop, .wpg-ic-el.is-hint.is-shake { animation-iteration-count: 1; }
@keyframes wpg-ic-pop { 0% { transform: scale(.4); opacity: .2; } 60% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); } }
@keyframes wpg-ic-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-3deg); } 40% { transform: translateX(6px) rotate(3deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes wpg-ic-rise { from { opacity: 0; transform: translate(-50%, 6px); } }
@keyframes wpg-ic-spark { to { transform: rotate(var(--a)) translateY(-46px) scale(.3); opacity: 0; } }
@keyframes wpg-ic-glow { 0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); } }

/* Goal bar */
.wpg-ic-goal {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 44px; padding: 5px 6px 5px 11px; border-radius: 13px;
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); font-size: 14px;
}
.wpg-ic-goal.is-pop { animation: wpg-ic-pop .36s var(--ease); }
.wpg-ic-goal.is-done { background: color-mix(in srgb, var(--ok) 11%, transparent); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.wpg-ic-goal__lbl { font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.wpg-ic-goal__item { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--tile-line); font-weight: 750; }
.wpg-ic-goal__item .wpg-ic-n { max-width: 150px; }
.wpg-ic-goal__acts { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.wpg-ic-goal__ok { font-weight: 800; color: var(--ok); white-space: nowrap; }
.wpg-ic-goal .wpg-btn--sm { padding: 6px 12px; font-size: 13px; }

/* Board */
.wpg-ic-canvas {
    position: relative; height: clamp(300px, 46svh, 470px); overflow: hidden; border-radius: 14px; border: 1px solid var(--line);
    background-color: var(--tile-bg);
    background-image: radial-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1.3px);
    background-size: 22px 22px; touch-action: pan-y;
}
.wpg-ic-tip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px 40px 60px; text-align: center; color: var(--ink-soft); font-size: 15px; font-weight: 600; line-height: 1.45; pointer-events: none; }
.wpg-ic-tip[hidden] { display: none; }
.wpg-ic-count { position: absolute; top: 8px; left: 8px; z-index: 4; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); font-size: 12.5px; font-weight: 800; color: var(--ink-soft); pointer-events: none; }
.wpg-ic-ctl { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 4; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; pointer-events: none; }
.wpg-ic-ctl > * { pointer-events: auto; }
.wpg-ic-clear { background: color-mix(in srgb, var(--surface) 92%, var(--ink)) !important; }
.wpg-ic-hint.is-off { filter: grayscale(.85); opacity: .65; }
.wpg-ic-hint.is-busy { opacity: .75; cursor: progress; }

/* List */
.wpg-ic-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wpg-ic-find { display: flex; gap: 6px; }
.wpg-app--infinite-craft input.wpg-ic-search {
    flex: 1 1 auto; min-width: 0; width: auto !important; height: 40px !important; margin: 0 !important; padding: 0 12px !important;
    border: 1.5px solid var(--tile-line) !important; border-radius: 11px !important; background: var(--tile-bg) !important; color: var(--ink) !important;
    font: inherit !important; font-size: 16px !important; font-weight: 600 !important; box-shadow: none !important; outline: none;
    user-select: text; -webkit-user-select: text;
}
.wpg-app--infinite-craft input.wpg-ic-search:focus { border-color: var(--accent) !important; }
.wpg-app--infinite-craft .wpg-ic-sort {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 40px; margin: 0; padding: 0 12px; border-radius: 11px;
    border: 1.5px solid var(--tile-line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 750; cursor: pointer; box-shadow: none;
}
.wpg-ic-sort svg { width: 16px; height: 16px; }
.wpg-ic-list {
    display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 2px 2px 6px; overflow-y: auto; overscroll-behavior: contain;
    max-height: clamp(150px, 29svh, 300px); touch-action: pan-y;
}
.wpg-ic-chip { padding: 5px 10px 5px 8px; font-size: 14.5px; transition: transform .12s, border-color .12s; }
.wpg-ic-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--tile-line)); }
.wpg-ic-chip.is-press { transform: scale(.95); border-color: var(--accent); }
.wpg-ic-chip.is-fresh { border-color: #f59e0b; background: color-mix(in srgb, #fbbf24 12%, var(--surface)); }
.wpg-ic-empty { width: 100%; padding: 14px 6px; text-align: center; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }

/* Dialog bits */
.wpg-ic-statx { display: grid; gap: 6px; margin-top: 12px; }
.wpg-ic-statx > div, .wpg-ic-set__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 4%, transparent); font-size: 14.5px; }
.wpg-ic-set { display: grid; gap: 8px; }
.wpg-ic-set__row span { font-weight: 700; }
.wpg-modal p.wpg-ic-p { margin: 0; color: var(--ink-soft); }

@media (max-width: 420px) {
    .wpg-app--infinite-craft { padding: 8px !important; }
    .wpg-ic-goal { font-size: 13px; gap: 6px; padding-left: 9px; }
    .wpg-ic-goal__item .wpg-ic-n { max-width: 96px; }
    .wpg-ic-el { font-size: 14px; padding: 5px 9px 5px 8px; }
    .wpg-ic-chip { font-size: 14px; }
    .wpg-ic-n { max-width: 200px; }
}
@media (min-width: 760px) {
    .wpg-ic { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: stretch; }
    .wpg-ic-canvas { height: clamp(430px, calc(100svh - 290px), 600px); }
    .wpg-ic-side { min-height: 0; }
    .wpg-ic-list { flex: 1 1 0; min-height: 0; max-height: none; }
}

/*  Base, theme and page layout  */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Segoe UI"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
:root {
    color-scheme: light;
    --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --accent: #4f46e5; --accent-2: #c7d2fe; --accent-soft: #eef0ff;
    --bg: #f4f5fb; --surface: #ffffff; --tile-bg: #f8f9fd; --ink: #091022; --ink-soft: #17213a;
    --line: #e1e5f0; --tile-line: #d3d9e8; --ok: #16a34a; --warn: #f59e0b;
    --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 8px 28px rgba(20, 24, 40, .07);
    --ease: cubic-bezier(.2, .9, .3, 1.2); --radius: 16px; --item-scale: 1;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --accent: #8b85ff; --accent-2: #3b3f7a; --accent-soft: #232748;
    --bg: #0f1220; --surface: #181c2e; --tile-bg: #131729; --ink: #eef1fb; --ink-soft: #d6dffc;
    --line: #2a3050; --tile-line: #353c60; --ok: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
}
:root[data-size="s"] { --item-scale: .9; }
:root[data-size="l"] { --item-scale: 1.15; }
.wpg-ic-el, .wpg-ic-chip { font-size: calc(15px * var(--item-scale)); }
:root[data-anim="off"] *, :root[data-anim="off"] *::before, :root[data-anim="off"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body.wpg-page { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10300; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 40%, transparent); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; gap: 14px; max-width: 1120px; height: 60px; margin: 0 auto; padding: 0 14px; }
.wpg-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.wpg-brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.site-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.site-nav + .wpg-tools { margin-left: 0; }
.site-nav a { padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 650; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.wpg-tools { display: flex; gap: 6px; flex: 0 0 auto; min-width: 122px; justify-content: flex-end; margin-left: auto; }
.wpg-tool { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; font-size: 17px; cursor: pointer; transition: border-color .15s, transform .1s; }
.wpg-tool:hover { border-color: var(--accent); }
.wpg-tool:active { transform: scale(.94); }
@media (max-width: 720px) { .site-nav { display: none; } .site-nav + .wpg-tools { margin-left: auto; } }

/* page */
.wpg-main { max-width: 1120px; margin: 0 auto; padding: 14px; }
.content { display: block; }
.hero { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid var(--line); position: relative; }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--ink-soft); font-size: clamp(15px, 2vw, 17px); max-width: 68ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wpg-stage { margin: 0; }
.wpg-shell { margin: 0; padding: 0; }
.wpg-app { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: min(760px, calc(75svh + 124px)); }
@media (min-width: 760px) { .wpg-app { min-height: min(660px, calc(100svh - 150px)); } }
@media (max-width: 380px) { .wpg-app { padding: 8px !important; } }
.wpg-loading { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 60px 20px; min-height: 300px; text-align: center; color: var(--ink-soft); }
.wpg-spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: wpg-spin .8s linear infinite; }
@keyframes wpg-spin { to { transform: rotate(360deg); } }

/* buttons */
.wpg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 11px; padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; transition: filter .15s, transform .1s; }
:root[data-theme="dark"] .wpg-btn:not(.wpg-btn--ghost) { color: #10132a; }
.wpg-btn:hover { filter: brightness(1.07); }
.wpg-btn:active { transform: scale(.97); }
.wpg-btn--sm { padding: 7px 13px; font-size: 14px; border-radius: 10px; }
.wpg-btn--ghost { background: transparent; color: var(--ink); border-color: var(--tile-line); }
.wpg-btn.is-busy { opacity: .6; pointer-events: none; }
.wpg-btn__n[hidden] { display: none; }
.wpg-btn__ico { line-height: 1; }
.wpg-btn svg { width: 16px; height: 16px; flex: none; }

/* toasts, modal */
.wpg-toasts { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.wpg-toast { background: #1f2437; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: opacity .25s; }
.wpg-toast.is-out { opacity: 0; }
.wpg-modal-back { position: fixed; inset: 0; background: rgba(12, 15, 30, .55); z-index: 10080; display: flex; align-items: center; justify-content: center; padding: 16px; }
.wpg-modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; max-width: 480px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: wpg-ic-pop .25s var(--ease); }
.wpg-modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wpg-modal__head h3 { margin: 0; font-size: 20px; }
.wpg-modal__x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.wpg-modal__acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.wpg-rules { padding-left: 20px; line-height: 1.55; margin: 6px 0; }
.wpg-rules li { margin-bottom: 6px; }
.wpg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin: 10px 0; }
.wpg-stat { padding: 10px 4px; border-radius: 12px; background: var(--accent-soft); }
.wpg-stat b { display: block; font-size: 24px; }
.wpg-stat span { font-size: 12px; color: var(--ink-soft); }
.wpg-confetti { position: fixed; top: -10px; width: 9px; height: 14px; z-index: 10200; pointer-events: none; animation: wpg-fall linear forwards; }
@keyframes wpg-fall { to { transform: translateY(105vh) rotate(720deg); } }

/* segmented control (settings) */
.wpg-seg { display: inline-flex; border: 1px solid var(--tile-line); border-radius: 10px; overflow: hidden; }
.wpg-seg button { border: 0; background: transparent; color: var(--ink); padding: 6px 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
.wpg-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .wpg-seg button[aria-pressed="true"] { color: #10132a; }
.wpg-ic-set__hint { display: block; font-weight: 500; font-size: 12px; color: var(--ink-soft); }

/* content */
.text { max-width: 860px; margin: 0 auto 36px; content-visibility: auto; contain-intrinsic-size: 1px 420px; }
.content > .text:first-of-type { margin-top: 36px; }
.text h2 { font-size: clamp(21px, 3vw, 27px); line-height: 1.25; letter-spacing: -.015em; margin: 0 0 12px; }
.text h3 { font-size: 17px; margin: 18px 0 6px; }
.text p { margin: 0 0 12px; }
.text a { font-weight: 600; }
/* about */
.about { position: relative; padding: 24px 26px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); box-shadow: var(--shadow); overflow: hidden; }
.about::after { content: ""; position: absolute; right: -50px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; }
.about h2 { position: relative; }
.about p { position: relative; max-width: 68ch; }
.about__facts { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.about__facts li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--tile-line); font-size: 13.5px; font-weight: 700; }
@media (max-width: 520px) { .about { padding: 18px 16px; border-radius: 16px; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; }
:root[data-theme="dark"] .steps li::before { color: #10132a; }
.steps b { display: block; margin-bottom: 2px; }
.tips, .features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.tip-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tip-card h3 { margin: 0 0 4px; font-size: 16px; }
.tip-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.recipes { width: 100%; border-collapse: collapse; font-size: 15px; }
.recipes th, .recipes td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.recipes tr:last-child td { border-bottom: 0; }
.recipes th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--tile-bg); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); }
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__in { max-width: 1120px; margin: 0 auto; padding: 26px 14px calc(26px + env(safe-area-inset-bottom)); display: grid; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer p { margin: 0; }
.disclaimer { font-size: 13px; line-height: 1.55; padding: 12px 14px; border-radius: 12px; background: var(--tile-bg); border: 1px solid var(--line); }
@media (max-width: 420px) { .wpg-main { padding: 10px; } .wpg-stats { grid-template-columns: repeat(2, 1fr); } }
@media print { .site-header, .wpg-stage, .site-footer nav { display: none; } }

/* embed code box */
.embed-box { position: relative; }
.embed-box textarea { width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border: 1px solid var(--tile-line); border-radius: 12px; background: var(--tile-bg); color: var(--ink); font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.embed-box .wpg-btn { margin-top: 10px; }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.link-list a { display: inline-block; padding: 7px 13px; border: 1px solid var(--tile-line); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 650; font-size: 14px; }

/* ?embed=1: only the game, so it fits inside an iframe */
.embed-credit { display: none; }
html.is-embed, html.is-embed body { height: 100%; }
html.is-embed body { background: var(--surface); }
.is-embed .skip, .is-embed .site-nav, .is-embed .hero, .is-embed .text, .is-embed .site-footer { display: none !important; }
.is-embed .site-header { position: static; background: var(--surface); }
.is-embed .site-header__in { height: 48px; max-width: none; }
.is-embed .wpg-brand { font-size: 16px; }
.is-embed .wpg-brand img { width: 28px; height: 28px; }
.is-embed .wpg-main { max-width: none; padding: 8px; }
.is-embed .wpg-app { box-shadow: none; border-radius: 12px; min-height: calc(100svh - 130px); }
.is-embed .embed-credit { display: block; text-align: center; font-size: 12.5px; padding: 0 0 10px; color: var(--ink-soft); }
.is-embed .wpg-ic-canvas { height: clamp(240px, calc(100svh - 360px), 600px); }
@media (min-width: 760px) { .is-embed .wpg-ic-canvas { height: calc(100svh - 190px); min-height: 280px; } .is-embed .wpg-app { min-height: calc(100svh - 130px); } }

.is-embed .site-nav + .wpg-tools { margin-left: auto; }

/*  v5 additions  */
[hidden] { display: none !important; }
:root[data-goal="off"] .wpg-ic-goal { display: none; }
.wpg-main { padding-top: 12px; }

/* kbd, switch, danger */
.wpg-kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font: 700 11px/1 var(--font); border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 12%, transparent); }
@media (hover: none) { .wpg-btn .wpg-kbd { display: none; } }
.wpg-switch { position: relative; flex: none; width: 44px; height: 26px; padding: 0; border: 1px solid var(--tile-line); border-radius: 999px; background: color-mix(in srgb, var(--ink) 14%, var(--surface)); cursor: pointer; transition: background .2s, border-color .2s; }
.wpg-switch__knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.wpg-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.wpg-switch[aria-checked="true"] .wpg-switch__knob { transform: translateX(18px); }
.wpg-switch:disabled { opacity: .5; cursor: not-allowed; }
.wpg-btn--danger { color: #b91c1c; border-color: color-mix(in srgb, #ef4444 50%, var(--tile-line)); }
:root[data-theme="dark"] .wpg-btn--danger { color: #fca5a5; }
.wpg-btn--danger:hover { background: color-mix(in srgb, #ef4444 10%, transparent); }
.wpg-ic-danger { background: color-mix(in srgb, #ef4444 8%, transparent) !important; }
.wpg-ic-set__h { margin: 12px 2px 0; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
.wpg-ic-set__h:first-child { margin-top: 0; }
.wpg-ic-set__btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wpg-ic-set__row { flex-wrap: wrap; }
.wpg-ic-keys { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 6px 4px; font-size: 14px; color: var(--ink-soft); }
.wpg-ic-keys .wpg-kbd { color: var(--ink); }

/* hint + step buttons */
.wpg-ic-hint { gap: 7px; padding-inline: 12px; background: linear-gradient(135deg, #fbbf24, #f97316); border-color: transparent; color: #2b1500; box-shadow: 0 4px 14px rgba(249, 115, 22, .35); }
:root[data-theme="dark"] .wpg-ic-hint { color: #2b1500; }
.wpg-ic-hint:hover { filter: brightness(1.05); }
.wpg-ic-hint.is-pop, .wpg-ic-clear.is-pop { animation: wpg-ic-pop .3s var(--ease); }
.wpg-ic-hint.is-busy .wpg-btn__ico { animation: wpg-spin .8s linear infinite; }
.wpg-ic-step { gap: 7px; }
.wpg-btn__ico { display: inline-flex; align-items: center; }
.wpg-ic-clear { gap: 7px; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.wpg-ic-clear.is-drop { background: #fee2e2 !important; border-color: #ef4444; color: #b91c1c; transform: scale(1.08); }
:root[data-theme="dark"] .wpg-ic-clear.is-drop { background: #4a1d1d !important; color: #fecaca; }
@media (max-width: 360px) { .wpg-ic-hint .wpg-btn__txt, .wpg-ic-clear span { font-size: 13px; } .wpg-brand span { font-size: 16px; } .wpg-tools { min-width: 0; } .wpg-tool { width: 36px; height: 36px; } }

/* install button */
.wpg-install { gap: 7px; }
.site-header__in > .wpg-install { margin-left: auto; flex: none; }
.site-header__in > .wpg-install + .wpg-tools { margin-left: 0; }
.site-nav + .wpg-install { margin-left: 0; }
@media (max-width: 520px) { .site-header__in > .wpg-install .wpg-btn__txt { display: none; } .site-header__in > .wpg-install { padding: 0; width: 38px; height: 38px; border-radius: 11px; } }

/* content blocks */
.feature { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.feature__e { font-size: 24px; line-height: 1; display: block; margin-bottom: 8px; }
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.table-wrap table { min-width: 340px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--tile-bg); white-space: nowrap; }
.data-table td:first-child { white-space: nowrap; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.cat { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cat h3 { margin: 0 0 8px; font-size: 16px; }
.cat ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.cat li { color: var(--ink-soft); }
.cat b { color: var(--ink); }
.steps li { overflow-wrap: anywhere; }
.faq summary { align-items: center; }

/* breadcrumbs + simple pages */
.crumbs { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.crumbs a { text-decoration: none; font-weight: 600; }
.page-simple { max-width: 800px; margin: 0 auto; padding: 22px 14px 10px; }
.page-simple h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; }
.page-simple .updated { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }
.page-simple h2 { font-size: 21px; margin: 28px 0 8px; letter-spacing: -.01em; }
.page-simple p, .page-simple li { overflow-wrap: anywhere; }
.page-simple ul { padding-left: 22px; }
.page-simple li { margin-bottom: 6px; }
.callout { padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-2); margin: 0 0 18px; }
.callout p { margin: 0; }
.cta-row { margin: 28px 0 0; }

/* footer columns */
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.site-footer__cols h2 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); }
.site-footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__cols a { text-decoration: none; font-weight: 600; }
.site-footer__cols a:hover { text-decoration: underline; }
.is-embed .site-header__in > .wpg-install { display: none; }
