/* ═══════════════════════════════════════════════════════════════
   THIỆP TỐT NGHIỆP — dark terminal theme, glassmorphism edition
   black glass terminals · dark blue window headers · navy #032B91 base
   cream text #FFF8EC · accent #1488DB
   fonts: Space Mono (content) · Be Vietnam Pro (titles & headings)
   ═══════════════════════════════════════════════════════════════ */

/* ── tokens ─────────────────────────────────────────────────── */
:root {
  --bg: #020B2C;
  --bg-deep: #01061A;
  --bg-panel: #02123D;
  --text: #FFF8EC;
  --accent: #1488DB;
  --accent-soft: #4AA9E8;
  --str: #FFD285;      /* "string" gold */
  --comment: #7FA8E0;  /* muted blue comments */
  --kw: #4AA9E8;       /* keyword/function blue */
  --ok: #4ADE80;       /* success green */
  --line: rgba(20, 136, 219, 0.38);
  --glow: rgba(20, 136, 219, 0.35);

  /* glass surfaces */
  --glass-blur: 14px;                    /* tabs / inner panels */
  --glass-sat: 180%;                     /* frost saturation — keeps the blue alive behind the glass */
  --glass-black: rgba(3, 10, 26, 0.46);  /* terminal black glass — rain becomes soft bokeh behind it */
  --glass-panel: rgba(6, 14, 34, 0.40);  /* inner cards / rectangles — layered glass above the terminal body */
  --term-blur: 10px;                     /* terminals are properly frosted now, not just tinted */
  --term-tone: saturate(135%) brightness(0.62); /* smoked-glass tone behind the frost */
  --glass-border: rgba(255, 255, 255, 0.17);
  --glass-hi: rgba(255, 255, 255, 0.22);  /* top edge highlight */
  --glass-sheen: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(255, 255, 255, 0.05) 22%,
    rgba(255, 255, 255, 0.015) 46%,
    rgba(255, 255, 255, 0) 64%,
    rgba(255, 255, 255, 0.035) 100%
  );                                     /* diagonal specular sheen on every pane */
  --glass-rim: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  --glass-depth: inset 0 -24px 48px rgba(0, 0, 0, 0.16);
  --header-blue: rgba(3, 43, 145, 0.93);  /* dark blue window header */

  /* fonts */
  --font-body: 'Space Mono', 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --font-mono: 'Space Mono', 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --font-display: 'Be Vietnam Pro', system-ui, sans-serif;
}

/* shared glass recipe — mọi hình chữ nhật dùng chung */
.term-window,
#statusbar {
  background-color: var(--glass-black);
}
.session-card,
.cd-num,
.car-slide {
  background-color: var(--glass-panel);
}
.term-window,
.session-card,
.cd-num,
.car-slide,
.tab,
.keycap,
#statusbar {
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

/* ── base ────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 74px; /* status bar clearance */
  overflow-x: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--accent-soft); }

::selection { background: rgba(20, 136, 219, 0.55); color: var(--text); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #06309C; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 4px; }

.cmt { color: var(--comment); font-family: var(--font-mono); }
.prompt { color: var(--accent-soft); font-weight: 700; }
/* dấu $ mở đầu các lệnh — to hơn cho dễ thấy */
.letter-prompt .prompt,
.hero-line .prompt,
.rsvp-field .prompt,
.boot-line .prompt { font-size: 1.25em; }
.tok-str { color: var(--str); }
.tok-kw { color: var(--kw); }
.tok-num { color: var(--accent-soft); font-weight: 700; }

/* ── matrix rain canvas ──────────────────────────────────────── */
#rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── boot / no-js gating ─────────────────────────────────────── */
#intro { display: none; }
html.boot body { overflow: hidden; }
html.boot #card, html.boot #statusbar { display: none; }
html.boot #intro {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 42%),
    rgba(2, 17, 49, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}
#intro.done { opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0.6s; }

/* ── card layout ─────────────────────────────────────────────── */
#card {
  position: relative;
  z-index: 1;
  width: min(1440px, 94vw);
  margin: 0 auto;
  padding: 34px 0 90px;
  display: flex;
  flex-direction: column;
  gap: 64px; /* khoảng thở cho dây nối spine giữa các cửa sổ */
}

