/* =====================================================================
   Trang xác nhận có mặt cựu học sinh – THPT Trần Nguyên Hãn
   Cùng ngôn ngữ thiết kế với bộ nhận diện Đại lễ 50 năm:
   navy + đỏ + vàng kim/cam + ảnh trường + card trắng.
   Mobile-first · không framework · không thư viện animation
   ===================================================================== */
:root {
  /* Màu lấy từ ảnh thiết kế Đại lễ & logo 50 năm */
  --navy-dark: #001844;
  --navy: #04204c;
  --navy-2: #0a2f6e;
  --royal-blue: #1f56b8;
  --royal-deep: #013e9b;
  --anniversary-red: #ce1513;
  --anniversary-orange: #f88e30;
  --orange-2: #fe9a3c;
  --anniversary-gold: #f5c04a;
  --gold-light: #ffe3a3;
  --cream: #fff6e3;
  --white: #fff;
  --text-dark: #0d1b33;
  --text-muted: #5a6780;
  --line: #dfe6f1;
  --field-bg: #f7f9fc;
  --field-line: #c9d6ea;
  --success: #1f56b8;

  --radius-card: 20px;
  --radius-panel: 26px;
  --radius-btn: 14px;
  --shadow-card: 0 26px 60px rgba(0, 16, 50, .34), 0 3px 10px rgba(0, 16, 50, .16);
  --grad-primary: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-2) 100%);
  --grad-orange: linear-gradient(135deg, #ffb44d 0%, var(--anniversary-orange) 100%);
  --topbar-h: 46px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--navy-dark);
  overflow-x: hidden;
}
img { max-width: 100%; }
picture { display: contents; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }

/* ============================ HEADER ============================ */
.topbar {
  position: relative; z-index: 5;
  background: linear-gradient(90deg, var(--navy-dark) 0%, #02275f 62%, #0b3a78 100%);
  color: var(--white);
}
.topbar::before, .topbar::after {                  /* đường vàng kim mảnh */
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, rgba(245, 192, 74, 0) 0%, #ffd978 18%, var(--anniversary-gold) 55%, #ffe8a8 82%, rgba(245, 192, 74, .2) 100%);
}
.topbar::before { top: 0; }
.topbar::after { bottom: 0; opacity: .55; height: 1px; }
.topbar-in { max-width: 1320px; margin: 0 auto; height: var(--topbar-h); padding: 0 14px; display: flex; align-items: center; gap: 9px; }
.tb-school { flex: 0 0 auto; display: flex; }
.tb-school-logo {                       /* logo trường nhỏ, được "thắp sáng" trên nền navy */
  display: block; width: 28px; height: 28px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 227, 163, .9), 0 0 12px 3px rgba(255, 214, 140, .65);
  filter: brightness(1.06) saturate(1.1);
}
.tb-city-abbr { display: none; }
.tb-text { min-width: 0; margin: 0; font-size: clamp(10.5px, 3.1vw, 13px); font-weight: 800; letter-spacing: .018em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-full { display: none; }
.tb-50 { display: none; margin-left: auto; }
.hero-fx, .wv-shine { display: none; }

/* ============================ HERO ============================ */
.hero { position: relative; flex: 1; isolation: isolate; overflow: hidden; background-color: var(--navy); }
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background-color: var(--navy);
  background-size: cover;
  background-position: 30% 22%;       /* điện thoại: giữ khu nhà A + sân trường */
  background-repeat: no-repeat;
}
.hero-bg::after {                     /* lớp phủ navy + ánh vàng rất nhẹ */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 92% 0%, rgba(255, 196, 92, .30), transparent 70%),
    linear-gradient(180deg, rgba(0, 24, 68, .80) 0%, rgba(2, 32, 80, .70) 30%, rgba(1, 26, 70, .86) 62%, rgba(0, 24, 68, .96) 100%);
}
.hero-deco { display: none; }
.hero-in {
  position: relative; z-index: 1;
  max-width: 1320px; margin: 0 auto;
  padding: 14px 14px 76px;              /* chừa chỗ cho dải sóng */
  display: flex; flex-direction: column; gap: 16px;
}

