/* Lumi – giao diện lấy cảm hứng rừng phát sáng: chữ mảnh, đường viền sáng mảnh, không khung nặng. */
:root {
  --ink: #eef6ff;
  --ink-dim: rgba(225, 238, 255, .62);
  --glow: #9ff0ff;
  --glow-soft: rgba(159, 240, 255, .35);
  --gold: #ffdf9a;
  --bad: #ff8fa6;
  --line: rgba(190, 230, 255, .45);
  --deep: rgba(6, 10, 30, .55);
  --serif: "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  --sans: "Quicksand", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #070614; color: var(--ink); font-family: var(--sans); user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }

#world { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#flash { position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; opacity: 0; transition: opacity .5s; }

/* ---------- Màn hình chung ---------- */
.screen { position: fixed; left: 0; top: 0; right: 0; bottom: 0; display: none; z-index: 5; }
.screen.active { display: flex; }

.orn { width: 260px; height: 14px; display: block; margin: 10px auto; }
.orn path, .orn circle { stroke: var(--line); fill: none; stroke-width: 1; }
.orn path:nth-child(2) { fill: rgba(159, 240, 255, .25); stroke: var(--glow); }

/* ---------- Màn chính ---------- */
#scr-home { flex-direction: column; align-items: center; justify-content: space-between; padding: 6vh 20px 3vh; text-align: center; }
#scr-home .menu { margin-top: auto; margin-bottom: 2vh; }
.title-block { margin-top: 2vh; }
.logo { font-family: var(--serif); font-weight: 500; font-size: clamp(64px, 13vw, 150px); line-height: .9; letter-spacing: .06em; color: #fffaf0;
  text-shadow: 0 0 18px rgba(255, 230, 190, .7), 0 0 60px rgba(255, 180, 140, .45); }
.logo span { color: #dffcff; text-shadow: 0 0 14px #bff6ff, 0 0 40px #6fe0ff; }
.subtitle { font-family: var(--serif); font-size: clamp(16px, 2.6vw, 24px); letter-spacing: .42em; text-transform: uppercase; color: rgba(255, 240, 225, .9); margin-top: 6px; padding-left: .42em; }
.tag { max-width: 460px; margin: 4px auto 0; font-size: 15px; color: rgba(255, 240, 230, .8); line-height: 1.5; text-shadow: 0 1px 8px rgba(30, 10, 40, .8); }

.menu { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.menu button { position: relative; font-family: var(--serif); font-size: clamp(20px, 2.8vw, 27px); font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  padding: 10px 46px; color: rgba(240, 236, 255, .72); transition: color .25s, text-shadow .25s; text-shadow: 0 1px 10px rgba(20, 5, 40, .9); }
.menu button::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 56px; transform: translateY(-50%) scaleX(.6); opacity: 0; transition: opacity .3s, transform .3s;
  background: radial-gradient(ellipse at center, rgba(200, 240, 255, .32), rgba(160, 120, 255, .12) 45%, transparent 70%); z-index: -1; }
.menu button.sel, .menu button:hover, .menu button:focus-visible { color: #fff; text-shadow: 0 0 12px rgba(190, 240, 255, .9), 0 0 2px #fff; outline: none; }
.menu button.sel::before, .menu button:hover::before, .menu button:focus-visible::before { opacity: 1; transform: translateY(-50%) scaleX(1); }
.home-foot { font-size: 14px; letter-spacing: .08em; color: rgba(255, 235, 220, .75); }
.home-foot .sep { margin: 0 10px; opacity: .5; }

/* ---------- Chọn chủ đề ---------- */
#scr-topics { flex-direction: column; background: radial-gradient(ellipse at 50% 120%, rgba(30, 60, 120, .55), rgba(4, 8, 24, .93) 65%); }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 4px; }
.bar h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 3.4vw, 34px); letter-spacing: .3em; text-transform: uppercase; text-shadow: 0 0 16px var(--glow-soft); padding-left: .3em; }
.back { display: flex; align-items: center; gap: 6px; font-size: 14px; letter-spacing: .1em; color: var(--ink-dim); min-width: 120px; }
.back svg, .icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: #fff; }
.bar-right { min-width: 120px; text-align: right; color: var(--gold); letter-spacing: .08em; text-shadow: 0 0 10px rgba(255, 210, 120, .6); }
.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 6px 16px 12px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 30px; padding: 3px; background: rgba(5, 12, 35, .5); }
.seg button { padding: 7px 16px; border-radius: 26px; font-weight: 700; font-size: 14px; color: var(--ink-dim); line-height: 1.15; transition: background .2s, color .2s; }
.seg button small { display: block; font-weight: 500; font-size: 11px; opacity: .75; }
.seg button.on { color: #06142a; background: linear-gradient(180deg, #e9fdff, #9ce9ff); box-shadow: 0 0 16px rgba(140, 230, 255, .55); }

.topic-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.topic-list { padding: 4px 4vw 30px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px 10px; padding: 8px 0 6px; align-content: start; }
.grp { font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-dim); margin: 14px 0 2px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(190, 230, 255, .14); text-shadow: 0 0 12px var(--glow-soft); }
.node { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border-radius: 16px; transition: transform .2s; }
.node .ring { position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 34px;
  border: 1.5px solid rgba(180, 225, 255, .55); background: radial-gradient(circle at 50% 40%, rgba(120, 200, 255, .18), rgba(5, 12, 35, .6) 70%);
  box-shadow: inset 0 0 18px rgba(120, 210, 255, .18); transition: box-shadow .25s, border-color .25s; }