/* ── terminal windows ─────────────────────────────────────────── */
.term-window {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(var(--term-blur)) var(--term-tone);
  backdrop-filter: blur(var(--term-blur)) var(--term-tone);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    var(--glass-depth),
    0 0 22px rgba(20, 136, 219, 0.16),
    0 18px 48px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.term-window:hover {
  border-color: rgba(148, 197, 240, 0.42);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    var(--glass-depth),
    0 0 30px rgba(20, 136, 219, 0.24),
    0 18px 48px rgba(0, 0, 0, 0.45);
}

/* section glyph — sits at the right edge of the window header */
.win-icon {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1;
  color: rgba(148, 197, 240, 0.9);
  text-shadow: 0 0 12px var(--glow);
  user-select: none;
  pointer-events: none;
  animation: floaty 7s ease-in-out infinite alternate;
}
#hero .win-icon { color: rgba(255, 248, 236, 0.9); }
#schedule .win-icon { animation-delay: -2s; }
#gallery .win-icon { animation-delay: -4s; }
#music .win-icon { animation-delay: -1s; }
#letter .win-icon { animation-delay: -3s; }

.chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--header-blue);
  border-bottom: 1px solid rgba(20, 136, 219, 0.45);
  border-radius: 11px 11px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.dots { display: inline-flex; gap: 7px; }
