/* Ren'Py translation guide — loaded AFTER /style.css; rules for this page only. */
.g-head { max-width: 980px; }
.g-crumbs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 18px; font: 500 12px/1.6 var(--mono); letter-spacing: .08em; color: var(--dim); }
.g-crumbs a { color: var(--ice); border-bottom: 1px solid var(--line); }
.g-crumbs a:hover { border-color: var(--accent); }
.g-crumbs span[aria-hidden] { color: var(--accent); }
.guide h1 { font-size: clamp(2.1rem, 4.6vw, 4.2rem); line-height: 1; margin: 18px 0 0; overflow-wrap: break-word; }
.guide h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.05; margin: 0 0 22px; overflow-wrap: break-word; scroll-margin-top: 110px; }
.g-block { margin-top: clamp(56px, 9vh, 96px); max-width: 1060px; }
.g-prose p { margin: 0 0 14px; max-width: 72ch; color: #c9d5dd; font-size: 16.5px; line-height: 1.65; }
.g-prose strong, .g-step strong, .g-engine-card strong, .g-mini-engine strong { color: #fff; }
.g-prose a, .g-step a, .g-note a, .guide .faq details a, .g-engine-card a, .g-mini-engine a { color: var(--accent); border-bottom: 1px solid currentColor; }
.g-toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 28px; }
.g-toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ice); transition: border-color .2s, color .2s; }
.g-toc a:hover { border-color: var(--accent); color: #fff; }
.g-code { margin: 6px 0 18px; padding: 14px 16px; background: #0b1117; border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.g-code code { font: 500 14px/1.55 var(--mono); color: #fff; border: 0; white-space: pre; overflow-wrap: normal; }
.g-code .t { color: var(--accent); }

/* Click-to-zoom figures */
.g-hero-fig { margin: clamp(28px, 4.5vh, 44px) 0 0; max-width: 1060px; }
.g-fig { margin: 18px 0 4px; max-width: 920px; }
.g-fig figcaption, .g-fig figcaption span,
.g-hero-fig figcaption, .g-hero-fig figcaption span,
.frame figcaption, .frame figcaption span { white-space: normal; }
.shot__link { display: block; cursor: zoom-in; position: relative; border: 0 !important; }
.shot__link img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.shot__link:hover img { opacity: .94; }
.g-zoom-hint { margin-left: auto; color: var(--accent) !important; font-size: 10.5px; letter-spacing: .12em; }

/* Interactive before / after compare slider */
.compare { margin: 24px 0 10px; max-width: 960px; --pos: 30%; }
.compare__tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.compare__tabs button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 15px;
  background: rgba(5, 7, 10, 0.72);
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--dim); cursor: pointer;
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 0.22s, border-color 0.22s, background 0.22s;
}
.compare__tabs button b { font-weight: inherit; }
.compare__tabs button span { color: var(--dim); transition: color 0.22s; }
.compare__tabs button:hover { color: var(--ice); border-color: rgba(223, 234, 241, 0.36); }
.compare__tabs button[aria-selected="true"] {
  color: #fff;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, rgba(5, 7, 10, 0.88));
}
.compare__tabs button[aria-selected="true"] span { color: var(--accent); }
.compare__stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid rgba(223, 234, 241, 0.22);
  border-radius: 10px;
  overflow: hidden;
  background: #070a0f;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  transition: border-color 0.25s;
}
.compare__stage:hover, .compare__stage.is-dragging { border-color: var(--accent); }
.compare__stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.compare__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; pointer-events: none;
  user-select: none; -webkit-user-drag: none;
}
.compare__img--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); will-change: clip-path; }
.compare__badges { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.compare__badge {
  position: absolute; top: clamp(10px, 1.8vw, 18px);
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 45%;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(5, 7, 10, 0.8);
  border: 1px solid rgba(223, 234, 241, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 500 11px/1.25 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ice);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compare__badge--before { left: clamp(10px, 1.8vw, 18px); }
.compare__badge--before::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.compare__badge--after {
  right: clamp(10px, 1.8vw, 18px);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  color: #fff;
}
.compare__badge--after::before { content: ""; flex: none; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); }
.compare__divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; z-index: 4; pointer-events: none;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 2px rgba(0, 0, 0, 0.85);
}
.compare__handle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(5, 7, 10, 0.9);
  border: 2px solid var(--accent);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.compare__chev { font: 600 18px/1 var(--body); color: var(--accent); transition: color 0.2s; }
.compare__stage:hover .compare__handle, .compare__stage.is-dragging .compare__handle { transform: translate(-50%, -50%) scale(1.1); }
.compare__stage.is-dragging .compare__handle { background: var(--accent); }
.compare__stage.is-dragging .compare__chev { color: var(--on-accent); }
.compare__cap { margin-top: 12px; font: 500 11.5px/1.45 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }

