/* Radon Axis — bộ giao diện chung của các bài thi (công ty giả lập). Dark Minimalist 3D, đơn sắc đen than.
   SỬA Ở challenges/_shared/radon/ rồi chạy scripts/sync-radon.sh; bản trong từng bài là bản chép.
   Nền blocks.svg do scripts/gen-radon-bg.py sinh ra. */

@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #060606;
  --glass: rgba(14, 14, 14, .78);
  --line: #262626;
  --line-hi: #3a3a3a;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --faint: #5c5c5c;
  --err: #f87171;
  --ok: #4ade80;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  /* bóng nhiều lớp: khối "nổi" lên khỏi mặt sàn */
  --depth: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 4px rgba(0,0,0,.5), 0 16px 32px -8px rgba(0,0,0,.7), 0 48px 96px -24px rgba(0,0,0,.9);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text);
  font: 400 1rem/1.6 var(--sans); overflow-x: hidden; background: transparent; }
/* Nền 3D: mặt sàn khối nổi, "thở" rất chậm cho cảm giác chiều sâu */
body::before { content: ""; position: fixed; inset: -4%; z-index: -2; pointer-events: none;
  background: url("blocks.svg") center / cover no-repeat, var(--bg); animation: rc-breathe 40s ease-in-out infinite alternate; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60rem 36rem at 50% 45%, rgba(6,6,6,.15), rgba(6,6,6,.75)); }
@keyframes rc-breathe { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1.5%, -1%); } }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::selection { background: #f2f2f2; color: #060606; }

/* ---------- Khung trang ---------- */
.rc-top { display: flex; align-items: center; gap: 1rem; padding: 1.25rem clamp(1rem, 4vw, 3rem); }
.rc-brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none;
  font-weight: 300; font-size: 1.2rem; letter-spacing: .04em; text-transform: lowercase; }
.rc-brand img { width: 26px; height: 26px; }
.rc-brand small { color: var(--muted); font-size: 1em; }
.rc-app { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 300; letter-spacing: .04em; }
.rc-main { flex: 1; width: 100%; max-width: 64rem; margin: 0 auto; padding: clamp(2rem, 8vh, 6rem) clamp(1rem, 4vw, 2rem); }
.rc-main--narrow { max-width: 27rem; }
.rc-foot { padding: 1.5rem clamp(1rem, 4vw, 3rem); color: var(--faint); font-size: .78rem; font-weight: 300;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

.rc-eyebrow { color: var(--muted); font-weight: 300; font-size: .9rem; letter-spacing: .08em; margin: 0 0 .75rem; text-transform: lowercase; }
.rc-title { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 300; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .9rem; }
.rc-lead { color: var(--muted); font-weight: 300; margin: 0 0 2.25rem; max-width: 40rem; }

/* ---------- Khối kính nổi (nghiêng nhẹ theo chuột qua radon.js) ---------- */
.rc-card { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--depth);
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .3s ease-out, border-color .3s; }
.rc-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.07), transparent 40%); }
.rc-card:hover { border-color: var(--line-hi); }
.rc-card + .rc-card { margin-top: 1.25rem; }
.rc-card h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }

/* ---------- Form ---------- */
.rc-field { display: block; margin-bottom: 1.1rem; }
.rc-field > span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-bottom: .45rem; }
.rc-input { width: 100%; font: inherit; color: var(--text); background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 8px;
  padding: .75rem .9rem; box-shadow: inset 0 2px 8px rgba(0,0,0,.6); transition: border-color .15s, box-shadow .15s; }
.rc-input:focus { outline: none; border-color: #8a8a8a; box-shadow: inset 0 2px 8px rgba(0,0,0,.6), 0 0 0 3px rgba(255,255,255,.08); }
.rc-input::placeholder { color: var(--faint); }
.rc-row { display: flex; gap: .6rem; }
.rc-row .rc-input { flex: 1; }
.rc-btn { font: 600 .95rem var(--sans); letter-spacing: .02em; color: #0a0a0a; background: #f2f2f2; border: 0; border-radius: 8px;
  padding: .8rem 1.4rem; cursor: pointer; box-shadow: 0 1px 0 #fff inset, 0 10px 24px -10px rgba(255,255,255,.35);
  transition: transform .15s, box-shadow .2s, background .2s; }
.rc-btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 1px 0 #fff inset, 0 14px 32px -10px rgba(255,255,255,.45); }
.rc-btn:active { transform: translateY(1px); }
.rc-btn--block { width: 100%; }
.rc-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-hi); box-shadow: none; }
.rc-btn--ghost:hover { background: rgba(255,255,255,.06); }

