/* The Balatro mods on mods.aong.dev: mod cards, mod pages and the install guide, in the site's look
   (css/hub.css is loaded first and gives the panels, buttons, top bar, footer and both themes).
   Behind them runs the Balatro paint swirl (js/swirl.js) instead of the valley. The Balatro colours
   (chips, mult, gold...) map onto the site's palette. */
:root {
  --chips: var(--sky); --chips-deep: var(--sky-deep);
  --mult: var(--berry); --mult-deep: var(--berry-deep);
  --gold: var(--sun); --gold-deep: var(--sun-deep);
  --green: var(--leaf); --green-deep: var(--leaf-deep);
  --neg: #8b74cc; --neg-deep: #5a4795;
  --note: #8a5d06;
  --tag-ink: #0f1420;
}
html[data-theme="dark"] { --note: var(--sun); }

/* ---------- the swirl ---------- */
#swirl {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1;
  image-rendering: pixelated; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, #2a6b50, #0e271f);
  view-transition-name: swirl;
}
html[data-theme="light"] #swirl { background: radial-gradient(circle at 50% 40%, #5aa58d, #2a6b50); }
/* on the mods home the swirl fades in over the valley while the Balatro category is open */
.has-category #swirl { opacity: 0; transition: opacity 1.4s ease; }
.has-category.on-swirl #swirl { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .has-category #swirl { transition-duration: .01s; } }
.on-swirl body { background: #0e271f; }

/* ---------- pages ---------- */
main.balatro { max-width: 1180px; margin: 0 auto; padding: calc(var(--bar) + 8px) 20px 0; display: grid; gap: 24px; }
.page-back { justify-self: start; color: #fff; text-decoration: none; font: 600 1.05rem/1 var(--f-head); text-shadow: 0 2px 0 rgba(0,0,0,.5); padding: 6px 0; }
.page-back:hover { color: var(--sun); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; background: var(--panel-sub); box-shadow: inset 0 0 0 1px var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
[hidden] { display: none !important; }

/* buttons as they're named in the Balatro pages */
.btn-blue { --b: var(--sky); --b-deep: var(--sky-deep); }
.btn-green { --b: var(--leaf); --b-deep: var(--leaf-deep); }
.btn-red { --b: var(--berry); --b-deep: var(--berry-deep); }
.btn-orange { --b: var(--sun); --b-deep: var(--sun-deep); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { color: var(--ink); background: var(--panel-sub); }
.btn-off { background: var(--panel-sub); color: var(--ink-dim); box-shadow: inset 0 0 0 2px var(--line); cursor: default; }
.btn-off:hover { color: var(--ink-dim); transform: none; filter: none; }

/* panel look for the Balatro blocks */
.mod, .mod-hero, .sheet {
  position: relative; background: var(--panel); color: var(--ink); border-radius: var(--r);
  box-shadow: inset 0 0 0 2px var(--line), 0 10px 30px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tile { background: var(--panel-sub); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--line); }

/* tags in the Balatro colours */
.fx, .tag {
  display: inline-block; font: 600 .9rem/1 var(--f-head); padding: 5px 8px 4px; border-radius: 8px;
  white-space: nowrap; color: var(--tag-ink); background: var(--panel-sub);
}
.fx-chips, .tag-blue { background: var(--chips); }
.fx-mult, .tag-red { background: var(--mult); }
.fx-xmult { background: var(--mult); box-shadow: inset 0 0 0 2px var(--tag-ink); }
.fx-neg { background: var(--neg); color: #fff; }
.fx-gold, .tag-gold { background: var(--gold); }
.fx-green, .tag-green { background: var(--green); }
.fx-rand { background: linear-gradient(90deg, var(--chips), var(--mult), var(--gold)); }
.badge {
  font: 400 .72rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase;
  background: var(--badge, var(--panel-sub)); color: #fff; padding: 5px 8px 4px; border-radius: 999px;
}
.badge-dev { background: var(--gold); color: var(--tag-ink); }
.badge-live { background: var(--green); color: var(--tag-ink); }

/* ---------- mod cards ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.mod { display: flex; flex-direction: column; overflow: hidden; min-width: 0; transition: transform .18s ease-out; }
.mod-art {
  height: 200px; position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, rgba(53, 189, 134, .45), transparent 70%), #1d4a39;
  box-shadow: inset 0 -2px 0 var(--line);
}
.mini {
  width: 100px; height: 134px; margin: 0 -13px -12px;
  transform: rotate(calc(var(--r) * 6deg)) translateY(calc(var(--o) * 6px));
  transition: transform .15s; filter: drop-shadow(0 5px 0 rgba(0,0,0,.4));
}
.mini:hover { transform: translateY(-14px) scale(1.04); z-index: 1; }
.deck-sprite { width: 100%; height: 100%; image-rendering: pixelated; background-repeat: no-repeat; }
.mod-body { padding: 20px 22px 22px; display: grid; gap: 14px; align-content: start; flex: 1; }
.mod-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-title h3 { font-size: 1.8rem; }
.mod-title h3 a { color: inherit; text-decoration: none; }
.mod-title h3 a:hover { color: var(--sky-deep); }
html[data-theme="dark"] .mod-title h3 a:hover { color: var(--sun); }
.mod-summary { color: var(--ink-dim); max-width: 60ch; }
.deck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.deck-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--panel-sub); border-radius: 10px; padding: 6px 8px 6px 8px; font-size: .98rem;
}
.deck-list li.has-thumb { grid-template-columns: 26px minmax(0, 1fr) auto; }
.deck-list li:not(.has-thumb) { padding: 9px 8px 9px 12px; }
.row-thumb { width: 26px; height: 35px; display: block; }
.row-name { font-weight: 600; }
.mod-note, .sheet-note { color: var(--note); font-size: .98rem; }
.meta { margin: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.meta div { display: grid; gap: 4px; }
.meta dt { font: 400 .7rem/1 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.meta dd { margin: 0; }
.mod-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.credit { font-size: .88rem; color: var(--ink-dim); }

.art-anim { align-items: center; }
.anim-icon {
  width: 128px; height: 128px; background-size: calc(var(--frames) * 128px) 128px; background-repeat: no-repeat;
  image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
  animation: strip var(--dur) steps(var(--frames)) infinite, bob 3.2s ease-in-out infinite;
}
@keyframes strip { to { background-position-x: calc(var(--frames) * -128px); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.art-sky { align-items: center; background: linear-gradient(180deg, #2a2357 0%, #4a3a78 55%, #c0605a 100%); }
.sky-icon { position: relative; width: 128px; height: 128px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); animation: bob 3.6s ease-in-out infinite; }
.sky-icon-lg { width: 192px; height: 192px; }

.mod-soon {
  grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 28px; padding: 22px 28px;
  background: transparent; box-shadow: inset 0 0 0 2px var(--line); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
html[data-theme="light"] .mod-soon { background: rgba(250, 247, 239, .55); }
html[data-theme="dark"] .mod-soon { background: rgba(13, 18, 32, .45); }
.soon-backs { display: flex; flex: none; }
.soon-backs span {
  width: 60px; height: 80px; margin-right: -20px; display: grid; place-items: center;
  background: var(--neg); border-radius: 8px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.18), 0 4px 0 rgba(0,0,0,.3);
  font: 600 2rem/1 var(--f-head); color: var(--sun);
}
.soon-backs span:nth-child(1) { transform: rotate(-10deg); }
.soon-backs span:nth-child(3) { transform: rotate(10deg); }
.soon-copy { min-width: 0; padding-left: 16px; display: grid; gap: 6px; }
.soon-copy h3 { font-size: 1.6rem; }
.soon-copy p { color: var(--ink-dim); max-width: 60ch; }

/* ---------- mod pages ---------- */
.mod-page { gap: 24px; }
.mod-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); overflow: hidden; }
.mod-hero-art {
  display: flex; align-items: flex-end; justify-content: center; min-height: 300px; overflow: hidden; padding-inline: 16px;
  background: radial-gradient(ellipse at 50% 120%, rgba(53, 189, 134, .45), transparent 70%), #1d4a39;
}
.mod-hero-art.art-anim, .mod-hero-art.art-sky { align-items: center; }
.mod-hero-art.art-sky { background: linear-gradient(180deg, #2a2357 0%, #4a3a78 55%, #c0605a 100%); }
.mod-hero-art .mini { width: 120px; height: 160px; margin: 0 -18px -14px; }
.anim-icon-lg { width: 192px; height: 192px; background-size: calc(var(--frames) * 192px) 192px; animation-name: strip-lg, bob; }
@keyframes strip-lg { to { background-position-x: calc(var(--frames) * -192px); } }
.mod-hero-info { padding: 28px; display: grid; gap: 16px; align-content: center; min-width: 0; }
.mod-hero-info h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.mod-hero-lede { color: var(--ink-dim); font-size: 1.12rem; max-width: 58ch; }

.sheet { padding: 24px 26px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.sheet > p { max-width: 66ch; }
.sheet h2 { font-size: 1.7rem; }
.sheet a:not(.btn) { color: var(--ink); }
.sheet-quiet { background: var(--panel); }
.sheet-small { font-size: .95rem; color: var(--ink-dim); line-height: 1.9; }
.sheet-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.count { font: 400 .78rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

.deck-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.deck-card { background: var(--panel-sub); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; justify-items: start; transition: transform .18s ease-out; }
.deck-big { width: 100%; max-width: 142px; aspect-ratio: 142 / 190; justify-self: center; filter: drop-shadow(0 5px 0 rgba(0,0,0,.35)); }
.deck-card h3 { font-size: 1.2rem; margin-top: 4px; }
.deck-card p { font-size: .95rem; color: var(--ink-dim); }

.settings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings li { display: flex; align-items: center; gap: 12px; background: var(--panel-sub); border-radius: 10px; padding: 8px 12px; }
.switch { flex: none; width: 52px; text-align: center; font: 400 .72rem/1 var(--f-label); text-transform: uppercase; padding: 6px 0 5px; border-radius: 999px; background: var(--line); color: var(--ink-dim); }
.switch-on { background: var(--green); color: var(--tag-ink); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; min-height: 34px; padding-top: 5px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--chips); color: var(--tag-ink); border-radius: 10px; box-shadow: inset 0 -3px 0 var(--chips-deep); font: 600 1.1rem/1 var(--f-head);
}
.path { display: block; font-size: .95rem; color: var(--ink-dim); margin-top: 4px; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.langs span { background: var(--panel-sub); border-radius: 8px; padding: 4px 8px; font-size: .9rem; }

.feat-grid { columns: 2; column-gap: 16px; }
.feat-grid > .feat-group { break-inside: avoid; margin-bottom: 16px; }
.feat-group { background: var(--panel-sub); border-radius: 12px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.feat-group h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feat-group h3 .fx { font-size: 1.05rem; }
.feat-count { font: 400 .75rem/1 var(--f-label); color: var(--ink-dim); }
.feat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feat-list li { display: grid; gap: 2px; border-top: 2px solid var(--line); padding-top: 10px; }
.feat-list li:first-child { border-top: 0; padding-top: 0; }
.feat-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feat-list p { font-size: .95rem; color: var(--ink-dim); }
.lobby { font: 400 .62rem/1 var(--f-label); letter-spacing: .05em; text-transform: uppercase; background: var(--mult-deep); color: #fff; padding: 4px 6px 3px; border-radius: 6px; }

.compat { margin: 0; display: grid; gap: 8px; }
.compat div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; background: var(--panel-sub); border-radius: 10px; padding: 10px 12px; }
.compat dt { font: 600 1.05rem/1.2 var(--f-head); color: var(--note); }
.compat dd { margin: 0; font-size: .95rem; color: var(--ink-dim); }
.compat-wide div { grid-template-columns: 210px minmax(0, 1fr); }

.bb-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bb-card { grid-column: span 2; background: var(--panel-sub); border-radius: 12px; padding: 16px; display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; }
.bb-card:nth-child(n+4) { grid-column: span 3; }
.bb-card h3 { font-size: 1.3rem; }
.bb-card p { font-size: .95rem; color: var(--ink-dim); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row span { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 3px 8px; font-size: .85rem; }

/* Better Background preview: the stage is a little Balatro screen, so it keeps Balatro's own colours */
.bb-try { gap: 16px; }
.bb-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1a2326; box-shadow: inset 0 0 0 2px var(--line); }
.bb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bb-swirl { image-rendering: pixelated; }
#bb-swirl.fallback { background: radial-gradient(circle at 40% 40%, #fe5f55, #009dff 60%, #1a2326); }
.bb-opener { position: absolute; left: 50%; bottom: 14%; translate: -50% 0; transition: opacity .25s, transform .08s; }
.bb-opener.is-hidden { opacity: 0; pointer-events: none; }
.bb-window {
  position: absolute; left: 50%; top: 50%; width: min(56%, 380px); translate: -50% -50%;
  background: #3a4a4f; color: #fff; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 6px 0 #1a2326;
  padding: 14px; display: grid; gap: 8px; text-align: center;
  visibility: hidden; transform: translateY(150%);
  transition: transform .4s cubic-bezier(.3, 0, .8, .4), visibility 0s linear .4s;
}
.bb-window.is-open { visibility: visible; transform: none; transition: transform .45s cubic-bezier(.2, .9, .3, 1.12), visibility 0s; }
.fade-mode .bb-window { transform: none; opacity: 0; transition: opacity .25s linear, visibility 0s linear .25s; }
.fade-mode .bb-window.is-open { opacity: 1; transition: opacity .25s linear, visibility 0s; }
.bb-window-title { font: 600 clamp(1.1rem, 2.6vw, 1.6rem)/1 var(--f-head); }
.bb-window-text { font-size: clamp(.75rem, 1.8vw, .95rem); color: #c3d0d2; }
.bb-window-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.bb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bb-next { font: 400 .75rem/1 var(--f-label); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-dim); }
.bb-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bb-group { background: var(--panel-sub); border-radius: 12px; padding: 14px; display: grid; gap: 8px; min-width: 0; }
.bb-group h3 { margin-bottom: 2px; }
.bb-group h3 .fx { font-size: 1.05rem; }
.bb-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--panel); color: var(--ink); border: 0; border-radius: 10px; box-shadow: inset 0 0 0 2px var(--line);
  padding: 7px 10px; font: 600 .95rem/1.2 var(--f-body); text-align: left; cursor: pointer;
}
.bb-toggle:hover { background: var(--panel-solid); }
.bb-toggle .box { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--panel-sub); box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; }
.bb-toggle[aria-pressed="true"] .box { background: var(--green); box-shadow: inset 0 -2px 0 var(--green-deep); }
.bb-toggle[aria-pressed="true"] .box::after { content: ""; width: 10px; height: 5px; border: solid var(--tag-ink); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.bb-cycle { display: grid; gap: 4px; }
.bb-label { font: 400 .7rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.cyc { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: stretch; gap: 6px; }
.cyc button { border: 0; border-radius: 10px; background: var(--mult); color: var(--tag-ink); cursor: pointer; font: 600 1.3rem/1 var(--f-head); box-shadow: inset 0 -3px 0 var(--mult-deep); padding: 0 0 2px; }
.cyc button:active { transform: translateY(2px); }
.cyc output { display: grid; place-items: center; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); border-radius: 10px; font: 600 1rem/1 var(--f-head); padding: 7px 4px 6px; text-align: center; }
.is-idle { opacity: .6; }
.bb-sub { text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
.bb-hint { margin-top: 2px; font-size: .85rem; color: var(--ink-dim); }
.bb-noscript { position: absolute; inset: auto 16px 16px; margin: 0; background: var(--panel); padding: 10px 12px; border-radius: 10px; }

/* FAQ and guide */
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.faq-item { background: var(--panel-sub); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.faq-item h3 { font-size: 1.15rem; line-height: 1.2; color: var(--note); }
.faq-item p { font-size: .95rem; color: var(--ink-dim); }
.guide-head { justify-items: start; }
.guide-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.step-no {
  display: inline-grid; place-items: center; width: 38px; height: 38px; margin-right: 8px; vertical-align: 3px;
  background: var(--chips); color: var(--tag-ink); border-radius: 10px; box-shadow: inset 0 -3px 0 var(--chips-deep); font-size: 1.3rem;
}
.guide-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .95rem; }
.guide-table caption { text-align: left; font: 400 .78rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); padding-bottom: 4px; }
.guide-table th, .guide-table td { text-align: left; padding: 10px 12px; background: var(--panel-sub); vertical-align: middle; }
.guide-table thead th { background: none; padding-block: 0; font: 600 1rem/1 var(--f-head); color: var(--note); }
.guide-table tbody th { font: 600 1.05rem/1.2 var(--f-head); border-radius: 10px 0 0 10px; }
.guide-table tbody td:last-child { border-radius: 0 10px 10px 0; color: var(--ink-dim); }
.guide-table .badge { font-size: .66rem; vertical-align: 2px; margin-left: 4px; }
.collection-foot { color: var(--ink-dim); }
.collection-foot a { color: var(--ink); }
.notfound h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }

/* ---------- the Balatro category on the mods home ---------- */
.category { position: relative; z-index: 1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s cubic-bezier(.3, .7, .2, 1), margin .7s; margin-top: 0; }
.category > .category-inner { min-height: 0; overflow: hidden; display: grid; gap: 22px; opacity: 0; transform: translateY(-16px); transition: opacity .5s ease, transform .7s ease; }
.category.is-open { grid-template-rows: 1fr; margin-top: 28px; }
.category.is-open > .category-inner { opacity: 1; transform: none; transition-delay: .12s; overflow: visible; padding-bottom: 4px; }
.category-box {
  display: grid; gap: 22px; padding: 22px;
  border-radius: calc(var(--r) + 6px);
  background: rgba(250, 247, 239, .14); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22), 0 14px 40px rgba(0, 0, 0, .16);
  -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
}
html[data-theme="dark"] .category-box { background: rgba(13, 18, 32, .22); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 14px 40px rgba(0, 0, 0, .25); }
.category-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 4px 4px 0; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.category-head > div { display: grid; gap: 8px; }
.category-head h3 { font-size: 1.8rem; }
.category-head p { color: rgba(255, 255, 255, .88); max-width: 62ch; }
.category-head a { color: #fff; }
.category-head .count { color: rgba(255, 255, 255, .8); }
.category-head .actions { flex: none; }
.toggle-cat[aria-expanded="true"] .when-closed, .toggle-cat[aria-expanded="false"] .when-open { display: none; }
.toggle-cat .caret { display: inline-block; transition: transform .3s; }
.toggle-cat[aria-expanded="true"] .caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .category, .category > .category-inner, .toggle-cat .caret { transition: none; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-soon { flex-direction: column; justify-content: center; text-align: center; }
  .soon-copy { padding-left: 0; }
  .soon-copy p { margin-inline: auto; }
}
@media (max-width: 980px) {
  .deck-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-card, .bb-card:nth-child(n+4) { grid-column: auto; }
  .bb-card:last-child { grid-column: 1 / -1; }
  .bb-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-controls .bb-group:last-child { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .mod-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-hero { grid-template-columns: minmax(0, 1fr); }
  .mod-hero-art { min-height: 220px; }
  .sheet-row { grid-template-columns: minmax(0, 1fr); }
  .feat-grid { columns: 1; }
}
@media (max-width: 760px) { .faq-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .bb-controls { grid-template-columns: minmax(0, 1fr); }
  .bb-opener { font-size: .9rem; bottom: 10%; }
  .bb-window { width: 78%; padding: 8px; gap: 4px; }
  .bb-window .btn-sm { font-size: .85rem; }
}
@media (max-width: 560px) {
  main.balatro { padding-left: 16px; padding-right: 16px; }
  .deck-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini { width: 72px; height: 96px; margin: 0 -10px -10px; }
  .mod-art { height: 150px; }
  .mod-hero-art .mini { width: 72px; height: 96px; margin: 0 -10px -10px; }
  .anim-icon { width: 96px; height: 96px; background-size: calc(var(--frames) * 96px) 96px; animation-name: strip-sm, bob; }
  .anim-icon-lg { width: 128px; height: 128px; background-size: calc(var(--frames) * 128px) 128px; animation-name: strip, bob; }
  .sky-icon-lg { width: 128px; height: 128px; }
  .compat div, .compat-wide div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bb-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet, .mod-hero-info { padding: 20px 18px; }
  .category-box { padding: 14px; gap: 16px; }
  .deck-list li, .deck-list li.has-thumb { grid-template-columns: minmax(0, 1fr) auto; }
  .row-thumb { display: none; }
  .guide-table thead { display: none; }
  .guide-table tr { display: grid; margin-bottom: 8px; background: var(--panel-sub); border-radius: 10px; }
  .guide-table th, .guide-table td { border-radius: 0 !important; padding: 6px 12px; background: none; }
  .guide-table tbody td:nth-child(2)::before { content: "Lovely: "; color: var(--ink-dim); }
  .guide-table tbody td:nth-child(3)::before { content: "Steamodded: "; color: var(--ink-dim); }
}
@keyframes strip-sm { to { background-position-x: calc(var(--frames) * -96px); } }
@media (prefers-reduced-motion: reduce) {
  .anim-icon, .sky-icon { animation: none; }
  .mod, .mini, .deck-card { transition: none; }
}
