:root {
  /* --- text tones: 明度3段（見出し / 本文・ラベル / 補助） 全て緑相で統一 --- */
  --ink: #e9ffec;
  --ink-dim: #b2d7b6;
  --muted: #6d8c71;
  /* --- surfaces: 深い黒緑を4段階 --- */
  --bg: #050805;
  --surface: #0b120c;
  --surface-2: #121c13;
  --panel: #080e09;
  /* --- lines: 2段階 --- */
  --line: #1e2b1f;
  --line-strong: #31492f;
  /* --- accents: 緑〜黄緑の中で彩度・明度の階調を作る --- */
  --accent: #33ff66;
  --accent-soft: #8fe89d;
  --accent-lime: #b6e84a;
  --accent2: #e8d84a;
  --accent-cyan: #4ad8e8;
  --focus: #7bff9c;
  --glow-green: rgba(51, 255, 102, 0.4);
  --glow-focus: rgba(123, 255, 156, 0.35);
  --glow-lime: rgba(182, 232, 74, 0.32);
  --glow-cyan: rgba(74, 216, 232, 0.3);
  --scanline: repeating-linear-gradient(to bottom, rgba(51, 255, 102, 0.022) 0px, rgba(51, 255, 102, 0.022) 2px, transparent 2px, transparent 8px);
  --scanline-strong: repeating-linear-gradient(to bottom, rgba(51, 255, 102, 0.045) 0px, rgba(51, 255, 102, 0.045) 1px, transparent 1px, transparent 3px);
  --crt-vignette: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.32) 100%);
  --silhouette-img: url(assets/gallery/horse_silhouette.webp);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 60% at 50% 0%, rgba(51, 255, 102, 0.06), transparent 70%);
  background-attachment: fixed;
  color: var(--ink-dim);
  font-family: sans-serif;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 760px;
  padding: 1rem 1.1rem 2rem;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: var(--scanline), var(--crt-vignette);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  animation: crt-flicker 4s infinite;
}

@keyframes crt-flicker {
  0%, 89%, 100% { opacity: 0; }
  90% { opacity: 1; }
  91% { opacity: 0; }
  93% { opacity: 0.7; }
  94% { opacity: 0; }
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  z-index: 1000;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: calc((100vw - min(100vw, 760px)) / 2 + 1.1rem);
  padding-right: calc((100vw - min(100vw, 760px)) / 2 + 1.1rem);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line-strong);
  padding-top: 0.9rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1.6rem;
  box-shadow: 0 -1px 14px -2px var(--glow-green);
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: var(--scanline-strong);
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.wordmark {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.15em;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: clamp(1.15em, 5.8vw, 2.2em);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(51, 255, 102, 0.28);
  min-width: 0;
}

.wordmark-link {
  cursor: pointer;
}

.wordmark .logo-icon {
  height: 1.3em;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.wordmark span {
  color: var(--accent);
  text-shadow: 0 0 10px var(--glow-green);
}

.wordmark .version-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.22em;
  font-weight: 400;
  color: var(--accent2);
  vertical-align: super;
  margin-left: 0.25em;
  flex-shrink: 0;
  text-shadow: none;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0.4rem;
}

.menu-btn {
  position: static;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-drawer {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: top 0.5s ease-out;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, transparent 45%),
    linear-gradient(320deg, rgba(51, 255, 102, 0.06) 0%, transparent 30%),
    linear-gradient(rgba(11, 18, 12, 0.86), rgba(11, 18, 12, 0.86));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.menu-drawer.open {
  top: 0;
}

.menu-drawer-header {
  padding: 16px 24px;
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--line-strong);
  line-height: 1.4;
  font-family: "IBM Plex Mono", monospace;
}

.menu-drawer nav {
  padding: 16px 0;
}

.menu-drawer nav a {
  display: block;
  padding: 16px 24px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 1rem;
}

.menu-drawer nav a:hover {
  background: rgba(51, 255, 102, 0.1);
  color: var(--accent);
}

.menu-drawer nav .menu-disabled {
  display: block;
  padding: 16px 24px;
  color: var(--line-strong);
  font-size: 1rem;
  cursor: default;
  pointer-events: none;
}