.dots i {
  width: 11px; height: 11px; border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
}
.dots i:nth-child(1) { background: #FF5F56; }
.dots i:nth-child(2) { background: #FFBD2E; }
.dots i:nth-child(3) { background: #27C93F; }

.tabs { display: flex; gap: 6px; min-width: 0; }
.tab {
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(127, 168, 224, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: 6px 6px 0 0;
  background-color: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.tab.active {
  color: var(--accent-soft);
  background-color: rgba(20, 136, 219, 0.30);
  border-color: rgba(20, 136, 219, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 12px rgba(20, 136, 219, 0.18);
}

.term-body {
  position: relative;
  overflow: hidden;
  padding: 24px 28px;
}
/* CRT scanlines */
.term-body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0 1px,
    transparent 1px 3px
  );
}

/* section headers with line-number gutter */
.sec-header { display: flex; gap: 12px; align-items: baseline; margin-bottom: 18px; }
.sec-header .gutter {
  color: rgba(127, 168, 224, 0.4);
  user-select: none;
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 2ch;
  text-align: right;
}
.sec-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.sec-header h2:hover { animation: glitch 0.18s steps(2) 2; }

.sec-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  margin-bottom: 20px;
  color: var(--text);
}
.sec-title::before { content: "> "; color: var(--accent-soft); }

.sec-note {
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.5;
  white-space: pre-line;
  color: rgba(255, 248, 236, 0.9);
}
/* mỗi đoạn là một khối, cách nhau một khoảng nhỏ thay vì cả dòng trống */
.note-para { display: block; margin-top: 10px; }
.note-para.first { display: inline; margin-top: 0; }
/* đoạn giới thiệu là span trong <p> — đặt max-width + khoảng cách ở <p> cha */
p:has(> .sec-note) {
  max-width: 128ch;
  margin-bottom: 32px;
}

/* ── keycap buttons ──────────────────────────────────────────── */
.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.68em 1.35em;
  font-family: var(--font-mono);
  color: var(--text);
  background:
    var(--glass-sheen),
    linear-gradient(180deg, rgba(20, 136, 219, 0.42), rgba(6, 48, 156, 0.38));
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(120, 190, 240, 0.60);
  border-bottom-width: 4px;
  border-radius: 9px;
  box-shadow:
    0 6px 18px rgba(20, 136, 219, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.keycap:hover {
  filter: brightness(1.16);
  border-color: rgba(148, 197, 240, 0.75);
  box-shadow: 0 6px 24px rgba(20, 136, 219, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.keycap:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}
.keycap.rsvp {
  color: #D6FFE4;
  border-color: rgba(74, 222, 128, 0.65);
  background:
    var(--glass-sheen),
    linear-gradient(180deg, rgba(74, 222, 128, 0.36), rgba(11, 93, 51, 0.38));
  box-shadow:
    0 6px 18px rgba(74, 222, 128, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}
.keycap.rsvp:hover { box-shadow: 0 6px 24px rgba(74, 222, 128, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.24); }
.keycap:disabled,
.keycap:disabled:hover {
  opacity: 0.42;
  cursor: default;
  filter: none;
  transform: none;
  border-bottom-width: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ── intro boot ──────────────────────────────────────────────── */
.intro-window { width: min(640px, 96vw); }
.intro-window .term-body { min-height: 232px; }
#boot-lines { min-height: 150px; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); }
.boot-line { min-height: 1.55em; }
.boot-line.cmd .cmd-text { color: var(--text); }
.boot-line.out { color: var(--comment); }
.boot-line.ok { color: var(--ok); }
.boot-bar { color: var(--str); }
.boot-actions { margin-top: 20px; min-height: 58px; }
.run-key {
  font-size: 1.05rem;
  padding: 0.8em 1.7em;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.run-key.show { opacity: 1; transform: none; pointer-events: auto; }

/* ── hero ────────────────────────────────────────────────────── */
.hero-body { text-align: center; padding-top: 34px; }
.ascii-cap {
  font-family: var(--font-mono);
  font-size: clamp(8px, 2.4vw, 13px);
  line-height: 1.2;
  color: var(--accent-soft);
  text-shadow: 0 0 12px var(--glow);
  margin-bottom: 18px;
  user-select: none;
}
.hero-run-slot { min-height: 0; margin-bottom: 6px; }
.hero-run-slot .keycap { font-size: 0.95rem; }
.hero-line {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.8vw, 1.2rem);
  margin-bottom: 14px;
  min-height: 1.7em;
  overflow-wrap: break-word;
}
.hero-rest { opacity: 1; }
html.js .hero-rest { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
html.js .hero-rest.show { opacity: 1; transform: none; }
.big-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 6.2vw, 4.6rem);
  letter-spacing: 0.04em;
  text-shadow: 0 0 22px var(--glow), 0 0 60px rgba(20, 136, 219, 0.25);
  margin: 10px 0 8px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(12px, 2.5vw, 22px);
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
}
.hero-meta > span:empty { display: none; }
.hero-meta > span:not(:empty):has(~ span:not(:empty)) {
  padding-right: clamp(12px, 2.5vw, 22px);
  border-right: 1px solid var(--line);
}
.hero-hint { margin-top: 26px; font-size: 13px; }

.cursor {
  display: inline-block;
  width: 0.58em;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent-soft);
  box-shadow: 0 0 8px var(--glow);
  animation: blink 1.1s steps(1) infinite;
}

/* hero "lùi về phía sau" khi cuộn xuống — --zoom (0..1) do JS cập nhật.
   Dùng thuộc tính scale riêng để không đụng transform của reveal/tilt;
   zoom-live tắt transition opacity/scale để bám sát con cuộn. */
#hero.zoom-live {
  scale: calc(1 - 0.12 * var(--zoom, 0));
  opacity: calc(1 - 0.45 * var(--zoom, 0));
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── schedule / countdown ────────────────────────────────────── */
.countdown { margin-bottom: 32px; }
.cd-label { color: var(--comment); margin-bottom: 10px; font-size: 0.92rem; }
.cd-grid { display: flex; align-items: center; gap: clamp(8px, 2.5vw, 18px); flex-wrap: wrap; }
.cd-unit { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cd-num {
  display: inline-block;
  min-width: 2.6em;
  padding: 8px 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  font-weight: 700;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    inset 0 -14px 24px rgba(0, 0, 0, 0.14);
  text-shadow: 0 0 14px var(--glow);
}
.cd-num.flip { animation: cd-flip 0.35s ease; }
.cd-cap { font-size: 12px; color: var(--comment); }
.cd-sep { font-family: var(--font-mono); font-size: clamp(1.3rem, 4vw, 2rem); color: rgba(127, 168, 224, 0.55); }
.cd-done { font-size: clamp(1.1rem, 3.4vw, 1.45rem); color: var(--ok); text-shadow: 0 0 14px rgba(74, 222, 128, 0.4); }

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}
.session-card {
  position: relative;
  display: block;
  text-align: left;
  color: inherit;
  line-height: 1.45;
  cursor: pointer;
  background-color: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 18px 20px;
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 10px 26px rgba(0, 0, 0, 0.24);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease;
}
.session-card:hover {
  border-color: rgba(148, 197, 240, 0.48);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 0 20px rgba(20, 136, 219, 0.22),
    0 10px 26px rgba(0, 0, 0, 0.24);
}
.session-card.past { opacity: 0.55; cursor: default; }
.session-card.past:hover { opacity: 0.8; }

.session-card.selected {
  border-color: rgba(74, 222, 128, 0.62);
  background-color: rgba(9, 34, 27, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 0 22px rgba(74, 222, 128, 0.20),
    0 10px 26px rgba(0, 0, 0, 0.24);
}
.session-card.selected:hover {
  border-color: rgba(74, 222, 128, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 0 28px rgba(74, 222, 128, 0.3),
    0 10px 26px rgba(0, 0, 0, 0.24);
}
.session-card:focus-within {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.s-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.s-pick {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(127, 168, 224, 0.55);
  user-select: none;
}
.session-card.selected .s-pick {
  color: var(--ok);
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.s-day { display: block; color: var(--accent-soft); font-size: 0.85rem; }
.s-date {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 1px 0 3px;
}
.s-time { display: block; color: var(--str); }
.s-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--comment);
  border: 1px dashed rgba(127, 168, 224, 0.5);
  border-radius: 999px;
}

/* ── RSVP ────────────────────────────────────────────────────── */
.rsvp-wrap { margin-top: 0; }
.rsvp-guide { font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.5; margin-bottom: 18px; }
.rsvp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rsvp-field {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 0.55em 0.95em;
  font-family: var(--font-mono);
  color: var(--comment);
  background-color: var(--glass-panel);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-rim);
}
.rsvp-flag { color: var(--str); font-size: 0.9rem; }
/* [hidden] phải thắng display:flex/inline-flex của các class trên */
.rsvp-field[hidden],
.rsvp-row[hidden] { display: none; }
.rsvp-input {
  flex: 1;
  min-width: 8ch;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  caret-color: var(--accent-soft);
}
.rsvp-input::placeholder { color: rgba(127, 168, 224, 0.45); }
.rsvp-status {
  min-height: 1.7em;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--comment);
}
.rsvp-status.ok { color: var(--ok); text-shadow: 0 0 12px rgba(74, 222, 128, 0.28); }
.rsvp-status.warn { color: var(--str); }

/* ── bức tường lời chúc — form ──────────────────────────────── */
.wall-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin: 20px 0 4px;
}
.wall-msg-field { align-items: flex-start; }
.wall-msg-field .rsvp-flag { padding-top: 0.1em; }
.wall-textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  line-height: 1.55;
}
.wall-local-hint { margin-top: 6px; font-size: 0.85rem; }

/* ── admin export (chỉ mở khi ?admin=1) ──────────────────────── */
.admin-hint { font-family: var(--font-mono); font-size: 0.85rem; margin-bottom: 16px; }
.admin-empty { color: var(--comment); }
.admin-scroll { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(20, 136, 219, 0.18);
}
.admin-table th { color: var(--comment); font-weight: 500; }
.admin-table td { color: var(--text); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-key { color: var(--str); }
.admin-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-soft);
  overflow-wrap: anywhere;
}
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ── gallery — carousel ───────────────────────────────────────── */
.gallery-hint { font-size: 0.85rem; line-height: 1.5; margin-bottom: 22px; }

.car-stage { display: flex; align-items: center; gap: 12px; }
.car-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  height: clamp(440px, 74vh, 760px);
  border-radius: 9px;
}
.car-arrow {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  color: var(--text);
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 14px 11px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-rim);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.car-arrow:hover {
  border-color: rgba(148, 197, 240, 0.48);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-rim), 0 0 18px rgba(20, 136, 219, 0.28);
}
.car-arrow:active { transform: translateY(1px); }

