/* 3dtrimview — minetrim-parity layout
   Light pastel sky + cloud bg, white cards, pixel-perfect Minecraft icons.
   Right panel matches minetrim's 1+4 row inline-dropdown editor.
*/

:root {
  --sky-1: #d6e0fa;
  --sky-2: #b9c8ee;
  --cloud: #ffffff;
  --card:   #ffffff;
  --card-2: #f4f6fb;
  --border: #d8dde8;
  --border-2: #c2cad6;
  --text:    #2d2f36;
  --text-dim:#6b7280;
  --accent:  #6cd47a;
  --accent-d:#46b956;
  --accent-2:#f5cf3d;
  --warn:    #ec5d5d;
  --viewer-bg: #1a2540;
  --pixel-font: 'VT323', 'Press Start 2P', monospace;
  --shadow-1: 0 1px 2px rgba(20, 30, 60, .06), 0 2px 8px rgba(20, 30, 60, .04);
  --shadow-2: 0 6px 24px rgba(20, 30, 60, .08);
  --radius: 14px;
  --radius-sm: 10px;
  --content-max: 1020px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background:
    radial-gradient(ellipse 220px 60px at 12% 14%, var(--cloud) 0%, var(--cloud) 60%, transparent 65%),
    radial-gradient(ellipse 160px 48px at 86% 22%, var(--cloud) 0%, var(--cloud) 60%, transparent 65%),
    radial-gradient(ellipse 280px 70px at 48% 6%,  var(--cloud) 0%, var(--cloud) 60%, transparent 65%),
    radial-gradient(ellipse 200px 55px at 28% 30%, var(--cloud) 0%, var(--cloud) 60%, transparent 65%),
    radial-gradient(ellipse 240px 60px at 72% 8%,  var(--cloud) 0%, var(--cloud) 60%, transparent 65%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; color: var(--text); }
h1 { font-size: 28px; font-family: var(--pixel-font); letter-spacing: .5px; }
h2 { font-size: 18px; }
h3 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }

button, .btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s, border-color .12s, transform .08s;
  box-shadow: var(--shadow-1);
}
button:hover, .btn:hover { background: var(--card-2); border-color: var(--border-2); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); color: #0a3a14; border-color: var(--accent-d); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-d); color: #fff; }
button.ghost, .btn.ghost { background: transparent; box-shadow: none; }
button.selected, .btn.selected {
  background: #fff5cd;
  border-color: var(--accent-2);
  color: #5e4a0a;
}
button.danger { background: transparent; border-color: var(--warn); color: var(--warn); }

input[type="text"], input[type="color"], select, textarea {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  width: 100%;
}
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
input[type="file"] { color: var(--text-dim); font-size: 12px; padding: 4px 0; }
label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 4px; font-weight: 500; }

/* Inline label + color swatch so the Camera tab's "Background color" reads
   as one row instead of stacking label above a full-width picker. Label
   shrinks to its content; the swatch stretches to take the rest of the row
   so the user has a generous click target close to the label. */
.bg-color-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bg-color-row label { margin: 0; flex: 0 0 auto; }
.bg-color-row input[type="color"] { flex: 1 1 auto; width: auto; min-width: 0; }