/* ---------- Giới thiệu (mobile: chữ trực tiếp trên nền) ---------- */
.intro { text-align: center; color: var(--white); }
.glow-logo { position: relative; display: inline-block; }
.intro .intro-school, .side .side-50, .intro .pill, .title .dbr { display: none; }
.glow-logo::before {                  /* quầng sáng kem/vàng giúp logo nổi trên nền navy */
  content: ""; position: absolute; inset: -18% -14%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 249, 234, .97) 0%, rgba(255, 240, 205, .85) 45%, rgba(255, 214, 140, .35) 72%, rgba(255, 214, 140, 0) 100%);
}
.intro-50 { margin: 6px auto 8px; }
.intro-50 .logo-50 { display: block; width: clamp(118px, 36vw, 150px); height: auto; }
.kicker {
  margin: 0 0 6px; color: var(--orange-2); font-weight: 800; font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase;
}
.kicker-year { color: var(--gold-light); margin-left: .35em; white-space: nowrap; }
.title {
  margin: 0 auto; max-width: 21ch;
  font-size: clamp(25px, 7.4vw, 30px); line-height: 1.3; font-weight: 900; letter-spacing: .01em;
  text-transform: uppercase; text-wrap: balance; text-shadow: 0 2px 14px rgba(0, 10, 35, .45);
}
.title em { font-style: normal; color: var(--gold-light); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title em {
    background: linear-gradient(180deg, #fff1c9 0%, #ffd779 55%, #f6b845 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: none; filter: drop-shadow(0 2px 10px rgba(0, 10, 35, .45));
  }
}
.divider {
  display: block; width: 72px; height: 3px; margin: 12px auto 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--anniversary-orange), #ffc164);
}
.welcome { margin: 0; font-size: 16.5px; font-weight: 600; color: var(--cream); line-height: 1.45; }
.pill {
  margin: 20px 0 0; padding: 8px 18px; border-radius: 999px; width: fit-content;
  background: var(--grad-orange); color: var(--navy-dark); font-weight: 900; font-size: 15px; letter-spacing: .06em;
  box-shadow: 0 6px 18px rgba(248, 142, 48, .35);
}

/* ============================ THẺ XÁC NHẬN CÓ MẶT ============================ */
.ck {
  scroll-margin-top: 10px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid #f3d9a6;
  border-left: 6px solid var(--anniversary-orange);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px 16px 18px;
}
.ck-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ck-icon {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--grad-orange); box-shadow: 0 6px 16px rgba(248, 142, 48, .38), inset 0 -3px 6px rgba(160, 70, 0, .18);
  display: grid; place-items: center;
}
.ck-icon svg, .round-ico svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ck-title { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 900; color: var(--navy-dark); letter-spacing: .02em; }
.ck-sub { margin: 2px 0 0; font-size: 14px; color: var(--text-muted); line-height: 1.35; }

/* ---------- Ô tìm kiếm ---------- */
.search-box { position: relative; }
.search-ico { position: absolute; z-index: 1; left: 17px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); fill: none; stroke: var(--royal-blue); stroke-width: 2.6; stroke-linecap: round; pointer-events: none; }
#q {
  width: 100%; height: 62px; padding: 0 52px 0 52px;
  font-size: 17.5px; font-weight: 600; color: var(--text-dark);
  border: 2px solid #8eaee3; border-radius: 16px; background: #fff;
  box-shadow: 0 10px 24px rgba(1, 62, 155, .16), 0 0 0 5px rgba(248, 142, 48, .12);
  outline: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