/* ảnh giữa to, hai bên nhỏ dần và trượt ra sau (--off: -2..2) */
.car-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(94%, 620px);
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  overflow: hidden;
  background-color: var(--glass-panel);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 10px 26px rgba(0, 0, 0, 0.24);
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--off, 0) * 78%))
    scale(calc(1 - 0.3 * var(--abs, 0)));
  opacity: calc(1 - 0.4 * var(--abs, 0));
  filter: brightness(calc(1 - 0.18 * var(--abs, 0)));
  pointer-events: none;
  transition:
    transform 0.6s cubic-bezier(0.22, 0.9, 0.28, 1),
    opacity 0.6s ease,
    filter 0.6s ease,
    visibility 0s linear 0.6s;
}
.car-slide.is-active {
  pointer-events: auto;
  border-color: rgba(148, 197, 240, 0.48);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    inset 0 -18px 32px rgba(0, 0, 0, 0.14),
    0 0 24px rgba(20, 136, 219, 0.30),
    0 10px 26px rgba(0, 0, 0, 0.24);
}
.car-slide.far {
  visibility: hidden;
  transition:
    transform 0.6s cubic-bezier(0.22, 0.9, 0.28, 1),
    opacity 0.6s ease,
    filter 0.6s ease,
    visibility 0s 0s;
}
.car-slide figcaption {
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--comment);
  border-top: 1px solid rgba(20, 136, 219, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* placeholder / missing-image slot */
.car-slide.placeholder .shot-frame, .car-slide.missing .shot-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(127, 168, 224, 0.4);
  margin: 10px;
  aspect-ratio: auto;
  min-height: 240px;
  background: transparent;
}
.car-slide.missing .shot-frame img { display: none; }