.header-sub-row .subtitle {
  color: var(--muted);
  font-size: 0.62em;
  letter-spacing: 0.06em;
  margin: 0 0 0 3.8rem;
}

.lang-toggle {
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.16), rgba(51, 255, 102, 0.04));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 3px;
  padding: 0.25rem 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-shadow: 0 0 8px var(--glow-green);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 12px -2px var(--glow-green);
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.26), rgba(51, 255, 102, 0.08));
}

/* ---- tab bar ---- */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tab-btn {
  position: relative;
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.tab-btn::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 2px;
  background: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tab-btn:hover {
  color: var(--ink-dim);
  border-color: var(--line-strong);
}

.tab-btn.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.14), rgba(51, 255, 102, 0.02) 60%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-shadow: 0 0 10px var(--glow-green);
  box-shadow: 0 0 16px -4px var(--glow-green), inset 0 0 20px -12px var(--accent);
}

.tab-btn.active::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow-green);
}

/* ---- sections / panels ---- */
section {
  margin-bottom: 2.6rem;
}

section:last-of-type {
  margin-bottom: 1.6rem;
}

#section-source,
#section-basic,
#section-stats,
#section-gear,
#section-output,
#section-parse {
  position: relative;
  padding: 1.4rem 1.3rem 1.6rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 26px -20px #000;
}

#section-source::before,
#section-source::after,
#section-basic::before,
#section-basic::after,
#section-stats::before,
#section-stats::after,
#section-gear::before,
#section-gear::after,
#section-output::before,
#section-output::after,
#section-parse::before,
#section-parse::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-color: var(--accent);
  opacity: 0.75;
}

#section-source::before,
#section-basic::before,
#section-stats::before,
#section-gear::before,
#section-output::before,
#section-parse::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

#section-source::after,
#section-basic::after,
#section-stats::after,
#section-gear::after,
#section-output::after,
#section-parse::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

section h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.15em, 3vw, 1.45em);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(51, 255, 102, 0.22);
  margin: 0 0 1.4rem;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.55rem;
}

#section-source h2::before,
#section-basic h2::before,
#section-stats h2::before,
#section-output h2::before,
#section-parse h2::before {
  content: "■ ";
  color: var(--accent);
  text-shadow: 0 0 10px var(--glow-green);
}

summary {
  cursor: pointer;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

summary h2 {
  display: inline;
  border-bottom: none;
  padding-bottom: 0;
  margin: 0;
}

#section-gear summary {
  margin-bottom: 1.2rem;
}

#x-share-guide {
  margin-top: 1.4rem;
}

#x-share-guide > p {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 1rem 0 0.4rem;
}

/* ---- form rows ---- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.form-row label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.form-row input,
.form-row select {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  width: 100%;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.form-row input:hover,
.form-row select:hover {
  border-color: color-mix(in srgb, var(--focus) 45%, var(--line-strong));
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--focus);
  color: #fff;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--focus), 0 0 16px -2px var(--glow-focus);
}

.form-row input:disabled {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, var(--bg) 90%);
}

.form-row-fixed input {
  opacity: 0.7;
}

.form-row-triple {
  flex-direction: row;
  gap: 0.8rem;
}

.form-row-triple > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row-triple label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  display: block;
  min-height: 2.4em;
}

.form-row-quad {
  display: flex;
  gap: 0.5rem;
}

.form-row-quad-item {
  width: 25%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-row-quad-item label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  min-height: 0;
}

.form-row-quad-item input {
  width: 100%;
}

/* ---- stat rows (sliders) ---- */
.stat-row {
  margin-bottom: 1.1rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
}

.stat-row label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 0.55rem;
}

.stat-row-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.stat-row-controls input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.stat-row-controls input[type="number"] {
  width: 5rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.35rem;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-row-controls input[type="number"]:focus,
.stat-row-controls input[type="range"]:focus {
  outline: none;
}

.stat-row-controls input[type="number"]:focus {
  border-color: var(--focus);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--focus), 0 0 16px -2px var(--glow-focus);
}

