/* Terminal / metro: type, flat surfaces and useful controls. Scene/camera are independent. */
:root {
    color-scheme: dark;
    --ti-le-ui: 1;
    font-size: calc(15px * var(--ti-le-ui));
    --nen: #121411;
    --nen-nang: #1b1d19;
    --chu: #efeee6;
    --chu-mo: #b5b8af;
    --vien: #55594f;
    --do: #ffb6a9;
    --font-ui: 'IBM Plex Mono', 'Liberation Mono', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font-ui); color: var(--chu); background: var(--nen); font-size: 1rem; }
button, input, select { font: inherit; border-radius: 0; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--chu); outline-offset: 3px; }
a { color: var(--chu); text-underline-offset: 3px; }
a:hover { color: white; }
.an, [hidden] { display: none !important; }
[inert] { pointer-events: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 600; }
h1 { font-size: 2rem; letter-spacing: -.035em; line-height: 1.4; }
h2 { font-size: 1.35rem; line-height: 1.5; }
h3 { font-size: .9rem; line-height: 1.5; }
p { line-height: 1.7; }
kbd { font: inherit; font-size: .75rem; color: var(--chu-mo); }
#san3d { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }

.nut { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 44px; padding: .65rem .85rem; border: 1px solid var(--vien); background: transparent; font-size: .9rem; line-height: 1.5; text-align: center; }
.nut:hover:not(:disabled), .nut-nhom button:hover:not(:disabled) { background: #30332c; border-color: var(--chu-mo); }
.nut kbd { margin-left: auto; }
.nut-chinh, .nut-nhom button.chon { background: var(--chu); color: var(--nen); border-color: var(--chu); }
.nut-chinh:hover:not(:disabled), .nut-nhom button.chon:hover { background: white; color: var(--nen); border-color: white; }
.nut-chinh kbd { color: var(--nen); }
.nut-nguy-hiem { color: var(--do); border-color: #a76a5f; }
.nut-nguy-hiem:hover:not(:disabled) { background: #3c2721; border-color: var(--do); }
.nut-bieu-tuong { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0; background: transparent; color: var(--chu); border: 1px solid transparent; }
.nut-bieu-tuong:hover:not(:disabled) { border-color: var(--vien); background: #30332c; }
.lien-ket { border: 0; background: none; color: var(--chu-mo); padding: .6rem 0; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.lien-ket:hover { color: var(--chu); }
.hang-nut { display: flex; flex-wrap: wrap; gap: .65rem; margin-left: auto; }
.danh-sach-nut { display: grid; gap: .65rem; margin-top: 1.5rem; }
.nut-nhom { display: flex; flex-wrap: wrap; gap: 6px; }
.nut-nhom button { flex: 1 1 auto; min-height: 44px; min-width: 0; padding: .6rem .75rem; border: 1px solid var(--vien); background: transparent; color: var(--chu); font-size: .83rem; line-height: 1.5; }

/* A compact menu leaves most of the garden visible. No hero, slogans or ornaments. */
#lop-phu { position: fixed; inset: 0; z-index: 40; display: grid; align-items: center; justify-items: center; padding: 24px; background: rgba(0,0,0,.55); }
#lop-phu[data-trang="menu"] { justify-items: start; background: rgba(0,0,0,.16); }
.khung-phu { --dem: 24px; width: min(680px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: var(--dem); border: 1px solid var(--vien); background: var(--nen); scrollbar-gutter: stable; }
.khung-phu:focus { outline: none; }
.khung-menu { width: min(330px, 100%); background: rgba(18,20,17,.97); }
.lenh-menu { display: grid; gap: 7px; margin-top: 1.4rem; }
.lenh-menu > .nut { justify-content: flex-start; }
.chan-menu { margin-top: 1.25rem; }
.chi-tiet-van { margin-top: 1rem; color: var(--chu-mo); font-size: .78rem; }
.chi-tiet-van summary { cursor: pointer; min-height: 36px; padding: .4rem 0; }
.lich-su { max-height: 150px; overflow: auto; padding-left: 1.7rem; line-height: 1.9; }
.luu-y-dong-ho, .ket-noi { color: var(--chu-mo); font-size: .75rem; margin-top: .8rem; line-height: 1.6; }
.ket-noi { color: var(--do); }

.dau-hop { margin-bottom: 1.4rem; }
.chan-hop { position: sticky; bottom: calc(-1 * var(--dem)); z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1rem; align-items: center; margin: 1.5rem calc(-1 * var(--dem)) calc(-1 * var(--dem)); padding: 1rem var(--dem); border-top: 1px solid var(--vien); background: var(--nen); }
.chan-hop .luu-y-dong-ho { margin: 0; flex: 1; min-width: 15ch; }
.hang-chon { margin-top: 1.25rem; }
.hang-chon h3, .hang-chon label { display: block; margin-bottom: .55rem; font-size: .9rem; font-weight: 400; }
select { width: 100%; max-width: 100%; min-height: 44px; padding: .65rem; border: 1px solid var(--vien); color: var(--chu); background: var(--nen); font-size: .85rem; }
select:hover { border-color: var(--chu-mo); }
select option { color: var(--chu); background: var(--nen); }

/* Accessible selection and independent audio controls, not decorative cards. */
.cac-tab { display: flex; flex-wrap: wrap; gap: 6px; margin: 1.2rem 0 .4rem; }
.cac-tab button { flex: 1 1 auto; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--vien); background: transparent; color: var(--chu-mo); font-size: .82rem; }
.cac-tab button[aria-selected="true"] { color: var(--nen); background: var(--chu); border-color: var(--chu); }
.cac-tab button:hover { border-color: var(--chu); }
.hang-cai-dat { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid #34382f; }
.hang-cai-dat h3, .hang-cai-dat label { font-size: .88rem; font-weight: 400; }
.gia-tri-cai-dat { min-width: 0; }
.ngon-ngu { padding-top: 0; }
.cong-tac { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; min-height: 44px; padding: .45rem 0; margin-left: auto; border: 0; background: transparent; font-size: .85rem; color: var(--chu-mo); }
.cong-tac.chon { color: var(--chu); }
.cong-tac:hover { text-decoration: underline; text-underline-offset: 4px; }
.am-luong { display: flex; align-items: center; gap: 5px; width: 100%; }
.am-luong input { appearance: none; flex: 1; min-width: 32px; width: 100%; height: 36px; background: transparent; cursor: pointer; }
.am-luong input::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--chu) var(--muc), var(--vien) var(--muc)); }
.am-luong input::-webkit-slider-thumb { appearance: none; width: 10px; height: 14px; margin-top: -6px; border: 1px solid var(--chu); background: var(--chu); }
.am-luong input::-moz-range-track { height: 2px; background: var(--vien); }
.am-luong input::-moz-range-progress { height: 2px; background: var(--chu); }
.am-luong input::-moz-range-thumb { width: 8px; height: 12px; border: 1px solid var(--chu); border-radius: 0; background: var(--chu); }
.am-luong output { font-size: .78rem; min-width: 4ch; text-align: right; }
.nhac-nhanh { border-top: 1px solid var(--vien); padding-top: .65rem; }
.nut-nhac { background: none; border: 1px solid transparent; padding: .3rem 0; min-height: 36px; font-size: .85rem; }
.nut-nhac:hover { text-decoration: underline; text-underline-offset: 4px; }
.huong-dan-ban-phim { padding-top: 1.25rem; }
.huong-dan-ban-phim p { margin-top: .65rem; color: var(--chu-mo); font-size: .8rem; }

/* Only turn, clocks and three game actions remain on the board. */
#lop-hud { position: relative; z-index: 10; pointer-events: none; }
.khung-hud { border: 1px solid var(--vien); background: rgba(18,20,17,.96); }
#thanh-tren { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; padding: 5px; gap: 4px; max-width: calc(100vw - 16px); }
.dong-ho { display: flex; flex-direction: column; justify-content: center; padding: .3rem .65rem; min-width: 80px; border: 1px solid transparent; }
.dong-ho .nhan { color: var(--chu-mo); font-size: .7rem; }
.gio { font-size: 1.1rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.dong-ho.dang-di { background: #2b2e26; border-color: var(--chu-mo); }
.dong-ho.sap-het-gio .gio { color: var(--do); }
#chi-bao-luot { display: flex; align-items: center; justify-content: center; padding: .5rem .7rem; }
#chi-bao-luot strong { font-size: .83rem; font-weight: 400; text-align: center; line-height: 1.5; }
#chi-bao-luot.bi-chieu { color: var(--do); }
#thanh-duoi { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 4px; max-width: calc(100vw - 16px); pointer-events: auto; }
#nut-nhanh { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
#nut-nhanh .nut { border-color: transparent; font-size: .8rem; padding: .5rem .7rem; }
#nut-nhanh .nut:hover:not(:disabled) { border-color: var(--vien); }

.huong-dan-dau { margin-bottom: 1rem; color: var(--chu-mo); font-size: .85rem; }
.huong-dan-dau p + p { margin-top: .6rem; }
.cac-quan { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.the-quan { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem 0; border-bottom: 1px solid #34382f; }
.so-do-quan { flex: 0 0 72px; width: 72px; height: 72px; color: var(--chu); }
.the-quan h3 { margin-bottom: .3rem; }
.the-quan p { font-size: .78rem; color: var(--chu-mo); line-height: 1.7; }
.luat-ket-thuc { margin-top: 1.25rem; }
.luat-ket-thuc p { font-size: .82rem; color: var(--chu-mo); margin-top: .5rem; }
.ket-qua { max-width: 380px; margin: 0 auto; padding: .5rem 0; }
.ket-qua h2 { font-size: 1.6rem; }
#ket-qua-ly-do { font-size: .9rem; color: var(--chu-mo); margin-top: .7rem; }
.ghi-cong-noi-dung p { color: var(--chu-mo); font-size: .85rem; margin-bottom: 1rem; }

/* Online lobby: flat fields and room rows, no card wrapper per room. */
.khung-online { width: min(760px, 100%); }
.online-field { display: grid; gap: .4rem; min-width: 0; }
.online-field label { color: var(--chu-mo); font-size: .8rem; }
.online-field input {
    width: 100%; min-height: 44px; padding: .65rem; border: 1px solid var(--vien);
    background: var(--nen); color: var(--chu); font-size: .88rem;
}
.online-field input:hover { border-color: var(--chu-mo); }
.online-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 1rem; }
.online-actions .nut { flex: 1 1 auto; }
.online-form { display: grid; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #34382f; }
.online-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; }
.online-row .nut { flex: 0 0 auto; }
.online-search { flex: 1 1 220px; }
.online-check { display: flex; align-items: center; gap: .55rem; min-height: 36px; color: var(--chu-mo); font-size: .82rem; }
.online-check input { width: 18px; height: 18px; accent-color: var(--chu); }
.online-note, .online-status { color: var(--chu-mo); font-size: .78rem; line-height: 1.7; margin-top: .8rem; }
.online-error { color: var(--do); font-size: .82rem; line-height: 1.7; margin-top: .8rem; }
.online-rooms { margin-top: .5rem; border-top: 1px solid #34382f; }
.online-room {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(100px, .7fr) auto;
    align-items: center; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid #34382f;
}
.online-room-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1rem; }
.online-room h3 { font-size: .92rem; }
.online-room p { color: var(--chu-mo); font-size: .74rem; line-height: 1.6; }
.online-room .nut { min-height: 40px; }
.online-room-meta { min-width: 0; overflow-wrap: anywhere; }
.online-code { font-size: .95rem; letter-spacing: .08em; color: var(--chu); }
.online-ten-phong { font-size: 1.45rem; line-height: 1.45; overflow-wrap: anywhere; }
.online-players { margin-top: 1rem; display: grid; gap: .35rem; }
.online-players p { font-size: .85rem; color: var(--chu-mo); }
.online-players strong { color: var(--chu); font-weight: 400; }
.online-result { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #34382f; }
.online-result p { font-size: .9rem; color: var(--chu-mo); }
.online-result strong { color: var(--chu); }
.online-footer { position: static; margin-bottom: calc(-1 * var(--dem)); }
#thanh-online {
    position: fixed; top: 86px; left: 50%; transform: translateX(-50%); z-index: 11;
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .8rem;
    max-width: calc(100vw - 16px); padding: .32rem .6rem;
    border: 1px solid var(--vien); background: rgba(18,20,17,.92);
    color: var(--chu-mo); font-size: .72rem; line-height: 1.5; pointer-events: none;
}
#thanh-online strong { color: var(--chu); font-weight: 400; }

/* Specific messages only. Full outlines, never colored edge rails or redundant headings. */
.lop-xac-nhan { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.75); }
.hop-xac-nhan { width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 24px; background: var(--nen); border: 1px solid var(--vien); }
.hop-xac-nhan h2 { font-size: 1.2rem; }
.hop-xac-nhan p { font-size: .87rem; color: var(--chu-mo); margin: 1rem 0 1.5rem; }
#thong-bao { position: fixed; right: 18px; bottom: 85px; z-index: 80; display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; width: min(360px, calc(100vw - 32px)); background: var(--nen); border: 1px solid var(--vien); }
#thong-bao > span { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; }
#thong-bao.loi { color: var(--do); }
#chu-thich-quan { position: fixed; top: 0; left: 0; z-index: 35; max-width: calc(100vw - 16px); padding: .5rem .7rem; background: var(--nen); border: 1px solid var(--vien); pointer-events: none; font-size: .8rem; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--nen); }
::-webkit-scrollbar-thumb { background: var(--vien); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 740px) {
    #lop-phu { padding: 12px; }
    .khung-phu { --dem: 20px; max-height: calc(100dvh - 24px); }
    .hang-cai-dat { grid-template-columns: 1fr; gap: .6rem; }
    .cong-tac { margin-left: 0; }
    .cac-quan { grid-template-columns: 1fr; }
    #nut-nhanh kbd { display: none; }
    .dong-ho { min-width: 65px; padding: .25rem .4rem; }
    #chi-bao-luot { padding: .4rem; }
    #chi-bao-luot strong { font-size: .75rem; }
    .online-room { grid-template-columns: 1fr auto; }
    .online-room-meta { grid-column: 1; }
    .online-room .online-vao { grid-column: 2; grid-row: 1 / span 2; }
    #thanh-online { top: 74px; font-size: .66rem; }
}
@media (max-width: 430px) {
    .nut-nhom button { padding: .55rem .5rem; }
    .chan-hop .hang-nut { width: 100%; }
    .chan-hop .hang-nut .nut { flex: 1; }
    #thanh-tren { top: 8px; }
    #nut-nhanh .nut { font-size: .75rem; padding: .5rem; }
    .gio { font-size: 1rem; }
}
@media (pointer: coarse) { .nut-bieu-tuong, .nut-nhac { min-width: 44px; min-height: 44px; } }
html[data-giam-chuyen-dong="bat"] *, html[data-giam-chuyen-dong="bat"] *::before, html[data-giam-chuyen-dong="bat"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