/* chấm chọn ảnh */
.car-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
}
.car-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid rgba(127, 168, 224, 0.55);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.car-dot:hover {
  border-color: var(--accent-soft);
  transform: scale(1.2);
}
.car-dot.active {
  background: var(--str);
  border-color: var(--str);
}
.shot-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg-deep);
}
.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* tên file chỉ hiện trong ô chờ ảnh — ẩn ở ảnh thường để không làm khung cao hơn tỉ lệ */
.car-slide .shot-alt { display: none; }
.car-slide.placeholder .shot-alt, .car-slide.missing .shot-alt { display: block; }
/* hiệu ứng rgb-split chạy trên lớp phủ trong suốt — ảnh gốc không bị
   filter/transform nên không bao giờ mờ */
.car-slide.is-active:hover .shot-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: rgb-split 0.35s steps(3) infinite alternate;
}
.shot-alt { color: rgba(127, 168, 224, 0.65); font-size: 13px; }

/* ── bức tường lời chúc — carousel thẻ lời chúc ──────────────── */
#wall .car-viewport { height: clamp(280px, 46vh, 440px); }
.car-dots[hidden] { display: none; }
.car-slide.wish-card {
  width: min(94%, 430px);
  min-height: 220px;
  max-height: calc(100% - 24px);
  justify-content: center;
}
.wish-text {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 22px 22px 14px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
}
.wish-card.empty .wish-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--comment);
}
.wish-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--comment);
  border-top: 1px solid rgba(20, 136, 219, 0.18);
  white-space: nowrap;
}
.wish-from {
  color: var(--str);
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wish-time { flex: 0 0 auto; }
.wish-idx { margin-left: auto; flex: 0 0 auto; opacity: 0.8; }

/* ── music ──────────────────────────────────────────────────── */
/* --pulse (0..1) do AnalyserNode cập nhật mỗi frame khi nhạc đang phát —
   viền cửa sổ "thở" theo nhịp cùng với đĩa */
#music {
  --pulse: 0;
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    var(--glass-rim),
    var(--glass-depth),
    0 0 calc(22px + 36px * var(--pulse)) rgba(20, 136, 219, calc(0.16 + 0.3 * var(--pulse))),
    0 18px 48px rgba(0, 0, 0, 0.45);
}
.music-stage {
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 46px);
  flex-wrap: wrap;
  transition: opacity 0.4s ease;
}
#music.no-music .music-stage { opacity: 0.3; pointer-events: none; }

.disc-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.disc {
  position: relative;
  width: clamp(190px, 34vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 50%, var(--bg-panel) 0 17%, transparent 17.5%),
    repeating-radial-gradient(circle at 50% 50%, #041C66 0 3px, #062B8C 3px 5px, #041C66 5px 8px);
  box-shadow:
    0 0 calc(14px + 26px * var(--pulse)) rgba(20, 136, 219, calc(0.28 + 0.4 * var(--pulse))),
    0 0 0 1px rgba(20, 136, 219, 0.4),
    inset 0 0 34px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.18s linear;
}
.disc::before {
  content: "";
  position: absolute;
  top: 11%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--str);
  box-shadow: 0 0 6px rgba(255, 210, 133, 0.8);
}
.disc::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(1.4em, 5vw, 2em);
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), #032B91);
  border: 2px solid rgba(255, 248, 236, 0.28);
}
/* số thứ tự bài hát nằm giữa đĩa */
.disc-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.disc.spinning { animation: spin 3.2s linear infinite; }
.disc-hint { font-size: 12px; text-align: center; }

/* phổ âm ASCII chạy dưới đĩa — chỉ hiện khi nhạc đang phát */
.spectrum { display: none; }
.spectrum.live { display: flex; justify-content: center; gap: 3px; min-height: 1.15em; }
.spectrum.live span {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  color: var(--accent-soft);
  text-shadow: 0 0 6px var(--glow);
  transition: opacity 0.08s linear;
}