.pixel-img, img.pixel {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

/* ────────── Header ────────── */
header.site {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  /* Header bar is wider than the 1020px body so non-English nav labels
     (RU/DE/JA/ES/PT) fit on one row without cramping the language switcher. */
  padding: 12px max(24px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
header.site .brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
header.site .brand:hover { text-decoration: none; }
header.site .brand-mark {
  display: block;
  width: 148px;
  height: 40px;
  background: url("/logo.png") center / contain no-repeat;
  border-radius: 0;
  box-shadow: none;
}
header.site .brand h1 { display: none; }
header.site h1 { font-size: 22px; margin: 0; }
header.site nav a { margin-left: 18px; color: var(--text); font-size: 14px; font-weight: 500; }
header.site nav a:hover { color: var(--accent-d); text-decoration: none; }

/* Java / Bedrock edition toggle — sits in the center of the header
   (between the brand and the nav). Visually a segmented control so the
   two top-level modes of the site are obvious at a glance. Scoped to
   header.site to avoid clobbering the pre-existing #fm-edition-toggle
   inside the floating menu, which is a different control. */
header.site .edition-toggle {
  display: inline-flex;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
header.site .edition-toggle a {
  margin: 0;
  padding: 6px 16px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s, color .12s;
}
header.site .edition-toggle a:hover { color: var(--text); background: rgba(0,0,0,0.04); }
header.site .edition-toggle a.active {
  background: var(--accent-d);
  color: #fff;
}
header.site .edition-toggle a.active:hover { background: var(--accent-d); color: #fff; }

/* Version selector — sits right after the edition toggle. Visually a slim
   pill that reads as "I target Minecraft X.YZ" so users know which /give
   syntax they're getting. Same baseline as the language switcher. */
header.site .version-select {
  margin: 0 0 0 10px;
  width: auto;
  padding: 5px 22px 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
/* Compact language switcher sits at the end of the header nav.
   Was buried in the footer where users never scrolled to find it. */
header.site .header-lang-switch {
  margin-left: 18px;
  width: auto;
  padding: 5px 24px 5px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
}

/* ────────── Hero strip ────────── */
.hero { text-align: center; padding: 22px 18px 12px; }
.hero h1 { font-family: var(--pixel-font); font-size: 38px; margin: 0 0 4px; }
.hero p { color: var(--text-dim); margin: 0; }

/* ────────── Layout ────────── */
/* Tight three-column rail / viewer / editor, sized so the three blocks
   sit shoulder-to-shoulder instead of floating apart in the centre
   column's leftover space. Total content ≈ 940 px; everything centres
   inside a 1080 px max so the page doesn't feel sparse. */
main.app {
  display: grid;
  grid-template-columns: 60px 420px 400px;
  gap: 10px;
  padding: 12px 20px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  align-items: start;
}

/* ────────── Sets rail (left) ────────── */
.sets-rail-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sets-list { display: contents; }
.set-card {
  background: var(--accent);
  color: #0a3a14;
  border: 1px solid var(--accent-d);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  box-shadow: var(--shadow-1);
  user-select: none;
}
.set-card.add {
  background: var(--card);
  color: var(--text-dim);
  border-color: var(--border);
  font-size: 22px;
  font-weight: 300;
  padding: 14px 6px;
}
.set-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.set-card.selected { outline: 2px solid var(--accent-d); }
.set-card { position: relative; }
.set-card-label { display: block; padding: 0 6px; }
.set-card-del {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  color: var(--warn, #ec5d5d);
  font-size: 14px; line-height: 16px; font-weight: 700;
  cursor: pointer; opacity: 0;
  transition: opacity .12s, background .12s;
  box-shadow: var(--shadow-1);
}
.set-card:hover .set-card-del,
.set-card-del:focus-visible { opacity: 1; }
.set-card-del:hover { background: var(--warn, #ec5d5d); color: #fff; }
/* `.set-card.add` (the + and trash buttons at top/bottom) re-uses the
   `.set-card` class but mustn't show the per-set delete badge. */
.set-card.add .set-card-del { display: none; }

/* ────────── 3D viewer + camera/skin tabs stack (center column) ────────── */
.center-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ────────── 3D viewer card ────────── */
/* Cap the viewer width so it doesn't sprawl across the whole centre
   column. Minetrim's preview is roughly portrait — ~460×520 — and
   centring inside the column gives the Camera/Skin card underneath
   somewhere to breathe. */
#viewer-host {
  background: var(--viewer-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 480px;
  box-shadow: var(--shadow-1);
}
#viewer-canvas { width: 100%; height: 100%; display: block; }

/* ────────── Card base ────────── */
.controls { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-1);
}
.card.editor-card { padding: 10px; }

/* ────────── Trim editor: 1 edit-all + 4 edit-single rows ────────── */
#edit-trim-model { display: flex; flex-direction: column; gap: 4px; }
#edit-all { padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
#edit-single { display: flex; flex-direction: column; gap: 4px; }
.trim-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  align-items: center;
}

.dropdown-cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  transition: border-color .1s, transform .08s;
}
.dropdown-cell:hover { border-color: var(--border-2); }
.dropdown-cell:active { transform: translateY(1px); }
.dropdown-cell.open { border-color: var(--accent-d); box-shadow: 0 0 0 2px rgba(108,212,122,.25); }
.dropdown-cell img.selected-disp {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dropdown-cell .empty-cell-mark {
  font-size: 22px;
  color: var(--border-2);
  font-weight: 300;
  user-select: none;
}

.dropdown-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  max-width: 340px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.dropdown-options.hidden { display: none; }
.dropdown-options img {
  width: 52px;
  height: 52px;
  padding: 6px;
  background: var(--card-2);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  object-fit: contain;
  image-rendering: pixelated;
}
.dropdown-options img:hover { border-color: var(--accent-d); background: #f0fbf2; transform: scale(1.05); transition: transform .08s ease-out; }
.dropdown-options img.selected { border-color: var(--accent-d); background: #f0fbf2; }

/* Burger ⋮ button */
.burger {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.burger:hover { background: var(--card); border-color: var(--border-2); }
.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 1px;
}
.burger.open span { background: var(--accent-d); }

/* Burger expand panel — slides out below the row */
.burger-panel {
  grid-column: 1 / -1;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 4px;
}
.burger-panel.hidden { display: none; }
.burger-panel h4 { margin: 0 0 6px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; }
.burger-panel .dye-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.burger-panel .dye-row img {
  width: 100%;
  aspect-ratio: 1;
  padding: 3px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  image-rendering: pixelated;
}
.burger-panel .dye-row img:hover { border-color: var(--accent-d); }
.burger-panel .dye-row img.selected { border-color: var(--accent-d); background: #f0fbf2; }
.burger-panel .give-line {
  background: #0e1525;
  color: #5dec8a;
  border: 1px solid #1f2a44;
  border-radius: 6px;
  padding: 6px 8px;
  font: 11px ui-monospace, Consolas, monospace;
  word-break: break-all;
  white-space: pre-wrap;
  cursor: copy;
  user-select: text;
}
.burger-panel .give-line.copied { border-color: var(--accent-d); box-shadow: 0 0 0 2px rgba(108,212,122,.25); }

/* ────────── Dice section ────────── */
/* Match the editor rows' 5 equal columns so dice and the enchant book
   share the same footprint as armor / dye / trim / material / burger. */
#dice {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.die {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  box-shadow: none;
}
.die:hover { background: var(--card-2); border-color: var(--accent-d); }
.die span { background: transparent; border-radius: 50%; }
.die span.dot { background: var(--text); width: 8px; height: 8px; align-self: center; justify-self: center; }
.enchant-btn {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  line-height: 1;
  box-shadow: none;
}
.enchant-btn:hover { background: var(--card-2); border-color: var(--accent-d); }
.enchant-btn.selected {
  border-color: rgba(190, 110, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(190, 110, 255, 0.5), 0 0 14px rgba(190, 110, 255, 0.6);
}

/* Enchanted-item glint lives on the actual armor materials now (see
   viewer.setGlint). The button keeps a purple ring to signal toggle state. */

/* ────────── Model handling tabs ────────── */
#model-handling .mh-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
}
#model-handling .mh-tabs button {
  padding: 6px 10px;
  font-size: 13px;
  box-shadow: none;
  border-bottom: 2px solid transparent;
}
#model-handling .mh-tabs button.selected {
  background: transparent;
  border-color: var(--border);
  border-bottom-color: var(--accent-d);
  color: var(--text);
}
.tab-pane.hidden { display: none; }

/* ────────── More tools (parity actions) ────────── */
#more-tools { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
#more-tools button { padding: 12px 8px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1.1; }
#more-tools #screenshot { order: 1; }
#more-tools #record-clip { order: 2; }
#more-tools #share { order: 3; }
#more-tools #join-discord,
#more-tools #dice-locked,
#more-tools button[hidden] { display: none !important; }

/* ────────── Unique tools accordion ────────── */
.unique-tools { padding: 0; }
.unique-tools summary {
  padding: 14px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.unique-tools summary::-webkit-details-marker { display: none; }
.unique-tools summary::after { content: '▾'; color: var(--text-dim); }
.unique-tools[open] summary::after { content: '▴'; }
.unique-tools .section-row {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.unique-tools .section-row h3 { margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.edition-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.command-block {
  position: relative;
  background: #0e1525;
  color: #5dec8a;
  border: 1px solid #1f2a44;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  padding-right: 70px;
  font: 12px ui-monospace, 'Cascadia Mono', Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 8px;
}
.command-block .copy-btn { position: absolute; top: 4px; right: 4px; padding: 4px 10px; font-size: 11px; }
/* The inner <pre> overrides .command-block's white-space without these.
   `overflow-wrap: anywhere` handles unbreakable trim={...} tokens. */
.command-block pre {
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  margin: 0;
}

/* ────────── Mobile ────────── */
@media (max-width: 1080px) {
  main.app { grid-template-columns: 1fr; padding: 14px; }
  .sets-rail-host { flex-direction: row; overflow-x: auto; }
  .set-card { min-width: 90px; }
  #viewer-host { height: min(52vh, 420px); min-height: 300px; }

  html,
  body {
    overflow-x: hidden;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  body > header.site { order: 1; }
  body > main.app { order: 2; }
  body > .hero { order: 3; }
  body > .seo-content { order: 4; }
  body > footer.site { order: 5; }

  header.site {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  header.site .brand {
    justify-content: center;
    min-width: 0;
  }

  header.site .brand-mark {
    width: 132px;
    height: 36px;
    flex: 0 0 auto;
  }

  header.site h1 {
    font-size: 18px;
    white-space: nowrap;
  }

  header.site .edition-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin: 0;
  }

  header.site .edition-toggle a {
    padding: 7px 8px;
    text-align: center;
  }

  header.site .version-select {
    grid-column: 1 / -1;
    width: 100%;
    margin: 4px 0 0;
  }

  header.site nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
  }

  header.site nav a {
    margin: 0;
    padding: 6px 8px;
    text-align: center;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
  }

  header.site .header-lang-switch {
    margin: 0;
    width: 100%;
    min-width: 0;
    font-size: 12px;
  }

  .hero {
    padding: 4px 14px 10px;
    margin-top: 0;
  }

  .hero h1 {
    font-size: 25px;
    line-height: 1.18;
  }

  .hero p {
    max-width: 34ch;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.4;
  }

  main.app {
    padding: 10px 14px 18px;
    gap: 10px;
  }

  @media (orientation: landscape) and (max-height: 500px) {
    header.site {
      grid-template-columns: auto minmax(240px, 1fr);
      grid-template-areas:
        "brand edition"
        "nav nav";
      gap: 6px 10px;
      padding: 6px 10px;
      align-items: center;
    }

    header.site .brand {
      grid-area: brand;
      justify-content: flex-start;
    }

    header.site .brand-mark {
      width: 104px;
      height: 28px;
    }

    header.site .edition-toggle {
      grid-area: edition;
      grid-template-columns: minmax(48px, .45fr) minmax(68px, .55fr) minmax(126px, 1fr);
      width: 100%;
      padding: 2px;
      gap: 2px;
    }

    header.site .edition-toggle a {
      padding: 5px 6px;
      font-size: 12px;
      line-height: 1.1;
    }

    header.site .version-select {
      grid-column: auto;
      width: 100%;
      margin: 0;
      padding: 4px 20px 4px 8px;
      font-size: 11px;
      min-height: 28px;
    }

    header.site nav {
      grid-area: nav;
      grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
      gap: 4px;
    }

    header.site nav a {
      padding: 5px 6px;
      border-radius: 6px;
      font-size: 11px;
      line-height: 1.1;
    }

    header.site .header-lang-switch {
      min-height: 28px;
      padding: 4px 18px 4px 8px;
      font-size: 11px;
      border-radius: 6px;
    }
  }

  .center-col {
    order: 1;
  }

  .controls {
    order: 2;
  }

  .sets-rail-host {
    order: 3;
    gap: 8px;
  }

  .set-card {
    min-width: 88px;
    padding: 12px 6px;
  }

  .card.editor-card {
    padding: 8px;
  }

  .dropdown-options {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(70vh, 420px);
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    z-index: 120;
  }

  .dropdown-options img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

/* ────────── SEO content (below) ────────── */
.seo-content {
  max-width: 980px;
  margin: 32px auto;
  padding: 18px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.seo-content p { color: var(--text-dim); }
.seo-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.seo-content th, .seo-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.seo-content th { background: var(--card-2); font-weight: 600; }
.seo-content tr:nth-child(even) td { background: var(--card-2); }
.home-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.home-guide-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 116px;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-1);
}
.home-guide-card:hover {
  border-color: var(--accent-d);
  text-decoration: none;
}
.home-guide-card span {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
}

/* 3dskinview-style centred footer: copyright → legal links → Mojang
   disclaimer, stacked vertically. The lang switch slots in below as a
   tail row. */
footer.site {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
footer.site .footer-copy { margin: 0; }
footer.site .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
footer.site .footer-links a { color: var(--accent-d); font-weight: 500; }
footer.site .footer-disclaimer {
  margin: 0; max-width: 880px; font-size: 12px; line-height: 1.5;
  color: var(--text-dim);
}

/* Cookie banner */
#cookie-banner {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  max-width: 540px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: none;
  box-shadow: var(--shadow-2);
  z-index: 1000;
}
#cookie-banner.show { display: block; }
#cookie-banner .actions { display: flex; gap: 6px; margin-top: 10px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Floating "more" panel (minetrim parity) ─────────────────────────
   Restyled for the light theme — previously hardcoded dark fallbacks
   (var(--bg, #0d1117), rgba(255,255,255,0.04), etc.) that didn't match
   the rest of the site. Now everything pulls from the site's CSS
   variables so the panel reads as part of the same UI. */
#floating-menu-btn {
  position: fixed;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  z-index: 90;
  box-shadow: var(--shadow-2);
  transition: background .12s, transform .12s, box-shadow .12s;
  /* Subtle pulse for the first ~6 s so first-time visitors notice it.
     `forwards` + 3 iterations stops the animation after the third pulse. */
  animation: fm-btn-pulse 1.6s ease-in-out 3 forwards;
}
#floating-menu-btn:hover {
  background: var(--card-2);
  box-shadow: 0 4px 18px rgba(108,212,122,0.35);
}
#floating-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.fm-btn-label {
  font-style: normal; font-weight: 700;
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 6px;
}
#floating-menu-btn[aria-expanded="true"] {
  transform: translateY(-50%) translateX(-400px);
  animation: none;  /* once opened, no more pulse */
}
@keyframes fm-btn-pulse {
  0%, 100% { box-shadow: var(--shadow-2); }
  50%      { box-shadow: 0 0 0 6px rgba(108,212,122,0.20), 0 4px 18px rgba(108,212,122,0.40); }
}

#floating-menu {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 400px; max-width: 92vw;
  background: var(--card);
  color: var(--text);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(20,30,60,0.12);
  z-index: 95;
  overflow-y: auto;
  padding: 16px;
  transform: translateX(100%);
  transition: transform .22s ease;
}
#floating-menu:not([hidden]) { transform: translateX(0); }
#floating-menu[hidden] { display: block !important; }  /* keep transition; hide via transform */
#floating-menu header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
#floating-menu header strong { font-size: 15px; color: var(--text); }
#floating-menu-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 24px; line-height: 1; padding: 0 6px; cursor: pointer;
}
#floating-menu-close:hover { color: var(--text); }
#floating-menu .fm-section { margin: 14px 0; }
#floating-menu .fm-section h4 {
  margin: 0 0 8px; font-size: 12px; letter-spacing: .04em;
  color: var(--text-dim); text-transform: uppercase;
}
.fm-armor {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.fm-armor .fm-piece {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card-2); font-size: 10px;
  color: var(--text);
}
.fm-armor .fm-piece.empty { opacity: 0.45; }
.fm-armor img { width: 32px; height: 32px; image-rendering: pixelated; }

/* 16-dye swatch grid for leather color. */
.fm-leather-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 8px;
}
.fm-leather-grid img {
  width: 100%; aspect-ratio: 1/1; image-rendering: pixelated;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; padding: 2px;
}
.fm-leather-grid img:hover { border-color: var(--border-2); }
.fm-leather-grid img.selected { border-color: var(--accent-d); background: rgba(108,212,122,0.18); }

.fm-give-version {
  font-size: 10px; font-weight: normal; text-transform: lowercase;
  color: var(--text-dim); margin-left: 6px;
}
#fm-command-out {
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px; padding: 10px; margin: 0 0 8px;
  font: 11px/1.4 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all;
  max-height: 240px; overflow-y: auto;
  cursor: copy;
  user-select: text;
}
#fm-command-out.copied { border-color: var(--accent-d); box-shadow: 0 0 0 2px rgba(108,212,122,.25); }
#fm-copy-cmd { width: 100%; }

/* Slot tabs at top of the enchantments panel — without these the
   "current slot" was pinned to helmet forever. */
.ench-slot-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; margin-bottom: 10px;
}
.ench-slot-tabs button {
  padding: 6px 4px; font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.ench-slot-tabs button:hover { background: var(--card-2); color: var(--text); }
.ench-slot-tabs button.selected {
  background: var(--accent); color: #0a3a14;
  border-color: var(--accent-d); font-weight: 600;
}

/* Floating menu top tabs: keep all 3 panes ≤ one viewport tall so power
   users don't scroll past Give just to reach Enchants. */
.fm-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin: -4px 0 12px;
}
.fm-tabs button {
  padding: 6px 4px; font-size: 12px; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fm-tabs button:hover { background: var(--card-2); color: var(--text); }
.fm-tabs button.selected {
  background: var(--accent); color: #0a3a14;
  border-color: var(--accent-d); font-weight: 600;
}
.fm-pane.hidden { display: none; }

/* Name & Lore slot tabs — same shape as the enchant slot tabs above. */
.name-slot-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; margin: 0 0 10px;
}
.name-slot-tabs button {
  padding: 6px 4px; font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.name-slot-tabs button:hover { background: var(--card-2); color: var(--text); }
.name-slot-tabs button.selected {
  background: var(--accent); color: #0a3a14;
  border-color: var(--accent-d); font-weight: 600;
}

/* Give scope chips: All / Helmet / Chest / Legs / Boots. Compact pills
   so the row fits the panel without wrap on the default width. */
.fm-give-scope {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; margin: 8px 0;
}
.fm-give-scope button {
  padding: 5px 4px; font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.fm-give-scope button:hover { background: var(--card-2); color: var(--text); }
.fm-give-scope button.selected {
  background: var(--accent); color: #0a3a14;
  border-color: var(--accent-d); font-weight: 600;
}

@media (max-width: 700px) {
  #floating-menu-btn {
    right: 14px;
    top: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: none;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    gap: 3px;
  }

  #floating-menu-btn span {
    width: 24px;
  }

  #floating-menu-btn .fm-btn-label {
    display: none;
  }

  #floating-menu-btn:hover {
    transform: translateY(-1px);
  }

  #floating-menu-btn[aria-expanded="true"] {
    transform: none;
    opacity: 0;
    pointer-events: none;
  }

  #floating-menu {
    width: 100vw;
    max-width: 100vw;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-left: 0;
  }

  #floating-menu[hidden] {
    visibility: hidden;
    pointer-events: none;
  }

  .seo-content {
    margin: 24px 0;
    padding: 14px;
  }

  .seo-content table {
    table-layout: fixed;
    width: 100%;
    font-size: 12px;
  }

  .home-guide-grid {
    grid-template-columns: 1fr;
  }

  .home-guide-card {
    min-height: 0;
  }

  .seo-content th,
  .seo-content td {
    padding: 8px 6px;
    overflow-wrap: anywhere;
  }

  .seo-content th:nth-child(1),
  .seo-content td:nth-child(1) {
    width: 24%;
  }

  .seo-content th:nth-child(2),
  .seo-content td:nth-child(2) {
    width: 36%;
  }

  .seo-content th:nth-child(3),
  .seo-content td:nth-child(3) {
    width: 22%;
  }

  .seo-content th:nth-child(4),
  .seo-content td:nth-child(4) {
    width: 18%;
  }
}

/* Ad library injects an empty fullscreen #rewardModal that blocks the viewer
   canvas when the rewarded ad fails to fill (e.g. third-party cookies blocked).
   Force-hide it so the canvas stays interactive. */
#rewardModal { display: none !important; }
