:root {
  --bg: #f4efe6; --card: #fffdf8; --ink: #2b2620; --muted: #7a6f62; --line: #e4dccd;
  --accent: #e8702a; --accent-ink: #fff; --good: #2f9e6a; --bad: #d64545; --coin: #d99a00;
  --shadow: 0 6px 24px rgba(60, 40, 10, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
h1, h3 { margin: 0; }
h3 { font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
h3 small { color: var(--muted); font-weight: 500; }
kbd { background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }

.btn { border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; background: #ece4d5; color: var(--ink); }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.warm { background: #2b2620; color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { padding: 5px 9px; font-size: 13px; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }

/* Auth */
#auth { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #ffe0c2 0, transparent 40%), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--card); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; }
.sub { color: var(--muted); margin: 6px 0 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: #f1ebdf; padding: 9px; border-radius: 9px; font: inherit; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--ink); color: #fff; }
.form { display: flex; flex-direction: column; gap: 10px; }
.creator { display: flex; gap: 14px; align-items: center; }
#preview { background: #efe6d4; border-radius: 12px; image-rendering: pixelated; flex: none; }
.look-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; flex: 1; }
.look-fields label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--muted); }
.look-fields label:last-child { grid-column: span 2; }
.look-fields input[type=color] { width: 40px; height: 28px; padding: 2px; }
.error { color: var(--bad); min-height: 1em; margin: 10px 0 0; }

/* Game */
#game { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 800; }
.banner { flex: 1; min-width: 200px; font-weight: 600; color: var(--muted); }
.banner b { color: var(--accent); }
.me-box { display: flex; align-items: center; gap: 8px; }
.coin { font-weight: 800; color: var(--coin); background: #fff6dd; padding: 4px 10px; border-radius: 99px; }
.coin::after { content: " MCOIN"; font-size: 11px; font-weight: 700; }
.layout { flex: 1; display: grid; grid-template-columns: 1fr 320px; gap: 12px; padding: 12px; min-height: 0; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
#office { max-width: 100%; max-height: calc(100% - 30px); border-radius: 12px; box-shadow: var(--shadow); image-rendering: pixelated; background: #ddd; }
.help { color: var(--muted); font-size: 12px; margin-top: 8px; }
.hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 7px 14px; border-radius: 99px; font-weight: 600; pointer-events: none; }
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.panel { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.bar { height: 6px; background: #efe6d4; border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.bar div { height: 100%; background: var(--good); width: 0; transition: width .3s; }
.tasks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tasks li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tasks .cd { color: var(--muted); font-variant-numeric: tabular-nums; }
.tasks .ready { color: var(--good); font-weight: 700; }
.leader { margin: 0; padding-left: 20px; font-size: 13px; }
.leader li span { float: right; color: var(--coin); font-weight: 700; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 180px; }
#feed { list-style: none; padding: 0; margin: 0 0 8px; flex: 1; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 3px; max-height: 260px; }
#feed .sys { color: var(--muted); }
#chatInput { width: 100%; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(30, 20, 10, .45); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { position: relative; background: var(--card); border-radius: 18px; padding: 24px; width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.close { position: absolute; top: 12px; right: 12px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal h2 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.timer { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.quiz-time { height: 6px; background: #efe6d4; border-radius: 99px; overflow: hidden; margin: 6px 0 12px; }
.quiz-time div { height: 100%; width: 100%; background: linear-gradient(90deg, #f59e0b, var(--accent)); transition: width .2s linear; }
.quiz-board { background: #fff; border: 6px solid #94a3b8; border-radius: 12px; padding: clamp(8px, 3vw, 14px) clamp(8px, 3vw, 16px); box-shadow: inset 0 0 0 2px #e2e8f0;
  display: flex; flex-direction: column; gap: 10px; }
.quiz-row { display: grid; grid-template-columns: 24px 1fr auto clamp(56px, 24vw, 96px); align-items: center; gap: clamp(4px, 2vw, 10px); font: 700 clamp(15px, 4.6vw, 22px)/1.2 ui-monospace, "SF Mono", Menlo, monospace; color: #1e3a8a; }
.quiz-num { width: 24px; height: 24px; line-height: 24px !important; border-radius: 50%; background: #e0e7ff; color: #3730a3; font: 700 13px/26px system-ui; text-align: center; }
.quiz-expr { text-align: right; white-space: nowrap; }
.quiz-eq { color: #64748b; }
.quiz-row input { box-sizing: border-box; width: 100%; min-width: 0; padding: 6px 10px; font: inherit; color: #b45309;
  text-align: center; border: 2px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; }
.quiz-row input:focus { outline: none; border-color: var(--accent); border-style: solid; background: #fff7ed; }
.quiz-submit { align-self: center; margin-top: 4px; padding: 10px 28px; }
.sentence { font-size: 20px; background: #f6efe2; padding: 14px; border-radius: 10px; margin: 12px 0; letter-spacing: .3px; }
.sentence .ok { color: var(--good); } .sentence .bad { color: var(--bad); text-decoration: underline; }
.typing-input { width: 100%; font-size: 18px; }
.seq { display: flex; gap: 8px; justify-content: center; margin: 18px 0; min-height: 56px; flex-wrap: wrap; }
.seq span { width: 48px; height: 48px; display: grid; place-items: center; font-size: 26px; background: #f6efe2; border-radius: 10px; }
.arrows { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; }
.arrows button { height: 48px; font-size: 22px; }
.result { text-align: center; font-size: 18px; margin: 18px 0 6px; }
.big { font-size: 34px; font-weight: 800; color: var(--coin); }

/* Auction */
.auction-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; }
.phase { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eee; }
.phase.open { background: #dcf5e8; color: var(--good); } .phase.before { background: #fff1d6; color: #a76a00; }
.phase.settled, .phase.closing { background: #ece4d5; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: #f6efe2; border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 20px; }
.bidrow { display: flex; gap: 8px; margin-bottom: 14px; }
.bidrow input { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tr.me td { background: #fff3e6; font-weight: 700; }
tr.out td { color: var(--muted); }
.ticket { background: linear-gradient(135deg, #ffecd6, #ffd6b0); border: 2px dashed var(--accent); border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 14px; }
.ticket b { font-size: 26px; display: block; }
.admin { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; z-index: 20; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { overflow: visible; }
}

/* Level & tiếng Anh */
.tiny { font-size: 12px; margin: -2px 0 8px; }
.level-panel h3 b { color: var(--accent); font-size: 18px; }
.bar.xp { margin: 4px 0 4px; }
.bar.xp div { background: linear-gradient(90deg, #7c5cff, #e8702a); }
.lb-tabs { display: flex; gap: 4px; }
.lb-tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.lb-tab.active { background: var(--ink); color: #fff; }
.lv { display: inline-block; font-size: 11px; font-weight: 700; background: #ede6ff; color: #5b3fd6; padding: 0 6px; border-radius: 99px; margin-right: 4px; }
.intro { background: #f6efe2; padding: 10px 12px; border-radius: 10px; margin: 8px 0 4px; }
.eq { margin: 14px 0; }
.eq-q { font-weight: 700; margin-bottom: 6px; }
.eq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eq-opts label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: #fff; }
.eq-opts label:has(input:checked) { border-color: var(--accent); background: #fff3e6; }
.eq-opts input { accent-color: var(--accent); }
.review { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.rv { border-radius: 10px; padding: 10px 12px; background: #f6efe2; font-size: 13px; }
.rv.ok { border-left: 4px solid var(--good); } .rv.bad { border-left: 4px solid var(--bad); }
.rv .good { color: var(--good); font-weight: 700; } .rv .wrong { color: var(--bad); text-decoration: line-through; }
.levelup { text-align: center; background: linear-gradient(135deg, #ede6ff, #ffe6d1); border-radius: 12px; padding: 12px; font-weight: 700; margin-top: 10px; }
@media (max-width: 560px) { .eq-opts { grid-template-columns: 1fr; } }
.leader li span.lv { float: none; color: #5b3fd6; }

/* Trang phục */
.banner-limited { border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 7px 12px; border-radius: 99px;
  background: linear-gradient(90deg, #fff4c2, #ffe0f0); color: #8a5a00; animation: limPulse 2s ease-in-out infinite; }
@keyframes limPulse { 50% { box-shadow: 0 0 0 4px rgba(250, 204, 21, .25); } }
@media (prefers-reduced-motion: reduce) { .banner-limited { animation: none; } }
.modal-card.wide { width: min(980px, 100%); }
.shop-tabs { display: flex; gap: 6px; align-items: center; margin: 10px 0 12px; flex-wrap: wrap; }
.shop-tab { border: 0; background: #f1ebdf; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.shop-tab.active { background: var(--ink); color: #fff; }
.slot-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.slot-filter button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.slot-filter button.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.item { border: 2px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.item.wearing { box-shadow: 0 0 0 3px rgba(232, 112, 42, .35); }
.item .prev { align-self: center; background: #f6efe2; border-radius: 10px; image-rendering: pixelated; }
.item .btn { margin-top: auto; }
.item-name { font-weight: 700; }
.item-name.big { font-size: 20px; }
.item-meta { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-desc { font-size: 12px; }
.rarity { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.r-common .rarity, .rarity.r-common { background: #eef0f2; color: #555; }
.r-rare .rarity, .rarity.r-rare { background: #dbeafe; color: #1d4ed8; }
.r-epic .rarity, .rarity.r-epic { background: #ede9fe; color: #6d28d9; }
.r-limited .rarity, .rarity.r-limited { background: linear-gradient(90deg, #fde68a, #fbcfe8); color: #92400e; }
.item.r-rare { border-color: #bfdbfe; } .item.r-epic { border-color: #ddd6fe; } .item.r-limited { border-color: #fcd34d; background: #fffbeb; }
.serial { font-size: 11px; font-weight: 800; color: #92400e; }
.lim-card { display: flex; gap: 16px; border: 2px solid #fcd34d; background: #fffbeb; border-radius: 16px; padding: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.lim-card .prev { background: #fff4c2; border-radius: 12px; image-rendering: pixelated; flex: none; }
.lim-info { flex: 1; min-width: 260px; }
.admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-form label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.admin-form input[type=number] { width: 80px; }

/* Cấp bậc Huyền thoại / Thần thoại */
.rarity.r-legendary, .r-legendary .rarity { background: linear-gradient(90deg, #fb923c, #f43f5e); color: #fff; }
.rarity.r-mythic, .r-mythic .rarity { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.3); }
.item.r-legendary { border-color: #fb923c; background: #fff7ed; }
.item.r-mythic { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7) border-box; }
.topbar .btn.ghost { padding: 7px 10px; }

/* Nạp MCOIN */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.pkg { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font: inherit; }
.pkg:hover { border-color: var(--accent); }
.pkg .coin { font-size: 18px; }
.pkg small { color: var(--good); font-weight: 700; }
.pay { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.qr { width: 250px; max-width: 100%; cursor: zoom-in; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.qr.small { width: 120px; }
.pay-info { flex: 1; min-width: 220px; }
.big-amount { font-size: 30px; font-weight: 800; color: #a50064; }
.code-box { display: flex; gap: 8px; align-items: center; background: #fdf2f8; border: 2px dashed #db2777; padding: 8px 12px; border-radius: 10px; margin-top: 4px; }
.code-box b { font-size: 22px; letter-spacing: 2px; flex: 1; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eee; white-space: nowrap; }
.st-wait { background: #fff1d6; color: #a76a00; } .st-pending { background: #dbeafe; color: #1d4ed8; }
.st-ok { background: #dcf5e8; color: var(--good); } .st-bad { background: #fde2e2; color: var(--bad); } .st-off { background: #eee; color: var(--muted); }
.dot { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
#cfgForm label { flex-direction: column; align-items: stretch; }
#cfgForm textarea { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }

/* Vòng quay */
.gacha-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-right: 28px; }
.g-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.g-feat { text-align: center; border-radius: 14px; padding: 8px; background: #fff7ed; border: 2px solid #fdba74; }
.g-feat.r-mythic { background: linear-gradient(#fffdf8, #fffdf8) padding-box, linear-gradient(120deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7) border-box; border-color: transparent; }
.gprev { image-rendering: pixelated; background: #f6efe2; border-radius: 10px; }
.g-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.big-btn { padding: 12px 18px; font-size: 15px; }
.pity { background: #f6efe2; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.pity .bar div { background: linear-gradient(90deg, #fb923c, #f43f5e); }
.odds { margin-top: 10px; } .odds summary { cursor: pointer; font-weight: 700; }
.g-recent { margin: 0; padding-left: 18px; font-size: 13px; }
.g-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; perspective: 800px; }
.g-results:not(.ten) { grid-template-columns: minmax(160px, 220px); justify-content: center; }
.g-card { position: relative; height: 170px; transform-style: preserve-3d; animation: flip .6s ease-out var(--d) both; }
.g-card > div { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; }
.g-back { background: repeating-linear-gradient(45deg, #2b2620 0 8px, #3a332b 8px 16px); transform: rotateY(0deg); }
.g-front { transform: rotateY(180deg); background: #fff; border: 2px solid var(--line); }
.g-card.r-rare .g-front { border-color: #93c5fd; } .g-card.r-epic .g-front { border-color: #c4b5fd; background: #faf5ff; }
.g-card.r-legendary .g-front { border-color: #fb923c; background: #fff7ed; box-shadow: 0 0 18px rgba(251,146,60,.6); }
.g-card.r-mythic .g-front { border: 3px solid #a855f7; background: #fdf4ff; box-shadow: 0 0 24px rgba(168,85,247,.7); }
@keyframes flip { 0% { transform: rotateY(0) scale(.9); } 60% { transform: rotateY(200deg) scale(1.05); } 100% { transform: rotateY(180deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .g-card { animation: none; transform: rotateY(180deg); } }
.new-tag { font-size: 11px; font-weight: 800; color: #fff; background: var(--good); padding: 1px 7px; border-radius: 99px; }

/* Phòng riêng */
.room-wrap { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
#roomCanvas { width: min(600px, 100%); height: auto; border-radius: 12px; image-rendering: pixelated; box-shadow: var(--shadow); cursor: crosshair; flex: none; }
.room-side { flex: 1; min-width: 240px; max-height: 480px; overflow: auto; }
.room-side h4 { margin: 10px 0 6px; }
.room-hint { background: #f6efe2; border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.decor-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.decor { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: 11px; }
.decor.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,112,42,.3); }
.decor.using { background: #ecfdf5; }
.decor.r-legendary { border-color: #fb923c; } .decor.r-mythic { border-color: #a855f7; }
.dprev { image-rendering: pixelated; border-radius: 6px; }
#visitSel { max-width: 220px; }

/* Phòng riêng: cảnh trực tiếp, cửa, danh sách */
.room-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; padding-right: 28px; }
.room-head h2 { display: flex; align-items: center; gap: 6px; }
.room-head-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.room-main { display: flex; flex-direction: column; gap: 6px; flex: none; width: min(600px, 100%); }
.room-main #roomCanvas { width: 100%; outline: none; }
.room-main #roomCanvas:focus { box-shadow: 0 0 0 3px rgba(232,112,42,.4); }
.room-people { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { background: #f1ebdf; border-radius: 99px; padding: 2px 9px; font-size: 12px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--bad); font-weight: 800; padding: 0 0 0 2px; }
.room-chat input { width: 100%; }
.guest-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.guest-row span { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.door { text-align: center; padding: 10px 0; }
.door-art { font-size: 64px; line-height: 1; }
.knock-wait { font-weight: 700; color: #a76a00; animation: limPulse 2s infinite; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.room-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.room-card { border: 2px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.room-card.mine { border-color: var(--accent); }
.room-card-name { font-weight: 800; font-size: 15px; }
#knockBox { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.knock-card { background: var(--card); border: 2px solid #f59e0b; border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.knock-card div { display: flex; gap: 4px; flex-wrap: wrap; }

/* Khoá màn hình khi phát hiện DevTools */
#guardOverlay { position: fixed; inset: 0; z-index: 9999; background: rgba(20, 14, 8, .94); display: grid; place-items: center; padding: 16px; user-select: none; }
#guardOverlay.hidden { display: none; }
.guard-card { background: var(--card); border-radius: 18px; padding: 28px; max-width: 420px; text-align: center; box-shadow: var(--shadow); }
.guard-card h2 { margin: 6px 0 10px; color: var(--bad); }

/* Màn hình bắt buộc cập nhật email công ty (tài khoản cũ) */
#emailGate { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #ffe0c2 0, transparent 40%), var(--bg); }

/* Trang quản trị */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-card b { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat-card.good b { color: var(--good); } .stat-card.warn { border-color: #f59e0b; background: #fffbeb; } .stat-card.warn b { color: #b45309; }
.admin-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.admin-search input { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 640px; }

/* Xoá tài khoản */
.btn.danger { background: var(--bad); color: #fff; }
.danger-zone { margin-top: 18px; border: 1px solid #fecaca; background: #fef2f2; border-radius: 12px; padding: 10px 12px; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--bad); }

/* Hộp thư góp ý */
.fb-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-cat input { display: none; }
.fb-cat span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; background: #fff; font-size: 13px; }
.fb-cat input:checked + span { border-color: var(--accent); background: #fff3e6; color: #9a3412; font-weight: 700; }
#fbForm textarea { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.fb-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-anon { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.fb-item.unread { border-color: var(--accent); background: #fffaf3; }
.fb-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fb-msg { white-space: pre-wrap; word-break: break-word; }