#q::placeholder { color: #5d6a82; font-weight: 500; text-overflow: ellipsis; }
#q:focus { border-color: var(--royal-blue); box-shadow: 0 10px 26px rgba(1, 62, 155, .20), 0 0 0 5px rgba(31, 86, 184, .20); }
#q::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: #e8eef9; color: var(--navy-2);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.status { min-height: 22px; margin: 10px 2px 4px; color: var(--text-muted); font-size: 14.5px; text-align: center; }
.status.loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--royal-blue); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kết quả ---------- */
.results { display: grid; gap: 10px; margin-top: 8px; }
.res {
  background: #fff; border: 1px solid #e6ebf3; border-left: 5px solid var(--anniversary-orange);
  border-radius: 14px; padding: 13px 14px 14px; box-shadow: 0 2px 8px rgba(0, 24, 68, .06);
}
.res-name { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 900; color: var(--navy-dark); text-transform: uppercase; word-break: break-word; }
.res-meta { margin: 3px 0 0; font-size: 16px; font-weight: 700; color: var(--royal-deep); }
.res-sub { margin: 2px 0 0; font-size: 15px; color: var(--text-muted); }
.res-sub b { color: var(--text-dark); font-weight: 600; }
.res .btn { margin-top: 12px; }
.badge-present {
  display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 4px 12px; border-radius: 999px;
  background: #e6f0ff; color: var(--royal-deep); font-weight: 800; font-size: 14px;
}
.more-hint { text-align: center; color: var(--text-muted); font-size: 14.5px; margin: 4px 0 0; }
.notfound { margin-top: 16px; padding: 14px 12px 12px; text-align: center; border-top: 1px dashed #d7deea; }
.notfound p { margin: 0 0 10px; font-weight: 700; color: var(--text-dark); font-size: 16px; }

/* ============================ NÚT ============================ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 12px 16px; border-radius: var(--radius-btn); border: 2px solid transparent;
  font-weight: 900; font-size: 16.5px; letter-spacing: .03em; text-decoration: none; cursor: pointer; text-align: center;
  transition: filter .15s, background-color .15s, transform .05s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .72; cursor: wait; }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 10px 22px rgba(10, 47, 110, .30); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-xl { min-height: 62px; font-size: clamp(16px, 4.5vw, 18.5px); }
.btn-outline { background: #fff; color: #b3570a; border-color: var(--anniversary-orange); }
.btn-outline:hover { background: #fff5ea; }
.btn-ghost { background: transparent; color: var(--text-muted); font-weight: 800; margin-top: 8px; min-height: 52px; }
.btn-ghost:hover { color: var(--text-dark); background: #eef2f8; }
.btn .spinner { width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.link-btn { display: block; margin: 14px auto 0; padding: 10px 16px; min-height: 48px; background: none; border: 0; color: var(--royal-deep); font-weight: 800; text-decoration: underline; cursor: pointer; font-size: 16px; }

/* ============================ XÁC NHẬN / THÀNH CÔNG ============================ */
.view.center { text-align: center; }
.round-ico { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; }
.round-gold { background: var(--grad-orange); box-shadow: 0 8px 20px rgba(248, 142, 48, .35); }
.round-blue { background: var(--grad-primary); box-shadow: 0 10px 24px rgba(10, 47, 110, .35), 0 0 0 6px #e6efff; }
.c-name { margin: 0; font-size: clamp(22px, 6.4vw, 27px); line-height: 1.2; font-weight: 900; color: var(--navy-dark); text-transform: uppercase; word-break: break-word; }
.c-meta { margin: 6px 0 14px; font-size: 17px; font-weight: 700; color: var(--royal-deep); }
.c-q { margin: 0 0 16px; font-size: 17.5px; font-weight: 600; color: var(--text-dark); }

.done { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.done-ico { width: 84px; height: 84px; }
.done-ico svg { width: 42px; height: 42px; }
.draw { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw .45s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-title { margin: 4px 0 6px; font-size: clamp(22px, 6.6vw, 28px); line-height: 1.2; font-weight: 900; color: var(--royal-deep); text-wrap: balance; }
.done.already .round-blue { background: var(--grad-orange); box-shadow: 0 10px 24px rgba(248, 142, 48, .35), 0 0 0 6px #fff1df; }
.done.already .done-title { color: var(--navy-2); font-size: clamp(19px, 5.6vw, 23px); }
.ornament { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.ornament i { width: 44px; height: 2px; background: linear-gradient(90deg, transparent, var(--anniversary-gold)); }
.ornament i:last-child { transform: scaleX(-1); }
.ornament b { width: 8px; height: 8px; background: var(--anniversary-orange); transform: rotate(45deg); }
.done-msg p { margin: 0 0 6px; font-size: 15.5px; color: var(--text-muted); }
.done-msg .done-hello { font-size: 17px; font-weight: 800; color: var(--anniversary-red); }
.done-person { margin-top: 14px; padding: 14px 12px; border-radius: 14px; background: linear-gradient(180deg, #f6f9ff, #eef3fb); border: 1px solid #e0e8f5; }
.done-name { margin: 0; font-size: 21px; font-weight: 900; color: var(--navy-dark); text-transform: uppercase; }
.done-meta { margin: 2px 0 6px; font-weight: 700; color: var(--royal-deep); }
.done-time { margin: 0; font-weight: 800; color: var(--text-dark); }

/* ============================ FORM ============================ */
.field { margin-bottom: 12px; text-align: left; }
.field label { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 800; letter-spacing: .04em; color: var(--text-muted); }
.field label b { color: var(--anniversary-red); }
.field input, .field textarea {
  width: 100%; min-height: 56px; padding: 12px 14px; font-size: 17px; border: 1.5px solid var(--field-line); border-radius: 13px;
  background: var(--field-bg); outline: none; -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field textarea:focus { background: #fff; border-color: var(--royal-blue); box-shadow: 0 0 0 3px rgba(31, 86, 184, .15); }
.field.invalid input { border-color: var(--anniversary-red); }
.f-err { margin: 4px 0 0; color: #a50f0f; font-size: 14px; font-weight: 700; }
.f-err:empty { display: none; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.err { margin: 10px 0; padding: 12px; border-radius: 12px; background: #fff4e5; color: #8a4b00; font-weight: 700; text-align: center; }
#v-dup .btn-outline { margin-top: 14px; }
.dup-title { font-size: 18px; }

/* ============================ DẢI SÓNG + CHÂN TRANG ============================ */
.waves { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 0; width: 100%; height: 64px; display: block; pointer-events: none; }
.foot { background: var(--navy-dark); color: #b9c6dd; text-align: center; padding: 6px 16px 24px; font-size: 13px; }
.foot p { margin: 0; }
.foot-sub { color: var(--anniversary-gold); font-weight: 700; letter-spacing: .08em; margin-top: 2px !important; }

/* Trang lỗi */
.error-card { text-align: center; }
.error-code { margin: 0; font-size: 56px; font-weight: 900; color: var(--royal-deep); line-height: 1; }

/* ============================ ≥ 420px ============================ */
@media (min-width: 420px) {
  .row2 { grid-template-columns: 1fr 1fr; }
}

/* ============================ TABLET ============================ */
@media (min-width: 761px) {
  .hero-bg { background-position: 42% 30%; }
  .hero-in { padding: 28px 28px 110px; max-width: 760px; }
  .ck { padding: 24px 24px 22px; }
  .tb-text { font-size: 13.5px; }
  .tb-full { display: inline; }
  .tb-short { display: none; }
  .waves { height: 96px; }
}

/* ============================ DESKTOP ============================ */
@media (min-width: 1080px) {
  :root { --topbar-h: 52px; }
  .tb-text { font-size: 14px; letter-spacing: .1em; }
  .tb-50 { display: block; height: 40px; }
  .tb-logo { display: block; height: 40px; width: auto; filter: drop-shadow(0 0 6px rgba(255, 240, 205, .55)); }

  .hero { min-height: calc(100vh - var(--topbar-h)); min-height: calc(100svh - var(--topbar-h)); }
  /* Desktop: KHÔNG dùng ảnh (tránh mờ khi phóng to) – nền navy tự thiết kế theo bộ nhận diện Đại lễ */
  .hero-bg {
    background-image:
      radial-gradient(ellipse 38% 52% at 88% 14%, rgba(255, 214, 128, .42) 0%, rgba(255, 190, 90, .16) 40%, transparent 72%),
      radial-gradient(ellipse 55% 70% at 18% 55%, rgba(31, 86, 184, .38), transparent 70%),
      radial-gradient(ellipse 45% 40% at 62% 96%, rgba(255, 190, 90, .14), transparent 70%),
      linear-gradient(118deg, transparent 0 52%, rgba(255, 226, 160, .07) 58%, transparent 66%),
      linear-gradient(104deg, transparent 0 64%, rgba(255, 226, 160, .06) 69%, transparent 75%),
      linear-gradient(135deg, #00123a 0%, #02265f 42%, #0a3a86 78%, #0d4497 100%);
    background-size: auto;
  }
  .hero-bg::after {                   /* hạt sáng rất nhẹ tạo chiều sâu */
    background:
      radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .05) 0 1px, transparent 2px) 0 0 / 46px 46px,
      linear-gradient(180deg, transparent 70%, rgba(0, 18, 58, .45) 100%);
    opacity: .9;
  }
  .hero-deco { display: block; position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
  .hero-in {
    max-width: 1320px;
    display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    gap: 48px; align-items: center;
    padding: 44px 40px 150px;
    min-height: calc(100vh - var(--topbar-h)); min-height: calc(100svh - var(--topbar-h));
  }

  /* Panel navy trái */
  .intro {
    position: relative; overflow: hidden; text-align: left;
    padding: 36px 36px 34px;
    border: 1.5px solid rgba(248, 142, 48, .9);
    border-radius: var(--radius-panel);
    background: linear-gradient(165deg, rgba(3, 30, 76, .93) 0%, rgba(2, 24, 64, .88) 60%, rgba(1, 20, 56, .92) 100%);
    box-shadow: 0 30px 70px rgba(0, 10, 35, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  @supports ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
    .intro { background: linear-gradient(165deg, rgba(3, 30, 76, .82) 0%, rgba(2, 24, 64, .74) 60%, rgba(1, 20, 56, .84) 100%); -webkit-backdrop-filter: blur(7px) saturate(120%); backdrop-filter: blur(7px) saturate(120%); }
  }
  .intro::before {                     /* ánh sáng vàng ở góc trên panel */
    content: ""; position: absolute; left: -60px; top: -70px; width: 240px; height: 200px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 200, 100, .38), transparent);
  }
  .intro .intro-50 { display: none; }
  .intro .intro-school { display: block; margin-bottom: 18px; }
  .intro-school .logo-school { display: block; width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 227, 163, .55), 0 8px 20px rgba(0, 0, 0, .3); }
  .kicker { font-size: 14.5px; margin-bottom: 18px; }
  .kicker-year { display: block; margin: 4px 0 0; font-size: 15px; letter-spacing: .18em; }
  .title { max-width: none; font-size: clamp(40px, 3.55vw, 54px); line-height: 1.16; letter-spacing: .012em; text-wrap: initial; }
  .title em { display: inline-block; margin-top: .08em; font-size: 1.08em; letter-spacing: .005em; }
  .title .dbr { display: inline; }
  .divider { margin: 22px 0 18px; width: 96px; height: 4px; }
  .welcome { font-size: 20px; color: var(--cream); }
  .intro .pill { display: block; }

  /* Cột phải */
  .side { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }
  .side .side-50 { display: block; margin-right: 4px; }
  .side-50 .logo-50 { display: block; width: 188px; height: auto; }
  .ck { width: 100%; max-width: 620px; padding: 26px 28px 24px; }
  .ck-head { margin-bottom: 18px; }
  .ck-icon { flex-basis: 54px; width: 54px; height: 54px; }
  .ck-title { font-size: 24px; }
  .ck-sub { font-size: 16px; }
  #q { height: 66px; font-size: 18px; }
  .waves { height: 130px; }
}

@media (min-width: 1440px) {
  .hero-in { gap: 64px; }
  .side-50 .logo-50 { width: 204px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .draw { stroke-dashoffset: 0; }
}

/* Điện thoại: chữ gợi ý trong ô tìm kiếm hiển thị trọn vẹn */
@media (max-width: 479px) {
  #q::placeholder { font-size: 16px; }
  #q:placeholder-shown { padding-right: 14px; }   /* nút × chỉ hiện khi đã có chữ */
}

/* Màn hình rất hẹp: "HẢI PHÒNG" → "HP" để dòng đầu không bị xuống dòng/cắt chữ */
@media (max-width: 339px) {
  .tb-city { display: none; }
  .tb-city-abbr { display: inline; }
}
.tb-text.tb-abbr .tb-city { display: none; }            /* JS đo thực tế trên máy: nếu tràn thì viết tắt */
.tb-text.tb-abbr .tb-city-abbr { display: inline; }

/* ============================ DESKTOP: CHUYỂN ĐỘNG NỀN NHẸ NHÀNG ============================
   Chỉ dùng transform/opacity (GPU) · tự tắt khi người dùng bật "giảm chuyển động" */
@media (min-width: 1080px) {
  .tb-school { display: none; }
  .hero-fx { display: block; position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
  .fx-glow {                            /* quầng sáng vàng "thở" chậm */
    position: absolute; right: 2%; top: -10%; width: 46vw; height: 46vw; max-width: 780px; max-height: 780px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 214, 128, .36), rgba(255, 190, 90, .12) 55%, transparent 76%);
    animation: fx-breathe 9s ease-in-out infinite alternate;
  }
  .fx-sweep {                           /* vệt sáng lướt qua thỉnh thoảng */
    position: absolute; top: -20%; bottom: -20%; left: 0; width: 26%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 230, 170, .07) 40%, rgba(255, 242, 205, .15) 50%, rgba(255, 230, 170, .07) 60%, transparent 100%);
    transform: translateX(-140%) skewX(-14deg);
    animation: fx-sweep 15s ease-in-out 2s infinite;
  }
  .rb { animation: fx-drift 18s ease-in-out infinite alternate; will-change: transform; }
  .rb2 { animation-duration: 22s; animation-direction: alternate-reverse; }
  .rb3 { animation-duration: 15s; animation-delay: -4s; }
  .rb4 { animation-duration: 26s; animation-direction: alternate-reverse; animation-delay: -8s; }
  .sp { transform-box: fill-box; transform-origin: center; animation: fx-twinkle 4.6s ease-in-out infinite; }
  .sp2 { animation-delay: -1.2s; animation-duration: 3.8s; }
  .sp3 { animation-delay: -2.4s; animation-duration: 5.2s; }
  .sp4 { animation-delay: -.6s; animation-duration: 4.2s; }
  .sp5 { animation-delay: -3.1s; }
  .sp6 { animation-delay: -1.9s; animation-duration: 5.6s; }
  .sp7 { animation-delay: -2.8s; animation-duration: 3.6s; }
  .side .side-50 .logo-50 { animation: fx-float 6.5s ease-in-out infinite alternate; }
  .side .side-50::before { animation: fx-halo 6.5s ease-in-out infinite alternate; }
  .wv-shine { display: inline; animation: fx-shine 8s linear infinite; }
}
@keyframes fx-breathe { from { transform: scale(.9); opacity: .65; } to { transform: scale(1.08); opacity: 1; } }
@keyframes fx-sweep { 0% { transform: translateX(-140%) skewX(-14deg); } 55%, 100% { transform: translateX(460%) skewX(-14deg); } }
@keyframes fx-drift { from { transform: translate(-28px, -4px); } to { transform: translate(28px, 10px); } }
@keyframes fx-twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes fx-float { from { transform: translateY(-5px); } to { transform: translateY(7px); } }
@keyframes fx-halo { from { opacity: .8; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
@keyframes fx-shine { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