.rc-alert { border-radius: 8px; padding: .8rem 1rem; margin: 1.25rem 0 0; border: 1px solid; overflow-wrap: anywhere; font-size: .95rem; }
.rc-alert--err { color: #fecaca; background: rgba(248,113,113,.07); border-color: rgba(248,113,113,.4); }
.rc-alert--ok { color: #bbf7d0; background: rgba(74,222,128,.07); border-color: rgba(74,222,128,.4); }

/* ---------- Dữ liệu ---------- */
.rc-term { font: .88rem/1.6 var(--mono); color: #e5e5e5; background: rgba(0,0,0,.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; margin: 1.25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: inset 0 2px 14px rgba(0,0,0,.8); }
.rc-term::before { content: "$ "; color: var(--faint); }
.rc-table { width: 100%; border-collapse: collapse; }
.rc-table th { text-align: left; color: var(--faint); font-size: .78rem; font-weight: 400; letter-spacing: .04em; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.rc-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); }
.rc-table tbody tr { cursor: pointer; transition: background .15s; }
.rc-table tbody tr:hover { background: rgba(255,255,255,.04); }
.rc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.rc-tile { display: flex; gap: .85rem; align-items: center; padding: 1rem; border-radius: 10px; background: var(--glass); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; box-shadow: var(--depth); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .2s, border-color .2s; }
.rc-tile:hover { transform: translateY(-3px); border-color: var(--line-hi); }
.rc-tile__icon { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 6px; display: grid; place-items: center; font: 600 .65rem var(--mono);
  color: #0a0a0a; background: linear-gradient(160deg, #f2f2f2, #9a9a9a); box-shadow: 0 6px 14px -6px rgba(0,0,0,.9); }
.rc-muted { color: var(--muted); }
.rc-kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; }
.rc-kv dt { color: var(--muted); font-weight: 300; }
.rc-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 560px) { .rc-row { flex-direction: column; } .rc-app { display: none; } }
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .rc-card { transform: none !important; transition: none; }
}

/* ---------- Bố cục bổ sung cho từng loại trang ---------- */
.rc-main--mid { max-width: 44rem; }
.rc-narrow { max-width: 27rem; }
.rc-field > label { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-bottom: .45rem; }
.rc-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.25rem; align-items: start; }
.rc-split .rc-card + .rc-card { margin-top: 0; }
.rc-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.rc-features .rc-card + .rc-card { margin-top: 0; }
.rc-features h2 { font-weight: 300; font-size: 1.3rem; }
.rc-title--hero { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 16ch; }
.rc-term pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; display: inline; }
.rc-raw { margin-top: 1.25rem; }
.rc-raw summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.rc-raw pre { font: .82rem/1.55 var(--mono); background: rgba(0,0,0,.7); border: 1px solid var(--line); border-radius: 8px; padding: .9rem; overflow-x: auto; }
.rc-result:empty { display: none; }
.rc-result { margin-top: 1.25rem; overflow-wrap: anywhere; }
.rc-result h2 { font-size: 1.05rem; }
.rc-notes { padding-left: 1.1rem; margin: 0; }
.rc-notes li { margin-bottom: .4rem; overflow-wrap: anywhere; }
.rc-small { font-size: .85rem; margin: 1rem 0 0; }
.rc-card > h2 + p.rc-muted { margin-top: -.4rem; }
@media (max-width: 760px) { .rc-split, .rc-features { grid-template-columns: 1fr; } .rc-split .rc-card + .rc-card, .rc-features .rc-card + .rc-card { margin-top: 0; } }

/* Ô nhập số tài khoản chia nhóm (bài chuyển khoản nội bộ): giữ nằm ngang cả trên điện thoại */
.rc-row--group { gap: .5rem; }
.rc-input--group { flex: 1 1 0; min-width: 0; text-align: center; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .rc-row--group { flex-direction: row; } }
