/* Kocia Gwardia (templates/cat_guard/game.html.twig): a cozy evening palette, big buttons, mobile first. */
:root {
    --cg-bg: #211a33;
    --cg-bg2: #2c2443;
    --cg-card: #342b4f;
    --cg-line: #4a3f6b;
    --cg-text: #f6f1ff;
    --cg-muted: #b9aed6;
    --cg-accent: #ffb547;
    --cg-accent2: #ff7a59;
    --cg-good: #6fe0a6;
    --cg-bad: #ff6b81;
    --r-common: #a9a6b8;
    --r-uncommon: #6fd38a;
    --r-rare: #5fb2ff;
    --r-epic: #b57bff;
    --r-legendary: #ffb547;
    --r-mythic: #ff5f8f;
}
* { box-sizing: border-box; }
/* `hidden` must win over the display of the components below (the enemy before a fight, banners, toasts). */
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -10%, #3b2d63 0%, var(--cg-bg) 60%) fixed, var(--cg-bg);
    color: var(--cg-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--cg-accent); }
.cg-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: 980px; margin: 0 auto; }
.cg-nav nav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.cg-nav nav a { color: var(--cg-text); text-decoration: none; }
.cg-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cg-text); }
.cg-brand span { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.cg { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.cg-loading { text-align: center; color: var(--cg-muted); padding: 60px 0; }
h1 { font-size: clamp(26px, 6vw, 38px); margin: 18px 0 6px; }
.cg-lead { color: var(--cg-muted); margin: 0 0 18px; max-width: 46em; }
.cg-h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--cg-muted); margin: 22px 0 10px; }

/* Creator */
.cg-furs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.cg-fur { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; background: var(--cg-card); border: 2px solid transparent; cursor: pointer; text-align: center; font-size: 12px; color: var(--cg-muted); }
.cg-fur input { position: absolute; opacity: 0; }
.cg-fur img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cg-fur:has(input:checked) { border-color: var(--cg-accent); color: var(--cg-text); background: var(--cg-bg2); }
.cg-fur:has(input:focus-visible) { outline: 2px solid var(--cg-accent); outline-offset: 2px; }
.cg-name { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.cg-name label { width: 100%; color: var(--cg-muted); font-size: 14px; }
.cg-name input { flex: 1 1 200px; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--cg-line); background: var(--cg-bg2); color: var(--cg-text); }
.cg-error { color: var(--cg-bad); }

