/* ==========================================================================
   Guestbook — page styles
   외장 v2 토큰 alias + PM 6 수정
   (720px / 45px blur 6 top 40% / rotation 가속 / font random /
    dur 2.5-9 / 8-30 동시 / cosmos 3-mode 무관 밤 고정)
   ========================================================================== */

.zeo-guestbook {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.zeo-guestbook .gb-pagehead { margin-bottom: 1.2rem; }
.zeo-guestbook h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4rem;
  letter-spacing: -0.005em;
}
.zeo-guestbook .gb-lede {
  color: var(--zeo-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.zeo-guestbook .gb-lede em {
  font-style: italic;
  color: var(--zeo-accent);
}
.zeo-guestbook .gb-section { margin-top: 1.6rem; }
.zeo-guestbook .gb-section > h2 {
  border-bottom: 1px solid var(--zeo-border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ==========================================================================
   FORM
   ========================================================================== */
.gb-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  position: relative;
}
.gb-form .gb-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.gb-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--inset-fg);
  background: var(--inset-soft);
  border: 1px solid var(--zeo-border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  outline: none;
  resize: none;
  min-height: 56px;
  max-height: 96px;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.gb-form textarea::placeholder,
.gb-form input::placeholder {
  color: var(--zeo-muted);
  opacity: 0.7;
}
.gb-form .gb-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr auto auto;
  gap: 0.5rem;
  align-items: center;
}
.gb-form input[type="text"],
.gb-form input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--inset-fg);
  background: var(--inset-soft);
  border: 1px solid var(--zeo-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.gb-form textarea:focus,
.gb-form input:focus {
  border-color: var(--zeo-accent);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--accent-glow);
}
.gb-form .gb-counter {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--zeo-muted);
  white-space: nowrap;
}
.gb-form .gb-submit {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: var(--zeo-accent);
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 120ms ease;
}
.gb-form .gb-submit:hover { opacity: 0.88; }
.gb-form .gb-submit:active { transform: translateY(1px); }
.gb-form .gb-submit:disabled {
  background: var(--zeo-border);
  color: var(--zeo-muted);
  cursor: not-allowed;
}
.gb-form .gb-error {
  font-size: 0.78rem;
  color: #C0392B;
  padding: 0.3rem 0;
}
:root[data-theme="dark"] .gb-form .gb-error,
:root[data-theme="blue"] .gb-form .gb-error { color: #E07A6B; }
.gb-form .gb-toast {
  font-size: 0.85rem;
  color: var(--zeo-accent);
  padding: 0.4rem 0.6rem;
  background: var(--accent-glow);
  border-radius: 6px;
}
@media (max-width: 600px) {
  .gb-form .gb-row { grid-template-columns: 1fr 1fr; }
  .gb-form .gb-counter, .gb-form .gb-submit { grid-column: span 1; }
}

/* ==========================================================================
   COSMIC LAUNCHER — 3-mode 무관 밤 고정
   ========================================================================== */
.gb-cosmos {
  position: relative;
  width: 100%;
  height: 720px;            /* PM #1: 560 → 720 */
  margin: 0 0 0.6rem;
  border: 2px solid var(--zeo-accent);
  overflow: hidden;
  perspective: 1200px;
  background-color: #05050a;
  background-image:
    radial-gradient(circle at 50% 40%, rgba(155, 122, 211, 0.25), transparent 55%),
    radial-gradient(circle at 50% 40%, rgba(107, 63, 160, 0.18), transparent 75%);
}
.gb-cosmos::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 40%;                 /* PM #4: 50% → 40% (위로) */
  width: 45px;              /* PM #6: 90 → 45 (절반) */
  height: 45px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(155, 122, 211, 0.55), transparent 70%);
  filter: blur(6px);        /* PM #6: 8 → 6 */
  pointer-events: none;
  z-index: 1;
}
.gb-cosmos-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gb-cosmos-stars i {
  position: absolute;
  display: block;
  width: 1px;
  height: 1px;
  background: #E8EEFF;
  border-radius: 50%;
  opacity: 0.7;
  animation: gb-twinkle 4s infinite ease-in-out;
}
.gb-cosmos-stars i.lg { width: 2px; height: 2px; opacity: 0.9; }
.gb-cosmos-stars i.xl { width: 3px; height: 3px; opacity: 1; }
.gb-cosmos-stars i.c-cool { background: #E8EEFF; }
.gb-cosmos-stars i.c-warm { background: #FFE89A; }
.gb-cosmos-stars i.c-red  { background: #FFC8B8; }
@keyframes gb-twinkle {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 1; }
}
.gb-cosmos-hud {
  position: absolute;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 3;
}
.gb-cosmos-hud.tl { top: 10px; left: 12px; }
.gb-cosmos-hud.tr { top: 10px; right: 12px; }
.gb-cosmos-hud.bl { bottom: 10px; left: 12px; }
.gb-cosmos-hud.br { bottom: 10px; right: 12px; }
.gb-cosmos-hud .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zeo-accent);
  box-shadow: 0 0 6px var(--zeo-accent);
  margin-right: 5px;
  vertical-align: middle;
  animation: gb-pulse 1.6s infinite ease-in-out;
}
@keyframes gb-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.2);  }
}