.stat-row-controls .stat-edge-label {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 重要な数値表示：最も強く光らせる（黄緑＝数値の差し色） */
.stat-row-controls .stat-value-display {
  width: 5rem;
  flex-shrink: 0;
  text-align: center;
  background: var(--panel);
  color: var(--accent-lime);
  border: 1px solid color-mix(in srgb, var(--accent-lime) 50%, transparent);
  border-radius: 3px;
  padding: 0.35rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px var(--glow-lime);
  box-shadow: inset 0 0 18px -9px var(--accent-lime), 0 0 12px -8px var(--glow-lime);
}

/* ---- gear ---- */
.gear-copy-box {
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1.4rem;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent 30%);
  backdrop-filter: blur(3px);
}

.gear-copy-box label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 0.4rem;
}

.gear-copy-row {
  display: flex;
  gap: 0.5rem;
}

.gear-copy-row input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.45rem;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* サポート情報（ヒント・ステータス）は静かに沈める */
.gear-copy-status,
.copy-status,
.color-sample-note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 1em;
  margin: 0.5rem 0 0;
}

.gear-copy-status {
  margin: 0.5rem 0 1rem;
}

#gear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.gear-field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 0.3rem;
}

.gear-field input {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.45rem;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gear-field input:focus,
.gear-copy-row input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--focus), 0 0 16px -2px var(--glow-focus);
}

/* ---- buttons ---- */
/* 主操作：生成・解析（ベタ塗りをやめ、グロー＋階調で立たせる） */
.search-btn,
#parse-btn {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.22), rgba(51, 255, 102, 0.05) 65%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  border-radius: 3px;
  padding: 0.8rem;
  font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  margin-bottom: 0.9rem;
  text-shadow: 0 0 12px var(--glow-green);
  box-shadow: 0 0 18px -4px var(--glow-green), inset 0 0 24px -14px var(--accent);
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.search-btn:hover,
#parse-btn:hover,
.search-btn:focus-visible,
#parse-btn:focus-visible {
  outline: none;
  color: #d6ffe4;
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.34), rgba(51, 255, 102, 0.1) 65%, transparent);
  box-shadow: 0 0 26px -4px var(--glow-green), inset 0 0 26px -10px var(--accent);
}

/* 副操作：読み込む・コピー系（シアン系のアウトライン） */
#load-source-btn,
#copy-btn,
#parse-copy-btn,
#share-copy-btn,
#x-template-copy-btn,
#x-share-copy-btn-inner,
.gear-copy-row button {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent-soft) 38%, transparent);
  border-radius: 3px;
  padding: 0.5rem 1rem;
  margin-top: 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px -9px var(--accent-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background 0.15s ease;
}

#load-source-btn:hover,
#copy-btn:hover,
#parse-copy-btn:hover,
#share-copy-btn:hover,
#x-template-copy-btn:hover,
#x-share-copy-btn-inner:hover,
.gear-copy-row button:hover,
#load-source-btn:focus-visible,
#copy-btn:focus-visible,
#parse-copy-btn:focus-visible,
#share-copy-btn:focus-visible,
#x-template-copy-btn:focus-visible,
#x-share-copy-btn-inner:focus-visible,
.gear-copy-row button:focus-visible {
  outline: none;
  color: #d6ffe0;
  border-color: var(--accent-soft);
  box-shadow: 0 0 14px -6px var(--glow-focus);
}

.gear-copy-row button {
  margin-top: 0;
}

/* ---- textarea ---- */
textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--focus), 0 0 16px -2px var(--glow-focus);
}

textarea[readonly] {
  color: var(--accent-soft);
}

/* ---- footer / links ---- */
footer {
  margin-top: 2.4rem;
}

footer .fnote,
.related-tools .fnote {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.7;
  text-align: center;
  margin: 0 auto 2px;
}

.ameri-link {
  margin: 0 0 2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 2px solid color-mix(in srgb, var(--accent-lime) 55%, transparent);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(51, 255, 102, 0.06), transparent 70%);
  backdrop-filter: blur(3px);
  text-align: left;
  font-size: 0.8em;
}