.music-panel { flex: 1; min-width: min(300px, 100%); }
.now-playing .np-title { color: var(--str); }
.np-note { font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.progress-line {
  font-family: var(--font-mono);
  font-size: 15px;
  margin: 14px 0 2px;
  user-select: none;
  white-space: nowrap;
  cursor: pointer;
}
.progress-line:hover #progress-dot,
.progress-line.dragging #progress-dot {
  color: var(--accent-soft);
  text-shadow: 0 0 8px var(--glow);
}
.progress-line:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
#progress-fill { color: var(--accent-soft); text-shadow: 0 0 8px var(--glow); }
#progress-dot { color: var(--text); }
#progress-rest { color: rgba(127, 168, 224, 0.45); }
.time { font-family: var(--font-mono); color: var(--comment); font-size: 13px; }
.controls { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* nút nhỏ dạng "flag" cho shuffle / repeat / mute */
.keycap.small { padding: 0.45em 0.85em; font-size: 13px; border-bottom-width: 3px; }
.keycap.toggle.on {
  color: var(--str);
  border-color: rgba(255, 210, 133, 0.6);
  background:
    var(--glass-sheen),
    linear-gradient(180deg, rgba(255, 210, 133, 0.30), rgba(122, 82, 22, 0.30));
  box-shadow:
    0 0 16px rgba(255, 210, 133, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

/* âm lượng ASCII: vol [████░░] — kéo được */
.vol-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.vol-slider {
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.vol-slider:hover, .vol-slider.dragging { background: rgba(20, 136, 219, 0.1); }
.vol-slider:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.vol-ascii { font-family: var(--font-mono); letter-spacing: 1px; color: var(--text); white-space: nowrap; }
.vol-pct { font-family: var(--font-mono); color: var(--comment); font-size: 12px; min-width: 4ch; }

.keys-hint { font-size: 12px; margin-top: 12px; }

.tracklist {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: rgba(255, 248, 236, 0.75);
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  overflow: hidden;
}
.track:hover { background: rgba(20, 136, 219, 0.1); color: var(--text); }
.track.active {
  border-left-color: var(--accent);
  background: rgba(20, 136, 219, 0.14);
  color: var(--text);
}
.t-idx { font-family: var(--font-mono); color: rgba(127, 168, 224, 0.6); width: 2.6ch; flex: none; }
.t-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-dur { font-family: var(--font-mono); font-size: 12px; color: var(--comment); flex: none; }

/* cột equalizer nhỏ thay cho số thứ tự ở bài đang phát */
.t-eq { display: none; align-items: flex-end; gap: 2px; height: 12px; width: 2.6ch; flex: none; }
.t-eq i {
  width: 3px;
  border-radius: 1px;
  background: var(--accent-soft);
  box-shadow: 0 0 4px var(--glow);
  animation: eq-b 0.9s ease-in-out infinite;
}
.t-eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: 0.15s; }
.t-eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: 0.3s; }
.track.active .t-idx { display: none; }
.track.active .t-eq { display: inline-flex; }
.tracklist.paused .track.active .t-eq i { animation-play-state: paused; }

/* vạch tiến độ mỏng dưới bài đang phát */
.t-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 6px var(--glow);
}
@keyframes eq-b { 0%, 100% { height: 3px; } 50% { height: 11px; } }

#music.no-music .vol-row { opacity: 0.4; pointer-events: none; }

.music-empty { text-align: center; padding: 10px 0 4px; }
.music-empty p:first-child { font-size: 1.05rem; }

/* ── letter ──────────────────────────────────────────────────── */
.letter-prompt { font-family: var(--font-mono); margin-bottom: 20px; }
.letter { max-width: 128ch; }
.salutation { font-size: 1.1rem; margin-bottom: 12px; }
.letter-text {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.6;
  white-space: pre-line;
}
.signature { margin-top: 30px; text-align: right; }

/* ── status bar ─────────────────────────────────────────────── */
#statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background:
    var(--glass-sheen),
    linear-gradient(180deg, rgba(6, 12, 28, 0.86), rgba(3, 6, 14, 0.92));
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  font-family: var(--font-mono);
  font-size: 12px;
}
.sb-progress { height: 3px; background: rgba(20, 136, 219, 0.14); }
#sb-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 8px var(--glow);
}
.sb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  white-space: nowrap;
  overflow: hidden;
}
.sb-item { color: rgba(127, 168, 224, 0.85); }
.sb-item:first-child { color: var(--text); }
.sb-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 6px var(--glow);
  vertical-align: baseline;
}
.sb-right { margin-left: auto; color: var(--str); }