.node .ring::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(180, 225, 255, .15); }
.node b { font-size: 15px; font-weight: 700; text-align: center; line-height: 1.15; }
.node small { font-size: 12px; color: var(--ink-dim); letter-spacing: .04em; }
.node .st { font-size: 13px; letter-spacing: .2em; color: rgba(255, 255, 255, .22); height: 16px; }
.node .st .on { color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 120, .8); }
.node:hover, .node:focus-visible { transform: translateY(-3px); outline: none; }
.node:hover .ring, .node:focus-visible .ring { border-color: #dffaff; box-shadow: inset 0 0 22px rgba(160, 235, 255, .45), 0 0 26px rgba(130, 220, 255, .55); }
.node.all .ring { border-color: rgba(255, 220, 150, .7); background: radial-gradient(circle at 50% 40%, rgba(255, 210, 140, .25), rgba(30, 12, 35, .6) 70%); }

/* ---------- HUD ---------- */
#hud { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none; }
.hud-left { position: absolute; left: 18px; top: 14px; }
.lives { display: flex; gap: 7px; }
.lives i { width: 18px; height: 26px; display: block; clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%);
  background: radial-gradient(circle at 50% 40%, #fff, #a8f3ff 40%, #42b9ff); filter: drop-shadow(0 0 6px #7fe6ff); transition: opacity .4s, transform .4s; }
.lives i.off { background: rgba(160, 190, 230, .2); filter: none; transform: scale(.8); }
.prog { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); letter-spacing: .06em; }
.prog-line { width: 120px; height: 2px; background: rgba(200, 230, 255, .2); position: relative; }
.prog-line i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #7fe6ff, #fff); box-shadow: 0 0 8px #9ff0ff; transition: width .5s; }
.hud-right { position: absolute; right: 16px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.score { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1; text-shadow: 0 0 14px var(--glow-soft); }
.score small { font-family: var(--sans); font-size: 12px; margin-left: 5px; color: var(--ink-dim); letter-spacing: .1em; }
.streak { font-size: 13px; letter-spacing: .14em; color: var(--ink-dim); transition: color .3s, transform .3s; }
.streak.hot { color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 120, .8); }
.icon-btn { pointer-events: auto; margin-top: 6px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: rgba(5, 12, 35, .35); color: var(--ink); }
.icon-btn:hover { border-color: #fff; box-shadow: 0 0 14px var(--glow-soft); }

.card { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); min-width: 300px; max-width: min(560px, 62vw); text-align: center; padding: 10px 34px 12px;
  background: radial-gradient(ellipse at center, rgba(6, 12, 34, .62), rgba(6, 12, 34, .25) 70%, transparent 100%); pointer-events: auto; cursor: default; }
.card-orn { height: 12px; position: relative; margin: 0 auto; width: 80%; }
.card-orn::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--glow) 50%, var(--line) 80%, transparent); }
.card-orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%) rotate(45deg); border: 1px solid var(--glow); background: #0a1630; box-shadow: 0 0 8px var(--glow); }
.card-ask { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-dim); margin-top: 4px; }
.card-main { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 58px; }
.card-emoji { font-size: 40px; line-height: 1; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35)); }
.card-word { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.05; text-shadow: 0 0 18px rgba(170, 235, 255, .55); }
.card-sub { font-size: 14px; min-height: 18px; color: var(--ink-dim); letter-spacing: .04em; margin-bottom: 2px; }
.card.pop .card-main { animation: pop .45s ease-out; }
.card.good .card-word { color: var(--gold); text-shadow: 0 0 18px rgba(255, 210, 120, .8); }
.card.bad .card-word { color: var(--bad); }
.card.listen .card-word { cursor: pointer; }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }

