/* gn3d.css - gun viewer widget (guns.9minecraft.net). Light/dark via [data-theme] on any ancestor or prefers-color-scheme. */
.gn3d, .gnv {
  --gn-bg: #ffffff; --gn-fg: #1b1f24; --gn-mut: #5d6672; --gn-card: #f4f5f2; --gn-line: #dcdfd8;
  --gn-acc: #d9661f; --gn-acc-fg: #ffffff; --gn-chip: #ffffff; --gn-chip-on: #fbe7d9; --gn-chip-on-fg: #8a3a08;
  --gn-stage1: #f1f2ee; --gn-stage2: #d7dbd2; --gn-shadow: 0 1px 2px rgba(20, 25, 20, .08); --gn-warn: #8a5a00; --gn-err: #b42318;
  color: var(--gn-fg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gn3d, :root:not([data-theme="light"]) .gnv {
    --gn-bg: #15181c; --gn-fg: #e8eae6; --gn-mut: #a0a8a0; --gn-card: #1d2126; --gn-line: #30363d;
    --gn-acc: #ff8a3d; --gn-acc-fg: #1a0d03; --gn-chip: #22272d; --gn-chip-on: #4a2a14; --gn-chip-on-fg: #ffd2b3;
    --gn-stage1: #2a3036; --gn-stage2: #121518; --gn-shadow: 0 1px 2px rgba(0, 0, 0, .45); --gn-warn: #f0c060; --gn-err: #ff8a80;
  }
}
[data-theme="dark"] .gn3d, [data-theme="dark"] .gnv, .gn3d[data-theme="dark"] {
  --gn-bg: #15181c; --gn-fg: #e8eae6; --gn-mut: #a0a8a0; --gn-card: #1d2126; --gn-line: #30363d;
  --gn-acc: #ff8a3d; --gn-acc-fg: #1a0d03; --gn-chip: #22272d; --gn-chip-on: #4a2a14; --gn-chip-on-fg: #ffd2b3;
  --gn-stage1: #2a3036; --gn-stage2: #121518; --gn-shadow: 0 1px 2px rgba(0, 0, 0, .45); --gn-warn: #f0c060; --gn-err: #ff8a80;
}

.gn3d { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "panel"; font: inherit; }
.gn3d * { box-sizing: border-box; }
@media (min-width: 960px) {
  .gn3d { grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "top top" "main panel"; align-items: start; }
}
.gn3d-top { grid-area: top; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; min-width: 0; }
.gn3d-main { grid-area: main; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gn3d-panel { grid-area: panel; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 960px) { .gn3d-panel { max-height: min(76vh, 720px); overflow: auto; padding-right: 2px; } }

.gn3d-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; flex: 1 1 420px; }
.gn3d-picker[hidden] { display: none; }
.gn3d-gsel, .gn3d-asel, .gn3d-speed, .gn3d-search {
  min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--gn-line); background: var(--gn-bg); color: var(--gn-fg); font: inherit; font-size: 14px; max-width: 100%;
}
.gn3d-gsel { flex: 1 1 200px; min-width: 0; }
.gn3d-search { flex: 1 1 140px; min-width: 0; }
.gn3d-gcount { font-size: 13px; color: var(--gn-mut); }
.gn3d-tabs { display: inline-flex; border: 1px solid var(--gn-line); border-radius: 10px; overflow: hidden; background: var(--gn-bg); }
.gn3d-tab { min-height: 40px; padding: 6px 16px; border: 0; background: transparent; color: var(--gn-fg); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.gn3d-tab.on { background: var(--gn-acc); color: var(--gn-acc-fg); }
.gn3d-tab[hidden] { display: none; }

.gn3d-stage {
  position: relative; width: 100%; height: min(70vh, 620px); min-height: 340px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--gn-stage1) 0%, var(--gn-stage2) 100%);
  border: 1px solid var(--gn-line); user-select: none; -webkit-user-select: none; outline: none;
}
.gn3d-stage[hidden] { display: none; }
.gn3d-stage:focus-visible { outline: 2px solid var(--gn-acc); outline-offset: 2px; }
.gn3d-stage[data-bg="light"] { background: #eef1f5; }
.gn3d-stage[data-bg="dark"] { background: #16191f; }
.gn3d-stage[data-bg="range"] { background: linear-gradient(180deg, #8fb4cf 0%, #c9dbe6 55%, #7b8a5a 55.5%, #5f6e43 100%); }
.gn3d-stage[data-bg="checker"] { background: repeating-conic-gradient(#c9ccd1 0% 25%, #eef0f2 0% 50%) 50% / 24px 24px; }
@media (max-width: 600px) { .gn3d-stage { height: 56vh; min-height: 300px; border-radius: 12px; } }
.gn3d-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; outline: none; }
.gn3d-canvas:active { cursor: grabbing; }
.gn3d-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.gn3d-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; cursor: pointer; flex: none;
  border: 1px solid var(--gn-line); background: var(--gn-bg); color: var(--gn-fg); box-shadow: var(--gn-shadow); -webkit-tap-highlight-color: transparent;
}
.gn3d-btn svg { width: 20px; height: 20px; fill: currentColor; }
.gn3d-btn:hover { border-color: var(--gn-acc); }
.gn3d-btn:focus-visible, .gn3d-chip:focus-visible, .gn3d-tab:focus-visible, .gn3d-gsel:focus-visible, .gn3d-asel:focus-visible, .gn3d-scrub:focus-visible { outline: 2px solid var(--gn-acc); outline-offset: 2px; }
.gn3d-btn[aria-pressed="true"] { background: var(--gn-acc); color: var(--gn-acc-fg); border-color: var(--gn-acc); }
.gn3d-loading, .gn3d-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--gn-mut); font-size: 15px; }
.gn3d-msg { color: var(--gn-fg); position: static; }

.gn3d-player { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--gn-line); border-radius: 12px; background: var(--gn-card); }
.gn3d-player[hidden] { display: none; }
.gn3d-asel { flex: 1 1 160px; min-width: 0; }
.gn3d-scrub { flex: 3 1 200px; min-width: 120px; accent-color: var(--gn-acc); height: 32px; }
.gn3d-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--gn-mut); min-width: 94px; text-align: right; }