/* tên "file" của cửa sổ đang xem — đổi qua một bước fade */
#sb-file {
  color: var(--accent-soft);
  transition: opacity 0.16s ease;
}
#sb-file.swap { opacity: 0; }

/* ── particles: confetti / trail / ripple ─────────────────────── */
.confetti-bit {
  position: fixed;
  top: -5vh;
  z-index: 150;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: var(--fs, 16px);
  font-weight: 700;
  animation: confetti-fall var(--dur, 3s) ease-in var(--delay, 0s) forwards;
}
.trail-bit {
  position: fixed;
  z-index: 160;
  pointer-events: none;
  font-family: var(--font-mono);
  color: rgba(255, 248, 236, 0.85);
  font-size: 11px;
  animation: trail 0.85s ease-out forwards;
}
.ripple-bit {
  position: fixed;
  z-index: 160;
  pointer-events: none;
  font-family: var(--font-mono);
  color: rgba(74, 169, 232, 0.9);
  font-size: 12px;
  font-weight: 700;
  animation: ripple 0.72s ease-out forwards;
}

/* ── spine: dây nối phát sáng giữa các cửa sổ ─────────────────── */
#spine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
#spine .sp-base {
  fill: none;
  stroke: rgba(20, 136, 219, 0.20);
  stroke-width: 2;
}
#spine .sp-glow {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--glow)) drop-shadow(0 0 14px rgba(20, 136, 219, 0.45));
}
/* gạch "dữ liệu" chạy trên đoạn đã sáng — thuần CSS, không cần rAF */
#spine .sp-flow {
  fill: none;
  stroke: rgba(255, 248, 236, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 3 12;
  opacity: 0;
}
#spine .sp-flow.on {
  opacity: 0.85;
  animation: sp-flow 1.1s linear infinite;
}
#spine .sp-node {
  fill: var(--bg-panel);
  stroke: rgba(74, 169, 232, 0.55);
  stroke-width: 1.5;
  transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}
#spine .sp-node.lit {
  fill: var(--str);
  stroke: var(--str);
  filter: drop-shadow(0 0 7px rgba(255, 210, 133, 0.75));
}
@keyframes sp-flow { to { stroke-dashoffset: -15; } }

/* ── scroll reveal ───────────────────────────────────────────── */
html.js .reveal { opacity: 0; transform: translateY(36px); scale: 0.97; }
html.js .reveal.revealed {
  opacity: 1;
  transform: none;
  scale: 1;
  /* bao gồm cả transition hover của từng thành phần — transition là
     shorthand, thiếu thuộc tính nào thì thuộc tính đó mất chuyển động */
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    scale 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
html.js #sessions .reveal { transition-delay: calc(var(--i, 0) * 90ms); }

/* ── gõ lệnh trong cửa sổ rồi mới hiện nội dung ──────────────
   (.content-in do JS thêm sau khi gõ xong các dòng lệnh;
   intro-window nằm ngoài #card nên không bị ảnh hưởng) */
html.js #card .term-window:not(.content-in) .term-body > *:not(.sec-header):not(.letter-prompt) {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
html.js #card .term-window.content-in .term-body > *:not(.sec-header):not(.letter-prompt) {
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--ci, 0) * 70ms);
}

/* ── keyframes ────────────────────────────────────────────────── */
@keyframes blink { 50% { opacity: 0; } }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-8px); } }

@keyframes cd-flip {
  0% { transform: rotateX(80deg); opacity: 0.25; color: var(--accent-soft); }
  100% { transform: rotateX(0); }
}

@keyframes glitch {
  0% { text-shadow: 2px 0 rgba(255, 80, 120, 0.9), -2px 0 rgba(0, 229, 255, 0.9); transform: translate(2px, -1px) skewX(3deg); }
  50% { text-shadow: -3px 0 rgba(255, 80, 120, 0.9), 3px 0 rgba(0, 229, 255, 0.9); transform: translate(-2px, 1px) skewX(-3deg); }
  100% { text-shadow: none; transform: none; }
}

/* bản glitch "mạnh" cho tiêu đề lớn — RGB split rộng, xé lát bằng clip-path,
   rung skew + nhấp nháy opacity; đơn vị em để scale theo cỡ chữ */