.chips { position: absolute; left: 50%; top: 168px; transform: translateX(-50%); display: flex; gap: 12px; pointer-events: auto; transition: opacity .3s; }
.chip { min-width: 128px; padding: 9px 16px; border-radius: 26px; border: 1px solid rgba(190, 230, 255, .35); background: rgba(5, 12, 35, .45);
  font-weight: 700; font-size: 18px; color: rgba(235, 245, 255, .85); transition: border-color .2s, box-shadow .2s, background .2s, color .2s; }
.chip.cur { border-color: #e8fdff; color: #fff; background: rgba(60, 140, 200, .35); box-shadow: 0 0 18px rgba(140, 230, 255, .55); }
.chip.ok { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 18px rgba(255, 210, 120, .6); }
.chip.no { border-color: var(--bad); color: var(--bad); }
.chips.off { opacity: 0; pointer-events: none; }

.toast { position: absolute; left: 50%; top: 58%; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, 0); font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: .04em; white-space: nowrap;
  opacity: 0; text-shadow: 0 0 16px rgba(0, 0, 0, .8), 0 0 18px rgba(255, 230, 170, .6); }
.toast.show { animation: toast 1.4s ease-out forwards; }
.toast.bad { text-shadow: 0 0 16px rgba(0, 0, 0, .8), 0 0 14px rgba(255, 120, 150, .6); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 14px); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.biome { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-family: var(--serif); font-size: clamp(24px, 4vw, 40px); letter-spacing: .32em; text-transform: uppercase;
  white-space: nowrap; opacity: 0; text-shadow: 0 0 20px rgba(200, 240, 255, .7); padding-left: .32em; }
.biome.show { animation: biome 3s ease-in-out forwards; }
.biome.small { font-size: clamp(16px, 2.4vw, 22px); letter-spacing: .4em; top: 46%; }
@keyframes biome { 0% { opacity: 0; letter-spacing: .5em; } 25%, 70% { opacity: .95; } 100% { opacity: 0; letter-spacing: .28em; } }