.gn3d-group { border: 1px solid var(--gn-line); border-radius: 12px; background: var(--gn-card); }
.gn3d-group[hidden] { display: none; }
.gn3d-group > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 15px; list-style: none; display: flex; gap: 6px; align-items: center; min-height: 44px; }
.gn3d-group > summary::-webkit-details-marker { display: none; }
.gn3d-group > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--gn-mut); border-bottom: 2px solid var(--gn-mut); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.gn3d-group[open] > summary::before { transform: rotate(45deg); }
.gn3d-count { font-weight: 400; color: var(--gn-mut); font-size: 13px; }
.gn3d-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.gn3d-chip {
  min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gn-line); background: var(--gn-chip); color: var(--gn-fg);
  font: inherit; font-size: 13.5px; cursor: pointer; -webkit-tap-highlight-color: transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gn3d-chip:hover { border-color: var(--gn-acc); }
.gn3d-chip[aria-pressed="true"] { background: var(--gn-chip-on); border-color: var(--gn-acc); color: var(--gn-chip-on-fg); font-weight: 600; }
.gn3d-bone { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; min-height: 32px; }
.gn3d-prow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; padding: 4px 0; border-top: 1px dashed var(--gn-line); }
.gn3d-prow:first-child { border-top: 0; }
.gn3d-plab { font-size: 12.5px; color: var(--gn-mut); width: 100%; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.gn3d-bgs { display: flex; gap: 8px; align-items: center; padding: 0 12px 12px; flex-wrap: wrap; }
.gn3d-bglab { font-size: 13px; color: var(--gn-mut); margin-right: 2px; }
.gn3d-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gn-line); cursor: pointer; padding: 0; }
.gn3d-sw[aria-pressed="true"] { border-color: var(--gn-acc); box-shadow: 0 0 0 2px var(--gn-acc); }
.gn3d-sw-studio { background: radial-gradient(circle, #f1f2ee, #b9bfb2); }
.gn3d-sw-light { background: #eef1f5; }
.gn3d-sw-dark { background: #16191f; }
.gn3d-sw-range { background: linear-gradient(180deg, #8fb4cf 50%, #5f6e43 50%); }
.gn3d-sw-checker { background: repeating-conic-gradient(#c9ccd1 0% 25%, #eef0f2 0% 50%) 50% / 10px 10px; }
.gn3d-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; padding: 0 2px; font-size: 14px; width: 100%; }
.gn3d-dl dt { color: var(--gn-mut); }
.gn3d-dl dd { margin: 0; overflow-wrap: anywhere; }
.gn3d-note { margin: 0; font-size: 13.5px; color: var(--gn-mut); }
.gn3d-warn { margin: 6px 0 0; font-size: 13px; color: var(--gn-warn); width: 100%; }

.gn3d-flat { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 12px; border: 1px solid var(--gn-line); border-radius: 14px; background: var(--gn-card); min-height: 240px; }
.gn3d-flat[hidden] { display: none; }
.gn3d-card { margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 12px; background: var(--gn-bg); border: 1px solid var(--gn-line); border-radius: 12px; }
.gn3d-img { width: 100%; max-height: 300px; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; background: repeating-conic-gradient(#d7d9dc 0% 25%, #f2f3f4 0% 50%) 50% / 16px 16px; border-radius: 8px; }
.gn3d-card figcaption { font-size: 13px; color: var(--gn-mut); text-align: center; overflow-wrap: anywhere; }
.gn3d-dlbtn { font-size: 13px; font-weight: 600; color: var(--gn-acc); text-decoration: none; padding: 6px 10px; border: 1px solid var(--gn-line); border-radius: 8px; min-height: 36px; display: inline-flex; align-items: center; }
.gn3d-fs { position: fixed !important; inset: 0; z-index: 9999; background: var(--gn-bg); padding: 10px; overflow: auto; }
.gn3d:fullscreen { background: var(--gn-bg); padding: 10px; overflow: auto; }
.gn3d:fullscreen .gn3d-stage { height: calc(100vh - 140px); }