.gb-shot {
  position: absolute;
  left: 50%;
  top: 40%;                 /* PM #4: 50 → 40 (소실점 위 정합) */
  --sx: 0px;
  --sy: 0px;
  --dur: 8s;
  --rot: 0deg;              /* PM #3: 회전 변수 */
  --fsz: 1rem;              /* PM #2: font-size random 변수 */
  width: 260px;
  margin-left: -130px;
  font-family: inherit;
  font-size: var(--fsz);
  line-height: 1.45;
  color: #fff;
  text-align: center;
  pointer-events: none;
  will-change: transform, opacity, filter;
  z-index: 2;
  text-shadow:
    0 0 6px rgba(155, 122, 211, 0.6),
    0 0 14px rgba(107, 63, 160, 0.4);
}
.gb-shot .gb-shot-name {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: #FFD86E;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 6px rgba(255, 216, 110, 0.5);
}
.gb-shot .gb-shot-text {
  display: block;
  font-size: 1em;
  font-weight: 500;
}

/* gb-recede — PM #3: rotation 가속 추가 (0deg → 2.5× rot) */
@keyframes gb-recede {
  0% {
    transform:
      translate(-50%, -50%)
      translate(var(--sx), var(--sy))
      rotate(var(--rot))
      scale(1.4);
    opacity: 0;
    filter: blur(0.5px);
  }
  10% {
    transform:
      translate(-50%, -50%)
      translate(calc(var(--sx) * 0.92), calc(var(--sy) * 0.92))
      rotate(calc(var(--rot) * 1.15))
      scale(1.3);
    opacity: 1;
    filter: blur(0px);
  }
  70% {
    transform:
      translate(-50%, -50%)
      translate(calc(var(--sx) * 0.28), calc(var(--sy) * 0.28))
      rotate(calc(var(--rot) * 2.0))
      scale(0.5);
    opacity: 0.85;
    filter: blur(0px);
  }
  100% {
    transform:
      translate(-50%, -50%)
      translate(0, 0)
      rotate(calc(var(--rot) * 2.5))
      scale(0.04);
    opacity: 0;
    filter: blur(2px);
  }
}
.gb-shot.is-flying {
  animation: gb-recede var(--dur) cubic-bezier(.42, .0, .78, .6) forwards;
}
/* 효과 끄기 — 단순 fade in/out (transform 정적, 가운데 고정) */
@keyframes gb-fade-static {
  0%, 100% { opacity: 0; }
  15%, 85% { opacity: 0.92; }
}
.gb-shot.is-reduced {
  transform: translate(-50%, -50%);
  animation: gb-fade-static var(--dur) ease-in-out forwards;
}
.gb-shot.is-mine .gb-shot-name {
  color: #FFE89A;
  text-shadow: 0 0 10px rgba(255, 232, 154, 0.85);
}
.gb-shot.is-mine .gb-shot-text {
  color: #FFF2C9;
  text-shadow:
    0 0 8px rgba(255, 232, 154, 0.7),
    0 0 18px rgba(255, 216, 110, 0.45);
}

/* ==========================================================================
   LIST + PAGINATION
   ========================================================================== */