/* ---------- Kết quả ---------- */
#scr-result { align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(8, 14, 40, .7), rgba(3, 5, 18, .92)); overflow-y: auto; padding: 20px; }
.result { text-align: center; width: min(620px, 100%); margin: auto; }
.res-kicker { font-size: 13px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-dim); }
.result h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 5vw, 46px); letter-spacing: .06em; margin-top: 6px; text-shadow: 0 0 22px var(--glow-soft); }
.res-stars { font-size: 34px; letter-spacing: .3em; margin-top: 6px; color: rgba(255, 255, 255, .18); padding-left: .3em; }
.res-stars .on { color: var(--gold); text-shadow: 0 0 14px rgba(255, 210, 120, .9); display: inline-block; animation: star .6s ease-out backwards; }
.res-stars .on:nth-child(2) { animation-delay: .2s; } .res-stars .on:nth-child(3) { animation-delay: .4s; }
@keyframes star { from { transform: scale(2.2); opacity: 0; } }
.res-stats { display: flex; justify-content: center; gap: 34px; margin: 6px 0 16px; }
.res-stats b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 600; }
.res-stats span { font-size: 12px; letter-spacing: .1em; color: var(--ink-dim); }
.res-words h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.res-words ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; max-height: 30vh; overflow-y: auto; }
.res-words li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid rgba(255, 160, 180, .35); border-radius: 22px; background: rgba(40, 10, 30, .35); font-size: 15px; }
.res-words li b { font-weight: 700; }
.res-words li span { color: var(--ink-dim); }
.res-words li button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); font-size: 13px; }
.res-words.empty ul { display: none; }
.res-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.btn-glow { padding: 12px 34px; border-radius: 30px; font-weight: 700; font-size: 17px; letter-spacing: .06em; color: #06142a;
  background: linear-gradient(180deg, #f4feff, #9fe8ff); box-shadow: 0 0 22px rgba(140, 230, 255, .6); }
.btn-glow:hover { box-shadow: 0 0 32px rgba(170, 240, 255, .9); }
.btn-line { padding: 11px 24px; border-radius: 30px; border: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--ink); background: rgba(5, 12, 35, .35); }
.btn-line:hover { border-color: #fff; box-shadow: 0 0 14px var(--glow-soft); }
.btn-line.small { font-size: 13px; padding: 8px 18px; margin: 4px 0 14px; color: var(--ink-dim); }

/* ---------- Lớp phủ ---------- */
.overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 5, 18, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.overlay.show { display: flex; }
.panel { position: relative; text-align: center; width: min(420px, 100%); padding: 26px 26px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(80, 160, 230, .2), rgba(5, 10, 30, .75) 70%); max-height: 100%; overflow-y: auto; }
.panel.wide { width: min(620px, 100%); }
.panel h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 14px; padding-left: .3em; text-shadow: 0 0 16px var(--glow-soft); }
.help { text-align: left; padding-left: 22px; margin-bottom: 18px; line-height: 1.5; font-size: 15px; }
.help li { margin-bottom: 8px; } .help li::marker { color: var(--glow); font-weight: 700; }
.help b { color: #fff; }
.toggles { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; text-align: left; }
.toggles label { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid rgba(190, 230, 255, .12); cursor: pointer; font-weight: 600; }
.toggles input { display: none; }
.toggles i { width: 44px; height: 24px; border-radius: 12px; border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.toggles i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: rgba(220, 235, 255, .55); transition: left .2s, background .2s, box-shadow .2s; }
.toggles input:checked + i { background: rgba(110, 200, 255, .3); }
.toggles input:checked + i::after { left: 23px; background: #e8fdff; box-shadow: 0 0 10px #9ff0ff; }

/* ---------- Màn hẹp / dọc ---------- */
@media (max-width: 760px) {
  .card { min-width: 0; width: calc(100vw - 150px); max-width: none; padding: 6px 10px 8px; top: 8px; }
  .card-word { font-size: 28px; } .card-emoji { font-size: 30px; } .card-main { min-height: 44px; }
  .hud-left { left: 10px; } .hud-right { right: 10px; }
  .lives i { width: 13px; height: 20px; } .lives { gap: 4px; }
  .prog-line { width: 60px; }
  .score { font-size: 28px; }
}
@media (orientation: portrait) {
  .card { top: 90px; width: calc(100vw - 24px); }
  .chips { top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); left: 8px; right: 8px; transform: none; justify-content: space-between; gap: 6px; }
  .chip { flex: 1; min-width: 0; padding: 14px 4px; font-size: 17px; border-radius: 18px; }
  .toast { top: 50%; font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .node .ring { width: 66px; height: 66px; font-size: 28px; }
  .bar h2 { font-size: 18px; letter-spacing: .18em; }
  .back span { display: none; } .back, .bar-right { min-width: 50px; }
  .seg button { padding: 6px 10px; font-size: 13px; }
}
@media (max-height: 460px) {
  .chips { top: 128px; } .chip { padding: 6px 12px; font-size: 16px; min-width: 100px; }
  .card { padding-top: 4px; } .card-main { min-height: 40px; }
  #scr-home { padding-top: 3vh; } .tag { display: none; }
}

/* bỏ viền focus khi chạm (WebView Android), giữ cho bàn phím */
button:focus:not(:focus-visible) { outline: none; }
* { -webkit-tap-highlight-color: transparent; }

/* ================= Lumi 2.0 ================= */
.bank { color: #9ff0ff; text-shadow: 0 0 10px rgba(120, 230, 255, .6); }
.home-foot .bank { color: #b8f4ff; }

/* cấp, bài */
.seg button.locked { opacity: .45; }
.seg button.locked::after { content: " 🔒"; font-size: 11px; }
.stages { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 2px 16px 6px; }
.stage { min-width: 132px; padding: 8px 14px 6px; border-radius: 16px; border: 1px solid rgba(190, 230, 255, .3); background: rgba(5, 12, 35, .45); text-align: center; line-height: 1.2;
  transition: border-color .2s, box-shadow .2s, background .2s; }
.stage b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .08em; }
.stage small { display: block; font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.stage .st { display: block; font-size: 13px; letter-spacing: .2em; color: rgba(255, 255, 255, .22); height: 18px; margin-top: 2px; }
.stage .st .on { color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 120, .8); }
.stage.on { border-color: #e8fdff; background: rgba(60, 140, 200, .3); box-shadow: 0 0 18px rgba(140, 230, 255, .45); }
.stage.locked { opacity: .5; }
.nudge { animation: nudge .45s; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.topic-msg { text-align: center; font-size: 14px; color: var(--gold); height: 0; opacity: 0; overflow: hidden; }
.topic-msg.show { animation: tmsg 3s ease forwards; }
@keyframes tmsg { 0% { height: 0; opacity: 0; } 10%, 85% { height: 22px; opacity: 1; } 100% { height: 0; opacity: 0; } }

/* HUD Leo cấp */
.goal { margin-top: 2px; font-size: 14px; letter-spacing: .08em; color: var(--ink-dim); }
.goal b { font-family: var(--serif); font-size: 26px; font-weight: 600; color: #fff; text-shadow: 0 0 10px var(--glow-soft); }
.goal.done b { color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 120, .8); }
.prog { margin-top: 4px; }
.score-need { font-size: 12px; letter-spacing: .08em; color: var(--ink-dim); }
.score-need.done { color: var(--gold); }
.powers { display: flex; gap: 6px; margin-top: 8px; font-size: 18px; line-height: 1; }
.powers span { padding: 4px 7px; border-radius: 14px; background: rgba(5, 12, 35, .5); border: 1px solid rgba(190, 230, 255, .3); font-size: 15px; font-weight: 700; white-space: nowrap; }
.powers .x2 { color: var(--gold); }
.chip { white-space: normal; line-height: 1.12; }
.chip.gone { opacity: .3; text-decoration: line-through; }
.chips.n4 .chip { min-width: 110px; }
.chips.n5 .chip { min-width: 96px; padding: 8px 10px; font-size: 16px; }
.chips.n4, .chips.n5 { gap: 8px; }

/* kết quả */
.res-cond { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 4px 0 6px; font-size: 15px; font-weight: 600; }
.res-cond .ok { color: #c8ffd8; } .res-cond .no { color: var(--bad); } .res-cond .info { color: var(--ink-dim); font-weight: 500; font-size: 14px; }
.res-bank { font-size: 14px; color: #b8f4ff; margin-bottom: 8px; text-shadow: 0 0 10px rgba(120, 230, 255, .5); }

/* tủ đồ */
#scr-shop { flex-direction: column; background: radial-gradient(ellipse at 50% 110%, rgba(60, 40, 130, .55), rgba(4, 8, 24, .94) 65%); }
.shop { flex: 1; min-height: 0; display: flex; gap: 18px; padding: 6px 4vw 18px; }
.shop-stage { flex: 0 0 38%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
#shop-preview { width: min(100%, 300px); aspect-ratio: 1; height: auto; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(120, 200, 255, .2), rgba(5, 12, 35, .3) 60%, transparent 72%); }
.shop-name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: .06em; text-shadow: 0 0 14px var(--glow-soft); }
#shop-act:disabled { opacity: .55; cursor: default; box-shadow: none; }
.shop-note { font-size: 13px; color: var(--ink-dim); min-height: 18px; max-width: 280px; }
.shop-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.shop-side .seg { align-self: center; }
.shop-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 16px; border: 1px solid rgba(190, 230, 255, .2); background: rgba(5, 12, 35, .4);
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.item canvas { width: 72px; height: 72px; }
.item b { font-size: 13px; line-height: 1.15; text-align: center; }
.item small { font-size: 12px; color: #b8f4ff; }
.item.own small { color: var(--ink-dim); }
.item.use { border-color: rgba(255, 220, 150, .7); } .item.use small { color: var(--gold); }
.item.lock { opacity: .62; }
.item.sel { border-color: #e8fdff; box-shadow: 0 0 18px rgba(140, 230, 255, .5); transform: translateY(-2px); }

/* chọn bản nhạc */
.trk { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; font-weight: 600; }
.trk-pick { display: flex; align-items: center; gap: 6px; }
.trk-pick b { min-width: 120px; text-align: center; font-weight: 700; color: #fff; }
.trk-pick button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); font-size: 18px; line-height: 1; }

@media (orientation: portrait) {
  .chips.n4 .chip, .chips.n5 .chip { min-width: 0; padding: 12px 2px; font-size: 14px; }
  .chips.n5 { gap: 4px; }
  .shop { flex-direction: column; gap: 8px; }
  .shop-stage { flex: none; }
  #shop-preview { width: 170px; }
  .stage { min-width: 0; flex: 1 1 40%; }
  .grp { font-size: 16px; }
}
@media (max-height: 460px) {
  .goal b { font-size: 20px; }
  .powers { margin-top: 4px; }
  #shop-preview { width: 150px; }
}

/* trời sáng: chữ HUD và thẻ cần nền, bóng đậm hơn cho dễ đọc */
#hud .hud-left, #hud .hud-right { text-shadow: 0 1px 6px rgba(0, 10, 30, .85), 0 0 2px rgba(0, 10, 30, .7); }
.card { background: radial-gradient(ellipse at center, rgba(6, 12, 34, .78), rgba(6, 12, 34, .5) 65%, rgba(6, 12, 34, .12) 100%); border-radius: 22px; }
.chip { background: rgba(5, 12, 35, .62); }
/* nút tạm dừng nằm cạnh khối điểm, không đè lên thẻ câu hỏi */
.hud-right { padding-right: 50px; min-height: 44px; }
.hud-right .icon-btn { position: absolute; right: 0; top: 2px; margin-top: 0; }

.mode-note{margin:4px auto 10px;max-width:640px;padding:8px 12px;border-radius:12px;background:rgba(6,12,30,.55);border:1px solid rgba(180,220,255,.22);color:#dbeaff;font-size:.86rem;line-height:1.4;text-align:center}
