/* Đêm Hoa Đăng — /study/games/lantern-night. File rời, không đi qua pipeline purge của styles.css. */
.ln-wrap { border-radius: 10px; padding: 16px 12px 20px; background: #fff; }
.ln-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.ln-head h1 { margin: 0; font-size: 26px; font-weight: 700; color: #262262; }
.ln-head a { font-size: 14px; color: #1f70f5; text-decoration: none; }
.ln-head a:hover { text-decoration: underline; }

.ln-board {
    position: relative; overflow: hidden; border-radius: 12px; background: #070b24;
    height: min(640px, max(500px, calc(100vh - 210px))); max-width: 1180px; margin: 0 auto;
    color: #f4f1ff; font-family: Lato, "Segoe UI", "Leelawadee UI", Tahoma, sans-serif; user-select: none;
}
.ln-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ln-board.ln-hit { animation: ln-hit .35s ease-out; }
@keyframes ln-hit { 0% { box-shadow: inset 0 0 0 4px #ff5d5d, inset 0 0 60px rgba(255, 70, 70, .55); } 100% { box-shadow: inset 0 0 0 0 transparent; } }

/* HUD */
.ln-hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 18px; padding: 8px 14px; pointer-events: none; z-index: 2; }
.ln-hud__stat { display: flex; flex-direction: column; line-height: 1.15; }
.ln-hud__stat span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #a9add6; }
.ln-hud__stat b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.ln-hud__combo { font-size: 20px; font-weight: 900; color: #ffd166; min-width: 80px; }
.ln-hud__combo.ln-pop { animation: ln-pop .22s ease-out; }
.ln-hud__combo--fever { color: #ff9a4a; text-shadow: 0 0 12px rgba(255, 140, 50, .9); }
@keyframes ln-pop { 0% { transform: scale(1.45); } 100% { transform: scale(1); } }
/* Chuỗi x5: viền lửa quanh bàn chơi. Chỉ đổi box-shadow, nhịp chậm 1.6s. */
.ln-board.ln-fever::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: 12px; animation: ln-fever 1.6s ease-in-out infinite; }
@keyframes ln-fever { 0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 160, 70, .55), inset 0 0 46px rgba(255, 120, 40, .28); } 50% { box-shadow: inset 0 0 0 2px rgba(255, 200, 110, .85), inset 0 0 80px rgba(255, 120, 40, .45); } }
.ln-hud__spacer { flex: 1; }
.ln-lives { display: flex; gap: 5px; }
.ln-flame { width: 13px; height: 18px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: linear-gradient(#ffe08a, #ff7a2f); box-shadow: 0 0 8px rgba(255, 150, 60, .8); }
.ln-flame--out { background: #3a3f66; box-shadow: none; }
.ln-power { width: 150px; }
.ln-power span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #a9add6; margin-bottom: 3px; }
.ln-power__track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ln-power__track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fd3ff, #b79bff); transition: width .2s; }
.ln-power--ready span { color: #fff; font-weight: 700; }
.ln-power--ready .ln-power__track { animation: ln-pulse 1s ease-in-out infinite; }
@keyframes ln-pulse { 50% { box-shadow: 0 0 12px #8fd8ff; } }

/* Ô gõ: để hiện thật cho người dùng bộ gõ có dấu nhìn thấy chữ đang ghép. */
.ln-input {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
    width: min(340px, 70%); height: 46px; border-radius: 23px; border: 2px solid rgba(255, 255, 255, .35);
    background: rgba(8, 11, 30, .82); color: #fff; font-size: 22px; font-weight: 700; text-align: center; outline: none; user-select: text;
}
.ln-input::placeholder { color: rgba(255, 255, 255, .35); font-weight: 400; font-size: 16px; }
.ln-input:focus { border-color: #ffd166; box-shadow: 0 0 0 4px rgba(255, 209, 102, .18); }
.ln-input:disabled { opacity: 0; }
.ln-input--bad, .ln-input--bad:focus { border-color: #ff6b6b; box-shadow: 0 0 0 4px rgba(255, 107, 107, .2); color: #ffb3b3; }
.ln-input--shake { animation: ln-shake .25s; }
@keyframes ln-shake { 25% { transform: translateX(calc(-50% - 7px)); } 75% { transform: translateX(calc(-50% + 7px)); } }

/* Overlay */
.ln-overlay { position: absolute; inset: 0; z-index: 3; overflow: auto; display: flex; padding: 54px 18px 18px; background: rgba(6, 8, 24, .78); user-select: none; }
.ln-overlay[hidden] { display: none; }
.ln-overlay--menu { background: rgba(6, 8, 24, .62); }
.ln-overlay h2 { margin: 0 0 10px; font-size: 28px; font-weight: 900; color: #fff; }
.ln-overlay h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: #a9add6; display: flex; justify-content: space-between; align-items: center; }
.ln-overlay h4 { margin: 0 0 6px; font-size: 12px; color: #a9add6; font-weight: 400; }
.ln-panel { margin: auto; width: min(680px, 100%); text-align: center; }
.ln-panel--narrow { width: min(360px, 100%); }
.ln-sub { margin: 0 0 4px; font-size: 14px; color: #b9bce0; }
.ln-key { margin: 8px 0 0; font-size: 12px; color: #8f94c2; }

.ln-menu { margin: auto; width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.ln-title { margin: 0 0 6px; font-size: 40px; line-height: 1.1; font-weight: 900; color: #ffe2a8; text-shadow: 0 0 24px rgba(255, 150, 60, .55); }
.ln-tag { margin: 0 0 16px; font-size: 15px; line-height: 1.45; color: #d7d9f2; }
.ln-pills { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ln-pill { border: 1px solid rgba(255, 255, 255, .28); background: transparent; color: #d7d9f2; border-radius: 16px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.ln-pill--on { background: #ffd166; border-color: #ffd166; color: #1a1430; font-weight: 700; }
.ln-btn { border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 10px; padding: 10px 26px; font-size: 16px; font-weight: 700; cursor: pointer; }
.ln-btn:hover { background: rgba(255, 255, 255, .14); }
.ln-btn--primary { background: linear-gradient(#ffb04a, #ff7a2f); border-color: #ffb04a; color: #2a1206; min-width: 180px; font-size: 18px; box-shadow: 0 6px 22px rgba(255, 122, 47, .4); }
.ln-btn--primary:hover { background: linear-gradient(#ffc06a, #ff8a45); }
.ln-btn:disabled { opacity: .55; cursor: default; }
.ln-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.ln-hints { margin: 14px 0 10px; padding: 0 0 0 18px; font-size: 13px; line-height: 1.5; color: #b9bce0; }
.ln-check { display: block; font-size: 13px; color: #b9bce0; margin-bottom: 4px; cursor: pointer; }
.ln-check input { margin-right: 6px; }

.ln-card { background: rgba(14, 18, 44, .82); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; text-align: left; }
.ln-card--flat { margin-top: 16px; }
.ln-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ln-profile__lvl { width: 42px; height: 42px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; color: #1a1430; background: #ffd166; }
.ln-profile__main { flex: 1; min-width: 0; }
.ln-profile__row { display: flex; justify-content: space-between; font-size: 13px; color: #b9bce0; margin-bottom: 5px; }
.ln-profile__row b { color: #fff; font-size: 15px; }
.ln-coins { font-weight: 900; font-size: 17px; color: #ffd84a; white-space: nowrap; }
.ln-streak { color: #ffb04a; font-weight: 700; letter-spacing: 0; text-transform: none; }
.ln-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ln-bar i { display: block; height: 100%; background: #6fd3ff; border-radius: 3px; }
.ln-bar--xp i { background: linear-gradient(90deg, #ffd166, #ff9a4a); }
.ln-bar--wide { max-width: 320px; margin: 8px auto 0; }
.ln-missions { list-style: none; margin: 0; padding: 0; }
.ln-mission { margin-bottom: 8px; font-size: 14px; color: #e6e7f7; }
.ln-mission:last-child { margin-bottom: 0; }
.ln-mission__row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ln-mission__row b { color: #ffd84a; white-space: nowrap; }
.ln-mission--done { color: #8f94c2; }
.ln-mission--done .ln-mission__row b { color: #63e6a5; }
.ln-mission--done .ln-bar i { background: #63e6a5; }
.ln-records dl, .ln-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.ln-records dt, .ln-stats dt { font-size: 11px; color: #a9add6; font-weight: 400; }
.ln-records dd, .ln-stats dd { margin: 0; font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.ln-stats { justify-content: center; gap: 8px 28px; margin: 12px 0; }
.ln-stats dd { font-size: 24px; }
.ln-shop__group { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; margin-bottom: 8px; }
.ln-shop__group:last-child { margin-bottom: 0; }
.ln-shop__group h4 { flex: 0 0 100%; margin: 0; }
.ln-item { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 78px; padding: 7px 4px 5px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: #e6e7f7; font-size: 11px; cursor: pointer; }
.ln-item i { width: 26px; height: 26px; border-radius: 50%; display: block; }
.ln-item em { font-style: normal; color: #ffd84a; font-size: 11px; }
.ln-item--on { border-color: #ffd166; background: rgba(255, 209, 102, .1); }
.ln-item--on em { color: #63e6a5; }
.ln-item--locked { opacity: .5; cursor: default; }

.ln-ups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ln-up { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 26px 12px 14px; min-height: 150px; border-radius: 14px; border: 1px solid rgba(255, 209, 102, .4); background: rgba(20, 24, 58, .92); color: #fff; cursor: pointer; }
.ln-up:hover { border-color: #ffd166; background: rgba(40, 42, 86, .95); transform: translateY(-2px); }
.ln-up kbd { position: absolute; top: -12px; background: #ffd166; color: #1a1430; border-radius: 6px; padding: 2px 9px; font-size: 14px; font-weight: 900; box-shadow: none; }
.ln-up b { font-size: 18px; color: #ffe2a8; }
.ln-up span { font-size: 13px; line-height: 1.4; color: #cfd1ee; }
.ln-pips { display: flex; gap: 4px; margin-top: auto; }
.ln-pips i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.ln-pips i.on { background: #ffd166; }
.ln-toast { margin: 6px 0 0; font-size: 14px; color: #dfe1f7; }
.ln-toast b { color: #ffd84a; }
.ln-toast--lvl { color: #ffd166; font-weight: 700; }
.ln-final { font-size: 54px !important; line-height: 1.1; margin-bottom: 2px !important; font-variant-numeric: tabular-nums; }
.ln-badge { display: inline-block; vertical-align: middle; font-size: 13px; font-weight: 700; background: #ffd166; color: #1a1430; padding: 3px 10px; border-radius: 12px; }
.ln-earned { margin: 0; font-size: 15px; color: #dfe1f7; }
.ln-earned b { color: #ffd84a; }
.ln-missed { margin-top: 14px; }
.ln-missed p { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ln-missed span { background: rgba(255, 107, 107, .16); border: 1px solid rgba(255, 107, 107, .4); border-radius: 6px; padding: 2px 8px; font-size: 15px; color: #ffd0d0; }
.ln-missed small { color: #8f94c2; font-size: 12px; }

.ln-guide { max-width: 1180px; margin: 22px auto 0; color: #333; }
.ln-guide h2 { font-size: 20px; font-weight: 700; color: #262262; margin: 0 0 10px; }
.ln-guide ul { padding-left: 20px; margin: 0; font-size: 15px; line-height: 1.7; }

/* Thẻ giới thiệu trên trang /study/games */
.ln-promo { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; padding: 18px 22px; border-radius: 12px; text-decoration: none; background: linear-gradient(120deg, #0b1030, #2b2558 60%, #7a3b4a); color: #fff; }
.ln-promo:hover { color: #fff; box-shadow: 0 8px 26px rgba(38, 34, 98, .35); }
.ln-promo__text { flex: 1; min-width: 0; }
.ln-promo__text b { display: block; font-size: 22px; color: #ffe2a8; }
.ln-promo__text span { font-size: 14px; color: #d7d9f2; }
.ln-promo__cta { flex: none; background: linear-gradient(#ffb04a, #ff7a2f); color: #2a1206; font-weight: 700; padding: 9px 20px; border-radius: 10px; }

@media (max-width: 767px) {
    .ln-menu { grid-template-columns: minmax(0, 1fr); }
    .ln-title { font-size: 30px; }
    .ln-ups { grid-template-columns: minmax(0, 1fr); }
    .ln-up { min-height: 0; }
    .ln-hud { gap: 10px; padding: 6px 10px; }
    .ln-power { width: 90px; }
    .ln-hud__stat--best { display: none; }
    .ln-promo { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .ln-board.ln-hit, .ln-input--shake, .ln-power--ready .ln-power__track, .ln-hud__combo.ln-pop, .ln-board.ln-fever::after { animation: none; }
    .ln-board.ln-fever::after { box-shadow: inset 0 0 0 2px rgba(255, 180, 90, .7); }
    .ln-up:hover { transform: none; }
}
