/* Kết Nối · bố cục căn phòng, màn hình CRT, khởi động, đăng nhập và từng ứng dụng.
   Màu và khung cửa sổ kiểu XP nằm trong xp.css. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0705; }
body { font: var(--fs) var(--ui); color: #000; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; inset: 0; z-index: 2; padding: 24px; background: #fff8e1; font: 18px/1.5 Tinos, serif; }

/* ================================================================ MÀN CHỜ (js/loader.js): cô dâu chú rể ASCII đuổi nhau, trắng đen */
.loader {
  --ld-mono: Consolas, "Cascadia Mono", Menlo, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  overflow: hidden; background: #000; color: #f2f2f2; font: 15px/1.4 var(--ld-mono); text-align: center;
  transition: opacity .8s ease;
}
.loader.out { opacity: 0; pointer-events: none; }
.ld-pre { margin: 0; font: 16px/1.1 var(--ld-mono); white-space: pre; text-align: left; color: #f2f2f2; }
.ld-pre i { font-style: normal; }
.ld-pre .d { color: #6e6e6e; } /* tóc, voan, bụi, mặt đất */
.ld-pre .h { color: #fff; }    /* tim, lấp lánh */
.ld-text { display: grid; justify-items: center; gap: 4px; }
.ld-names { margin: 0; font-size: clamp(18px, 4.6vw, 26px); letter-spacing: .3em; text-transform: uppercase; color: #fff; }
.ld-date { margin: 0; font-size: clamp(12px, 3.2vw, 15px); letter-spacing: .4em; color: #8a8a8a; }
.ld-bar { margin: 10px 0 0; font-size: clamp(12px, 3.4vw, 15px); white-space: pre; color: #cfcfcf; }
.ld-bar b { font-weight: inherit; color: #fff; }
.ld-msg { margin: 0; min-height: 1.4em; font-size: clamp(12px, 3.4vw, 15px); color: #a8a8a8; }
.ld-msg::after { content: "_"; animation: ldCursor 1s steps(1) infinite; }
@keyframes ldCursor { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .loader { transition: opacity .35s; }
  .ld-msg::after { animation: none; }
}

/* ================================================================ CĂN PHÒNG */
.room { position: fixed; inset: 0; overflow: hidden; background: #140c06; z-index: 2; }
.room::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, .45) 100%); }
.room-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.room3d { position: absolute; inset: 0; width: 100%; height: 100%; display: none; outline: none; }
.room.is3d .room3d { display: block; }
.room.is3d .room-stage { display: none; }
.room.is3d::after { display: none; }
.room-stage.zooming { transition: transform 1.9s cubic-bezier(.62, 0, .22, 1); }
.room-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; z-index: 2; user-select: none; -webkit-user-select: none; pointer-events: none; }
.room-glow {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(160, 200, 255, .38), rgba(120, 160, 255, .12) 16%, transparent 34%);
  mix-blend-mode: screen; opacity: 0; transition: opacity 1.2s;
  /* không hắt sáng lên chính mặt kính màn hình */
  -webkit-mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0) var(--sx) var(--sy) / var(--sw) var(--sh) no-repeat;
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) exclude, linear-gradient(#000 0 0) var(--sx) var(--sy) / var(--sw) var(--sh) no-repeat;
}
.room.on .room-glow { opacity: 1; animation: glowflick 4s infinite; }
@keyframes glowflick { 0%, 100% { opacity: 1; } 47% { opacity: .93; } 50% { opacity: 1; } }

.crt { position: absolute; z-index: 1; overflow: hidden; background: #0b100e; cursor: pointer; }
.crt-in { position: absolute; left: 0; top: 0; width: 640px; height: 480px; transform-origin: 0 0; background: #000; opacity: 0; }
.crt.lit .crt-in { opacity: 1; }
.crt-glass {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(255, 255, 255, .13), transparent 42%),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
}
.crt::after { content: ""; position: absolute; inset: 0; background: #e8f2ff; opacity: 0; pointer-events: none; }
.crt.flash::after { animation: crtOn .9s ease-out forwards; }
.crt.off::after { animation: crtOff .7s ease-in forwards; }
.crt.off .crt-in { animation: crtFade .3s forwards; }
@keyframes crtOn { 0% { opacity: 1; transform: scale(0, .006); } 30% { opacity: 1; transform: scale(1, .006); } 55% { opacity: .9; transform: scale(1, 1); } 100% { opacity: 0; transform: scale(1, 1); } }
@keyframes crtOff { 0% { opacity: 0; transform: scale(1, 1); } 30% { opacity: .85; transform: scale(1, .06); } 55% { opacity: 1; transform: scale(1, .006); } 80% { opacity: 1; transform: scale(.02, .006); } 100% { opacity: 0; transform: scale(0, 0); } }
@keyframes crtFade { 60% { opacity: .8; filter: brightness(2.5); } to { opacity: 0; filter: brightness(3); } }

.bios { margin: 0; position: absolute; inset: 0; padding: 18px 22px; font: 19px/1.12 VT323, "Lucida Console", monospace; color: #c9c9c9; white-space: pre-wrap; background: #000; }
.bios-star { position: absolute; right: 22px; top: 16px; display: flex; align-items: center; gap: 6px; color: #f3d33a; font-size: 44px; line-height: 1; text-shadow: 0 0 6px rgba(80, 140, 255, .6); }
.bios-star small { font-size: 16px; color: #6aa4ff; line-height: 1; text-align: left; }
.bios-foot { position: absolute; left: 22px; bottom: 16px; right: 22px; color: #9a9a9a; }
.crt-safe { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.crt-safe p { margin: 0 40px; color: #ff9024; font: 34px/1.2 VT323, monospace; text-align: center; text-shadow: 0 0 8px rgba(255, 120, 20, .55); }

/* tờ giấy nhớ */
.note {
  position: absolute; z-index: 5; width: 270px;
  padding: 22px 20px 16px;
  background:
    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 .45 0 0 0 0 .35 0 0 0 0 .1 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 90% 100%, rgba(150, 100, 0, .14), transparent 55%),
    linear-gradient(170deg, #fff8a8, #ffe86a 70%, #f7d84e);
  color: #3a2a12;
  font: 17px/1.35 Itim, "Comic Sans MS", cursive;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .18), 6px 14px 24px rgba(0, 0, 0, .5);
  transform: rotate(-2.2deg);
  transition: opacity .5s, transform .6s cubic-bezier(.3, .6, .3, 1);
  opacity: 0;
}
.loaded .note, .note.note-end { opacity: 1; }
.note::before { content: ""; position: absolute; left: 50%; top: -12px; width: 96px; height: 26px; margin-left: -48px; background: rgba(240, 236, 220, .62); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transform: rotate(3deg); }
.note.below { left: 50% !important; top: auto !important; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(350px, calc(100vw - 32px)); transform: translateX(-50%) rotate(-1.4deg); }
.note.gone { opacity: 0 !important; transform: translateY(40px) rotate(-6deg); pointer-events: none; }
.note.below.gone { transform: translate(-50%, 60px) rotate(-6deg); }
.note-kicker { margin: 0 0 2px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.note-title { margin: 0 0 6px; font: 400 34px/1.1 Pacifico, Itim, cursive; color: #2b1d0a; }
.note-title span { color: #e2304b; font-family: Itim, sans-serif; }
.note-line { margin: 0 0 14px; }
.power {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 8px 20px 8px 14px;
  border: 1px solid #9c8e6c; border-radius: 24px;
  background: linear-gradient(180deg, #fbf5e6, #e6dbc0 60%, #d4c6a2);
  box-shadow: inset 0 1px #fff, 0 3px 0 #a99a74, 0 5px 10px rgba(0, 0, 0, .35);
  font: 700 16px Tahoma, "Noto Sans", sans-serif; color: #2f2614;
  cursor: pointer; touch-action: manipulation;
}
.power:active { transform: translateY(2px); box-shadow: inset 0 1px #fff, 0 1px 0 #a99a74, 0 2px 6px rgba(0, 0, 0, .3); }
.power:focus-visible { outline: 2px dashed #6b4b12; outline-offset: 3px; }
.power:disabled { cursor: progress; color: #6d6450; }
.power-led { width: 11px; height: 11px; border-radius: 50%; background: #3cff52; box-shadow: 0 0 6px 2px rgba(60, 255, 90, .75), inset 0 -2px 2px rgba(0, 0, 0, .3); animation: led 1.6s ease-in-out infinite; }
.power:disabled .power-led { background: #ffb02e; box-shadow: 0 0 6px 2px rgba(255, 170, 40, .6); animation: led .5s steps(2) infinite; }
@keyframes led { 50% { opacity: .45; } }
.note-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 15px; }
.note-link { padding: 4px 0; border: 0; background: none; color: #5a3d0c; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.note-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

/* ================================================================ MÀN HÌNH MÁY TÍNH */
.os {
  --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='30' viewBox='0 0 20 30'%3E%3Cpath d='M1 1v23l5.5-5.2 3.8 8.6 3.6-1.6-3.8-8.4H17z' fill='%23fff' stroke='%23000' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 1 1, default;
  position: fixed; inset: 0; z-index: 3; overflow: hidden; background: #000; cursor: var(--cur);
}
/* trong XP, nút bấm vẫn dùng mũi tên; chỉ liên kết mới có bàn tay */
.os button, .os .balloon, .os .ph-card, .os .bl-u, .os .sn-msg, .os .dicon, .os .lg-user { cursor: var(--cur); }
.os a, .os .link, .os .doc-links .link, .os .pb-opts button { cursor: pointer; }
.os.fade-in { animation: fadeIn .7s ease-out; }
.os.fade-out { animation: fadeIn .6s ease-in reverse forwards; }
.os.black > * { visibility: hidden; }
@keyframes fadeIn { from { opacity: 0; } }

/* logo */
.xp-logo { display: inline-grid; justify-items: start; color: #fff; user-select: none; -webkit-user-select: none; }
.xl-brand { margin: 0 0 -6px 6px; font: 700 15px var(--title); letter-spacing: .02em; }
.xl-brand sup { font-size: .6em; }
.xl-word { font: italic 800 68px/1 "Fira Sans", "Franklin Gothic Medium", Arial, sans-serif; letter-spacing: -1.5px; text-shadow: 2px 2px 3px rgba(0, 0, 0, .25); }
.xl-word em { margin-left: 4px; font-size: .52em; color: #ff7b25; vertical-align: .62em; }
.xl-ed { justify-self: end; margin-top: -4px; font: italic 700 19px var(--title); color: #dfe7ff; }
.xp-logo.small .xl-word { font-size: 44px; }
.xp-logo.tiny .xl-word { font-size: 20px; letter-spacing: 0; }

.boot { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 56px; background: #000; padding-bottom: 6vh; }
.boot-bar { position: relative; width: 170px; height: 20px; border: 2px solid #b9b9b9; border-radius: 6px; overflow: hidden; }
.boot-bar i { position: absolute; top: 2px; left: 0; width: 9px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, #2a3aa8, #3e7af7 40%, #87b3ff 50%, #3e7af7 60%, #1d36a8); animation: bootbar 2s linear infinite; }
.boot-bar i:nth-child(2) { animation-delay: .12s; } .boot-bar i:nth-child(3) { animation-delay: .24s; }
@keyframes bootbar { from { transform: translateX(-34px); } to { transform: translateX(190px); } }
.boot-copy, .boot-corp { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; color: #fff; font: 13px var(--ui); }
.boot-copy { left: 26px; } .boot-corp { right: 26px; font: italic 700 16px var(--title); }

/* đăng nhập */
.login { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(54px, 11vh) 1fr minmax(64px, 13vh); background: #5a7edc; color: #fff; }
.lg-top { background: #00309c; position: relative; }
.lg-top::after, .lg-bot::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; }
.lg-top::after { bottom: 0; background: linear-gradient(90deg, #5a7edc, #fff 35%, #fff 45%, #5a7edc 90%); opacity: .7; }
.lg-mid { position: relative; display: grid; grid-template-columns: 1fr 2px 1fr; align-items: center; gap: 28px; padding: 24px 4vw; background: radial-gradient(ellipse at 15% 10%, #8fb1f1, transparent 55%), linear-gradient(90deg, #5a7edc, #6687e0 40%, #4b6fd3); }
.lg-left { justify-self: end; text-align: right; display: grid; justify-items: end; gap: 18px; }
.lg-left p { margin: 0; font: 16px var(--ui); }
.lg-line { align-self: stretch; margin: 6vh 0; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .85) 30%, rgba(255, 255, 255, .85) 70%, transparent); }
.lg-users { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; justify-self: start; width: min(380px, 100%); }
.lg-li { border-radius: 8px; transition: opacity .3s; }
.lg-li.dim { opacity: .35; }
.lg-li.picked, .lg-li:hover { background: linear-gradient(90deg, #0e3aac, rgba(14, 58, 172, 0) 95%); }
.lg-li.shake { animation: shake .45s linear; }
.lg-user { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; border: 0; background: none; color: #fff; text-align: left; cursor: pointer; touch-action: manipulation; }
.lg-user img { width: 58px; height: 58px; border: 2px solid #fff; border-radius: 5px; object-fit: cover; flex: none; box-shadow: 1px 1px 3px rgba(0, 0, 0, .35); transition: border-color .2s; }
.lg-user:hover img, .lg-user:focus-visible img { border-color: #ffcf5c; }
.lg-user:focus-visible { outline: 1px dotted #fff; }
.lg-user b { display: block; font: 20px var(--title); }
.lg-user small { font: 13px var(--ui); color: #dbe6ff; }
.lg-pass { padding: 0 8px 10px 82px; font-size: 13px; }
.lg-pass label { display: block; margin-bottom: 4px; }
.lg-pass-row { display: flex; gap: 6px; }
.lg-pass .field { width: 170px; letter-spacing: 2px; border-color: #0d2b84; }
.lg-go { width: 32px; border: 1px solid #fff; border-radius: 4px; background: linear-gradient(180deg, #6fd165, #2f9f30); color: #fff; font-size: 18px; cursor: pointer; }
.lg-pass small { display: block; margin-top: 4px; color: #cfdcff; }
.lg-welcome { position: absolute; inset: 0; grid-row: 2 / 3; grid-column: 1 / -1; display: grid; place-items: center; margin: 0; font: italic 700 clamp(44px, 8vw, 80px) var(--title); text-shadow: 3px 3px 6px rgba(0, 0, 40, .45); background: radial-gradient(ellipse at 15% 10%, #8fb1f1, transparent 55%), linear-gradient(90deg, #5a7edc, #6687e0 40%, #4b6fd3); animation: fadeIn .5s; }
.lg-busy { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); width: min(460px, 90vw); margin: 0; padding: 8px 12px; border: 1px solid #000; border-radius: 6px; background: #ffffe1; color: #000; font: 13px var(--ui); text-align: center; box-shadow: 2px 2px 4px rgba(0, 0, 0, .3); }
.lg-bot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 4vw calc(env(safe-area-inset-bottom)); background: #00309c; }
.lg-bot::before { top: 0; background: linear-gradient(90deg, #00309c, #f99736 30%, #f99736 60%, #00309c); }
.lg-bot p { margin: 0; max-width: 360px; font-size: 12px; text-align: right; color: #dfe8ff; }
.lg-off { display: flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: #fff; font: 14px var(--ui); cursor: pointer; }
.lg-off i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #fff; border-radius: 4px; background: linear-gradient(180deg, #ef8f63, #c94119); font-style: normal; }

/* ================================================================ MÀN HÌNH CHÍNH */
.desktop { position: absolute; inset: 0; overflow: hidden; }
.wallpaper { position: absolute; inset: 0; background: #3a7bd5 url("../assets/img/wallpaper.webp") 62% 50% / cover no-repeat; }
.windows { position: absolute; left: 0; top: 0; right: 0; bottom: calc(var(--task-h) + env(safe-area-inset-bottom)); z-index: 2; pointer-events: none; }
.windows > .win { pointer-events: auto; }
.win { container-type: inline-size; }
.desktop.greying .wallpaper, .desktop.greying .icons, .desktop.greying .windows, .desktop.greying .taskbar, .desktop.greying > .dicon { filter: grayscale(1) brightness(.8); transition: filter 1.6s; }

/* ---------------- Yêu! Messenger: đăng nhập */
.yl { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; background: linear-gradient(180deg, #fff, #f1f0ea); height: 100%; position: relative; }
.yl-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 8px; }
.yl-logo .emo { width: 64px; height: 64px; filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, .3)); }
.yl-logo span { font: italic 800 34px/1 "Fira Sans", sans-serif; color: #d81b60; letter-spacing: -1px; }
.yl-logo em { display: block; font: 700 15px var(--title); color: #555; letter-spacing: 0; }
.yl label:not(.check) { display: grid; gap: 3px; font-size: 12px; color: #333; }
.yl .btn { align-self: center; margin-top: 6px; min-width: 120px; }
.yl.busy > :not(.yl-wait):not(.yl-logo) { visibility: hidden; }
.yl-wait { position: absolute; left: 18px; right: 18px; top: 130px; display: grid; justify-items: center; gap: 8px; }
.yl-wait .emo { width: 54px; height: 54px; animation: spin 1.4s linear infinite; }
.yl-wait .progress { width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* danh sách bạn bè */
.bl { display: flex; flex-direction: column; height: 100%; background: #fff; }
.bl-me { display: flex; gap: 8px; align-items: center; padding: 8px; background: linear-gradient(180deg, #fdf3ff, #efe0f7); border-bottom: 1px solid #d6c3e5; }
.bl-me img { width: 44px; height: 44px; border: 1px solid #999; object-fit: cover; }
.bl-me b { display: block; font-size: 13px; }
.bl-me small { display: block; font-size: 11px; color: #555; }
.bl-tabs { display: flex; gap: 2px; padding: 4px 6px 0; background: #ece9d8; border-bottom: 1px solid #919b9c; font-size: 12px; }
.bl-tabs span { padding: 3px 10px; border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0; background: #f4f3ee; }
.bl-tabs .on { background: #fff; border-top: 2px solid #e68b2c; margin-bottom: -1px; }
.bl-list { flex: 1; list-style: none; margin: 0; padding: 4px 0; font-size: 12.5px; }
.bl-g { padding: 5px 8px 2px; font-weight: 700; color: #3b3b3b; }
.bl-u { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 14px; }
.bl-u[data-bl-chat] { cursor: pointer; }
.bl-u:hover { background: #e8eefc; }
.bl-u img { width: 26px; height: 26px; object-fit: cover; border: 1px solid #bbb; }
.bl-u b { display: block; font-weight: 400; }
.bl-u small { display: block; color: #777; font-size: 11px; line-height: 1.25; }
.bl-u small .emo { width: 15px; height: 15px; vertical-align: -3px; }
.bl-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff59a, #f2c200 50%, #b88a00); box-shadow: 0 0 0 1px #9b7a00; }
.bl-u.idle .bl-dot { background: radial-gradient(circle at 35% 35%, #ffd7d0, #e5512b 50%, #9e2b10); box-shadow: 0 0 0 1px #8a2610; }
.bl-u.off { color: #9a9a9a; }
.bl-u.off .bl-dot { background: #d8d8d8; box-shadow: 0 0 0 1px #aaa; }
.bl-ad { margin: 6px; padding: 8px; border: 2px dashed #f15b2a; background: linear-gradient(90deg, #fff27a, #ffd2f4); font-size: 12px; text-align: center; animation: adblink 1s steps(1) infinite; }
@keyframes adblink { 50% { border-color: #2a7bf1; } }

/* cửa sổ chat */
.ym { display: flex; flex-direction: column; height: 100%; background: var(--face); }
.ym-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: linear-gradient(180deg, #fbf8ff, #ebe3f5); border-bottom: 1px solid #cbbfd9; }
.ym-av { width: 40px; height: 40px; border: 1px solid #8f8f8f; object-fit: cover; }
.ym-who { flex: 1; min-width: 0; }
.ym-who b { display: block; font-size: 14px; }
.ym-who small { display: block; font-size: 12px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-who small .emo { width: 16px; height: 16px; vertical-align: -3px; }
.ym-ctl { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.ym-ctl .tb { border-color: #cbc4b0; background: linear-gradient(180deg, #fff, #f0eee6); font-size: 12px; }
.ym-ctl .tb.on { background: #ffe9a8; border-color: #e0b24a; }
.ym-main { position: relative; flex: 1; min-height: 0; display: flex; gap: 6px; padding: 6px 6px 0; }
.ym-log { flex: 1; min-width: 0; padding: 8px 10px; background: #fff; border: 1px solid; border-color: #7f9db9; font-size: 14.5px; line-height: 1.5; }
.ym-side { flex: none; width: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.ym-side figure { margin: 0; text-align: center; font-size: 11px; color: #444; }
.ym-side img { width: 104px; height: 104px; object-fit: cover; border: 1px solid #888; background: #fff; padding: 2px; }
.ym-side figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 560px) { .ym-side { display: none; } }
.m { margin: 0 0 3px; overflow-wrap: anywhere; }
.m-new { animation: msgIn .25s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.m-t { color: #9a9a9a; font-size: 11px; }
.m-who { font-weight: 700; }
.m-nam .m-who, .m-nam .m-txt { color: #1d3bb3; }
.m-nam .m-txt { font-family: Arimo, Arial, sans-serif; }
.m-trang .m-who { color: #c4126c; }
.m-trang .m-txt { color: #d0177a; font-family: "Comic Sans MS", Itim, cursive; font-size: 1.04em; }
.m-guest .m-who { color: #0b8a3b; }
.m-sys { margin: 4px 0; color: #808080; font-size: 12.5px; font-style: italic; }
.m-date { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; color: #6d6d6d; font-size: 12px; font-weight: 700; }
.m-date::before, .m-date::after { content: ""; flex: 1; height: 1px; background: #d6d3c4; }
.m-date.m-later { margin: 8px 0 4px; font-weight: 400; }
.m-buzz span { color: #e00000; font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.emo { width: 21px; height: 21px; vertical-align: -5px; overflow: visible; }
.emo * { transform-box: fill-box; transform-origin: center; }
.emo-beat { animation: beat .9s ease-in-out infinite; }
.emo-laugh { animation: wobble .8s ease-in-out infinite; transform-origin: center; }
.emo-tears { stroke-dasharray: 9; animation: tears 1.2s linear infinite; }
.emo-tear { animation: beat .6s infinite; }
.emo-spin { animation: spin 1.2s linear infinite; }
.emo-spin.r { animation-direction: reverse; }
.emo-float { animation: floaty 1.6s ease-in-out infinite; }
.emo-twinkle { animation: beat 1s infinite; }
.emo-tap { animation: beat .5s steps(2) infinite; }
@keyframes beat { 50% { transform: scale(1.18); } }
@keyframes wobble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes tears { from { stroke-dashoffset: 18; } to { stroke-dashoffset: 0; } }
@keyframes floaty { 50% { transform: translate(1px, -3px); } }

.m-photo { margin: 6px 0 8px; font-size: 13px; }
.ph-card { display: flex; gap: 10px; align-items: center; width: min(100%, 420px); margin-top: 4px; padding: 6px; border: 1px solid #cfcab5; border-radius: 3px; background: #f8f7f1; text-align: left; cursor: zoom-in; }
.ph-card:hover { border-color: #8aa6d8; background: #eef3fd; }
.ph-card img { width: 128px; flex: none; border: 1px solid #999; transition: filter .4s, opacity .4s; }
.ph-card.loading img { filter: blur(5px) grayscale(.6); opacity: .55; }
.ph-meta { display: grid; gap: 3px; min-width: 0; }
.ph-name { font-weight: 700; font-size: 12px; overflow-wrap: anywhere; }
.ph-cap { font-size: 12.5px; color: #444; }
.ph-card:not(.loading) .progress { display: none; }
.ph-card .progress { height: 12px; }
.m-file { display: flex; gap: 10px; margin: 8px 0; padding: 8px 10px; border: 1px solid #e3cf82; border-radius: 4px; background: #fffbe3; font-size: 13px; }
.m-file > img { width: 40px; height: 40px; flex: none; }
.f-body p { margin: 0 0 6px; }
.f-name { color: #1d3bb3; }
.f-act { display: flex; flex-wrap: wrap; gap: 6px; }
.f-prog small { display: block; margin-top: 4px; color: #555; }
.f-done span { color: #1b7d1b; font-weight: 700; margin-left: 6px; }
.ym-typing { flex: none; height: 20px; margin: 0; padding: 2px 10px; font-size: 12px; color: #555; font-style: italic; white-space: nowrap; overflow: hidden; }
.pen { display: inline-block; animation: wobble .6s infinite; font-style: normal; }
.ym-fmt { margin: 0 6px; border: 1px solid #c5c2b2; border-bottom: 0; }
.ym-fmt .emo { width: 18px; height: 18px; vertical-align: -4px; }
.ym-buzz { color: #c00; font-weight: 700; }
.ym-emo-pop { position: absolute; left: 8px; bottom: 96px; z-index: 5; display: grid; grid-template-columns: repeat(6, 34px); gap: 2px; padding: 6px; background: #fff; border: 1px solid #7f9db9; box-shadow: 2px 2px 6px rgba(0, 0, 0, .25); }
.ym-emo-pop .tb { width: 34px; height: 32px; padding: 0; justify-content: center; }
.ym-emo-pop .emo { width: 22px; height: 22px; }
.ym-input { flex: none; display: flex; gap: 6px; padding: 0 6px 6px; }
.ym-box, .ym-real { flex: 1; min-width: 0; min-height: 48px; padding: 6px 8px; font: 14px Arimo, Arial, sans-serif; color: #1d3bb3; }
.ym-box { white-space: pre-wrap; overflow: hidden; }
.ym-box::after { content: "|"; color: #000; animation: blink 1s steps(1) infinite; font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }
.ym-input .btn { min-width: 64px; align-self: stretch; }
.ym-cam { position: absolute; top: 12px; right: 12px; z-index: 4; width: min(230px, 55%); padding: 0 2px 2px; border-radius: 5px 5px 0 0; background: #0b54e6; box-shadow: 2px 3px 10px rgba(0, 0, 0, .4); }
.ym-cam-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 2px 3px 2px 6px; color: #fff; font: 700 11px var(--title); }
.ym-cam-bar .wb { width: 18px; height: 18px; }
.ym-cam-v { position: relative; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.ym-cam-v img { display: block; width: 100%; height: 100%; object-fit: cover; animation: camjit 3s steps(1) infinite; }
@keyframes camjit { 0% { transform: none; } 18% { transform: translate(-1px, 1px); filter: brightness(1.08); } 32% { transform: none; } 55% { transform: translate(1px, 0); } 70% { transform: none; filter: contrast(1.1); } 88% { transform: translate(0, -1px) scale(1.01); } }
.cam-rec { position: absolute; left: 6px; bottom: 4px; color: #ff4b4b; font: 13px VT323, monospace; text-shadow: 0 0 3px #000; }

/* hộp thoại cầu hôn */
.ask .ask-av { width: 54px; height: 54px; object-fit: cover; border: 1px solid #888; }
.ask-q { margin: 0 0 6px; font-size: 14px; }
.ask-q b { font-size: 19px; color: #1d3bb3; }
.ask-q .emo { width: 26px; height: 26px; vertical-align: -6px; }
.ask-hint { margin: 0; color: #555; font-size: 12px; }
.ask-btns { min-height: 72px; align-items: flex-end; }
.ask-no.dodging { position: absolute; transition: left .16s ease-out, top .16s ease-out; }
.ask-no.ask-gave-up { position: static; }
.burst { position: absolute; inset: 0; z-index: 9500; pointer-events: none; overflow: hidden; }
.burst span { position: absolute; bottom: -40px; animation: burst var(--d) ease-out forwards; }
.burst .emo { width: 34px; height: 34px; }
@keyframes burst { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--x), -105vh) scale(1.2) rotate(20deg); opacity: .2; } }

/* ---------------- quay số mạng */
.du-anim { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 0; }
.du-anim img { width: 46px; height: 46px; }
.du-dots { display: flex; gap: 6px; }
.du-dots i { width: 7px; height: 7px; border-radius: 50%; background: #2a68d8; opacity: .2; animation: dots 1s infinite; }
.du-dots i:nth-child(2) { animation-delay: .15s; } .du-dots i:nth-child(3) { animation-delay: .3s; } .du-dots i:nth-child(4) { animation-delay: .45s; } .du-dots i:nth-child(5) { animation-delay: .6s; }
@keyframes dots { 30% { opacity: 1; } }
.du-st { margin: 0; font-weight: 700; }
.du-sub { margin: -6px 0 0; color: #555; font-size: 12px; }

/* ---------------- thiệp mời .doc */
.word { position: relative; display: flex; flex-direction: column; height: 100%; }
.wd-tools .tb, .wd-fmt .tb { padding: 0 5px; }
.wd-tools svg { width: 16px; height: 16px; }
.wd-combo { display: inline-block; min-width: 46px; padding: 2px 18px 2px 5px; border: 1px solid #7f9db9; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5h6L5 7z' fill='%23000'/%3E%3C/svg%3E") right 3px center / 10px no-repeat; font-size: 12px; }
.wd-combo.wide { min-width: 120px; }
.wd-al i { display: block; width: 14px; height: 12px; background: repeating-linear-gradient(180deg, #333 0 2px, transparent 2px 4px); clip-path: polygon(0 0, 100% 0, 100% 17%, 0 17%, 0 33%, 70% 33%, 70% 50%, 0 50%, 0 67%, 100% 67%, 100% 83%, 0 83%); }
.wd-al.c i { clip-path: polygon(0 0, 100% 0, 100% 17%, 0 17%, 15% 33%, 85% 33%, 85% 50%, 15% 50%, 0 67%, 100% 67%, 100% 83%, 0 83%); }
.wd-al.on { border-color: #316ac5; background: #c1d2ee; }
.wd-color i { display: block; height: 3px; margin-top: 1px; background: #e01b1b; }
.wd-ruler { flex: none; height: 18px; background: #ece9d8; border-bottom: 1px solid #c5c2b2; padding: 2px 0; }
.wd-ruler span { display: block; width: min(700px, calc(100% - 32px)); height: 100%; margin: 0 auto; background: #fff repeating-linear-gradient(90deg, transparent 0 9px, #999 9px 10px) 0 60% / 100% 40% no-repeat; border: 1px solid #b8b8b8; }
.wd-area { flex: 1; min-height: 0; padding: 18px 16px 60px; background: #9ea7b8; outline: none; }
.page {
  width: min(700px, 100%); margin: 0 auto; padding: 48px clamp(18px, 7%, 66px) 56px;
  background: #fff; color: #000;
  border: 1px solid #555; box-shadow: 3px 3px 0 #4a4f5c;
  font: 17px/1.55 "Times New Roman", Tinos, serif;
  text-align: center;
}
.clip { display: block; width: 46%; max-width: 230px; margin: 0 auto -6px; }
.wordart { display: block; width: 100%; height: auto; overflow: visible; }
.wa-title { filter: drop-shadow(1px 1px 0 #6a1f8a) drop-shadow(1px 1px 0 #5b197a) drop-shadow(1px 1px 0 #4c1468) drop-shadow(1px 1px 0 #3d0f56) drop-shadow(3px 5px 3px rgba(0, 0, 0, .35)); }
.wa-names { margin: 6px 0 16px; filter: drop-shadow(1px 1px 0 #a35b00) drop-shadow(1px 1px 0 #8c4c00) drop-shadow(1px 1px 0 #733e00) drop-shadow(2px 4px 3px rgba(0, 0, 0, .3)); }
.wa-depth { display: none; }
.wa-face { font: 800 66px "Baloo 2", "Arial Black", sans-serif; text-anchor: middle; stroke: #13207a; stroke-width: 2.6px; paint-order: stroke; letter-spacing: 1px; }
.wa-face.gold { font-size: 52px; stroke: #6e3600; stroke-width: 2.2px; }
.p-center { margin: 0 0 4px; }
.p-small { font-size: .9em; font-style: italic; }
.guest-name { color: #b0122e; font-size: 1.15em; text-decoration: underline wavy #e33; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.dream { margin: 14px auto 24px; }
/* khung ảnh oval kiểu ảnh cưới studio 2000: viền hồng, loé trắng quanh mép, kim tuyến lấp lánh */
.dream-frame { position: relative; display: block; width: min(62%, 310px); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 5px #fff, 0 0 0 8px #f5a9c2, 0 0 22px 12px rgba(255, 175, 205, .75); }
.dream-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.dream-frame::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 50%; box-shadow: inset 0 0 28px 16px rgba(255, 255, 255, .92); }
.dream-frame::after { z-index: 2; content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 18% 22%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 78% 16%, #fff 0 2px, transparent 3px), radial-gradient(circle at 86% 64%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 24% 78%, #fff 0 2px, transparent 3px), radial-gradient(circle at 60% 88%, #fff 0 1.5px, transparent 2.5px); animation: twinkle 1.6s steps(2) infinite; }
@keyframes twinkle { 50% { opacity: .2; } }
.dream figcaption { margin-top: 12px; font-size: 13px; font-style: italic; color: #666; }
.families, .sched { width: 100%; margin: 0 auto 18px; border-collapse: collapse; font-size: .95em; }
.families th, .families td, .sched th, .sched td { border: 1px solid #000; padding: 6px 10px; vertical-align: top; }
.families th { font-variant: small-caps; letter-spacing: .05em; background: #fde4ec; }
.sched caption { margin-bottom: 8px; font-weight: 700; font-size: 1.15em; }
.sched th { width: 36%; text-align: left; font-weight: 400; font-style: italic; background: #f2f6ff; }
.sched td { text-align: left; font-weight: 700; }
.sq { display: inline-block; padding: 0 4px; border: 2px solid #e33; border-radius: 50%; color: #c00; }
.textbox { margin: 0 auto 18px; padding: 10px 12px; border: 1px solid #000; box-shadow: 4px 4px 0 #c9c9c9; background: #fffdf1; }
.tb-label { margin: 0 0 2px; font-size: 13px; font-style: italic; }
.cd { margin: 0; font-size: 1.05em; }
.cd b { font: 700 1.6em Tinos, serif; color: #c4122f; }
.cd-done { display: none; margin: 0; font-weight: 700; color: #c4122f; }
.textbox.done .cd { display: none; } .textbox.done .cd-done { display: block; }
.doc-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 0 0 18px; }
.doc-links a, .doc-links .link { color: #0000ee; font-size: 1.02em; text-decoration: underline; cursor: pointer; padding: 4px 0; font-family: inherit; }
.doc-links a:visited { color: #551a8b; }
.closing { margin: 0 0 6px; font-style: italic; }
.sign { margin: 0 0 18px; font: 26px Pacifico, cursive; color: #b0122e; }
.ps { margin: 0; font-size: 13px; text-align: left; color: #333; }
.ps .emo { width: 17px; height: 17px; }
.squig { text-decoration: underline wavy #e33; text-decoration-thickness: 1px; }

/* trợ lý Phong Bì */
.pb { position: absolute; right: 26px; bottom: 40px; z-index: 6; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.pb > * { pointer-events: auto; }
.pb-guy { width: 116px; padding: 0; border: 0; background: none; cursor: pointer; animation: bob 2.6s ease-in-out infinite, pbIn .6s cubic-bezier(.3, 1.6, .5, 1); }
.pb-guy svg { display: block; width: 100%; }
.pb-eyes { animation: pbBlink 4.2s infinite; }
.pb-flap { animation: pbFlap 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes pbIn { from { transform: translateY(60px) scale(.4); opacity: 0; } }
@keyframes pbBlink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes pbFlap { 0%, 80%, 100% { transform: none; } 88% { transform: scaleY(.82); } }
.pb-say { position: relative; width: min(290px, calc(100cqw - 40px)); margin: 0 18px 12px 0; padding: 10px 12px 8px; background: #ffffc9; border: 1px solid #000; border-radius: 10px; box-shadow: 2px 3px 6px rgba(0, 0, 0, .3); font: 13px/1.4 var(--ui); text-align: left; animation: balIn .3s; }
.pb-say::after { content: ""; position: absolute; right: 44px; bottom: -14px; border: 7px solid transparent; border-top: 8px solid #000; }
.pb-say::before { content: ""; position: absolute; right: 45px; bottom: -11px; border: 6px solid transparent; border-top: 7px solid #ffffc9; z-index: 1; }
.pb-hint { width: auto; max-width: 230px; margin-bottom: 14px; padding: 7px 10px; }
.pb-q { margin: 0 0 6px; }
.pb-opts { list-style: none; margin: 0; padding: 0; }
.pb-opts button { display: flex; gap: 8px; align-items: baseline; width: 100%; padding: calc(3px + var(--tap) / 2) 4px; border: 1px solid transparent; border-radius: 3px; background: none; text-align: left; color: #00f; cursor: pointer; }
.pb-opts button::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #bfe4ff, #2f7fe0 60%, #0b4ba8); transform: translateY(1px); }
.pb-opts button:hover { border-color: #9fb7e8; background: #fff; text-decoration: underline; }

/* ---------------- trình hướng dẫn hồi âm */
.wiz { display: grid; grid-template-columns: 164px 1fr; grid-template-rows: 1fr auto; height: 100%; background: #fff; }
.wiz-side { grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 10px; background: linear-gradient(165deg, #1d4fd6, #5d93ef 50%, #cfe0fb); }
.wiz-side img:first-child { width: 86px; filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, .35)); }
.wiz-doves { width: 140px; }
.wiz-pages { position: relative; min-height: 0; overflow: auto; padding: 20px 22px; }
.wiz-big { margin: 0 0 16px; font: 700 20px/1.25 Verdana, var(--ui); color: #000; }
.wiz-head { margin: -20px -22px 14px; padding: 12px 22px; background: #fff; border-bottom: 1px solid #aca899; font-size: 14px; }
.wiz-head small { display: block; margin-top: 3px; padding-left: 16px; font-weight: 400; color: #333; }
.wiz-page p { margin: 0 0 10px; line-height: 1.5; }
.wiz-body { display: grid; gap: 12px; }
.wiz-field { display: grid; gap: 4px; }
.wiz-field textarea { resize: vertical; min-height: 84px; }
.wiz-inline { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.spin { display: flex; width: 110px; }
.spin .field { width: 70px; text-align: right; }
.spin-btns { display: flex; flex-direction: column; }
.spin-btns button { flex: 1; width: calc(22px + var(--tap)); padding: 0; border: 1px solid #7f9db9; border-left: 0; background: linear-gradient(180deg, #fff, #dcdad0); font-size: 8px; cursor: pointer; }
.wiz-err { margin: 10px 0 0; padding: 6px 10px; border: 1px solid #000; border-radius: 6px; background: #ffffe1; font-size: 12.5px; }
.wiz-err::before { content: "⚠ "; color: #d40; }
.wiz-nav { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; padding: 10px 12px; background: var(--face); border-top: 1px solid #fff; box-shadow: 0 -1px #aca899; }
.wiz-nav [data-wiz-cancel] { margin-left: 10px; }
.wiz-copy { justify-items: center; text-align: center; padding-top: 4px; }
.fly { position: relative; display: flex; align-items: center; justify-content: space-between; width: 240px; }
.fly img { width: 52px; height: 52px; }
.fly-paper { position: absolute; left: 44px; top: 10px; width: 140px; height: 40px; }
.fly-paper i { position: absolute; left: 0; top: 14px; width: 14px; height: 17px; background: #fff; border: 1px solid #888; box-shadow: 1px 1px 0 #ccc; animation: fly 1.5s linear infinite; opacity: 0; }
.fly-paper i:nth-child(2) { animation-delay: .5s; } .fly-paper i:nth-child(3) { animation-delay: 1s; }
@keyframes fly { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translate(64px, -26px) rotate(80deg); } 90% { opacity: 1; } 100% { transform: translate(128px, 0) rotate(170deg); opacity: 0; } }
.fly-txt { margin: 0; font-size: 12.5px; }
.wiz-copy .progress { width: 100%; }
.fly-left { margin: 0; font-size: 12px; color: #555; }
.wiz-demo { padding: 6px 8px; background: #fffbe3; border: 1px solid #e3cf82; font-size: 12px; }
@container (max-width: 520px) {
  .wiz { grid-template-columns: 1fr; }
  .wiz-side { display: none; }
}

/* ---------------- ảnh kỷ niệm */
.ex { display: flex; flex-direction: column; height: 100%; }
.ex-addr { flex: none; display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: var(--face); border-bottom: 1px solid #c5c2b2; font-size: 12px; color: #555; }
.ex-path { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; min-height: 22px; padding: 1px 4px; }
.ex-path img { width: 16px; height: 16px; }
.ex-main { flex: 1; min-height: 0; display: flex; background: #fff; }
.ex-pane { flex: none; width: 196px; padding: 12px 10px; overflow: auto; background: linear-gradient(180deg, #7ba2e7, #6375d6); }
.ex-pane section { margin-bottom: 12px; border-radius: 3px 3px 0 0; overflow: hidden; background: #d6dff7; }
.ex-pane h4 { margin: 0; padding: 5px 10px; background: linear-gradient(90deg, #fff, #c6d3f7); color: #215dc6; font-size: 12px; }
.ex-pane .link { display: block; padding: 4px 10px; font-size: 12px; color: #215dc6; text-decoration: none; text-align: left; }
.ex-pane .link:hover { text-decoration: underline; color: #428eff; }
.ex-det { margin: 0; padding: 6px 10px 8px; font-size: 11.5px; line-height: 1.45; }
.ex-film { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-view { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; padding: 12px 12px 4px; }
.ex-view img { flex: 1; min-height: 0; width: 100%; object-fit: contain; filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, .3)); }
.ex-view figcaption { padding-top: 8px; text-align: center; font-size: 13px; color: #333; }
.ex-nav { flex: none; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 12px; }
.ex-strip { flex: none; display: flex; gap: 8px; margin: 6px 0 0; padding: 8px 10px 10px; list-style: none; overflow-x: auto; border-top: 1px solid #e3e3e3; }
.ex-strip li { flex: none; width: 92px; text-align: center; font-size: 10.5px; color: #333; }
.ex-strip li span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-strip button { display: grid; place-items: center; width: 92px; height: 70px; padding: 3px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.ex-strip button img { max-height: 62px; width: auto; }
.ex-strip button.on { border: 2px solid var(--sel); background: #e5edfb; }
@container (max-width: 600px) { .ex-pane { display: none; } }
.slides { position: absolute; inset: 0; z-index: 9800; display: grid; place-items: center; background: #000; outline: none; }
.slides img { max-width: 100%; max-height: 100%; object-fit: contain; }
.slides img.in { animation: fadeIn .8s; }
.sl-cap { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0; padding: 0 16px; text-align: center; color: #fff; font-size: 15px; text-shadow: 0 1px 3px #000; }
.sl-bar { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; padding: 3px; background: rgba(30, 50, 110, .85); border-radius: 4px; }
.sl-bar button { width: 40px; height: 34px; border: 1px solid transparent; border-radius: 3px; background: none; color: #fff; font-size: 15px; cursor: pointer; }
.sl-bar button:hover { border-color: #9cbaf5; background: rgba(255, 255, 255, .15); }

/* ---------------- Wedamp */
.win.skinned { padding: 0; border-radius: 0; background: none; box-shadow: 3px 6px 16px rgba(0, 0, 0, .5); }
.amp { display: flex; flex-direction: column; gap: 5px; padding: 0 6px 6px; background: linear-gradient(180deg, #3d3f52, #23242f 30%, #2b2c39); border: 1px solid #000; box-shadow: inset 1px 1px #6c6f87, inset -1px -1px #121219; color: #bfc6e0; font: 11px var(--ui); }
.amp-title { display: flex; align-items: center; gap: 6px; height: 20px; margin: 0 -6px; padding: 0 4px 0 8px; background: linear-gradient(180deg, #5b5f80, #33354a); color: #e9d58c; font: 700 11px/1 var(--title); letter-spacing: .25em; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.amp-logo { color: #ff6b8a; letter-spacing: 0; }
.amp-line { flex: 1; height: 6px; background: repeating-linear-gradient(180deg, #e9d58c 0 1px, transparent 1px 3px); opacity: .7; }
.amp-title button { width: calc(16px + var(--tap)); height: calc(14px + var(--tap)); padding: 0; border: 1px solid #111; background: linear-gradient(180deg, #8d90a8, #4b4d62); color: #fff; font: 10px/1 var(--ui); cursor: pointer; }
.amp-main { display: flex; gap: 6px; }
.amp-lcd { position: relative; flex: none; width: 168px; height: 66px; padding: 4px 6px; background: #000; border: 1px solid; border-color: #111 #6c6f87 #6c6f87 #111; }
.amp-state { position: absolute; left: 6px; top: 6px; color: #2bff2b; font-size: 11px; }
.amp-time { position: absolute; right: 8px; top: 0; color: #2bff2b; font: 32px/1 VT323, monospace; text-shadow: 0 0 6px rgba(40, 255, 40, .6); }
.amp-lcd canvas { position: absolute; left: 8px; bottom: 4px; width: 150px; height: 26px; image-rendering: pixelated; }
.amp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.amp-marquee { overflow: hidden; height: 18px; padding: 2px 4px; background: #000; border: 1px solid; border-color: #111 #6c6f87 #6c6f87 #111; color: #2bff2b; font: 15px/14px VT323, monospace; white-space: nowrap; }
.amp-marquee span { display: inline-block; padding-left: 100%; animation: marquee calc(var(--len, 60) * .22s) linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.amp-kbps { display: flex; gap: 6px; align-items: baseline; font-size: 10px; color: #9aa0bd; }
.amp-kbps b { padding: 0 2px; background: #000; color: #2bff2b; font: 13px VT323, monospace; }
.amp-kbps span { color: #4b4f66; } .amp-kbps .on { color: #2bff2b; }
.amp-seek, .amp-vol input { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; margin: 0; background: linear-gradient(180deg, #14151c, #393b4e); border: 1px solid #111; }
.amp-seek::-webkit-slider-thumb, .amp-vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 12px; background: linear-gradient(180deg, #e3dcb8, #9b8f58); border: 1px solid #222; }
.amp-seek::-moz-range-thumb, .amp-vol input::-moz-range-thumb { width: 26px; height: 10px; border-radius: 0; background: linear-gradient(180deg, #e3dcb8, #9b8f58); border: 1px solid #222; }
.amp-btns { display: flex; align-items: center; gap: 2px; }
.amp-btns > button { width: calc(30px + var(--tap)); height: calc(22px + var(--tap)); padding: 0; border: 1px solid; border-color: #9a9db6 #15151d #15151d #9a9db6; background: linear-gradient(180deg, #6d7089, #3e4055); color: #e8eaf5; font-size: 11px; cursor: pointer; }
.amp-btns > button:active { border-color: #15151d #9a9db6 #9a9db6 #15151d; }
.amp-vol { flex: 1; display: flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 9px; letter-spacing: .1em; }
.amp-list { margin: 0; padding: 2px 0; list-style: none; background: #000; border: 1px solid; border-color: #111 #6c6f87 #6c6f87 #111; max-height: 92px; overflow: auto; font: 12px var(--ui); }
.amp-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 2px 6px; border: 0; background: none; color: #2bff2b; text-align: left; cursor: pointer; }
.amp-list button span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.amp-list button.on { background: #0000c6; color: #fff; }
.amp-list button:hover:not(.on) { background: #10301a; }

/* ---------------- Rắn săn mồi */
.sn { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 100%; padding: 14px; background: linear-gradient(180deg, #5f6c78, #39434c); outline: none; }
.sn-lcd { position: relative; padding: 8px; border-radius: 6px; background: #a9c46c; box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .45); color: #2b3a1a; }
.sn:focus-visible .sn-lcd { outline: 2px solid #ffd76a; }
.sn-top { display: flex; justify-content: space-between; margin-bottom: 4px; font: 20px/1 VT323, monospace; }
.sn canvas { display: block; width: 100%; image-rendering: pixelated; border-top: 2px solid #2b3a1a; touch-action: none; }
.sn-msg { position: absolute; left: 8px; right: 8px; top: 34px; bottom: 8px; display: grid; place-content: center; margin: 0; padding: 10px; background: rgba(169, 196, 108, .92); font: 26px/1.1 VT323, monospace; text-align: center; cursor: pointer; }
.sn-msg small { font-size: 18px; }
.sn-pad { display: none; grid-template: ". u ." ". . ." / 1fr 1fr 1fr; grid-template-areas: ". u ." "l . r" ". d ."; gap: 4px; width: 200px; margin: 0 auto; }
.sn-pad button { height: 46px; border: 1px solid #222; border-radius: 10px; background: linear-gradient(180deg, #d9dde2, #9aa3ab); font-size: 18px; touch-action: manipulation; }
.sn-pad [data-d="0,-1"] { grid-area: u; } .sn-pad [data-d="-1,0"] { grid-area: l; } .sn-pad [data-d="1,0"] { grid-area: r; } .sn-pad [data-d="0,1"] { grid-area: d; }
@media (pointer: coarse) { .sn-pad { display: grid; } }

/* ---------------- Thùng rác, Thuộc tính hệ thống, Trợ giúp */
.bin-list { flex: 1; min-width: 0; position: relative; }
.bin-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bin-list th { position: sticky; top: 0; padding: 3px 8px; background: linear-gradient(180deg, #fff, #ebeadb); border: 1px solid #d6d2c2; border-width: 0 1px 2px 0; text-align: left; font-weight: 400; }
.bin-list td { padding: 3px 8px; white-space: nowrap; }
.bin-list td img { width: 16px; height: 16px; vertical-align: -3px; }
.bin-list tr:hover td { background: #e8eefc; }
.bin-empty { margin: 40px 16px; text-align: center; color: #555; font-size: 14px; }
.tabs { display: flex; gap: 1px; margin-bottom: -15px; padding-left: 4px; position: relative; z-index: 1; font-size: 12px; }
.tabs span { padding: 3px 9px; border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #fff, #f3f3ef); }
.tabs .on { border-top: 2px solid #e68b2c; padding-bottom: 5px; background: #fcfcfe; }
.sys-body { display: flex; gap: 14px; padding: 18px 14px; border: 1px solid #919b9c; background: #fcfcfe; }
.sys-logo { flex: none; padding: 10px 12px; border-radius: 6px; background: linear-gradient(160deg, #2b5fd9, #6fa0f0); align-self: flex-start; }
.xp-logo.sys-logo { padding: 8px 10px; }
.xp-logo.sys-logo .xl-brand { font-size: 10px; margin-bottom: -2px; }
.xp-logo.sys-logo .xl-word { font-size: 24px; letter-spacing: 0; }
.sys dl { margin: 0; font-size: 12.5px; line-height: 1.45; }
.sys dt { margin-top: 8px; color: #333; }
.sys dt:first-child { margin-top: 0; }
.sys dd { margin: 0 0 0 14px; }
@container (max-width: 420px) { .sys-logo { display: none; } }
.help { height: 100%; padding: 14px 20px; background: #fff; font-size: 13.5px; line-height: 1.55; }
.help h3 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid #f99736; color: #1d4fb3; font: 700 19px var(--title); }
.help h4 { margin: 14px 0 4px; color: #1d4fb3; }
.help ul { margin: 0; padding-left: 20px; }
.help-foot { margin-top: 16px; font-style: italic; color: #555; }
.dlg-text { padding-top: 4px; line-height: 1.45; }

/* ---------------- tắt máy */
.sd { position: absolute; inset: 0; z-index: 9900; display: grid; place-items: center; padding: 16px; }
.sd-box { width: min(330px, 100%); border-radius: 6px; overflow: hidden; box-shadow: 4px 6px 18px rgba(0, 0, 0, .55); animation: balIn .25s; }
.sd-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #0d2e9c; color: #fff; font: 18px var(--title); }
.sd-head .xp-logo .xl-word { font-size: 18px; }
.sd-mid { display: flex; justify-content: space-around; gap: 6px; padding: 26px 10px; background: linear-gradient(180deg, #7f9de8, #aac0f2 50%, #7f9de8); border-top: 2px solid #f99736; }
.sd-mid button { display: grid; justify-items: center; gap: 8px; width: 92px; padding: 6px 2px; border: 0; border-radius: 4px; background: none; color: #fff; font: 12.5px var(--ui); cursor: pointer; text-shadow: 0 1px 1px rgba(0, 0, 40, .5); }
.sd-mid button:hover, .sd-mid button:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }
.sd-ico { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 6px; font-style: normal; font-size: 21px; box-shadow: 1px 2px 3px rgba(0, 0, 0, .35); }
.sd-ico.y { background: linear-gradient(180deg, #ffd769, #e19a12); }
.sd-ico.r { background: linear-gradient(180deg, #f08a5d, #c63b17); }
.sd-ico.g { background: linear-gradient(180deg, #7ad66b, #2f9b2d); }
.sd-foot { display: flex; justify-content: flex-end; padding: 10px 14px; background: #0d2e9c; }
.saving { position: absolute; inset: 0; z-index: 9990; display: grid; place-content: center; justify-items: center; gap: 30px; background: radial-gradient(ellipse at 15% 10%, #8fb1f1, transparent 55%), #5a7edc; color: #fff; animation: fadeIn .5s; }
.saving p { margin: 0; font: 20px var(--title); }
.safe { position: absolute; inset: 0; display: grid; place-content: center; gap: 18px; padding: 24px; background: #000; text-align: center; }
.safe p { margin: 0; color: #ff9024; font: clamp(30px, 5vw, 54px)/1.15 VT323, monospace; text-shadow: 0 0 10px rgba(255, 120, 20, .5); }
.safe .safe-sub { font-size: clamp(22px, 3vw, 32px); color: #ffb366; }

/* ================================================================ LỚP PHỦ CRT + CON TRỎ MA */
.crt-fx { position: fixed; inset: 0; z-index: 99990; pointer-events: none; display: none; }
.in-os:not(.no-crt) .crt-fx { display: block; }
.crt-fx {
  background:
    radial-gradient(ellipse at 22% 0%, rgba(255, 255, 255, .055), transparent 45%),
    radial-gradient(ellipse at 50% 50%, transparent 64%, rgba(0, 0, 0, .3) 100%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .075) 0 1px, transparent 1px 3px);
  animation: crtflick .14s steps(2) infinite;
}
.crt-fx::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 40, 40, .022) 0 1px, rgba(40, 255, 40, .018) 1px 2px, rgba(40, 80, 255, .022) 2px 3px); }
@keyframes crtflick { 50% { opacity: .965; } }
.ghost { position: fixed; left: 0; top: 0; z-index: 99995; width: 20px; pointer-events: none; margin: -1px 0 0 -1px; }
.ghost svg { display: block; width: 20px; height: 30px; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .4)); transition: transform .1s; transform-origin: 0 0; }
.ghost.press svg { transform: scale(.82); }

/* ================================================================ MÀN NHỎ */
@media (orientation: portrait) and (max-width: 1100px), (max-width: 640px) {
  .xl-word { font-size: 50px; }
  .boot-copy { left: 16px; right: 16px; bottom: calc(46px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; }
  .boot-corp { left: 0; right: 0; text-align: center; }
  .login { grid-template-rows: 56px 1fr auto; }
  .lg-mid { grid-template-columns: 1fr; grid-template-rows: auto 2px auto; gap: 22px; padding: 20px 18px; align-content: center; }
  .lg-left { justify-self: center; text-align: center; justify-items: center; }
  .lg-line { margin: 0 8%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85) 30%, rgba(255, 255, 255, .85) 70%, transparent); }
  .lg-users { justify-self: center; }
  .lg-bot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .lg-bot p { text-align: left; }
  .lg-pass { padding-left: 16px; }
  .icons { grid-template-rows: repeat(auto-fill, 86px); gap: 2px; }
  .dicon { width: 76px; font-size: 11.5px; }
  .dicon img { width: 40px; height: 40px; }
  .ym-ctl .tb { padding: 0 5px; }
  .wd-tools, .wd-fmt, .wd-ruler { display: none; }
  .wd-area { padding: 10px 8px 90px; }
  .page { padding: 30px 16px 40px; font-size: 16px; }
  .pb { right: 8px; bottom: 34px; }
  .pb-guy { width: 84px; }
  .pb-say { margin-right: 6px; }
  .tasks .tbtn span { display: none; }
  .tasks .tbtn { flex: 0 0 auto; padding: 0 10px; }
  .start { padding-right: 16px; font-size: 17px; }
  .clock { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .login { grid-template-rows: 40px 1fr 52px; }
  .lg-mid { padding: 8px 4vw; }
  .lg-user img { width: 44px; height: 44px; }
  .lg-users { gap: 2px; }
  .lg-left .xp-logo .xl-word { font-size: 34px; }
  .icons { grid-template-rows: repeat(auto-fill, 78px); }
  .dicon img { width: 34px; height: 34px; }
  .note { padding: 16px 14px 10px; font-size: 14px; }
  .note-title { font-size: 26px; }
  .note-line { margin-bottom: 10px; }
  .note .power { min-height: 40px; padding: 6px 16px 6px 12px; font-size: 14px; }
  .note-links { margin-top: 8px; font-size: 13px; }
  .note.below { width: min(320px, calc(100vw - 32px)); }
  .wd-tools, .wd-fmt, .wd-ruler { display: none; }
  .pb-guy { width: 70px; }
  /* chat, album, rắn săn mồi trên điện thoại cầm ngang: bỏ bớt thanh phụ để chừa chỗ cho nội dung */
  .ym > .menubar, .ym-side, .ym-fmt, .ym-typing:empty { display: none; }
  .ym-head { padding: 3px 6px; }
  .ym-av { width: 28px; height: 28px; }
  .ym-box, .ym-real { min-height: 36px; padding: 4px 8px; }
  .ym-input { padding-top: 4px; }
  .ex > .menubar, .ex-addr, .ex-pane { display: none; }
  .ex-view { padding: 6px 8px 2px; }
  .ex-view figcaption { padding-top: 4px; }
  .ex-strip { padding: 4px 8px 6px; margin: 2px 0 0; }
  .ex-strip li { width: 64px; }
  .ex-strip li span { display: none; }
  .ex-strip button { width: 64px; height: 46px; }
  .ex-strip button img { max-height: 38px; }
  .sn { flex-direction: row; align-items: center; justify-content: center; padding: 8px; }
  .sn-lcd { width: min(100%, calc((100svh - 160px) * 1.4 + 16px)); }
  .sn-pad { flex: none; width: 170px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .crt-fx { animation: none; }
}