.ameri-link a {
  color: var(--accent-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px var(--glow-focus);
}

.ameri-link a:hover {
  text-decoration: underline;
}

.related-tools {
  text-align: center;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
  margin-bottom: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

footer a,
.related-tools a {
  color: var(--accent-soft);
}

footer .fnote.footer-credit {
  margin-top: 14px;
}

.visit-counter {
  text-align: center;
  margin-top: 10px;
  opacity: 0.55;
}

@media (max-width: 480px) {
  #gear-grid {
    grid-template-columns: 1fr;
  }

  #section-source,
  #section-basic,
  #section-stats,
  #section-gear,
  #section-output,
  #section-parse {
    padding: 1.1rem 0.95rem 1.3rem;
  }
}

/* ---- usage guide (howto accordion) ---- */
.usage-details {
  margin: 0 0 2rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--surface), var(--panel));
  backdrop-filter: blur(3px);
}

.usage-details summary {
  padding: 0.7rem 0.95rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  border-bottom: none;
  padding-bottom: 0.7rem;
  color: var(--ink);
}

.usage-details summary::-webkit-details-marker {
  display: none;
}

.usage-details summary::before {
  content: "▶ ";
  font-size: 0.8em;
  color: var(--accent);
  text-shadow: 0 0 8px var(--glow-green);
}

.usage-details[open] summary::before {
  content: "▼ ";
}

.usage-details ol {
  margin: 0;
  padding: 0 0.95rem 0.5rem 2rem;
  font-size: 0.78em;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--line);
}

.usage-details ol li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.usage-details ol li::marker {
  color: color-mix(in srgb, var(--accent) 70%, transparent);
  font-family: "IBM Plex Mono", monospace;
}

.usage-details ol li:last-child {
  border-bottom: none;
}

/* ---- color / mark samples ---- */
.color-sample-strip {
  margin-top: 8px;
  margin-bottom: 1.5rem;
  min-width: 0;
  grid-column: 1 / -1;
}

.color-sample-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
}

.color-sample-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-width: 0;
  max-width: 100%;
}

.color-sample-btn {
  flex-shrink: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-sample-btn.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 12px -2px var(--glow-green);
}

.color-sample-imgwrap {
  position: relative;
  z-index: 10000;
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  overflow: hidden;
}

.color-sample-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.color-sample-credit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 8px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 2px rgba(0,0,0,0.9);
  pointer-events: none;
}

.color-sample-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.color-sample-legend-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-dim);
}

.color-sample-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.head-mark-legend-details {
  grid-column: 1 / -1;
  min-width: 0;
}

.head-mark-legend-details .color-sample-strip {
  padding: 10px 14px 14px;
  margin-bottom: 0;
}

.color-sample-source-link {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-soft);
}

/* ---- micro-interaction: 生成/コピー成功時の一瞬のグロー演出 ---- */
@keyframes fss-pulse-glow {
  0% {
    box-shadow: 0 0 18px -4px var(--glow-green), inset 0 0 24px -14px var(--accent);
  }
  40% {
    box-shadow: 0 0 30px 0 var(--glow-green), inset 0 0 30px -6px var(--accent);
  }
  100% {
    box-shadow: 0 0 18px -4px var(--glow-green), inset 0 0 24px -14px var(--accent);
  }
}

.fss-pulse {
  animation: fss-pulse-glow 0.6s ease-out;
}

@keyframes fss-copy-flash {
  0% {
    color: var(--accent);
  }
  100% {
    color: var(--muted);
  }
}

.fss-copy-flash {
  animation: fss-copy-flash 0.6s ease-out;
}

/* ---- modal ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-content {
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--surface-2), var(--panel));
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 40px -10px var(--glow-focus);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5em;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
}

.install-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-2);
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.install-toggle:hover {
  border-color: var(--focus);
  box-shadow: 0 0 12px -4px var(--glow-focus);
}

.install-guide p {
  margin: 0 0 10px;
  font-size: 0.88em;
  color: var(--ink-dim);
}

.install-guide p:first-of-type {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.install-guide p:last-child {
  margin-bottom: 0;
}

.accordion-hint {
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 0.5em;
}

/* ---- footer disclaimer ---- */
.footer-disclaimer {
  margin: 14px auto 12px;
  max-width: 40em;
  text-align: center;
}

.footer-disclaimer summary {
  cursor: pointer;
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding-bottom: 3px;
}

