/* MinecraftArmor.com — sky, grass, dirt. Vanilla textures are declared in textures.css. */
:root {
  --sky-top: #4fa6ff;
  --sky-mid: #8fcbff;
  --sky-low: #cdeaff;
  --grass: #5fb33a;
  --grass-dark: #3f8a26;
  --grass-deep: #2c6a19;
  --grass-light: #86d14f;
  --dirt: #866043;
  --dirt-dark: #5c3f2a;
  --panel: #fff9ec;
  --panel-2: #f6ecd3;
  --panel-3: #ecdfbd;
  --ink: #2a2117;
  --ink-2: #4a3c2c;
  --line: #2a2117;
  --gold: #f6c33b;
  --diamond: #2fc6c0;
  --danger: #c8372b;
  /* aliases used in generated markup */
  --text: var(--ink);
  --text-dim: #5d4d3a;
  --text-faint: #8a7760;
  --ember: var(--grass-dark);
  --ember-hot: var(--grass-deep);
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --title: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --ui: 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #3a2a1c; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sky-top);
  min-height: 100vh;
  overflow-x: hidden;
}
img, canvas { image-rendering: pixelated; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--grass-deep); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: #154a08; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-family: var(--title); font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1320px, 100% - 32px); margin-inline: auto; }

/* ---------- world layers ---------- */
.sky {
  position: relative;
  background: linear-gradient(var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
  padding-bottom: 56px;
  overflow: hidden;
  isolation: isolate;
}
.sky-short { height: 180px; padding: 0; }
.sky > *:not(.clouds) { position: relative; z-index: 1; }
.clouds { position: absolute; inset: 0 0 30% 0; z-index: 0; pointer-events: none; contain: strict; }
.cloud {
  position: absolute; left: 0; height: auto; opacity: 0.95;
  animation: drift linear infinite;
  will-change: transform;
}
@keyframes drift { from { transform: translateX(-40vw); } to { transform: translateX(140vw); } }

.ground {
  position: relative;
  background: var(--tex-dirt, var(--dirt)) 0 0 / 128px 128px;
  padding-bottom: 32px;
}
.grass-edge {
  height: 64px;
  background: var(--tex-grass, var(--grass)) 0 0 / 128px 64px repeat-x;
}

/* ---------- panels ---------- */
.bevel {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: inset 3px 3px 0 #ffffff, inset -4px -4px 0 var(--panel-3), 0 6px 0 rgba(42, 33, 23, 0.35);
}
.well {
  background: var(--panel-2);
  box-shadow: inset 3px 3px 0 rgba(42, 33, 23, 0.18), inset -3px -3px 0 #fffdf6;
}

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: #fffcf4; border-bottom: 3px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { color: var(--grass-dark); font-weight: 700; }
.brand small { font-size: 0.8rem; color: var(--text-faint); margin-left: 1px; }
.site-nav { display: flex; gap: 6px; margin-left: auto; }
.site-nav a { white-space: nowrap; font-family: var(--ui); font-weight: 700; text-decoration: none; color: var(--ink-2); padding: 8px 12px; font-size: 1.02rem; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: #fff; background: var(--grass-dark); box-shadow: inset 0 -3px 0 var(--grass-deep); }
@media (max-width: 640px) {
  .site-nav a:not(.keep) { display: none; }
  .site-header .wrap { gap: 10px; }
  .brand { font-size: 1.1rem; }
  .brand small { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; min-height: 44px; border: 3px solid var(--line); cursor: pointer; text-decoration: none;
  font-family: var(--ui); font-weight: 700; font-size: 1rem; color: var(--ink);
  background: #e3e3e3;
  box-shadow: inset 3px 3px 0 #ffffff, inset -3px -4px 0 #9d9d9d;
}
.btn:hover { background: #f1f1f1; color: var(--ink); }
.btn:active { box-shadow: inset 3px 3px 0 #9d9d9d, inset -3px -3px 0 #fff; }
.btn.primary { background: var(--grass); color: #fff; text-shadow: 2px 2px 0 var(--grass-deep); box-shadow: inset 3px 3px 0 var(--grass-light), inset -3px -4px 0 var(--grass-deep); }
.btn.primary:hover { background: #6cc244; color: #fff; }
.btn svg { width: 20px; height: 20px; }
.icon-btn { width: 46px; height: 46px; padding: 0; }
.icon-btn[aria-pressed='true'] { background: var(--grass); color: #fff; box-shadow: inset 3px 3px 0 var(--grass-light), inset -3px -4px 0 var(--grass-deep); }

/* ---------- hero ---------- */
.hero { padding: 44px 0 28px; }
.hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.hero h1 { color: #fff; text-shadow: 0 3px 0 rgba(20, 60, 110, 0.55), 0 8px 24px rgba(20, 60, 110, 0.25); max-width: 900px; }
.hero p { color: #11335a; max-width: 640px; font-size: 1.12rem; margin: 0; font-weight: 700; }
.eyebrow { font-family: var(--ui); font-weight: 700; color: #0f3d6e; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.85rem; margin-bottom: 10px; display: inline-block; background: rgba(255, 255, 255, 0.6); padding: 2px 8px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { padding: 8px 14px; font-family: var(--ui); font-weight: 700; font-size: 1rem; color: var(--text-dim); }
.stat strong { color: var(--grass-dark); font-size: 1.3rem; margin-right: 6px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

/* ---------- workshop ---------- */
.workshop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(500px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1040px) { .workshop { grid-template-columns: minmax(0, 1fr); } }

.loadouts { grid-column: 1 / -1; min-width: 0; padding: 20px; }
.loadouts h2 { font-size: 1.1rem; margin-bottom: 10px; }
.loadout-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.loadout {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 8px; cursor: pointer; border: 3px solid transparent; text-align: left; background: var(--panel-2); min-width: 0;
  box-shadow: inset 3px 3px 0 rgba(42, 33, 23, 0.15);
}
.loadout canvas, .loadout img { width: 44px; height: 88px; }
.loadout .name { font-family: var(--ui); font-weight: 700; font-size: 1rem; line-height: 1.2; word-break: break-word; }
.loadout .meta { font-size: 0.86rem; color: var(--text-faint); }
.loadout:hover { background: #fff3d6; }
.loadout.active { background: #e4f6d2; border-color: var(--grass-dark); }
.loadout-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.loadout-actions .btn { flex: 0 1 auto; min-width: 88px; min-height: 44px; padding: 8px 16px; font-size: 0.9rem; white-space: nowrap; }

.stage { position: relative; padding: 0; min-width: 0; }
.stage-canvas { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 76vh; min-height: 420px; overflow: hidden; background: var(--stage-bg, linear-gradient(#5fb0ff 0%, #a9dcff 70%, #d8f0ff 100%)); border-bottom: 3px solid var(--line); }
.stage-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; image-rendering: auto; }
.stage-canvas canvas:active { cursor: grabbing; }
.stage-label { position: absolute; left: 14px; top: 12px; font-family: var(--ui); font-weight: 700; font-size: 1.15rem; pointer-events: none; color: #fff; text-shadow: 2px 2px 0 #1f4f86; }
.stage-label small { display: block; font-size: 0.9rem; }
.stage-hint { position: absolute; right: 12px; top: 12px; font-size: 0.86rem; font-weight: 700; color: #11335a; background: rgba(255, 255, 255, 0.65); padding: 2px 8px; pointer-events: none; }
.stage-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; justify-content: space-between; }
.stage-tools .group { display: flex; gap: 10px; flex-wrap: wrap; }
.dropping .stage-canvas::after { content: 'Drop your skin PNG'; position: absolute; inset: 12px; display: grid; place-items: center; font-family: var(--ui); font-weight: 700; font-size: 1.4rem; color: #fff; border: 4px dashed #fff; background: rgba(63, 138, 38, 0.6); }

.bench { min-width: 0; container-type: inline-size; container-name: bench; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 3px solid var(--line); }
.tabs button { border: 0; background: var(--panel-3); padding: 12px 8px; cursor: pointer; font-family: var(--ui); font-weight: 700; font-size: 1.05rem; color: var(--text-dim); box-shadow: inset -3px 0 0 var(--line); }
.tabs button:last-child { box-shadow: none; }
.tabs button[aria-selected='true'] { background: var(--panel); color: var(--ink); box-shadow: inset 0 4px 0 var(--grass), inset -3px 0 0 var(--line); }
.tab-panel { padding: 16px; }
.tab-panel[hidden] { display: none; }

.bench-head { display: grid; grid-template-columns: minmax(124px, 1fr) repeat(4, 52px) 44px; gap: 8px; font-size: 0.7rem; font-weight: 700; text-align: center; color: var(--text-dim); }
.bench-head span:first-child { text-align: left; }
.slot-row { display: grid; grid-template-columns: minmax(124px, 1fr) repeat(4, 52px) 44px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 2px dashed rgba(42, 33, 23, 0.15); }
.slot-row.all { border-bottom: 3px solid var(--line); padding-bottom: 14px; margin-bottom: 4px; }
.slot-name { min-width: 0; overflow-wrap: anywhere; font-family: var(--ui); font-weight: 700; font-size: 1rem; line-height: 1.15; }
.slot-name small { display: block; font-size: 0.82rem; color: var(--text-faint); font-family: var(--body); font-weight: 400; }
.cell {
  position: relative; width: 52px; height: 52px; padding: 0; border: 0; cursor: pointer; display: grid; place-items: center;
  background: #8b8b8b;
  box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #ffffff;
}
.cell img { width: 40px; height: 40px; }
.cell:hover { background: #a3a3a3; }
.cell.open { background: #9fd77a; box-shadow: inset 0 0 0 3px var(--grass-deep); }
.cell:disabled { opacity: 0.35; cursor: not-allowed; }
.cell .empty { font-family: var(--ui); font-weight: 700; font-size: 0.8rem; color: #f0f0f0; text-shadow: 1px 1px 0 #333; }
.cell .swatch { width: 28px; height: 28px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), inset 3px 3px 0 rgba(255, 255, 255, 0.35); }
.glint-toggle { justify-self: end; }
.glint-toggle[aria-pressed='true'] { background: #a45cf0; color: #fff; box-shadow: inset 3px 3px 0 #d2a6ff, inset -3px -4px 0 #5e2c99; }

.picker { grid-column: 1 / -1; padding: 12px; margin-top: 4px; }
.picker h4 { font-family: var(--ui); font-size: 1rem; margin-bottom: 8px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; border: 0; cursor: pointer; background: transparent; }
.opt img { width: 36px; height: 36px; }
.opt span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.15; text-align: center; }
.opt:hover { background: #fff; }
.opt[aria-checked='true'] { background: #e4f6d2; box-shadow: inset 0 0 0 3px var(--grass-dark); }
.opt[aria-checked='true'] span { color: var(--grass-deep); font-weight: 700; }
.opt .none { width: 32px; height: 32px; display: grid; place-items: center; font-family: var(--ui); color: var(--text-faint); box-shadow: inset 0 0 0 2px var(--panel-3); }
.dye-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.dye-grid button { aspect-ratio: 1; border: 2px solid var(--line); cursor: pointer; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), inset 3px 3px 0 rgba(255, 255, 255, 0.3); }
.dye-grid button[aria-checked='true'] { outline: 3px solid var(--gold); outline-offset: 1px; }
.custom-color { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.9rem; color: var(--text-dim); flex-wrap: wrap; }
input[type='color'] { width: 44px; height: 34px; padding: 0; border: 3px solid var(--line); background: none; cursor: pointer; }

@container bench (max-width: 480px) {
  .slot-row, .bench-head { grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; gap: 6px; }
  .bench-head span:first-child { display: none; }
  .cell { width: 100%; max-width: 52px; }
  .cell img { max-width: calc(100% - 8px); height: auto; }
  .slot-name { grid-column: 1 / -1; }
}

.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-bottom: 16px; }
.skin-opt { border: 3px solid transparent; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel-2); }
.skin-opt img { width: 40px; height: 40px; border: 2px solid var(--line); }
.skin-opt span { font-size: 0.82rem; color: var(--ink-2); text-align: center; line-height: 1.15; }
.skin-opt:hover { background: #fff3d6; }
.skin-opt[aria-checked='true'] { border-color: var(--grass-dark); background: #e4f6d2; }
.dropzone { display: grid; gap: 6px; place-items: center; text-align: center; padding: 20px 12px; border: 3px dashed #8a7760; cursor: pointer; color: var(--text-dim); margin-bottom: 14px; background: #fffdf7; }
.dropzone:hover, .dropzone.over { border-color: var(--grass-dark); color: var(--ink); background: #eef9e4; }
.dropzone svg { color: var(--grass-dark); }
.dropzone strong { font-family: var(--ui); font-size: 1.15rem; color: var(--ink); }
.dropzone small { color: var(--text-faint); }
.field-row { display: flex; gap: 8px; margin-bottom: 14px; }
.field-row input[type='text'] { flex: 1; min-width: 0; padding: 10px 12px; border: 3px solid var(--line); background: #fff; }
.seg { display: inline-grid; grid-auto-flow: column; border: 3px solid var(--line); }
.seg button { border: 0; padding: 8px 14px; cursor: pointer; background: #fff; color: var(--text-dim); font-family: var(--ui); font-weight: 700; }
.seg button + button { border-left: 3px solid var(--line); }
.seg button[aria-pressed='true'] { background: var(--grass); color: #fff; }
.opt-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px dashed rgba(42, 33, 23, 0.15); }
.opt-line > span { color: var(--ink-2); font-weight: 700; }
.switch { position: relative; width: 56px; height: 30px; border: 3px solid var(--line); cursor: pointer; background: #b9b9b9; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; box-shadow: inset -2px -2px 0 #9d9d9d; transition: left 0.12s steps(3); }
.switch[aria-checked='true'] { background: var(--grass); }
.switch[aria-checked='true']::after { left: 29px; }
.bg-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.bg-swatches button { width: 36px; height: 36px; border: 3px solid var(--line); cursor: pointer; }
.bg-swatches button[aria-checked='true'] { outline: 3px solid var(--gold); outline-offset: 1px; }
.note { font-size: 0.92rem; color: var(--text-dim); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%); padding: 12px 18px; font-family: var(--ui); font-weight: 700; z-index: 100; transition: transform 0.2s steps(4); max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: #ffe1dc; color: #7a1a10; }

/* ---------- sections on dirt ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; padding: 22px 24px; }
.section-head h2 { margin-bottom: 6px; }
.section-head p { color: var(--text-dim); max-width: 620px; margin: 0; }
.section-head .eyebrow { background: #e4f6d2; color: var(--grass-deep); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 3px solid var(--line); padding: 6px 12px; cursor: pointer; font-family: var(--ui); font-weight: 700; font-size: 0.95rem; background: #fff; color: var(--ink-2); }
.chip:hover { background: #fff3d6; }
.chip[aria-pressed='true'] { background: var(--grass); color: #fff; }

.trim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.trim-card { padding: 16px; display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-content: start; }
.trim-card .art { width: 72px; height: 136px; display: grid; place-items: center; background: linear-gradient(#7cc0ff, #d8f0ff 75%, #6cc244 75%); border: 3px solid var(--line); box-shadow: none; }
.trim-card .art canvas { width: 56px; height: 112px; }
.trim-card h3 { margin: 0 0 4px; font-size: 1.35rem; }
.trim-card h3 a { color: var(--ink); text-decoration: none; }
.trim-card h3 a:hover { color: var(--grass-dark); }
.trim-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.95rem; }
.trim-card dt { color: var(--text-faint); }
.trim-card dd { margin: 0; color: var(--ink-2); }
.trim-card .calc { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--text-dim); flex-wrap: wrap; padding: 8px 10px; }
.trim-card .calc input { width: 64px; padding: 4px 6px; font-size: 1rem; border: 2px solid var(--line); background: #fff; }
.trim-card .calc output { font-family: var(--ui); font-weight: 700; color: var(--grass-deep); margin-left: auto; font-size: 1.15rem; }
.trim-card .actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.trim-card .actions .btn { flex: 1; min-height: 40px; font-size: 0.92rem; padding: 6px 10px; }
.trim-card .actions .btn:first-child { background: var(--grass); color: #fff; text-shadow: 2px 2px 0 var(--grass-deep); box-shadow: inset 3px 3px 0 var(--grass-light), inset -3px -4px 0 var(--grass-deep); }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; font-family: var(--ui); padding: 1px 6px; margin-left: 6px; vertical-align: middle; border: 2px solid var(--line); }
.tag.nether { background: #a8321f; color: #fff; }
.tag.end { background: #e9e3a6; color: #4a3f6b; }

.guide { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; }
@media (max-width: 960px) { .guide { grid-template-columns: 1fr; } }
.prose { padding: 28px; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child, .prose h1:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 24px; counter-reset: s; padding: 0 !important; }
.steps li { list-style: none; padding: 14px; counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--ui); font-weight: 700; font-size: 1.6rem; color: var(--grass-dark); display: block; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.mat-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.mat-table th, .mat-table td { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--panel-3); }
.mat-table th { font-family: var(--ui); color: var(--text-dim); font-weight: 700; }
.mat-table img { width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; }
.sw3 { display: inline-flex; vertical-align: middle; border: 2px solid var(--line); }
.sw3 i { width: 14px; height: 14px; display: block; }
.aside-card { padding: 22px; margin-bottom: 20px; }
.aside-card h3 { color: var(--grass-deep); }

.faq h2 { color: #fff; text-shadow: 3px 3px 0 var(--line); }
.faq.block h2 { color: var(--ink); text-shadow: none; }
.faq details { padding: 14px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-family: var(--ui); font-weight: 700; font-size: 1.06rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--grass-dark); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

/* ---------- trim pages ---------- */
.crumbs { font-size: 0.95rem; padding: 18px 0 0; color: #11335a; font-weight: 700; }
.crumbs a { color: #0f3d6e; }
.crumbs span { margin: 0 6px; }
.trim-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 28px; padding: 18px 0 8px; align-items: start; }
@media (max-width: 900px) { .trim-hero { grid-template-columns: 1fr; } }
.trim-hero > div:first-child { padding: 24px; background: rgba(255, 252, 244, 0.94); border: 3px solid var(--line); box-shadow: 0 6px 0 rgba(31, 79, 134, 0.35); }
.trim-hero .eyebrow { background: #e4f6d2; color: var(--grass-deep); }
.trim-hero h1 { color: var(--ink); text-shadow: none; margin: 0; }
.trim-hero .lead { font-size: 1.15rem; margin-top: 14px; }
.trim-title { display: flex; align-items: center; gap: 16px; }
.trim-title img { width: 64px; height: 64px; flex: none; border: 3px solid var(--line); background: #8b8b8b; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0; }
.fact { padding: 12px 14px; }
.fact dt { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.fact dd { margin: 2px 0 0; font-family: var(--ui); font-weight: 700; font-size: 1.15rem; }
.viewer-card { padding: 0; position: sticky; top: 84px; }
.viewer-card .stage-canvas { aspect-ratio: 4 / 5; min-height: 360px; }
.viewer-controls { padding: 14px; display: grid; gap: 10px; }
.viewer-controls .label { font-size: 0.85rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.mini-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-swatches button { border: 0; padding: 4px; cursor: pointer; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.mini-swatches button img { width: 26px; height: 26px; display: block; }
.mini-swatches button[aria-checked='true'] { background: #9fd77a; box-shadow: inset 0 0 0 3px var(--grass-deep); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding: 32px 0 24px; }
@media (max-width: 960px) { .content-grid { grid-template-columns: 1fr; } }
.block { padding: 26px; margin-bottom: 24px; }
.block h2 { font-size: 1.6rem; }
.calc-big { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px; margin: 14px 0; }
.calc-big label { color: var(--ink-2); font-weight: 700; }
.calc-big input { width: 90px; padding: 8px 10px; border: 3px solid var(--line); font-family: var(--mono); background: #fff; }
.calc-big output { font-family: var(--ui); font-weight: 700; font-size: 2.2rem; color: var(--grass-dark); margin-left: auto; }
.chance-bars { display: grid; gap: 6px; margin-top: 10px; }
.chance-bar { display: grid; grid-template-columns: 96px 1fr 70px; gap: 10px; align-items: center; font-size: 0.95rem; color: var(--text-dim); }
.chance-bar .track { height: 16px; background: #8b8b8b; border: 2px solid var(--line); }
.chance-bar .fill { height: 100%; background: repeating-linear-gradient(90deg, var(--grass) 0 6px, var(--grass-light) 6px 8px); }
.chance-bar b { font-family: var(--ui); font-weight: 700; color: var(--ink); text-align: right; }

.recipe { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 16px 0; }
.craft-grid { display: grid; grid-template-columns: repeat(3, 56px); gap: 4px; padding: 10px; background: #c6c6c6; border: 3px solid var(--line); box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555; }
.craft-grid .cell { width: 56px; height: 56px; cursor: default; }
.craft-grid .cell:hover { background: #8b8b8b; }
.recipe .arrow { font-family: var(--ui); font-size: 2.2rem; color: var(--ink-2); }
.recipe .result .count { position: absolute; right: 4px; bottom: 0; font-family: var(--ui); font-weight: 700; font-size: 1.2rem; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.smith-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px; background: #c6c6c6; border: 3px solid var(--line); box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555; }
.smith-row .plus { font-family: var(--ui); font-weight: 700; font-size: 1.3rem; color: #3f3f3f; padding: 0 4px; }

.combo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.combo { padding: 14px; text-align: center; border: 3px solid transparent; cursor: pointer; color: var(--ink); }
.combo [data-doll] { display: block; width: 80px; margin: 0 auto 8px; background: linear-gradient(#7cc0ff, #d8f0ff 75%, #6cc244 75%); border: 3px solid var(--line); padding: 6px 0; }
.combo canvas { width: 56px; height: 112px; display: block; margin: 0 auto; }
.combo strong { display: block; font-family: var(--ui); font-size: 1.05rem; }
.combo span { font-size: 0.9rem; color: var(--text-dim); }
.combo:hover { border-color: var(--grass-dark); background: #eef9e4; }

.trim-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.trim-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; text-decoration: none; color: var(--ink-2); font-family: var(--ui); font-weight: 700; font-size: 0.92rem; border: 3px solid transparent; }
.trim-nav a img { width: 32px; height: 32px; }
.trim-nav a:hover { background: #fff3d6; color: var(--ink); }
.trim-nav a[aria-current='page'] { border-color: var(--grass-dark); background: #e4f6d2; color: var(--grass-deep); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { background: #17201a; color: #c9d3c6; border-top: 6px solid var(--grass); font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1.6fr 0.8fr; gap: 48px; padding: 56px 0 40px; }
.site-footer .brand { color: #fff; }
.site-footer .brand b { color: var(--grass-light); }
.site-footer .brand small { color: #8fa08b; }
.f-brand p { margin: 16px 0 20px; color: #aebbaa; max-width: 360px; line-height: 1.6; }
.f-col h4 { font-family: var(--ui); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #8fa08b; margin-bottom: 14px; }
.f-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.f-trims ul { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; }
.site-footer a:not(.btn) { color: #e4ebe1; text-decoration: none; }
.site-footer a:not(.btn):hover { color: var(--grass-light); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: #8fa08b; font-size: 0.86rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .f-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } .f-trims ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .cloud { animation: none; transform: translateX(var(--x, 20vw)); }
}

/* keep scaled pixel textures crisp */
.ground, .grass-edge { image-rendering: pixelated; image-rendering: crisp-edges; }

/* scene tab */
.panel-h { font-family: var(--ui); font-size: 1rem; margin: 18px 0 8px; color: var(--ink-2); }
.panel-h:first-child { margin-top: 0; }
.env-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.env-opt { border: 3px solid transparent; padding: 4px 4px 6px; background: var(--panel-2); cursor: pointer; display: grid; gap: 4px; justify-items: center; }
.env-opt i { width: 100%; aspect-ratio: 16 / 7; display: block; border: 2px solid var(--line); border-radius: 3px; }
.env-opt span { font-weight: 700; font-size: 0.85rem; }
.env-opt:hover { background: #fff3d6; }
.env-opt[aria-checked='true'] { border-color: var(--grass-dark); background: #e4f6d2; }
#pedestal-options .opt img { border: 2px solid var(--line); }
#pack-clear { margin: 4px 0 8px; }
.howto { margin-top: 6px; font-size: 0.92rem; color: var(--ink-2); }
.howto summary { cursor: pointer; font-weight: 700; }
.howto code { font-size: 0.82rem; background: var(--panel-2); padding: 1px 4px; word-break: break-all; }
.stage-canvas.checker { background: repeating-conic-gradient(#ffffff 0 25%, #e6e6e6 0 50%) 0 0 / 24px 24px; }
@media (max-width: 480px) { .env-grid { grid-template-columns: repeat(2, 1fr); } }

#workshop, #stage, #trims, #guide, section[id] { scroll-margin-top: 84px; }

/* Compact the preview when the editor stacks underneath it. */
@media (max-width: 1040px) {
  .stage-canvas { min-height: 280px; height: min(48vh, 420px); aspect-ratio: auto; }
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
}

.hero-sub { color: #fff !important; font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.5rem) !important; font-weight: 700 !important; margin: -4px 0 14px !important; text-shadow: 0 2px 0 rgba(20, 60, 110, 0.45); }
.hub-hero { padding: 26px; margin: 16px 0 8px; }
.hub-hero h1 { margin: 6px 0 10px; }
.hub-table-wrap { margin-top: 32px; }
.table-scroll { overflow-x: auto; }
.hub-table { min-width: 640px; }
.hub-table th[scope='row'] a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.hub-table th[scope='row'] a:hover { color: var(--grass-dark); text-decoration: underline; }
.hub-table td small { color: var(--text-faint); }
.hub-table tbody tr:hover { background: #fff3d6; }

/* picker tiles: equal size, label never changes tile width */
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.opt { gap: 6px; padding: 8px 4px; border: 2px solid transparent; border-radius: 6px; min-width: 0; }
.opt img, .opt .none { width: 40px; height: 40px; flex: none; }
.opt .none { display: grid; place-items: center; border: 2px solid var(--panel-3); font-size: 1rem; color: var(--text-faint); box-shadow: none; }
.opt span:not(.none) { font-size: 0.8rem; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: normal; hyphens: manual; min-height: 2.4em; display: flex; align-items: flex-start; justify-content: center; }
.opt:hover { background: #fff; border-color: var(--panel-3); }
.opt[aria-checked='true'] { background: #e4f6d2; border-color: var(--grass-dark); box-shadow: none; }
.opt[aria-checked='true'] span:not(.none) { font-weight: 600; color: var(--grass-deep); }
#pedestal-options .opt img { border: 2px solid var(--line); border-radius: 2px; }

/* armor pages */
.armor-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
.armor-hero > div:first-child { padding: 24px; background: rgba(255, 252, 244, 0.94); border: 3px solid var(--line); box-shadow: 0 6px 0 rgba(31, 79, 134, 0.35); }
.armor-pieces { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px; align-self: center; }
.armor-pieces .piece { display: grid; justify-items: center; gap: 6px; padding: 14px; background: var(--panel-2); font-weight: 700; }
.armor-pieces img { width: 64px; height: 64px; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 16px 0; }
.recipe-card { margin: 0; padding: 14px; }
.recipe-card figcaption { font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.recipe-card figcaption small { color: var(--text-dim); font-weight: 600; }
.recipe-card .recipe { margin: 0; gap: 12px; }
.recipe-card .craft-grid { grid-template-columns: repeat(3, 44px); }
.recipe-card .craft-grid .cell { width: 44px; height: 44px; }
.recipe-card .cell img { width: 32px; height: 32px; }
.recipe-card .result { width: 54px; height: 54px; }
.recipe-card .smith-row .cell { width: 44px; height: 44px; }
.mat-table tr.total th, .mat-table tr.total td { font-weight: 700; border-top: 3px solid var(--panel-3); }
.mat-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
@media (max-width: 900px) { .armor-hero { grid-template-columns: 1fr; } }

/* gallery */
.gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.gallery-head h2 { margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.gallery-card { padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.gallery-art { display: grid; place-items: center; width: 100%; padding: 12px 0; background: linear-gradient(#7cc0ff, #d8f0ff 78%, #6cc244 78%); border: 3px solid var(--line); }
.gallery-art img { width: 64px; height: 128px; }
.gallery-card h3 { font-size: 1.05rem; margin: 0; word-break: break-word; }
.gallery-actions { display: flex; gap: 8px; width: 100%; }
.gallery-actions .btn { flex: 1; min-height: 40px; padding: 6px 8px; font-size: 0.9rem; }
.like-btn[aria-pressed='true'] { background: #ffd9e1; color: #b0173a; }
#gallery-more { margin-top: 16px; }

/* keep wide recipe rows inside narrow screens */
@media (max-width: 960px) { .content-grid { grid-template-columns: minmax(0, 1fr); } }
.recipe-grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.recipe-card .smith-row { gap: 4px; padding: 8px; }
@media (max-width: 420px) {
  .recipe-card .smith-row .cell { width: 38px; height: 38px; }
  .recipe-card .smith-row .cell img { width: 28px; height: 28px; }
  .recipe-card .smith-row .plus { padding: 0 2px; }
}

/* header: Discord + language */
.site-nav { margin-left: auto; }
.discord-btn { min-height: 40px; padding: 6px 14px; background: #5865f2; color: #fff; border-color: #2a2117; box-shadow: inset 3px 3px 0 #8c95ff, inset -3px -4px 0 #3a43b8; white-space: nowrap; }
.discord-btn:hover { background: #6b77ff; color: #fff; }
.lang-switch { position: relative; }
.lang-btn { min-height: 40px; padding: 6px 10px; gap: 6px; }
.lang-btn .fi { width: 22px; height: 16px; border-radius: 2px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(560px, calc(100vw - 32px)); padding: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--panel); border: 3px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.lang-menu[hidden] { display: none; }
.lang-menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 700; }
.lang-menu a:hover { background: var(--panel-2); }
.lang-menu a[aria-current='true'] { background: #e4f6d2; color: var(--grass-deep); }
.lang-menu .fi { width: 28px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
@media (max-width: 760px) { .discord-btn span { display: none; } .discord-btn { padding: 6px 10px; } }
@media (max-width: 520px) { .lang-btn .lang-name { display: none; } .lang-menu { grid-template-columns: minmax(0, 1fr); max-height: 70vh; overflow: auto; } }
[dir='rtl'] .lang-menu { right: auto; left: 0; }
/* language button: flag only (name stays in aria-label) */
.lang-btn .lang-name { display: none; }
.lang-btn { min-width: 46px; padding: 6px 10px; }
.lang-btn .fi { width: 26px; height: 19px; }

/* preview controls float on the 3D view; main actions stay on one row */
.stage-float { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 2; }
.stage-float .icon-btn { width: 42px; height: 42px; min-height: 42px; background: rgba(255, 252, 244, 0.92); }
.stage-float .icon-btn[aria-pressed='true'] { background: var(--grass); }
.stage-tools { display: flex; flex-wrap: nowrap; gap: 10px; padding: 14px; justify-content: stretch; }
.stage-tools .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
@media (max-width: 440px) {
  .stage-tools .btn { padding: 8px 6px; font-size: 0.9rem; gap: 6px; }
  .stage-tools .btn .ico { width: 18px; height: 18px; }
}
@media (max-width: 360px) { .stage-tools .btn { font-size: 0; gap: 0; } .stage-tools .btn .ico { width: 22px; height: 22px; } }
/* compact header on phones */
@media (max-width: 480px) {
  .site-header .wrap { gap: 8px; }
  .site-header .brand span { display: none; }
  .site-nav a { padding: 8px 8px; }
  .discord-btn, .lang-btn { min-width: 42px; padding: 6px 8px; }
}

/* gallery cards: larger previews, single-row actions */
[hidden] { display: none !important; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.gallery-card { padding: 16px; gap: 12px; }
.gallery-art { padding: 20px 0 14px; }
.gallery-art img { width: 120px; height: 240px; }
.gallery-card h3 { font-size: 1.15rem; }
.gallery-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.gallery-actions .btn { white-space: nowrap; min-height: 44px; font-size: 0.95rem; }
.gallery-actions .btn.primary { flex: 1 1 auto; }
.gallery-actions .like-btn { flex: 0 0 auto; padding: 6px 14px; }
