/* =====================================================================
   Trường Quốc tế Canada (CIS) 360° — "Tủ locker × Cờ nỉ đuôi nheo × Kỷ yếu × Áo varsity"
   Alfa Slab One (chữ nỉ varsity) · Plus Jakarta Sans · Oswald (bảng chữ cài) · Playpen Sans (chữ viết tay kỷ yếu)
   ===================================================================== */
:root {
  --maroon: #7d1a1f; --maroon2: #5c1216; --red: #c8262c; --cream: #f6efdf; --paper: #fbf8f0; --paper2: #efe6d2;
  --ink: #1e1d1f; --ink2: #3a3739; --steel: #46525d; --gold: #e3b23c; --gold2: #f4d27a; --line: rgba(30, 29, 31, .14);
  --zc: #7d1a1f;              /* màu khu vực hiện tại (đặt bằng JS) */
  --slab: 'Alfa Slab One', Rockwell, 'Roboto Slab', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cond: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --hand: 'Playpen Sans', 'Comic Sans MS', cursive;
  --felt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a0b0d; color: var(--ink); font: 15px/1.5 var(--sans); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
#pano { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; background: #1c1214; }
#pano.grabbing { cursor: grabbing; }

/* ================= MÀN CHÀO: DÃY TỦ LOCKER ================= */
.ld { position: fixed; inset: 0; z-index: 50; overflow: auto; color: var(--cream); background: #3a0d10; transition: opacity .9s ease, visibility .9s; }
.ld.out { opacity: 0; visibility: hidden; }
.ld-lockers { position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(90% 70% at 50% 45%, rgba(20, 4, 6, .15), rgba(20, 4, 6, .82) 100%),
    repeating-linear-gradient(180deg, transparent 0 28px, rgba(0, 0, 0, .35) 28px 30px, transparent 30px 34px) 0 34px / 100% 60px no-repeat,
    linear-gradient(90deg, rgba(0, 0, 0, .55) 0 3px, transparent 3px 50%, rgba(255, 255, 255, .06) 50% 52%, transparent 52%) 0 0 / 128px 100%,
    repeating-linear-gradient(180deg, transparent 0 46%, rgba(0, 0, 0, .35) 46% 47%, transparent 47% 100%) 0 0 / 100% 100%,
    linear-gradient(180deg, #8d2025, #6e171b 60%, #4d1013);
}
.ld-lockers::before { content: ''; position: absolute; inset: 0; background: var(--felt); opacity: .18; mix-blend-mode: overlay; }
.ld-lockers::after { content: ''; position: absolute; left: 0; right: 0; top: 64px; height: 26px; opacity: .55;
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 0, 0, .55) 22px 30px, transparent 30px 40px, rgba(0, 0, 0, .55) 40px 48px, transparent 48px 58px, rgba(0, 0, 0, .55) 58px 66px, transparent 66px 128px); }
.ld-in { position: relative; min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 18px;
  padding: calc(22px + var(--sat)) calc(18px + var(--sar)) calc(22px + var(--sab)) calc(18px + var(--sal)); max-width: 1080px; margin: 0 auto; text-align: center; }
.ld-head { display: grid; justify-items: center; gap: 8px; }
.ld-logo { width: 190px; height: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.ld-kick { margin: 0; font: 600 12px/1.3 var(--cond); letter-spacing: .22em; text-transform: uppercase; color: var(--gold2); }
.ld-title { margin: 0; font: 400 clamp(30px, 5.2vw, 52px)/1.04 var(--slab); letter-spacing: .01em; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.ld-title em { display: block; margin-top: 8px; font: 500 clamp(15px, 2vw, 19px)/1.3 var(--hand); color: #ffd9c9; letter-spacing: 0; text-shadow: none; }

/* tủ locker */
.locker { --h: min(330px, 46vh); position: relative; height: var(--h); width: calc(var(--h) * .66); perspective: 1100px; }
.locker-in { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; background: #120708; box-shadow: inset 0 0 0 6px #2b0a0c, inset 0 10px 30px rgba(0, 0, 0, .8); }
.locker-in img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.locker-door { position: absolute; inset: 0; border-radius: 6px; transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.6, 0, .25, 1); transform-style: preserve-3d;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .08) 30%, rgba(0, 0, 0, .1) 70%, rgba(0, 0, 0, .3)), linear-gradient(180deg, #a3292f, #8a1f24 50%, #741a1e);
  box-shadow: 0 0 0 3px #4a0f12, 0 18px 40px rgba(0, 0, 0, .55), inset 0 0 0 7px rgba(0, 0, 0, .12), inset 0 0 0 8px rgba(255, 255, 255, .08); }
.locker-door::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--felt); opacity: .14; mix-blend-mode: overlay; }
.ld.open .locker-door { transform: rotateY(-108deg); }
.vents { position: absolute; left: 18%; right: 18%; top: 7%; display: grid; gap: 5px; }
.vents i { height: 6px; border-radius: 4px; background: #3b0b0e; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .15); }
.plate { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); padding: 3px 10px; border-radius: 3px; font: 600 11px/1.2 var(--cond); letter-spacing: .14em; color: #2a2a2a;
  background: linear-gradient(180deg, #e9e6df, #b9b4aa); box-shadow: 0 1px 0 rgba(0, 0, 0, .4), inset 0 1px 0 #fff; white-space: nowrap; }
.tag { position: absolute; left: 12%; right: 12%; top: 36%; padding: 7px 8px 6px; display: grid; gap: 1px; background: var(--paper); color: var(--ink); border-radius: 2px; transform: rotate(-2deg);
  box-shadow: 0 0 0 3px #c8c3b8, 0 0 0 4px #77706a, 0 4px 8px rgba(0, 0, 0, .35); text-align: left; }
.tag small { font: 600 9px/1.2 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--maroon); }
.tag b { font: 600 calc(var(--h) * .046)/1.15 var(--hand); }
.tag em { font: 500 10px/1.2 var(--cond); letter-spacing: .1em; font-style: normal; color: #6a6460; }
.sticker { position: absolute; left: 9%; bottom: 8%; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--red); transform: rotate(-14deg); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.sticker .i { width: 22px; height: 22px; }
.dial { position: absolute; left: 50%; bottom: 10%; width: 40%; aspect-ratio: 1; transform: translateX(-50%); }
.dial svg { position: absolute; inset: -6%; width: 112%; height: 112%; transform: rotate(-90deg); }
.d-ring { fill: none; stroke: rgba(0, 0, 0, .35); stroke-width: 5; }
.d-prog { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 351.9; stroke-dashoffset: 351.9; transition: stroke-dashoffset .3s; }
.d-face { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a4a4c, #161617 70%); box-shadow: 0 3px 6px rgba(0, 0, 0, .6), inset 0 0 0 2px #5d5d60;
  transition: transform .8s cubic-bezier(.5, 0, .3, 1); }
.d-face::after { content: ''; position: absolute; inset: 32%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #9a9a9e, #4a4a4d); box-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.d-face span { position: absolute; left: 50%; top: 4%; height: 46%; width: 1px; transform-origin: 50% 100%; }
.d-face span::before { content: ''; position: absolute; left: -.5px; top: 0; width: 1px; height: 6%; min-height: 3px; background: #ddd; }
.d-face span.k::before { width: 2px; left: -1px; height: 12%; }
.d-face span b { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); font: 500 calc(var(--h) * .024)/1 var(--cond); color: #eee; }
.d-mark { position: absolute; left: 50%; top: -9%; transform: translateX(-50%); border: 5px solid transparent; border-top: 8px solid var(--gold2); }
.handle { position: absolute; right: 7%; top: 44%; width: 10px; height: 18%; border-radius: 5px; background: linear-gradient(90deg, #8d8d90, #e6e6e8 45%, #77777a); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.ld.spin .d-face { transition-duration: 1.4s; }

.ld-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.ld-stats li { display: flex; align-items: baseline; gap: 6px; font: 500 13px/1.2 var(--sans); color: rgba(246, 239, 223, .82); }
.ld-stats b { font: 400 22px/1 var(--slab); color: #fff; }
.ld-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.seg button { padding: 7px 14px; border-radius: 999px; font: 600 13px/1 var(--sans); color: rgba(246, 239, 223, .78); }
.seg button.on { background: var(--cream); color: var(--maroon); }
.sw { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); font: 600 13px/1 var(--sans); }
.sw-t { display: inline-flex; align-items: center; gap: 6px; }
.sw-t .i { width: 17px; height: 17px; }
.sw-k { position: relative; width: 34px; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, .22); transition: background .2s; }
.sw-k i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw[aria-checked="true"] .sw-k { background: var(--gold); }
.sw[aria-checked="true"] .sw-k i { transform: translateX(14px); }
.sw b { min-width: 26px; text-align: left; font-weight: 700; color: var(--gold2); }
.ld-go { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 10px; font: 400 17px/1 var(--slab); letter-spacing: .03em; color: var(--maroon2);
  background: linear-gradient(180deg, #fff6df, #f1d68e); box-shadow: 0 4px 0 #9b7524, 0 10px 24px rgba(0, 0, 0, .4); transition: transform .15s, box-shadow .15s, opacity .3s; }
.ld-go:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 0 #9b7524, 0 14px 28px rgba(0, 0, 0, .45); }
.ld-go:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #9b7524, 0 6px 14px rgba(0, 0, 0, .4); }
.ld-go:disabled { opacity: .7; cursor: progress; }
.ld-go .i { width: 18px; height: 18px; }
.ld-foot { margin: 0; max-width: 520px; font: 500 11.5px/1.45 var(--sans); color: rgba(246, 239, 223, .6); }

@media (min-width: 860px) and (min-height: 520px) {
  .ld-in { grid-template-columns: 1fr auto; grid-template-areas: 'h l' 's l' 'o l' 'g l' 'f l'; column-gap: 64px; justify-items: start; text-align: left; align-content: center; }
  .ld-head { grid-area: h; justify-items: start; } .locker { grid-area: l; --h: min(440px, 74vh); align-self: center; }
  .ld-stats { grid-area: s; justify-content: start; } .ld-opts { grid-area: o; justify-content: start; } .ld-go { grid-area: g; } .ld-foot { grid-area: f; }
  .ld-title { font-size: clamp(38px, 4.6vw, 58px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ld-in { grid-template-columns: 1fr auto; grid-template-areas: 'h l' 's l' 'o l' 'g l' 'f l'; column-gap: 28px; gap: 8px 28px; justify-items: start; text-align: left; padding-top: calc(12px + var(--sat)); padding-bottom: calc(12px + var(--sab)); }
  .ld-head { grid-area: h; justify-items: start; gap: 4px; } .locker { grid-area: l; --h: min(330px, 84vh); align-self: center; }
  .ld-stats { grid-area: s; justify-content: start; } .ld-opts { grid-area: o; justify-content: start; } .ld-go { grid-area: g; padding: 11px 20px; } .ld-foot { grid-area: f; }
  .ld-logo { width: 130px; } .ld-title { font-size: 28px; } .ld-title em { margin-top: 3px; font-size: 14px; }
  .ld-stats b { font-size: 18px; }
}

/* ================= GIAO DIỆN ================= */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }

/* --- cờ nỉ tên cảnh --- */
.pen { position: absolute; left: calc(14px + var(--sal)); top: calc(12px + var(--sat)); width: min(400px, calc(100vw - 92px - var(--sal) - var(--sar))); filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
.pen-flag { position: relative; min-height: 96px; padding: 13px 64px 14px 34px; color: #fff8ea; transition: color .3s; }
.pen-flag::before { content: ''; position: absolute; inset: 0; background: var(--zc); clip-path: polygon(0 0, 100% 34%, 100% 66%, 0 100%); transition: background .5s; }
.pen-flag::after { content: ''; position: absolute; inset: 0; background: var(--felt); opacity: .28; mix-blend-mode: overlay; clip-path: polygon(0 0, 100% 34%, 100% 66%, 0 100%); }
.pen-flag > * { position: relative; z-index: 1; }
.pen-flag .stitch { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pen-flag .stitch polygon { fill: none; stroke: rgba(255, 248, 234, .7); stroke-width: 1.4; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.pen-flag .sleeve { position: absolute; left: 0; top: 0; bottom: 0; width: 18px; z-index: 1; background: linear-gradient(90deg, #efe6d2, #fff8ea 60%, #d9cdb3); }
.pen.light .pen-flag { color: #2a1a06; }
.pen.light .stitch polygon { stroke: rgba(42, 26, 6, .45); }
.pen-kick { margin: 0 0 3px; font: 600 11px/1.25 var(--cond); letter-spacing: .16em; text-transform: uppercase; opacity: .85; max-width: 86%; }
.pen-title { margin: 0; font: 400 clamp(19px, 2.3vw, 25px)/1.08 var(--slab); letter-spacing: .01em; max-width: 84%; text-wrap: balance; }
.pen-leaf { position: absolute; right: 22px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: rgba(255, 248, 234, .85); }
.pen.light .pen-leaf { color: var(--maroon); }
.pen-bar { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 18px; }
.pen-idx, .pen-pass { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px; border-radius: 8px; background: var(--paper); color: var(--ink); font: 600 13px/1 var(--cond); letter-spacing: .06em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pen-idx button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; }
.pen-idx button:hover { background: var(--paper2); }
.pen-idx .i { width: 16px; height: 16px; }
.pen-idx b { font-weight: 700; color: var(--maroon); }
.pen-pass { padding: 0 11px 0 9px; gap: 6px; text-transform: uppercase; font-size: 12px; }
.pen-pass .i { width: 16px; height: 16px; color: var(--red); }
.pen-pass:hover { background: #fff; }

/* --- áo varsity (tiến độ) --- */
.var { position: absolute; right: calc(14px + var(--sar)); top: calc(12px + var(--sat)); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 14px;
  background: var(--paper); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.var-c { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; font: 400 30px/1 var(--slab); color: var(--maroon); background: #fff8ea;
  box-shadow: inset 0 0 0 3px var(--maroon), inset 0 0 0 5px #fff8ea, inset 0 0 0 6px var(--gold); text-shadow: 1px 1px 0 var(--gold); }
.var-t small { display: block; font: 600 10px/1.2 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: #7a706a; }
.var-t b { font: 400 20px/1.1 var(--slab); color: var(--ink); }
.var-t i { font-style: normal; font-size: 13px; opacity: .55; }
.var-p { position: absolute; left: 60px; right: 14px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--paper2); overflow: hidden; }
.var-p::after { content: ''; position: absolute; inset: 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--maroon), var(--red)); transition: width .6s; }
.var.bump .var-c { animation: bump .6s; }
@keyframes bump { 30% { transform: scale(1.18) rotate(-6deg); } 60% { transform: scale(.95) rotate(3deg); } }

/* --- huy hiệu cài áo (công cụ) --- */
.tools { position: absolute; right: calc(14px + var(--sar)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.tools button { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--maroon); background: radial-gradient(circle at 35% 30%, #fffdf6, #efe6d2);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(125, 26, 31, .55), 0 4px 10px rgba(0, 0, 0, .35); transition: transform .15s, background .2s, color .2s; }
.tools button:hover { transform: scale(1.08); }
.tools button.on { background: radial-gradient(circle at 35% 30%, #b8323a, var(--maroon)); color: #fff; }
.tools button.off { color: #9a908a; }
.tools button.off::after { content: ''; position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; background: currentColor; transform: rotate(-40deg); border-radius: 1px; }
.tools .lang span { font: 700 13px/1 var(--cond); letter-spacing: .06em; }
.tools button[data-tip]:hover::before { content: attr(data-tip); position: absolute; right: 54px; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 5px 9px; border-radius: 6px;
  background: var(--ink); color: #fff; font: 600 12px/1 var(--sans); pointer-events: none; }

/* --- dây cờ đuôi nheo (khu vực) --- */
.bunting { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(10px + var(--sar)) calc(8px + var(--sab)) calc(10px + var(--sal)); }
.bt-rope { position: absolute; left: 0; right: 0; top: 10px; height: 3px; background: repeating-linear-gradient(90deg, #f3ead7 0 6px, #cbbfa5 6px 9px); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.bt-row { position: relative; display: flex; justify-content: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 4px 4px; }
.bt-row::-webkit-scrollbar { display: none; }
.flag { --c: #7d1a1f; position: relative; flex: none; width: 104px; height: 112px; padding: 14px 8px 0; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff8ea;
  transform-origin: 50% 0; transition: transform .25s; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.flag::before, .flag::after { content: ''; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 100% 64%, 50% 100%, 0 64%); }
.flag::before { background: var(--c); }
.flag::after { background: var(--felt); opacity: .3; mix-blend-mode: overlay; }
.flag > * { position: relative; z-index: 1; }
.flag .ring { position: absolute; top: -1px; left: 50%; width: 76%; height: 7px; transform: translateX(-50%); background: #f3ead7; border-radius: 0 0 3px 3px; z-index: 1; }
.flag b { font: 400 21px/1 var(--slab); letter-spacing: .02em; }
.flag span { margin-top: 4px; font: 600 10.5px/1.15 var(--cond); letter-spacing: .05em; text-transform: uppercase; max-width: 90px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flag .dots { margin-top: 5px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 60px; }
.flag .dots i { width: 5px; height: 5px; border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; opacity: .75; }
.flag .dots i.y { background: currentColor; opacity: 1; }
.flag.lt { color: #2a1a06; }
.flag:hover { transform: rotate(-3deg); }
.flag.cur { transform: translateY(4px) scale(1.05); }
.flag.cur::before { box-shadow: none; background: linear-gradient(var(--c), var(--c)) padding-box; }
.flag.cur .ring { background: var(--gold); }
.flag.done::after { opacity: .3; }
.flag .star { position: absolute; top: 58px; right: 14px; width: 18px; height: 18px; color: var(--gold2); z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }

/* ================= ĐIỂM NÓNG ================= */
.hs-layer { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.hs { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.hs > * { transform: translate(-50%, -50%); }
/* lá phong: đi tới */
.hs-go .pin { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 252, 244, .94); color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 38, 44, .55), 0 6px 14px rgba(0, 0, 0, .4); transition: transform .2s; }
.hs-go .pin .i { width: 28px; height: 28px; }
.hs-go .pin::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(255, 252, 244, .9); animation: ripple 2.4s ease-out infinite; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.hs-go:hover .pin { transform: scale(1.12) rotate(-8deg); }
.hs-go .tip { position: absolute; left: 0; bottom: 34px; transform: translate(-50%, 8px) rotate(-2deg); width: 168px; padding: 7px 7px 9px; background: #fff; border-radius: 2px; color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.hs-go .tip img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #ddd; }
.hs-go .tip b { display: block; margin-top: 6px; font: 600 14px/1.2 var(--hand); text-align: center; }
.hs-go .tip small { display: block; text-align: center; font: 500 10px/1.3 var(--cond); letter-spacing: .1em; color: #8a817b; text-transform: uppercase; }
.hs-go:hover .tip, .hs-go:focus-visible .tip { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }
.touch .hs-go .tip { display: none; }
.hs .lab { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; }
/* biển phòng: cửa */
.hs-door .plate2 { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 9px; border-radius: 7px; background: linear-gradient(180deg, #2c3d52, #1d2a3a); color: #fff; white-space: nowrap;
  font: 600 13px/1 var(--cond); letter-spacing: .07em; text-transform: uppercase; box-shadow: 0 0 0 2px #c8ccd2, 0 6px 14px rgba(0, 0, 0, .45); transition: transform .2s; }
.hs-door .plate2 .i { width: 17px; height: 17px; color: var(--gold2); }
.hs-door .plate2::before, .hs-door .plate2::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #9aa3ad; order: -1; }
.hs-door .plate2::after { order: 9; }
.hs-door:hover .plate2 { transform: translate(-50%, -50%) scale(1.07); }
/* biển chỉ đường hành lang */
.hs-sign .sg { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; background: var(--maroon); color: #fff; white-space: nowrap;
  font: 600 14px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 0 2px #fff, 0 6px 14px rgba(0, 0, 0, .45); transition: transform .2s; }
.hs-sign .sg .i { width: 18px; height: 18px; }
.hs-sign .sg.l { flex-direction: row-reverse; } .hs-sign .sg.l .i { transform: scaleX(-1); }
.hs-sign:hover .sg { transform: translate(-50%, -50%) scale(1.07); }
/* biển cầu thang */
.hs-lift .st { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 10px; background: var(--gold); color: #1d1a12; white-space: nowrap;
  font: 600 13px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 0 0 2px #1d1a12, 0 6px 14px rgba(0, 0, 0, .45); transition: transform .2s; }
.hs-lift .st span:first-child { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #1d1a12; color: var(--gold); }
.hs-lift .st .i { width: 22px; height: 22px; }
.hs-lift:hover .st { transform: translate(-50%, -50%) scale(1.07); }
/* cột cờ trên ảnh flycam */
.hs-pin .pole { display: block; transform: translate(-2px, -100%); position: relative; padding-bottom: 4px; }
.hs-pin .pole::before { content: ''; position: absolute; left: 0; bottom: 0; width: 3px; height: 100%; background: linear-gradient(90deg, #ddd, #fff, #aaa); border-radius: 2px; }
.hs-pin .pole::after { content: ''; position: absolute; left: -4px; bottom: -4px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--red), 0 2px 6px rgba(0, 0, 0, .5); }
.hs-pin .fl { position: relative; display: block; margin: 0 0 34px 3px; padding: 7px 26px 7px 10px; background: var(--red); color: #fff; white-space: nowrap; font: 400 14px/1 var(--slab);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%); transform-origin: 0 50%; transition: transform .2s; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.hs-pin:hover .fl { transform: scale(1.08); }
.hs-fly .pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(30, 29, 31, .78); color: #fff; white-space: nowrap;
  font: 600 13px/1 var(--sans); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .6), 0 6px 14px rgba(0, 0, 0, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hs-fly .pill .i { width: 18px; height: 18px; color: var(--gold2); }

/* ================= HUY HIỆU MỚI ================= */
.patch-pop { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; display: grid; justify-items: center; gap: 10px; text-align: center; transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.patch-pop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.patch-pop .msg { padding: 8px 14px; border-radius: 10px; background: var(--paper); font: 600 14px/1.3 var(--sans); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); max-width: 300px; }
.patch-pop .msg small { display: block; font: 600 10px/1.2 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.patch { --c: #7d1a1f; position: relative; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; align-content: center; color: #fff8ea; background: var(--c);
  box-shadow: 0 0 0 4px #fff8ea, 0 0 0 7px var(--c), 0 10px 22px rgba(0, 0, 0, .4); }
.patch::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px dashed rgba(255, 248, 234, .75); }
.patch::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--felt); opacity: .35; mix-blend-mode: overlay; }
.patch b { font: 400 28px/1 var(--slab); position: relative; z-index: 1; }
.patch small { position: relative; z-index: 1; font: 600 9px/1.1 var(--cond); letter-spacing: .12em; text-transform: uppercase; max-width: 78px; margin-top: 3px; }
.patch .i { position: relative; z-index: 1; width: 18px; height: 18px; margin-bottom: 2px; color: var(--gold2); }
.patch.lt { color: #2a1a06; } .patch.lt::before { border-color: rgba(42, 26, 6, .5); }

.toast { position: absolute; left: 50%; bottom: calc(150px + var(--sab)); transform: translate(-50%, 20px); opacity: 0; padding: 9px 16px; border-radius: 10px; background: var(--ink); color: #fff;
  font: 600 13px/1.3 var(--sans); pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= TẤM TRƯỢT ================= */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(20, 8, 9, .35); }
.sheet { position: fixed; z-index: 31; right: calc(12px + var(--sar)); top: calc(12px + var(--sat)); bottom: calc(12px + var(--sab)); width: min(460px, calc(100vw - 24px)); border-radius: 16px; overflow: hidden;
  background: var(--paper); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); animation: shIn .35s cubic-bezier(.2, .9, .3, 1); }
.sheet.wide { width: min(620px, calc(100vw - 24px)); }
@keyframes shIn { from { transform: translateX(30px); opacity: 0; } }
.sh-x { position: absolute; right: 10px; top: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.sh-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.sh-head { padding: 22px 56px 0 22px; }
.sh-kick { margin: 0 0 4px; font: 600 11px/1.3 var(--cond); letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.sh-title { margin: 0; font: 400 26px/1.1 var(--slab); color: var(--ink); }
.sh-pad { padding: 16px 22px 26px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 600 13px/1.2 var(--sans); color: var(--ink); text-decoration: none; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--maroon); }
.chip .i { width: 15px; height: 15px; color: var(--red); }
.btn-p { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 10px; background: var(--maroon); color: #fff; font: 700 14px/1 var(--sans); }
.btn-p .i { width: 17px; height: 17px; }

/* phiếu ra vào hành lang (hall pass) */
.hp { margin: 18px 22px 0; position: relative; border-radius: 12px; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 8px 22px rgba(60, 20, 20, .14); overflow: hidden; }
.hp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--zc); color: #fff8ea; position: relative; }
.hp-top::after { content: ''; position: absolute; inset: 0; background: var(--felt); opacity: .25; mix-blend-mode: overlay; pointer-events: none; }
.hp-top.lt { color: #2a1a06; }
.hp-top h3 { margin: 0; font: 400 22px/1 var(--slab); letter-spacing: .04em; }
.hp-top small { font: 600 10px/1.25 var(--cond); letter-spacing: .14em; text-transform: uppercase; text-align: right; opacity: .9; }
.hp-f { display: grid; grid-template-columns: auto 1fr; margin: 0; padding: 10px 16px 4px; gap: 0 14px; }
.hp-f dt { padding: 8px 0 6px; font: 600 10px/1.4 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: #8a817b; border-bottom: 1px dashed var(--line); }
.hp-f dd { margin: 0; padding: 6px 0 4px; font: 600 15px/1.35 var(--hand); color: #1b3a8a; border-bottom: 1px dashed var(--line); }
.hp-sig { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 16px 14px; }
.hp-sig .s { font: 600 20px/1 var(--hand); color: #1b3a8a; transform: rotate(-4deg); }
.hp-sig small { display: block; font: 600 9.5px/1.3 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: #8a817b; border-top: 1px solid var(--line); padding-top: 3px; margin-top: 4px; }
.hp-stamp { position: absolute; right: 16px; top: 64px; padding: 5px 10px; border: 2.5px solid var(--red); border-radius: 6px; color: var(--red); font: 400 13px/1 var(--slab); letter-spacing: .06em; transform: rotate(-12deg); opacity: .82; }
.hp-audio { margin: 16px 22px 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper2); }
.hp-audio button { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: #fff; box-shadow: 0 3px 8px rgba(125, 26, 31, .35); }
.hp-audio b { display: block; font: 700 14px/1.25 var(--sans); }
.hp-audio small { font: 500 12px/1.3 var(--sans); color: #6f6863; }
.hp-audio .eq { margin-left: auto; display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.hp-audio .eq i { width: 3px; height: 4px; background: var(--maroon); border-radius: 1px; }
.hp-audio.on .eq i { animation: eq .9s ease-in-out infinite; }
.hp-audio.on .eq i:nth-child(2) { animation-delay: .2s; } .hp-audio.on .eq i:nth-child(3) { animation-delay: .4s; } .hp-audio.on .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 50% { height: 18px; } }
.sib { padding: 16px 22px 26px; }
.sib h4 { margin: 0 0 10px; font: 600 11px/1.3 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: #8a817b; }
.sib-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.pol { display: block; padding: 6px 6px 8px; background: #fff; border-radius: 2px; box-shadow: 0 4px 12px rgba(0, 0, 0, .14); text-align: center; transform: rotate(var(--r, -1.5deg)); transition: transform .2s; }
.pol:nth-child(2n) { --r: 1.6deg; } .pol:nth-child(3n) { --r: -.6deg; }
.pol:hover { transform: rotate(0) translateY(-3px); }
.pol img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #e9e2d5; }
.pol b { display: block; margin-top: 6px; font: 600 13px/1.2 var(--hand); color: var(--ink); }
.pol.cur { box-shadow: 0 0 0 2.5px var(--gold), 0 4px 12px rgba(0, 0, 0, .14); }
.pol .ok { color: var(--red); font-size: 12px; }

/* bảng chữ cài (directory) */
.sheet.board { background: #1b1a1c; color: #f2f0ea; }
.sheet.board .sh-x { background: #2c2a2d; color: #fff; }
.lbd { min-height: 100%; padding: 20px 18px 28px; background:
  repeating-linear-gradient(180deg, transparent 0 9px, rgba(0, 0, 0, .55) 9px 10px, rgba(255, 255, 255, .04) 10px 11px), #232124; }
.lbd-frame { border-radius: 10px; padding: 16px 16px 18px; box-shadow: 0 0 0 7px #a3784a, 0 0 0 9px #6e4c2a, inset 0 0 22px rgba(0, 0, 0, .7); margin: 8px 6px 18px; }
.lbd h2 { margin: 0; font: 600 25px/1.2 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: #fff; text-align: center; }
.lbd h2 small { display: block; font-size: 12px; letter-spacing: .3em; color: #d9d3c6; }
.lbd-q { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; padding: 0 12px; height: 42px; border-radius: 8px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.lbd-q .i { width: 18px; height: 18px; opacity: .7; }
.lbd-q input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: #fff; font: 500 16px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; outline: 0; }
.lbd-q input::placeholder { color: rgba(255, 255, 255, .45); }
.lbd-f { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lbd-f button { padding: 6px 10px; border-radius: 6px; font: 600 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; background: rgba(255, 255, 255, .07); color: #ddd; }
.lbd-f button.on { background: #f2f0ea; color: #1b1a1c; }
.lbd-z { margin: 14px 0 4px; display: flex; align-items: center; gap: 10px; font: 600 14px/1.2 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--gold2); }
.lbd-z::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .15); }
.lbd-z i { font-style: normal; color: #aaa; letter-spacing: .08em; }
.lbd-r { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 6px; border-radius: 6px; text-align: left; font: 500 17px/1.25 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: #f6f4ee; }
.lbd-r:hover { background: rgba(255, 255, 255, .07); }
.lbd-r .no { width: 30px; flex: none; color: #9c968c; font-size: 14px; }
.lbd-r .nm { flex: 1; min-width: 0; }
.lbd-r .dl { flex: 0 1 60px; border-bottom: 2px dotted rgba(255, 255, 255, .25); align-self: center; margin-top: 8px; min-width: 14px; }
.lbd-r .ck { width: 22px; flex: none; text-align: center; color: var(--gold2); }
.lbd-r .ck .i { width: 16px; height: 16px; }
.lbd-r.cur { background: rgba(227, 178, 60, .16); }
.lbd-r.cur .nm::after { content: ' ◄'; color: var(--gold2); }
.lbd-empty { padding: 20px 6px; color: #aaa; font: 500 15px/1.4 var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.lbd-foot { margin-top: 18px; font: 500 12px/1.5 var(--sans); color: #a8a299; }

/* kỷ yếu */
.yb { background: var(--paper); }
.yb-cover { position: relative; padding: 26px 22px 22px; color: #fff8ea; background: var(--maroon); overflow: hidden; }
.yb-cover::before { content: ''; position: absolute; inset: 0; background:
  repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 22px, transparent 22px 44px), repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 22px, transparent 22px 44px); opacity: .55; }
.yb-cover::after { content: ''; position: absolute; inset: 0; background: var(--felt); opacity: .25; mix-blend-mode: overlay; }
.yb-cover > * { position: relative; z-index: 1; }
.yb-cover img { width: 170px; height: auto; display: block; margin-bottom: 14px; }
.yb-cover h2 { margin: 0; font: 400 30px/1.05 var(--slab); }
.yb-cover p { margin: 8px 0 0; font: 500 16px/1.35 var(--hand); color: #ffd9c9; }
.yb-sec { padding: 20px 22px 4px; }
.yb-sec h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font: 400 19px/1.2 var(--slab); color: var(--maroon); }
.yb-sec h3 .i { width: 18px; height: 18px; color: var(--red); }
.yb-sec p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.62; color: var(--ink2); }
.yb-6c { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.yb-6c span { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 600 13px/1.25 var(--sans); }
.yb-6c span b { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--maroon); color: #fff; font: 400 14px/1 var(--slab); }
.yb-sch { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.yb-sch li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.yb-sch li b { min-width: 52px; font: 400 15px/1 var(--slab); color: var(--maroon); }
.yb-gal { columns: 3 130px; column-gap: 10px; padding-top: 4px; }
.yb-gal button { display: block; width: 100%; margin: 0 0 12px; padding: 5px 5px 0; background: #fff; border-radius: 2px; box-shadow: 0 4px 12px rgba(0, 0, 0, .14); transform: rotate(var(--r, -1deg)); break-inside: avoid; transition: transform .2s; }
.yb-gal button:nth-child(2n) { --r: 1.4deg; } .yb-gal button:nth-child(3n) { --r: -.4deg; }
.yb-gal button:hover { transform: rotate(0) scale(1.03); }
.yb-gal img { display: block; width: 100%; height: auto; background: #e9e2d5; }
.yb-gal button::after { content: ''; display: block; height: 14px; }
.yb-vid { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000 url(../img/og-image.jpg) center/cover; }
.yb-vid button { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; color: #fff; background: rgba(30, 10, 12, .45); font: 600 14px/1.2 var(--sans); }
.yb-vid button span:first-child { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--red); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.yb-vid button .i { width: 30px; height: 30px; margin-left: 4px; }
.yb-vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#ybMap { height: 230px; border-radius: 12px; overflow: hidden; background: #e7e1d3; z-index: 0; }
.mk-leaf { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--red); box-shadow: 0 0 0 3px var(--red), 0 4px 10px rgba(0, 0, 0, .4); }
.mk-leaf .i { width: 26px; height: 26px; }
.yb-links { display: flex; flex-wrap: wrap; gap: 8px; }
.yb-sign { padding: 18px 22px 28px; display: grid; gap: 6px; }
.yb-sign p { margin: 0; font: 500 15px/1.4 var(--hand); color: #1b3a8a; transform: rotate(-1.2deg); }
.yb-sign small { font: 500 11.5px/1.45 var(--sans); color: #8a817b; }

/* áo varsity */
.jk { padding: 14px 22px 26px; }
.jk-fig { position: relative; margin: 4px auto 6px; width: min(340px, 100%); }
.jk-fig svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); }
.jk-fig .slot { position: absolute; width: 19%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; text-align: center;
  font: 400 13px/1 var(--slab); color: rgba(255, 255, 255, .55); border: 1.5px dashed rgba(255, 255, 255, .45); transition: transform .3s; }
.jk-fig .slot.sl:not(.y) { color: rgba(125, 26, 31, .6); border-color: rgba(125, 26, 31, .45); }
.jk-fig .slot.y { --c: #7d1a1f; border: 0; color: #fff8ea; background: var(--c); box-shadow: 0 0 0 2.5px #fff8ea, 0 0 0 4px var(--c), 0 4px 8px rgba(0, 0, 0, .35); }
.jk-fig .slot.y.lt { color: #2a1a06; }
.jk-fig .slot.y::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed rgba(255, 248, 234, .7); }
.jk-fig .slot:hover { transform: translate(-50%, -50%) scale(1.1); }
.jk-sum { text-align: center; margin: 4px 0 14px; font: 600 14px/1.4 var(--sans); color: var(--ink2); }
.jk-sum b { font: 400 22px/1 var(--slab); color: var(--maroon); }
.jk-list { display: grid; gap: 8px; }
.jk-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); text-align: left; width: 100%; }
.jk-row .patch { width: 46px; height: 46px; flex: none; box-shadow: 0 0 0 2px #fff8ea, 0 0 0 3.5px var(--c); }
.jk-row .patch::before { inset: 3px; border-width: 1px; }
.jk-row .patch b { font-size: 14px; }
.jk-row:not(.y) .patch { filter: grayscale(1) opacity(.35); }
.jk-row .t { flex: 1; min-width: 0; }
.jk-row .t b { display: block; font: 700 14px/1.25 var(--sans); }
.jk-row .t small { font: 500 12px/1.3 var(--sans); color: #7a716b; }
.jk-row .bar { height: 4px; margin-top: 5px; border-radius: 2px; background: var(--paper2); overflow: hidden; }
.jk-row .bar i { display: block; height: 100%; background: var(--c); }
.jk-reset { margin-top: 16px; font: 600 12px/1 var(--sans); color: #8a817b; text-decoration: underline; }

/* chia sẻ */
.share { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.share-qr { width: 156px; height: 156px; flex: none; padding: 8px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.share-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.share-l { flex: 1; min-width: 200px; display: grid; gap: 10px; }
.share-url { padding: 9px 11px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 500 12px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; }
.ck { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* xem ảnh lớn */
.lb { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(15, 6, 7, .9); padding: 50px 60px; }
.lb figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; justify-items: center; gap: 10px; padding: 10px 10px 14px; background: #fff; border-radius: 3px; transform: rotate(-.8deg); }
.lb img { max-width: min(1100px, calc(100vw - 140px)); max-height: calc(100vh - 160px); display: block; }
.lb figcaption { font: 600 14px/1.2 var(--hand); color: var(--ink); }
.lb-x { position: absolute; right: 14px; top: calc(14px + var(--sat)); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.lb-n { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); }
.lb-p { left: 10px; } .lb-q { right: 10px; }

/* bản đồ Leaflet */
.leaflet-container { font: 13px/1.4 var(--sans); }

/* ================= ĐIỆN THOẠI ================= */
@media (max-width: 640px) {
  .pen { width: calc(100vw - 80px - var(--sal) - var(--sar)); left: calc(8px + var(--sal)); top: calc(8px + var(--sat)); }
  .pen-flag { min-height: 78px; padding: 10px 44px 11px 28px; }
  .pen-flag .sleeve { width: 14px; }
  .pen-title { font-size: 18px; }
  .pen-kick { font-size: 10px; }
  .pen-leaf { right: 12px; width: 16px; height: 16px; margin-top: -8px; }
  .pen-bar { margin-left: 14px; }
  .pen-pass span { display: none; }
  .pen-pass { padding: 0 8px; }
  .var { right: calc(8px + var(--sar)); top: calc(8px + var(--sat)); padding: 5px; border-radius: 12px; }
  .var-t, .var-p { display: none; }
  .var-c { width: 46px; height: 46px; font-size: 22px; flex-direction: column; }
  .var-c::after { content: attr(data-n); font: 600 9px/1 var(--cond); letter-spacing: .04em; color: var(--ink2); text-shadow: none; margin-top: 1px; }
  .tools { right: calc(8px + var(--sar)); top: calc(70px + var(--sat)); transform: none; gap: 7px; }
  .tools button { width: 38px; height: 38px; }
  .tools .i { width: 18px; height: 18px; }
  .flag { width: 84px; height: 94px; padding-top: 11px; }
  .flag b { font-size: 17px; }
  .flag span { font-size: 9.5px; max-width: 74px; }
  .flag .star { top: 50px; right: 10px; width: 14px; height: 14px; }
  .bt-row { justify-content: flex-start; }
  .sheet, .sheet.wide { left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: min(82vh, 720px); border-radius: 18px 18px 0 0; animation-name: shUp; }
  @keyframes shUp { from { transform: translateY(40px); opacity: 0; } }
  .toast { bottom: calc(120px + var(--sab)); }
  .lb { padding: 50px 8px; }
  .lb img { max-width: calc(100vw - 36px); }
  .lb-n { top: auto; bottom: calc(16px + var(--sab)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .pen-flag { min-height: 70px; padding-top: 8px; padding-bottom: 9px; }
  .pen-title { font-size: 18px; }
  .flag { width: 78px; height: 74px; padding-top: 9px; }
  .flag b { font-size: 15px; }
  .flag span { font-size: 9px; -webkit-line-clamp: 1; }
  .flag .dots { display: none; }
  .flag .star { top: 40px; }
  .tools { flex-direction: row; top: auto; bottom: calc(86px + var(--sab)); transform: none; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
  .tools button { width: 36px; height: 36px; }
  .tools button[data-tip]:hover::before { display: none; }
  .sheet, .sheet.wide { top: calc(8px + var(--sat)); bottom: calc(8px + var(--sab)); left: auto; right: calc(8px + var(--sar)); width: min(460px, 70vw); height: auto; border-radius: 14px; }
  .toast { bottom: calc(90px + var(--sab)); }
}