/* Buttons */
.cg-button { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 2px solid var(--cg-line); background: var(--cg-card); color: var(--cg-text); cursor: pointer; transition: transform .08s ease, filter .15s; }
.cg-button:hover:not(:disabled) { filter: brightness(1.12); }
.cg-button:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.cg-button:disabled { opacity: .45; cursor: not-allowed; }
.cg-button small { font-weight: 600; opacity: .85; }
.cg-button img { width: 26px; height: 26px; object-fit: contain; }
.cg-coin { width: 1.25em !important; height: 1.25em !important; vertical-align: -.25em; object-fit: contain; }
.cg-primary { background: linear-gradient(180deg, var(--cg-accent), var(--cg-accent2)); border-color: transparent; color: #2a1606; }

/* Top bar */
.cg-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px; background: var(--cg-bg2); margin: 8px 0 12px; font-size: 14px; }
.cg-res { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; }
.cg-res img { width: 28px; height: 28px; object-fit: contain; }
.cg-lives { color: var(--cg-bad); letter-spacing: 1px; }
.cg-switches { display: inline-flex; gap: 4px; }
/* Sound, music, vibration and notification switches: drawn icons (the on and off parts in one SVG), a pop when pressed. */
.cg-switch { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
    color: var(--cg-accent); border: 2px solid color-mix(in srgb, var(--cg-accent) 55%, var(--cg-line));
    background: linear-gradient(180deg, #43376a, var(--cg-card)); box-shadow: 0 2px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: color .2s, border-color .2s, background .2s, opacity .2s, transform .15s; }
.cg-switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    filter: drop-shadow(0 0 4px color-mix(in srgb, currentColor 45%, transparent)); }
.cg-switch .ic-fill { fill: currentColor; }
.cg-switch[aria-pressed="true"] .ic-off, .cg-switch[aria-pressed="false"] .ic-on { display: none; }
.cg-switch[aria-pressed="false"] { color: var(--cg-muted); border-color: var(--cg-line); background: var(--cg-card); opacity: .6; }
.cg-switch[aria-pressed="false"] svg { filter: none; }
.cg-switch[aria-pressed="false"] .ic-fill { fill: none; }
.cg-switch:hover, .cg-switch:focus-visible { transform: translateY(-1px); border-color: var(--cg-accent); opacity: 1; }
.cg-switch.is-pop { animation: cg-switch-pop .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes cg-switch-pop { 35% { transform: scale(1.18) rotate(-7deg); } 70% { transform: scale(.96) rotate(2deg); } }
.cg-push-hint { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--cg-bg2); border: 2px dashed var(--cg-line); color: var(--cg-muted); font-size: 14px; }
.cg-place { flex: 1; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; font: inherit; font-weight: 600; text-align: left; color: var(--cg-text); background: var(--cg-card); border: 2px solid var(--cg-line); border-radius: 10px; cursor: pointer; }
.cg-place::after { content: '›'; margin-left: auto; padding-left: 6px; color: var(--cg-muted); font-size: 18px; line-height: 1; }
.cg-place:hover, .cg-place:focus-visible { border-color: var(--cg-accent); }
.cg-h2 small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.cg-muted { color: var(--cg-muted); }

/* Battle stage */
.cg-stage { position: relative; aspect-ratio: 16 / 9; min-height: 220px; max-width: 100%; border-radius: 20px; overflow: hidden; background: #3a3054 center / cover no-repeat; box-shadow: inset 0 -60px 80px rgba(20, 12, 40, .35); }
.cg-fighter { position: absolute; bottom: 9%; width: 32%; display: flex; flex-direction: column; align-items: center; transition: transform .18s ease; }
.cg-fighter > img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.cg-enemy.is-boss { width: 40%; }
/* Paper doll: the base cat on its whole canvas and the worn layers on top, pixel for pixel (doll() in game.js). */
.cg-cat { width: 38%; left: 2%; bottom: 4%; }
.cg-doll { position: relative; width: 100%; aspect-ratio: 1; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.cg-doll-base { display: block; width: 100%; }
.cg-wear { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cg-team-row { position: absolute; left: 2%; bottom: 14%; display: flex; align-items: flex-end; gap: 0; width: 34%; pointer-events: none; }
.cg-team-row img { width: 45%; aspect-ratio: 1; object-fit: contain; object-position: 50% 100%; margin-right: -14%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)) brightness(.95); }
.cg-team-row:not(:empty) + .cg-cat { left: 16%; }
.cg-enemy { right: 6%; }
.cg-hp { width: 80%; height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .45); overflow: hidden; margin-top: 4px; }
.cg-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--cg-good), #b6f0a0); transition: width .25s ease; }
.cg-enemy .cg-hp i { background: linear-gradient(90deg, var(--cg-bad), #ffb0a0); }
.cg-tag { margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(20, 12, 40, .6); font-size: 12px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cg-fighter.is-attack { animation: cg-lunge-right .3s ease; }
.cg-fighter.is-attack-left { animation: cg-lunge-left .3s ease; }
.cg-fighter.is-hit > img, .cg-fighter.is-hit .cg-doll { animation: cg-hit .3s ease; }
.cg-fighter.is-enter { animation: cg-enter .6s ease; }
.cg-fighter.is-down { animation: cg-down .5s ease forwards; }
@keyframes cg-lunge-right { 40% { transform: translateX(18%) rotate(4deg); } }
@keyframes cg-lunge-left { 40% { transform: translateX(-18%) rotate(-4deg); } }
@keyframes cg-hit { 30% { transform: translateX(6px); filter: brightness(1.8) drop-shadow(0 0 8px #fff); } 60% { transform: translateX(-4px); } }
@keyframes cg-enter { from { transform: translateX(60%) scale(.8); opacity: 0; } }
@keyframes cg-down { to { transform: translateY(20%) scale(.6) rotate(12deg); opacity: 0; } }
.cg-floaters { position: absolute; inset: 0; pointer-events: none; }
.cg-float { position: absolute; top: 38%; font-weight: 900; font-size: clamp(18px, 4vw, 30px); color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .6); animation: cg-float 1.1s ease forwards; }
.cg-float.on-enemy { right: 18%; }
.cg-float.on-cat { left: 18%; color: #ffd2d8; }
.cg-float.is-crit { color: var(--cg-accent); font-size: clamp(22px, 5vw, 38px); }
.cg-float.is-dodge { color: #a6e4ff; }
.cg-float.is-heal { color: var(--cg-good); }
@keyframes cg-float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70px); opacity: 0; } }
.cg-banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); padding: 10px 20px; border-radius: 16px; font-weight: 900; font-size: clamp(18px, 4.5vw, 28px); background: rgba(20, 12, 40, .78); animation: cg-enter .4s ease; white-space: nowrap; }
.cg-banner.is-win { color: var(--cg-accent); }
.cg-banner.is-lose { color: #ffc2cb; }
/* PixiJS stage (stage.js): the canvas under the bars and numbers; the DOM sprites stay as invisible boxes that say where
   the characters stand, and their CSS animations are off (the canvas animates). */
.cg-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.has-pixi .cg-doll, .has-pixi .cg-fighter > img, .has-pixi .cg-team-row img { visibility: hidden; }
.has-pixi .cg-fighter { animation: none !important; }
.has-pixi .cg-fighter .cg-hp, .has-pixi .cg-fighter .cg-tag { transition: opacity .3s; }
.has-pixi .cg-fighter.is-down .cg-hp, .has-pixi .cg-fighter.is-down .cg-tag { opacity: 0; }
.has-pixi .cg-fighter.is-enter .cg-hp, .has-pixi .cg-fighter.is-enter .cg-tag { animation: cg-fade .5s ease both; }
@keyframes cg-fade { from { opacity: 0; } }
.cg-flycoin { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; object-fit: contain; pointer-events: none; z-index: 25; }
.cg-res.is-gain img { animation: cg-gain .3s ease; }
@keyframes cg-gain { 40% { transform: scale(1.35) rotate(-8deg); } }

/* Tabs and panels */
.cg-tabs { display: flex; gap: 6px; margin: 12px 0 4px; overflow-x: auto; scrollbar-width: none; }
.cg-tabs::-webkit-scrollbar { display: none; }
.cg-tabs button { flex: 1 0 auto; font: inherit; font-weight: 700; font-size: 14px; padding: 10px 12px; border-radius: 12px; border: 2px solid transparent; background: var(--cg-bg2); color: var(--cg-muted); cursor: pointer; white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s; }
.cg-tabs button:hover { color: var(--cg-text); transform: translateY(-1px); }
.cg-tabs button[aria-selected="true"] { background: var(--cg-card); color: var(--cg-text); border-color: var(--cg-accent);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--cg-accent) 35%, transparent); animation: cg-tab-pop .3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes cg-tab-pop { 45% { transform: translateY(-2px) scale(1.06); } }
/* A new tab's panel slides in from the side of its tab and its parts rise one after another (switchTab in game.js). */
.cg-panel.is-in { animation: cg-panel-in .3s cubic-bezier(.2, .8, .2, 1) both; }
.cg-panel.is-in.is-back { animation-name: cg-panel-back; }
.cg-panel.is-in > * { animation: cg-rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.cg-panel.is-in > :nth-child(2) { animation-delay: .04s; }
.cg-panel.is-in > :nth-child(3) { animation-delay: .08s; }
.cg-panel.is-in > :nth-child(4) { animation-delay: .12s; }
.cg-panel.is-in > :nth-child(n+5) { animation-delay: .16s; }
@keyframes cg-panel-in { from { opacity: 0; transform: translateX(26px); } }
@keyframes cg-panel-back { from { opacity: 0; transform: translateX(-26px); } }
@keyframes cg-rise { from { opacity: 0; transform: translateY(10px); } }
.cg.is-fighting .cg-tabs button { pointer-events: none; opacity: .6; }
.cg-panel .cg-lead { margin: 12px 0; font-size: 14px; }
.cg-mini { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--cg-line); background: var(--cg-bg2); color: var(--cg-text); cursor: pointer; margin-top: 6px; }
.cg-mini:disabled { opacity: .4; cursor: not-allowed; }
.cg-slots { color: var(--cg-muted); font-size: 14px; }
.cg-companions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.cg-companion { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-line); }
.cg-companion img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.cg-companion b { display: block; }
.cg-companion small { color: var(--cg-muted); }
.cg-companion p { margin: 4px 0 0; font-size: 13px; }
.cg-companion.is-active { border-color: var(--cg-accent); box-shadow: 0 0 16px -4px var(--cg-accent); }
.cg-companion.is-locked img { filter: brightness(0) opacity(.35); }
.cg-towerinfo { display: flex; gap: 14px; align-items: baseline; margin: 6px 0 12px; font-size: 18px; }
.cg-towerinfo span { color: var(--cg-muted); font-size: 14px; }
.cg-raid { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--cg-card); }
.cg-raid img { width: 110px; height: 110px; object-fit: contain; flex: none; }
.cg-raid > div { flex: 1; }
.cg-raid b { font-size: 18px; }
.cg-raid-hp { width: 100%; height: 12px; margin: 8px 0 4px; }
.cg-raid small { color: var(--cg-muted); }
.cg-board { list-style: none; counter-reset: rank; padding: 0; margin: 0; }
.cg-board li { counter-increment: rank; display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--cg-bg2); margin-bottom: 6px; font-size: 14px; }
.cg-board li::before { content: counter(rank) "."; color: var(--cg-muted); width: 2em; flex: none; }
.cg-board li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-board li.is-me { border: 2px solid var(--cg-accent); }
.cg-rebirth { margin-top: 16px; padding: 12px 14px; border-radius: 16px; background: var(--cg-bg2); font-size: 14px; }
.cg-rebirth p { margin: 0 0 10px; }
.cg-rebirth p:last-child { margin: 0; }
.cg-season { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--cg-accent2); color: #2a1606; font-size: 12px; font-weight: 800; }
.cg-toast-img { width: 40px; height: 40px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.cg-toast-place { width: 64px; height: 36px; object-fit: cover; border-radius: 8px; float: left; margin: 2px 10px 2px 0; }

/* Progress: streak, quests of the day, achievement badges with bronze → diamond frames */
.cg-tabs button { position: relative; }
.cg-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--cg-bad); }
.cg-streak { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: var(--cg-card); }
.cg-streak img { width: 56px; height: 56px; object-fit: contain; }
.cg-streak b { display: block; font-size: 18px; }
.cg-streak small { color: var(--cg-muted); }
.cg-quests { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cg-quests li { padding: 10px 12px; border-radius: 14px; background: var(--cg-bg2); border: 2px solid var(--cg-line); }
.cg-quests li.is-done { border-color: var(--cg-good); opacity: .8; }
.cg-quests span { font-weight: 700; }
.cg-quests small { color: var(--cg-muted); }
.cg-quest-hp { width: 100%; margin: 6px 0 4px; }
.cg-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cg-badge { --frame: var(--cg-line); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--frame); text-align: center; font-size: 13px; }
.cg-badge img { width: 64px; height: 64px; object-fit: contain; }
.cg-badge .cg-hp { width: 90%; }
.cg-badge.is-locked img { filter: grayscale(1) opacity(.45); }
.cg-badge.tier-1 { --frame: #c98a5b; }
.cg-badge.tier-2 { --frame: #c9d1dc; }
.cg-badge.tier-3 { --frame: var(--r-legendary); box-shadow: 0 0 14px -4px var(--frame); }
.cg-badge.tier-4 { --frame: #9ff0ff; box-shadow: 0 0 16px -3px var(--frame); }
.cg-badge.tier-5 { --frame: var(--r-mythic); box-shadow: 0 0 18px -2px var(--frame); }
/* Wardrobe */
.cg-wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cg-skin { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-line); text-align: center; font-size: 13px; }
.cg-skin img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cg-skin.is-special { border-color: var(--r-epic); }
.cg-skin.is-worn { border-color: var(--cg-accent); box-shadow: 0 0 16px -4px var(--cg-accent); }
.cg-skin.is-locked img { filter: brightness(0) opacity(.35); }
.cg-worn { color: var(--cg-accent); font-weight: 800; }
/* Ranking boards */
.cg-boards { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.cg-boards button { flex: 1 0 auto; font: inherit; font-size: 13px; font-weight: 700; padding: 8px 10px; border-radius: 10px; border: 2px solid transparent; background: var(--cg-bg2); color: var(--cg-muted); cursor: pointer; }
.cg-boards button[aria-selected="true"] { color: var(--cg-text); border-color: var(--cg-accent2); }
.cg-board li { align-items: center; }
.cg-board-cat { width: 34px; height: 34px; object-fit: contain; flex: none; }
.cg-toast.is-note { border-color: var(--cg-accent); }
/* The app on the home screen (PWA): the content below the status bar. */
.cg-nav { padding-top: max(10px, env(safe-area-inset-top)); }

/* Obrona Kanapy (arcade.js): the whole screen, the HUD over the canvas. */
.cg-arcade { position: fixed; inset: 0; z-index: 40; background: #1a1430; touch-action: none; user-select: none; -webkit-user-select: none; }
body.cg-arcade-open { overflow: hidden; }
.cg-arcade-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cg-arcade-hud { position: absolute; inset: 0; pointer-events: none; padding: max(10px, env(safe-area-inset-top)) 12px 12px; }
.cg-arcade-hud button { pointer-events: auto; }
.cg-arcade-bars .cg-hp { width: min(60%, 360px); height: 12px; margin: 0 0 6px; }
.cg-arcade-bars .cg-xp i { background: linear-gradient(90deg, var(--r-rare), #a6e4ff); }
.cg-arcade-top { display: flex; gap: 12px; align-items: center; font-weight: 800; text-shadow: 0 2px 0 #000; }
.cg-arcade-top span { color: var(--cg-muted); }
.cg-arcade-top button { margin: 0 0 0 auto; }
.cg-arcade-hint { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 12px; background: rgba(18, 12, 34, .75); color: var(--cg-muted); font-size: 14px; text-align: center; width: max-content; max-width: 90%; }
.cg-arcade-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-weight: 900; font-size: clamp(24px, 7vw, 40px); color: var(--cg-accent); text-shadow: 0 3px 0 #000; animation: cg-enter .4s ease; white-space: nowrap; }
.cg-arcade-choice { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 6, 22, .72); pointer-events: auto; }
.cg-arcade-choice > b { font-size: 22px; color: var(--cg-accent); margin-bottom: 6px; text-align: center; }
.cg-arcade-choice button { font: inherit; width: min(100%, 360px); padding: 12px 16px; border-radius: 16px; border: 2px solid var(--cg-line); background: var(--cg-card); color: var(--cg-text); cursor: pointer; text-align: left; display: grid; gap: 2px; }
.cg-arcade-choice button:hover { border-color: var(--cg-accent); }
.cg-arcade-choice button:has(img) { grid-template-columns: 52px 1fr; column-gap: 12px; align-items: center; }
.cg-arcade-choice button img { grid-row: span 3; width: 52px; height: 52px; object-fit: contain; }
.cg-arcade-choice button small { color: var(--cg-muted); }
.cg-arcade-choice button i { font-style: normal; color: var(--cg-accent); letter-spacing: 2px; font-size: 12px; }
.cg-arcade-info { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.cg-arcade-info small { color: var(--cg-muted); }
.cg-arcade-result { margin-bottom: 12px; padding: 12px 14px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-accent); }
.cg-arcade-result p { margin: 4px 0; }
.cg-record { color: var(--cg-accent); font-size: 18px; }

/* Actions, stats, gear */
.cg-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; align-items: center; }
.cg-actions .cg-box, .cg-actions .cg-upgrade { grid-column: span 2; }
@media (min-width: 640px) { .cg-actions { grid-template-columns: auto auto 1fr auto; } .cg-actions .cg-box, .cg-actions .cg-upgrade { grid-column: auto; } }
.cg-auto { display: inline-flex; gap: 8px; align-items: center; color: var(--cg-muted); font-size: 14px; }
.cg-auto input { width: 20px; height: 20px; accent-color: var(--cg-accent); }
.cg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; padding: 6px; border-radius: 14px; background: var(--cg-bg2); font-weight: 700; }
.cg-stat { font: inherit; color: var(--cg-text); display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 8px 4px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; }
.cg-stat:hover, .cg-stat.is-open { background: var(--cg-card); border-color: var(--cg-line); }
.cg-stat b { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cg-stat b i { font-style: normal; color: var(--cg-accent); }
.cg-stat small { font-size: 12px; font-weight: 600; color: var(--cg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cg-stats-help { margin: 8px 2px 0; font-size: 14px; color: var(--cg-muted); }
.cg-stats-help b { color: var(--cg-text); }
.cg-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cg-slot { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 6px 6px; border-radius: 14px; background: var(--cg-card); border: 2px solid var(--r, var(--cg-line)); font-size: 12px; color: var(--cg-muted); min-height: 104px; justify-content: flex-end; }
.cg-slot img { width: 64px; height: 64px; object-fit: contain; }
.cg-slot small { color: var(--cg-text); }
.cg-slot.is-empty { border-style: dashed; opacity: .7; }
.r-common { --r: var(--r-common); }
.r-uncommon { --r: var(--r-uncommon); }
.r-rare { --r: var(--r-rare); }
.r-epic { --r: var(--r-epic); }
.r-legendary { --r: var(--r-legendary); }
.r-mythic { --r: var(--r-mythic); }
.cg-slot.r-epic, .cg-slot.r-legendary, .cg-slot.r-mythic { box-shadow: 0 0 14px -2px var(--r); }
.cg-odds { margin-top: 16px; color: var(--cg-muted); font-size: 14px; }
.cg-odds div { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.cg-odds span { color: var(--r); }
.cg-foot { color: var(--cg-muted); font-size: 13px; margin-top: 18px; }
.cg-link { font: inherit; color: var(--cg-accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* Item dialog */
.cg-dialog { border: 0; padding: 0; background: transparent; color: var(--cg-text); max-width: min(440px, calc(100vw - 32px)); width: 100%; }
.cg-dialog::backdrop { background: rgba(10, 6, 22, .7); backdrop-filter: blur(3px); }
.cg-item { position: relative; overflow: hidden; background: var(--cg-bg2); border-radius: 22px; padding: 18px; border: 2px solid var(--cg-line); animation: cg-enter .35s ease; }
/* Opening the box (unbox() in game.js): it shakes for --shake, bursts with light in the rarity's colour, the item pops out. */
.cg-unbox { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--cg-bg2); cursor: pointer; }
.cg-unbox img { position: relative; width: 44%; max-width: 180px; animation: cg-shake var(--shake, .6s) ease-in both; }
.cg-unbox [data-unbox-open] { position: absolute; width: 56%; max-width: 230px; opacity: 0; animation: none; }
.cg-unbox-rays { position: absolute; width: 170%; aspect-ratio: 1; opacity: 0; pointer-events: none;
    background: repeating-conic-gradient(color-mix(in srgb, var(--r, #fff) 75%, transparent) 0 7deg, transparent 7deg 20deg);
    -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 60%); mask: radial-gradient(circle, #000 0 18%, transparent 60%); }
.cg-unbox::after { content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--r, #fff) 55%, #fff) 0, transparent 62%); }
.cg-item.is-unboxing > :not(.cg-unbox) { visibility: hidden; }
.cg-item.is-revealed .cg-unbox { background: transparent; pointer-events: none; }
.cg-item.is-revealed .cg-unbox [data-unbox-closed] { animation: cg-box-pop .3s ease-out forwards; }
.cg-item.is-revealed .cg-unbox.has-open [data-unbox-closed] { visibility: hidden; }
.cg-item.is-revealed .cg-unbox [data-unbox-open] { animation: cg-open-pop .75s ease-out forwards; }
.cg-item.is-revealed .cg-unbox-rays { animation: cg-rays .9s ease-out forwards; }
.cg-item.is-revealed .cg-unbox::after { animation: cg-flash .5s ease-out; }
.cg-item.is-revealed .cg-item-card .cg-card { animation: cg-card-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.cg-item.is-revealed .cg-compare, .cg-item.is-revealed .cg-item-current, .cg-item.is-revealed .cg-dialog-actions { animation: cg-fade .4s .2s ease both; }
@keyframes cg-shake {
    0% { transform: scale(.5); opacity: 0; }
    12% { transform: scale(1); opacity: 1; }
    24%, 48%, 72% { transform: rotate(-7deg) scale(1.02); }
    36%, 60%, 84% { transform: rotate(7deg) scale(1.05); }
    100% { transform: scale(1.14); filter: drop-shadow(0 0 22px var(--r, #fff)) brightness(1.35); }
}
@keyframes cg-box-pop { to { transform: scale(1.7); opacity: 0; } }
@keyframes cg-open-pop { 0% { transform: scale(.75); opacity: 1; } 30% { transform: scale(1.12); opacity: 1; } 50% { opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes cg-rays { 0% { opacity: 0; transform: scale(.4) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15) rotate(45deg); } }
@keyframes cg-flash { 0% { opacity: 0; } 20% { opacity: .9; } 100% { opacity: 0; } }
@keyframes cg-card-pop { from { transform: scale(.4); opacity: 0; } }
.cg-eyebrow { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--cg-muted); }
.cg-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--r, var(--cg-line)); }
.cg-card img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.cg-card b { display: block; font-size: 17px; }
.cg-card small { display: block; color: var(--r, var(--cg-muted)); margin: 2px 0 4px; }
.cg-power { font-weight: 800; }
.cg-card.cg-empty { justify-content: center; min-height: 60px; color: var(--cg-muted); border-style: dashed; }
.cg-item-card .cg-card { box-shadow: 0 0 22px -4px var(--r); }
.cg-item-current { margin-top: 12px; opacity: .85; }
/* The box dialog: what the cat wears now → what fell out of the box, side by side (openItem in game.js). */
.cg-swap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.cg-swap .cg-item-current { margin: 0; opacity: .8; }
.cg-swap-side .cg-eyebrow { margin: 0 0 6px; text-align: center; }
.cg-swap-arrow { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 18px; border-radius: 50%; background: var(--cg-card); border: 2px solid var(--cg-line); color: var(--cg-accent); animation: cg-nudge 1.4s ease-in-out infinite; }
.cg-swap-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes cg-nudge { 50% { transform: translateX(3px); } }
.cg-tile { position: relative; flex-direction: column; gap: 2px; text-align: center; padding: 10px 8px; min-height: 100%; }
.cg-tile img { width: 72px; height: 72px; }
.cg-tile b { font-size: 14px; line-height: 1.2; }
.cg-tile small { margin: 2px 0; font-size: 12px; }
.cg-tile.cg-empty { min-height: 150px; font-size: 13px; }
.cg-power-diff { position: absolute; top: -10px; right: -6px; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--cg-card); border: 2px solid var(--cg-line); color: var(--cg-muted); }
.cg-power-diff.up { color: #12301f; background: var(--cg-good); border-color: var(--cg-good); }
.cg-power-diff.down { color: #fff; background: var(--cg-bad); border-color: var(--cg-bad); }
.cg-dialog-actions .cg-button { flex-direction: column; justify-content: center; gap: 2px; line-height: 1.15; }
.cg-dialog-actions .cg-button small { display: block; margin: 0; font-weight: 600; font-size: 12px; opacity: .85; white-space: nowrap; }
.cg-compare { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 2px 0; font-weight: 700; }
.cg-compare i { font-style: normal; font-size: 13px; margin-left: 2px; color: var(--cg-muted); }
.cg-compare i.up { color: var(--cg-good); }
.cg-compare i.down { color: var(--cg-bad); }
.cg-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.cg-toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(460px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: #120c22; border: 1px solid var(--cg-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); z-index: 20; }
.cg-toast.is-error { border-color: var(--cg-bad); }
/* Journey map (map.js): chapters as cards, the regions as stops of a winding path, the cat at its stop. */
.cg-map-dialog { max-width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); background: var(--cg-bg); border: 2px solid var(--cg-line); border-radius: 20px; padding: 0; overflow: auto; overscroll-behavior: contain; }
.cg-map-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--cg-bg2); border-bottom: 2px solid var(--cg-line); }
.cg-map-head h2 { margin: 0; font-size: 18px; }
.cg-map-loop { margin: 12px 16px 0; padding: 10px 14px; border-radius: 14px; background: var(--cg-card); color: var(--cg-accent); font-weight: 700; font-size: 14px; }
.cg-map { position: relative; padding: 8px 16px 24px; }
.cg-map-line { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
.cg-map-line path { fill: none; stroke-linecap: round; }
.cg-line-all { stroke: var(--cg-line); stroke-width: 4; stroke-dasharray: 2 10; }
.cg-line-done { stroke: var(--cg-accent); stroke-width: 4; opacity: .75; }
.cg-chapter { position: relative; z-index: 1; margin-top: 18px; }
.cg-chapter header { position: relative; padding: 12px 14px; border-radius: 16px; background: var(--cg-bg2); border: 2px solid var(--cg-line); }
.cg-chapter.is-current header { border-color: var(--cg-accent); }
.cg-chapter-art { display: block; width: calc(100% + 28px); aspect-ratio: 16 / 7; object-fit: cover; margin: -12px -14px 10px; border-radius: 14px 14px 0 0; }
.cg-chapter header small { color: var(--cg-accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.cg-chapter h3 { margin: 2px 0 4px; font-size: 18px; }
.cg-chapter header p { margin: 0; color: var(--cg-muted); font-size: 14px; }
.cg-path { list-style: none; margin: 0; padding: 6px 0; }
.cg-node { --x: 1; position: relative; display: flex; align-items: center; gap: 10px; width: 62%; margin: 10px 0 10px calc(var(--x) * 19%); }
.cg-node-pic { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: visible; background: linear-gradient(180deg, #4b3d73, #3a3054 68%, #5a4636 69%, #3d2f26); border: 3px solid var(--cg-line); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.cg-node-pic > img:first-child { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.cg-node-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 1.25; }
.cg-node-text b { overflow-wrap: anywhere; }
.cg-node-text small { color: var(--cg-muted); font-size: 12px; }
.cg-node-badge { position: absolute; right: -8px; bottom: -8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 900; background: var(--cg-card); border: 2px solid var(--cg-line); }
.cg-node.is-done .cg-node-pic { border-color: var(--cg-good); }
.cg-node.is-done .cg-node-badge { background: var(--cg-good); border-color: var(--cg-good); color: #10301f; }
.cg-node.is-here .cg-node-pic { border-color: var(--cg-accent); box-shadow: 0 0 0 4px rgba(255, 181, 71, .25), 0 0 22px -2px var(--cg-accent); }
.cg-node.is-here .cg-node-text b { color: var(--cg-accent); }
.cg-node-cat { position: absolute; left: 50%; bottom: 4%; width: auto; height: 96%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .45)); animation: cg-hop 1.6s ease-in-out infinite; }
.cg-node.is-locked .cg-node-pic > img:first-child { filter: grayscale(.85) brightness(.55); }
.cg-node.is-locked .cg-node-text, .cg-node.is-soon .cg-node-text { opacity: .7; }
.cg-node.is-soon .cg-node-pic { border-style: dashed; }
.cg-node.is-soon .cg-node-badge { color: var(--cg-muted); }
@keyframes cg-hop { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
@media (max-width: 420px) { .cg-node { width: 74%; margin-left: calc(var(--x) * 13%); } .cg-node-pic { width: 84px; } }
/* Obrona Kanapy: the arena. */
.cg-arena { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; color: var(--cg-muted); }
.cg-arena select { flex: 1; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--cg-line); background: var(--cg-card); color: var(--cg-text); }

/* Wyzwanie tygodnia: the week's modifiers as cards. */
.cg-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.cg-mod { padding: 10px 12px; border-radius: 14px; background: var(--cg-card); border: 2px solid var(--cg-accent2); }
.cg-mod b { display: block; }
.cg-mod small { color: var(--cg-muted); font-size: 13px; }

/* Warsztat (fight tab): a row per equipment slot. */
.cg-refine { position: absolute; top: 6px; right: 8px; font-style: normal; font-weight: 800; font-size: 13px; color: var(--cg-accent); }
.cg-refines { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 8px; }
.cg-refine-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--cg-card); border: 2px solid var(--cg-line); }
.cg-refine-row img, .cg-refine-row > i { width: 44px; height: 44px; object-fit: contain; flex: none; }
.cg-refine-row span { flex: 1; min-width: 0; }
.cg-refine-row b { display: block; }
.cg-refine-row small { color: var(--cg-muted); font-size: 12px; }
.cg-refine-row .cg-mini { margin: 0; }
.cg-workshop .cg-chron-note { padding: 0; }

/* The cat's skills (fight tab) and their names in fights. */
.cg-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 8px; }
.cg-skill { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-line); }
.cg-skill.is-active { border-color: var(--cg-accent); }
.cg-skill.is-locked { opacity: .55; }
.cg-skill.is-locked img { filter: grayscale(1); }
.cg-skill img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.cg-skill b { display: block; }
.cg-skill small { display: block; color: var(--cg-muted); font-size: 13px; }
.cg-skill span { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-float.is-skill { display: flex; align-items: center; gap: 4px; top: 22%; font-size: clamp(14px, 3vw, 20px); color: #ffe7a8; }
.cg-float-icon { width: 28px; height: 28px; object-fit: contain; }

/* Wyprawy (team tab): those away, then the form for a free slot. */
.cg-expeditions { display: grid; gap: 10px; margin-top: 8px; }
.cg-exp { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-line); overflow: hidden; }
.cg-exp.is-back { border-color: var(--cg-good); }
.cg-exp-place { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.cg-exp-cat { position: relative; width: 72px; height: 72px; object-fit: contain; flex: none; }
.cg-exp > div { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-exp small { color: var(--cg-muted); }
.cg-exp span { font-weight: 800; color: var(--cg-accent); }
.cg-exp.is-back span { color: var(--cg-good); }
.cg-exp-form { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--cg-bg2); border: 2px dashed var(--cg-line); }
.cg-exp-form label { display: grid; gap: 4px; font-size: 13px; color: var(--cg-muted); }
.cg-exp-form select { font: inherit; font-size: 15px; padding: 10px; border-radius: 12px; border: 2px solid var(--cg-line); background: var(--cg-card); color: var(--cg-text); }
.cg-exp-go { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cg-exp-go .cg-button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; }
.cg-exp-go small { font-size: 12px; font-weight: 600; }
.cg-exp-note { margin: 0; color: var(--cg-muted); font-size: 14px; }

/* Kocia kronika: a region (or an age of items) per card, its enemies as a grid; unknown ones as silhouettes. */
.cg-chron-sum { margin: 0 0 10px; color: var(--cg-muted); font-size: 14px; }
.cg-chron-sum b { color: var(--cg-text); }
.cg-chron { display: grid; gap: 8px; margin-top: 12px; }
.cg-chron-region { border-radius: 16px; background: var(--cg-card); border: 2px solid var(--cg-line); }
.cg-chron-region.is-complete { border-color: var(--cg-good); }
.cg-chron-region summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; cursor: pointer; list-style: none; }
.cg-chron-region summary::-webkit-details-marker { display: none; }
.cg-chron-region summary img { width: 64px; height: 44px; object-fit: cover; border-radius: 10px; flex: none; background: var(--cg-bg2); }
.cg-chron-region summary span { flex: 1; min-width: 0; }
.cg-chron-region summary b { display: block; }
.cg-chron-region summary small { color: var(--cg-muted); font-size: 12px; }
.cg-chron-region summary em { font-style: normal; font-weight: 800; color: var(--cg-accent); }
.cg-chron-region.is-complete summary em { color: var(--cg-good); }
.cg-chron-region img.is-dark { filter: brightness(0) invert(1) opacity(.2); }
.cg-chron-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 0 10px 10px; }
.cg-chron-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--cg-bg2); text-align: center; font-size: 12px; }
.cg-chron-card img { width: 72px; height: 72px; object-fit: contain; }
.cg-chron-card small { color: var(--cg-muted); font-size: 11px; }
.cg-chron-card.is-boss { box-shadow: inset 0 0 0 2px var(--cg-accent2); }
.cg-chron-card.is-elite img { filter: drop-shadow(0 0 6px rgba(190, 120, 255, .7)); }
.cg-chron-card.is-unknown img { filter: brightness(0) invert(1) opacity(.2); }
.cg-chron-card.is-unknown b { color: var(--cg-muted); }
.cg-chron-h { margin: 0; padding: 0 12px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--cg-muted); }
.cg-chron-note { margin: 0; padding: 0 12px 10px; font-size: 13px; color: var(--cg-muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Language menu (ludo/_lang.html.twig, the same choice as in Ludo and the account pages). */
.ludo-lang-menu { position: relative; }
.ludo-lang-menu summary { list-style: none; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font-weight: 700; font-size: 13px; color: var(--cg-text); }
.ludo-lang-menu summary::-webkit-details-marker { display: none; }
.ludo-lang-menu ul { position: absolute; right: 0; top: 130%; z-index: 30; min-width: 160px; margin: 0; padding: 6px; list-style: none; border-radius: 12px; background: var(--cg-bg2); border: 1px solid var(--cg-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.ludo-lang-menu li a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--cg-text); text-decoration: none; }
.ludo-lang-menu li a:hover, .ludo-lang-menu li a[aria-current] { background: var(--cg-card); }
.ludo-lang-menu small { color: var(--cg-muted); }

/* Settings: the art on the device (game.js, "Settings"). */
.cg-settings .cg-lead { margin: 6px 0 10px; color: var(--cg-muted); font-size: 14px; }
.cg-art-status { margin: 8px 0; font-weight: 700; }
.cg-art-bar { height: 10px; border-radius: 999px; background: var(--cg-card); border: 2px solid var(--cg-line); overflow: hidden; }
.cg-art-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cg-accent2), var(--cg-accent)); transition: width .25s ease; }
.cg-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; cursor: pointer; }
.cg-check input { width: 18px; height: 18px; accent-color: var(--cg-accent); }
.cg-check small { color: var(--cg-muted); }
.cg-settings-btn svg { stroke-width: 1.8; }

/* Kocie mieszkanko (home.js): the room with things placed by their foot (x, y in %), the storage, the shop. */
.cg-home-sum { margin: 0 0 10px; color: var(--cg-muted); font-size: 14px; }
.cg-home-sum b { color: var(--cg-text); }
.cg-home-room { position: relative; width: 100%; aspect-ratio: 1344 / 768; border-radius: 18px; overflow: hidden; background: linear-gradient(#5a4a7d 0 66%, #6b5040 66%) center / cover no-repeat;
    border: 2px solid var(--cg-line); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cg-home-thing { position: absolute; touch-action: none; cursor: grab; transform-origin: 50% 100%; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); }
.cg-home-thing:active { cursor: grabbing; }
.cg-home-thing > img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.cg-home-thing.is-cat > img.cg-wear { position: absolute; inset: 0; height: 100%; }
.cg-home-thing.is-selected { filter: drop-shadow(0 0 3px var(--cg-accent)) drop-shadow(0 0 1px #fff); }
.cg-home-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.cg-home-tools .cg-mini { margin-top: 0; }
.cg-home-hint { color: var(--cg-muted); font-size: 13px; margin: 8px 0 0; }
.cg-home-store { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cg-home-store .cg-muted { margin: 0; font-size: 14px; }
.cg-home-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; padding: 8px 4px; border-radius: 12px; border: 2px solid var(--cg-line);
    background: var(--cg-card); color: var(--cg-text); font: inherit; font-size: 12px; cursor: pointer; }
.cg-home-chip img { width: 56px; height: 56px; object-fit: contain; }
.cg-home-chip:disabled { opacity: .45; cursor: not-allowed; }
.cg-home-list { margin-top: 12px; }
.cg-home-list .cg-h2 { margin-top: 16px; }
.cg-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin-top: 8px; }
.cg-home-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 14px; background: var(--cg-card); border: 2px solid var(--cg-line);
    text-align: center; font-size: 13px; }
.cg-home-card img { width: 84px; height: 84px; object-fit: contain; }
.cg-home-card.is-room img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.cg-home-card small { color: var(--cg-muted); font-size: 11px; }
.cg-home-card.is-locked img { filter: grayscale(1) opacity(.5); }
.cg-home-card.is-worn { border-color: var(--cg-accent); }

/* Dziewięć żyć: the picture of the next life above the button, the dialog after a new life. */
.cg-life-teaser { display: block; width: 100%; max-width: 420px; aspect-ratio: 1344 / 768; object-fit: cover; border-radius: 14px; margin: 0 auto 10px; }
/* "The cat woke up": the window after a nap (game.js wake()). */
.cg-wake { text-align: center; }
.cg-wake-cat { position: relative; width: 150px; margin: -6px auto 2px; }
.cg-wake-zzz { position: absolute; top: 8%; right: -6%; font-style: normal; font-weight: 800; color: var(--cg-muted); pointer-events: none; }
.cg-wake-zzz b { position: absolute; right: 0; opacity: 0; animation: cg-zzz 2.4s ease-out infinite; }
.cg-wake-zzz b:nth-child(1) { font-size: 14px; }
.cg-wake-zzz b:nth-child(2) { font-size: 18px; animation-delay: .8s; }
.cg-wake-zzz b:nth-child(3) { font-size: 24px; animation-delay: 1.6s; }
@keyframes cg-zzz { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -44px) rotate(12deg); } }
.cg-wake h2 { margin: 0 0 4px; font-size: 22px; }
.cg-wake-time { margin: 0 0 14px; color: var(--cg-muted); }
.cg-wake-loot { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.cg-wake-loot li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--cg-card); border: 1px solid var(--cg-line); text-align: left; animation: cg-rise .35s ease both; }
.cg-wake-loot li:nth-child(2) { animation-delay: .12s; }
.cg-wake-loot li:nth-child(3) { animation-delay: .24s; }
.cg-wake-loot li > img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.cg-wake-loot li > div { display: flex; flex-direction: column; min-width: 0; }
.cg-wake-loot b { font-size: 20px; line-height: 1.2; color: var(--cg-accent); font-variant-numeric: tabular-nums; }
.cg-wake-loot b i { font-style: normal; }
.cg-wake-loot span { font-size: 13px; color: var(--cg-muted); }
.cg-wake-loot .is-main { padding: 14px 16px; background: linear-gradient(135deg, rgba(255, 181, 71, .2), rgba(255, 122, 89, .12)); border-color: rgba(255, 181, 71, .45); }
.cg-wake-loot .is-main b { font-size: 32px; }
.cg-wake-loot .is-main > img { width: 56px; height: 56px; }
.cg-wake-note { margin: 0 0 10px; font-size: 13px; color: var(--cg-muted); }
.cg-wake-actions { display: flex; gap: 10px; margin-top: 16px; }
.cg-wake-actions .cg-button { flex: 1; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .cg-wake-zzz b, .cg-wake-loot li { animation: none; } .cg-wake-zzz b { opacity: .8; } .cg-wake-zzz b:nth-child(2) { top: -16px; right: 10px; } .cg-wake-zzz b:nth-child(3) { top: -38px; right: 22px; } }
.cg-life { text-align: center; }
.cg-life img { display: block; width: 100%; aspect-ratio: 1344 / 768; object-fit: cover; border-radius: 14px; margin-bottom: 12px; }
.cg-life h2 { margin: 0 0 8px; }
.cg-life p { color: var(--cg-muted); margin: 0 0 16px; }

/* A boss's line (speak() in game.js): a speech bubble over the enemy's side of the stage. */
.cg-speech { position: absolute; z-index: 6; top: 8%; right: 4%; max-width: min(62%, 320px); margin: 0; padding: 8px 12px; border-radius: 14px; background: #fff; color: #2a2140;
    font-weight: 700; font-size: clamp(13px, 3.4vw, 16px); line-height: 1.25; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); pointer-events: none; }
.cg-speech::after { content: ''; position: absolute; bottom: -8px; right: 28%; border: 9px solid transparent; border-top-color: #fff; border-bottom: 0; }
.cg-speech.is-in { animation: cg-speech-in .25s ease-out; }
@keyframes cg-speech-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.cg-home-card.is-gold { border-color: var(--r-legendary); }