/* Step cards */
.g-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; counter-reset: s; }
.g-step { position: relative; min-width: 0; border: 1px solid var(--line); background: rgba(223,234,241,.03); padding: 24px clamp(18px,3vw,32px) 26px clamp(70px,8vw,96px); }
.g-step::before { counter-increment: s; content: counter(s); position: absolute; left: clamp(16px,2.4vw,28px); top: 20px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 20px/1 var(--display); }
.g-step h3 { margin: 0 0 10px; font: 700 clamp(19px,2.2vw,24px)/1.2 var(--display); color: #fff; }
.g-step p { margin: 0 0 10px; color: #c9d5dd; font-size: 15.5px; line-height: 1.6; max-width: 74ch; }
.g-step p:last-child { margin-bottom: 0; }
.g-step code, .g-prose code, .g-tips code, .g-engine-card code, .g-mini-engine code { overflow-wrap: anywhere; }

/* 3-option engine summary strip inside Step 3 */
.g-tier-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 6px; }
.g-tier-box { border: 1px solid var(--line); background: rgba(5, 7, 10, 0.55); padding: 14px 15px; min-width: 0; }
.g-tier-box__k { display: block; font: 600 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.g-tier-box p { margin: 0; font-size: 14px; line-height: 1.5; color: #c9d5dd; }

/* 2x2 visual showcase for the new interface */
.g-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.g-gallery .frame { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.g-gallery figcaption { margin-top: auto; }
.g-gallery__title { display: block; color: #fff !important; font-size: 12px; margin-bottom: 3px; }

/* Featured other-engines cards (RPG Maker, Unity, Unreal) */
.g-engines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 22px; }
.g-engine-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px; align-items: center;
  border: 1px solid var(--line); background: rgba(223,234,241,.03);
  padding: clamp(18px, 2.6vw, 28px);
}
.g-engine-card__body { min-width: 0; }
.g-badge {
  display: inline-block; margin-bottom: 10px; padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.g-engine-card h3 { margin: 0 0 10px; font: 700 clamp(19px, 2.2vw, 24px)/1.2 var(--display); color: #fff; }
.g-engine-card p { margin: 0 0 10px; color: #c9d5dd; font-size: 15.5px; line-height: 1.6; }
.g-engine-card p:last-child { margin-bottom: 0; }
.g-engine-card .frame { margin: 0; }

/* Compact grid for remaining engines (Godot, Tyrano, WOLF, KiriKiri, QSP, Twine, GameMaker, SRPG) */
.g-subhead { margin: 36px 0 14px; font: 600 12px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.g-engine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g-mini-engine { border: 1px solid var(--line); background: rgba(223,234,241,.025); padding: 16px 18px; min-width: 0; }
.g-mini-engine h4 { margin: 0 0 6px; font: 700 16px/1.25 var(--display); color: #fff; }
.g-mini-engine p { margin: 0; color: #c9d5dd; font-size: 14.5px; line-height: 1.55; }

/* Tips & note */
.g-tips { columns: 1; max-width: 1060px; }
.g-tips div { grid-template-columns: 170px minmax(0, 1fr); }
.g-tips dd { color: #c9d5dd; line-height: 1.6; }
.g-tips dd strong { color: #fff; }

.g-note { margin-top: clamp(36px, 6vh, 64px); max-width: 1060px; border-left: 3px solid var(--accent); padding: 16px 20px; background: rgba(223,234,241,.04); }
.g-note h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin: 0 0 10px; }
.g-note p { margin: 0 0 8px; max-width: 78ch; color: #c9d5dd; font-size: 15.5px; line-height: 1.6; }
.g-note p:last-child { margin-bottom: 0; }

.guide .faq { padding-top: clamp(40px, 8vh, 90px); }
.guide .faq h2 { font-size: clamp(1.8rem, 3.2vw, 3rem); }
.g-cta { padding-top: 0; }
.g-cta__box { max-width: 1060px; border-top: 1px solid var(--ice); padding-top: clamp(30px, 5vh, 50px); }
.g-cta__box p { max-width: 66ch; color: #c9d5dd; margin: 0 0 24px; }
.g-cta__actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.g-prose .notes { list-style: none; margin: 0; padding: 0; max-width: 82ch; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .g-engine-card { grid-template-columns: minmax(0, 1fr); }
  .g-tier-strip { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .g-gallery { grid-template-columns: minmax(0, 1fr); }
  .g-engine-grid { grid-template-columns: minmax(0, 1fr); }
  .g-tips div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 640px) {
  .compare__tabs { gap: 8px; }
  .compare__tabs button { padding: 7px 11px; font-size: 10.5px; letter-spacing: 0.08em; }
  .compare__badge { padding: 4px 7px; font-size: 8.5px; letter-spacing: 0.02em; gap: 5px; max-width: 47%; white-space: normal; text-wrap: balance; border-radius: 9px; }
  .compare__badge::before { width: 5px; height: 5px; }
  .compare__handle { width: 38px; height: 38px; }
  .compare__chev { font-size: 15px; }
}
@media (max-width: 560px) {
  .g-step { padding-left: 18px; padding-top: 74px; }
  .g-code code { font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
}