.footer-disclaimer summary:hover {
  color: var(--ink-dim);
  border-color: var(--line-strong);
}

.footer-disclaimer[open] summary {
  margin-bottom: 10px;
}

.disclaimer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  counter-reset: disclaimer-count;
}

.disclaimer-section {
  background: linear-gradient(180deg, var(--surface), var(--panel));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 0;
}

.disclaimer-section h4 {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  counter-increment: disclaimer-count;
}

.disclaimer-section h4::before {
  content: counter(disclaimer-count, decimal-leading-zero) " ";
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  text-shadow: 0 0 8px var(--glow-green);
}

.disclaimer-section p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--muted);
}

.disclaimer-dates {
  display: block;
  margin-top: 10px;
}

/* ---- 名馬ギャラリー (gallery.html) ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 1.6rem;
}

@media (min-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.2rem 0;
}

.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0.7rem 1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 26px -20px #000;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

.gallery-card::before,
.gallery-card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--accent);
  opacity: 0.75;
}

.gallery-card::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.gallery-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 16px -4px var(--glow-green), inset 0 0 20px -12px var(--accent);
}

.gallery-silhouette-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2);
}

.gallery-silhouette-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 82%;
  height: 82%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #3d4d40;
}

.gallery-silhouette-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 70%;
  transform: translate(-50%, -50%);
  -webkit-mask-image: var(--silhouette-img);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: var(--silhouette-img);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.gallery-card-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 10px rgba(51, 255, 102, 0.18);
}

.gallery-card-creator {
  font-size: 0.72rem;
  color: var(--muted);
}

.gallery-card-ratings {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-rating-chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-soft);
}

/* ---- 馬詳細ページ (detail.html) ---- */

.gallery-detail-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.85rem;
}

.gallery-detail-back:hover {
  color: var(--accent);
}

.gallery-detail-message {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
}

.gallery-detail-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-detail-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.gallery-detail-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 10px rgba(51, 255, 102, 0.18);
}

.gallery-detail-creator {
  font-size: 0.8rem;
  color: var(--muted);
}

.gallery-detail-section {
  position: relative;
  margin-bottom: 1.2rem;
  padding: 0.9rem 0.9rem 1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.gallery-detail-section::before,
.gallery-detail-section::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--accent);
  opacity: 0.75;
}

.gallery-detail-section::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.gallery-detail-section::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.gallery-detail-section h2 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.gallery-detail-silhouette-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gallery-detail-silhouette-wrap {
  width: 120px;
  flex-shrink: 0;
}

.gallery-detail-rating-big {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gallery-detail-rating-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.gallery-detail-rating-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.gallery-detail-rating-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.gallery-detail-radar-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.detail-radar {
  width: 210px;
  height: 210px;
}

.detail-radar .radar-label {
  font-size: 9px;
}

.radar-base {
  fill: var(--surface-2);
  stroke: var(--muted);
  stroke-width: 1.5;
}

.radar-ring {
  fill: none;
  stroke: var(--muted);
  stroke-width: 0.8;
  opacity: 0.55;
}

.radar-spoke {
  stroke: var(--muted);
  stroke-width: 0.8;
  opacity: 0.4;
}

.radar-value {
  fill: var(--accent);
  fill-opacity: 0.35;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  pointer-events: none;
}

.radar-label {
  fill: var(--ink-dim);
  font-size: 13px;
  pointer-events: none;
}

.gallery-detail-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.gallery-detail-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.gallery-detail-stat-label {
  font-size: 0.8rem;
  color: var(--ink-dim);
  font-weight: 700;
}

.gallery-detail-stat-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.gallery-detail-running-style-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.gallery-detail-rs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.gallery-detail-rs-value {
  font-size: 0.62rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.gallery-detail-rs-chip {
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.gallery-detail-rs-chip.is-main {
  border-color: var(--accent);
  color: var(--accent-soft);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.gallery-detail-slider-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.gallery-detail-slider-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent-soft);
  opacity: 0.5;
  border-radius: 999px;
}

.gallery-detail-slider-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px var(--glow-green);
}

.gallery-detail-age-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.gallery-detail-age-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.gallery-detail-age-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.gallery-detail-age-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
  color: var(--ink);
}