@keyframes glitch-strong {
  0% {
    text-shadow: 0.05em 0 rgba(255, 80, 120, 0.95), -0.05em 0 rgba(0, 229, 255, 0.95);
    transform: translate(0.04em, -0.02em) skewX(5deg);
    clip-path: inset(0 0 0 0);
  }
  15% {
    text-shadow: -0.06em 0 rgba(255, 80, 120, 0.95), 0.06em 0 rgba(0, 229, 255, 0.95);
    transform: translate(-0.05em, 0.02em) skewX(-7deg);
    clip-path: inset(18% 0 52% 0);
  }
  30% {
    text-shadow: 0.07em 0 rgba(255, 80, 120, 0.95), -0.07em 0 rgba(0, 229, 255, 0.95);
    transform: translate(0.05em, 0) skewX(6deg);
    clip-path: inset(0 0 0 0);
  }
  45% {
    text-shadow: -0.04em 0.02em rgba(255, 80, 120, 0.95), 0.04em -0.02em rgba(0, 229, 255, 0.95);
    transform: translate(-0.03em, -0.02em) skewX(-4deg);
    clip-path: inset(52% 0 14% 0);
  }
  60% {
    text-shadow: 0.06em 0 rgba(255, 80, 120, 0.95), -0.06em 0 rgba(0, 229, 255, 0.95);
    transform: translate(0.04em, 0.02em) skewX(5deg);
    clip-path: inset(0 0 0 0);
    opacity: 0.88;
  }
  75% {
    text-shadow: -0.07em 0 rgba(255, 80, 120, 0.95), 0.07em 0 rgba(0, 229, 255, 0.95);
    transform: translate(-0.05em, 0) skewX(-6deg);
    clip-path: inset(28% 0 42% 0);
  }
  90% {
    text-shadow: 0.04em 0 rgba(255, 80, 120, 0.95), -0.04em 0 rgba(0, 229, 255, 0.95);
    transform: translate(0.02em, 0.01em) skewX(3deg);
    clip-path: inset(0 0 0 0);
    opacity: 0.94;
  }
  100% {
    text-shadow: none;
    transform: none;
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}
.big-title:hover,
.big-title.glitching { animation: glitch-strong 0.5s steps(1) both; }

@keyframes rgb-split {
  0% {
    transform: translateX(1px);
    box-shadow: inset 2px 0 rgba(255, 0, 80, 0.55), inset -2px 0 rgba(0, 229, 255, 0.55);
  }
  100% {
    transform: translateX(-1px);
    box-shadow: inset -3px 0 rgba(255, 0, 80, 0.55), inset 3px 0 rgba(0, 229, 255, 0.55);
  }
}

@keyframes confetti-fall {
  from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  to { transform: translate(var(--dx, 0px), 112vh) rotate(var(--rot, 360deg)); opacity: 0.55; }
}

@keyframes trail {
  from { opacity: 0.9; transform: translate(-50%, -50%); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -320%); }
}

@keyframes ripple {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to { opacity: 0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))); }
}

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  .term-body { padding: 18px 14px; }
  #card { gap: 44px; }
  #spine .sp-base, #spine .sp-glow, #spine .sp-flow { stroke-width: 1.5; }
  .win-icon { font-size: 22px; }
  .sb-hide-m { display: none; }
  .sb-row { gap: 10px; }
  .music-stage { flex-direction: column; align-items: stretch; }
  .disc-wrap { align-items: center; }
  .music-panel { min-width: 100%; }
  .spectrum.live span { font-size: 13px; }
  .controls { gap: 8px; }
  .car-stage { gap: 8px; }
  .car-arrow { padding: 11px 8px; font-size: 13px; }
  .car-slide { width: min(98%, 620px); }
  .letter-text { font-size: 0.98rem; }
  .signature { text-align: left; }
  .rsvp-field { min-width: 100%; }
  .rsvp-row .keycap { width: 100%; }
  .wall-form .keycap { width: 100%; }
  .car-slide.wish-card { width: min(98%, 430px); }
}

/* ── reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor, #rain-canvas { display: none !important; }
  .win-icon { animation: none !important; }
  .disc.spinning { animation: none !important; }
  .spectrum { display: none !important; }
  html.js .reveal, html.js .hero-rest { opacity: 1; transform: none; scale: 1; }
  #hero.zoom-live { scale: none; opacity: 1; }
  html.js #card .term-window:not(.content-in) .term-body > * {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}