.gb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gb-list li {
  border-bottom: 1px solid var(--zeo-border);
  padding: 0.85rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: baseline;
}
.gb-list li:first-child { border-top: 1px solid var(--zeo-border); }
.gb-list .gb-row-name {
  font-weight: 600;
  color: var(--zeo-fg);
  font-size: 0.97rem;
}
.gb-list .gb-row-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--zeo-muted);
  margin-right: 0.35rem;
}
.gb-list .gb-row-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--zeo-muted);
  justify-self: end;
}
.gb-list .gb-row-content {
  grid-column: 1 / -1;
  color: var(--zeo-fg);
  font-size: 0.93rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.gb-empty {
  padding: 1.5rem 0;
  color: var(--zeo-muted);
  text-align: center;
  font-size: 0.9rem;
}

.gb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 1rem 0 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.gb-pager .page-numbers {
  font-family: inherit;
  font-size: inherit;
  color: var(--zeo-fg);
  background: transparent;
  border: 1px solid var(--zeo-border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  min-width: 2rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.gb-pager a.page-numbers:hover {
  color: var(--zeo-accent);
  border-color: var(--zeo-accent);
}
.gb-pager .page-numbers.current {
  color: #fff;
  background: var(--zeo-accent);
  border-color: var(--zeo-accent);
  cursor: default;
}
.gb-pager .page-numbers.dots {
  border: 0;
  padding: 0 0.2rem;
  color: var(--zeo-muted);
  user-select: none;
}
.gb-pager .gb-pager-meta {
  margin-left: 0.6rem;
  color: var(--zeo-muted);
  font-size: 0.78rem;
}

/* ==========================================================================
   CONTROL PANEL — 외장 v2 결 <details> 접힘, pbtn LED + nameplate cap
   ========================================================================== */
.gb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px solid var(--zeo-border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.gb-section-head > h2 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  font-size: 1.4rem;
  font-weight: 700;
}
.gb-prefs { position: relative; }
.gb-prefs > .gb-prefs-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.75rem 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--raise);
  color: var(--case-fg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 80ms ease, box-shadow 120ms ease;
  user-select: none;
}
.gb-prefs > .gb-prefs-summary::-webkit-details-marker { display: none; }
.gb-prefs > .gb-prefs-summary::marker { content: ''; }
.gb-prefs > .gb-prefs-summary:hover { transform: translateY(-1px); }
.gb-prefs[open] > .gb-prefs-summary {
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(1px);
}
.gb-prefs-led {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.gb-prefs[open] .gb-prefs-led {
  background: var(--zeo-accent);
  box-shadow:
    inset 0 1px 1px rgba(0, 0, 0, 0.3),
    0 0 6px var(--accent-glow);
}
.gb-prefs-cap {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--case-ink);
}

.gb-prefs-panel {
  margin-top: 0.6rem;
  padding: 0.85rem 0.95rem;
  background: var(--case-bg);
  border: 1px solid var(--case-line);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 0.7rem;
}
.gb-prefs-row {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
}
.gb-prefs-row-toggles {
  grid-template-columns: 1fr 1fr auto;
}
.gb-prefs-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--case-ink);
  text-transform: uppercase;
}
.gb-prefs-out {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--zeo-fg);
  min-width: 3rem;
  text-align: right;
}

/* slider — inset track + raise thumb */
.gb-prefs input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
.gb-prefs input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--inset-soft);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.gb-prefs input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--inset-soft);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.gb-prefs input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--raise);
  border: 1px solid var(--case-line);
  border-radius: 50%;
  margin-top: -5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.25);
}
.gb-prefs input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--raise);
  border: 1px solid var(--case-line);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.25);
}
.gb-prefs input[type="range"]:focus { outline: none; }
.gb-prefs input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 0 0 3px var(--accent-glow);
}

/* segmented buttons — pbtn 결 */
.gb-prefs-seg {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.gb-prefs-seg button {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--case-fg);
  background: var(--raise);
  border: 0;
  border-radius: 5px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 80ms ease, color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.gb-prefs-seg button:hover { transform: translateY(-1px); }
.gb-prefs-seg button.is-on {
  background: var(--zeo-accent);
  color: #fff;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.25),
    0 0 0 1px var(--accent-glow);
}

/* toggle with LED */
.gb-prefs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--case-fg);
  background: var(--raise);
  border: 0;
  border-radius: 5px;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.15);
}
.gb-prefs-toggle-led {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.gb-prefs-toggle.is-on .gb-prefs-toggle-led {
  background: var(--zeo-accent);
  box-shadow:
    inset 0 1px 1px rgba(0, 0, 0, 0.3),
    0 0 5px var(--accent-glow);
}
.gb-prefs-reset {
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--case-ink);
  background: transparent;
  border: 1px solid var(--case-line);
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.gb-prefs-reset:hover { color: var(--zeo-accent); border-color: var(--zeo-accent); }

@media (max-width: 600px) {
  .gb-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .gb-prefs-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .gb-prefs-row-toggles {
    grid-template-columns: 1fr 1fr;
  }
  .gb-prefs-out { text-align: left; }
}