.gallery-like-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
}

.gallery-like-btn:hover:not(:disabled) {
  box-shadow: 0 0 16px -4px var(--glow-green);
}

.gallery-like-btn:disabled,
.gallery-like-btn.is-liked {
  opacity: 0.6;
  cursor: default;
  border-color: var(--line-strong);
  background: transparent;
}

.gallery-like-icon {
  font-size: 1.2rem;
}

.gallery-like-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.gallery-like-caption {
  font-size: 0.65rem;
  color: var(--muted);
}

.gallery-detail-delete {
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.gallery-detail-delete summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.gallery-detail-delete-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.gallery-detail-delete-body input {
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.gallery-delete-btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid #e85a5a;
  background: transparent;
  color: #e85a5a;
  cursor: pointer;
  align-self: flex-start;
}

.gallery-delete-btn:hover {
  background: rgba(232, 90, 90, 0.1);
}

.gallery-detail-delete-error {
  color: #e85a5a;
  font-size: 0.82rem;
  margin: 0;
}

.gallery-section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.05em, 3vw, 1.3em);
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(51, 255, 102, 0.2);
  margin: 1.6rem 0 1rem;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.5rem;
}

.gallery-section-title:first-of-type {
  margin-top: 0;
}

.gallery-detail-lineage {
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.gallery-detail-lineage summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.gallery-detail-lineage-body {
  margin-top: 0.7rem;
}

.gallery-detail-lineage-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.gallery-detail-lineage-node {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-dim);
  background: var(--surface-2);
  text-decoration: none;
  font-size: 0.85rem;
}

.gallery-detail-lineage-node:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-detail-lineage-node.is-self {
  color: var(--accent);
  border-color: var(--accent);
  cursor: default;
}

.gallery-detail-lineage-arrow {
  color: var(--muted);
  padding-left: 14px;
  font-size: 0.82rem;
}

.gallery-detail-lineage-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- 「この馬を元に作る」ボタン ---- */
.gallery-remix-btn {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.22), rgba(51, 255, 102, 0.05) 65%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  border-radius: 3px;
  padding: 0.8rem;
  font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  margin: 0.9rem 0;
  text-shadow: 0 0 12px var(--glow-green);
  box-shadow: 0 0 18px -4px var(--glow-green), inset 0 0 24px -14px var(--accent);
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.gallery-remix-btn:hover,
.gallery-remix-btn:focus-visible {
  outline: none;
  color: #d6ffe4;
  background: linear-gradient(180deg, rgba(51, 255, 102, 0.34), rgba(51, 255, 102, 0.1) 65%, transparent);
  box-shadow: 0 0 26px -4px var(--glow-green), inset 0 0 26px -10px var(--accent);
}

.gallery-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.gallery-share-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.gallery-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
}

.gallery-share-btn:hover {
  box-shadow: 0 0 16px -4px var(--glow-green);
}

.gallery-share-caption {
  font-size: 0.65rem;
  color: var(--muted);
}

.gallery-browse-all-btn {
  display: block;
  width: 100%;
  margin: 0 0 1.6rem;
  padding: 0.7em 1em;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  cursor: pointer;
}

.gallery-search-row {
  margin: 0 0 1rem;
}

.gallery-browse-back-btn {
  display: block;
  width: 100%;
  margin: 0.4rem 0 0;
  padding: 0.6em 1em;
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}

.gallery-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6em 0.8em;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin: 1rem 0;
}

.gallery-pagination .page-btn {
  padding: 0.4em 0.8em;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.gallery-pagination .page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-pagination .page-indicator {
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink);
}

.gallery-new-ribbon {
  position: absolute;
  top: 14px;
  left: -34px;
  width: 120px;
  padding: 3px 0;
  text-align: center;
  transform: rotate(-45deg);
  background: rgba(10, 20, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
  pointer-events: none;
}

.gallery-new-ribbon span {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #47cf73, #38b6ff, #a06bff, #ff5f6d);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gallery-new-ribbon-flow 3s linear infinite;
}

@keyframes gallery-new-ribbon-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
