:root {
  --accent: #ff5d8f;
  --glass: rgba(13, 14, 24, 0.56);
  --glass-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f7fc;
  --muted: rgba(232, 235, 248, 0.68);
  --r: 22px;
  --gut: 20px;
  --side: 340px;
  --games-w: 480px;
  /* chỗ cho thanh tên khi nó nằm trên cột game (màn 861–1300px) */
  --brand-h: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  overflow: hidden;
  background: #0d0e16;
  color: var(--text);
  font: 15px/1.5 "Be Vietnam Pro", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

/* Cảnh 3D + lớp chuyển cảnh */
#world, #fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#world { touch-action: none; cursor: grab; }
#world:active { cursor: grabbing; }
#fx { pointer-events: none; z-index: 5; opacity: 0; filter: blur(16px) saturate(1.25); transform: scale(1.07); }
#fx.show { opacity: 1; filter: none; transform: none; }

/* Mọi khối UI mờ dần khi đổi mode, hiện lại so le */
.ui { z-index: 10; transition: opacity 0.45s ease, translate 0.45s ease; }
body:not(.ready) .ui { opacity: 0; translate: 0 12px; }
body.switching .ui:not(.dock) { opacity: 0; translate: 0 10px; transition-duration: 0.26s; transition-delay: 0s; }
body:not(.switching) .info { transition-delay: 0.12s; }
body:not(.switching) .wheel { transition-delay: 0.22s; }

.panel {
  position: fixed;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Tên + link ở giữa trên */
.brand {
  /* nằm giữa khoảng trống giữa 2 panel */
  position: fixed; top: var(--gut); left: calc(var(--games-w) + var(--gut) * 2); right: calc(var(--side) + var(--gut) * 2);
  width: fit-content; margin-inline: auto;
  display: flex; align-items: center; gap: 14px;
  padding: 6px 6px 6px 18px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  white-space: nowrap;
  /* không lấn sang 2 panel; thiếu chỗ thì tên co lại */
  max-width: calc(100vw - var(--games-w) - var(--side) - var(--gut) * 4);
}
.who { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.who-top { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* email dưới tên, bấm để copy */
.email { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0; border: 0; background: none; color: var(--muted); font-family: inherit; font-size: 11.5px; font-weight: 500; line-height: 1.3; text-align: left; cursor: pointer; transition: color 0.2s; }
.email:hover { color: var(--text); }
.email.copied { color: var(--accent); }
.who b { font-weight: 800; font-size: 14px; }
.who span { color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.links { display: flex; gap: 4px; }
.links a { text-decoration: none; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); transition: background 0.2s; }
.links a:hover { background: rgba(255, 255, 255, 0.16); }
.links a:first-child { background: var(--accent); color: #fff; }
.links a.alt { color: var(--muted); }

/* Bộ đếm vật nhặt */
.dock-row { display: flex; align-items: center; gap: 8px; }
/* Nút âm thanh */
.sound {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); color: var(--muted);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background 0.25s, color 0.25s;
}
.sound svg { width: 18px; height: 18px; }
.sound.on { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -6px var(--accent); }
.sound.pending { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.silent-tag {
  position: absolute; left: 8px; bottom: 8px; display: none; padding: 3px 8px; border-radius: 8px;
  font-size: 10.5px; color: #fff; background: rgba(0, 0, 0, 0.55);
}
.player.silent .silent-tag { display: block; }
.collect {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 12px 3px 4px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 12.5px; color: var(--muted);
}
.collect i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-style: normal; color: #fff; font-size: 13px; }
.collect i::after { content: "♥"; }
.collect[data-kind="note"] i::after { content: "♪"; }
.collect[data-kind="coin"] i::after { content: "$"; font-weight: 800; }
.collect[data-kind="carrot"] i::after { content: "✿"; }
.collect[data-kind="bulb"] i::after { content: "✦"; }
.collect[data-kind="bump"] i::after { content: "✸"; }
.collect b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.collect.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { scale: 1.18; } }

/* Góc trái trên: danh sách game + video */
.games {
  left: var(--gut); top: calc(var(--gut) + var(--brand-h)); width: var(--games-w);
  max-height: calc(100vh - var(--gut) - var(--brand-h) - 340px);
  /* không đặt min-height: video ngang (16:9) thấp hơn, khung cao cố định sẽ dư khoảng trống dưới đáy */
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px; }
.mode-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.mode-ride { font-size: 12px; color: var(--muted); }
/* Cao cố định cho cả video dọc lẫn ngang: đổi game không làm khung co giãn; video ngang nằm giữa, trên dưới là nền mờ (#player-bg) */
.player { position: relative; flex: none; height: 240px; border-radius: 14px; overflow: hidden; background: #000; }
#player-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(16px) brightness(0.55); transform: scale(1.25); }
#video { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.expand {
  position: absolute; right: 8px; top: 8px; width: 32px; height: 32px;
  border: 0; border-radius: 10px; background: rgba(0, 0, 0, 0.5); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background 0.2s;
}
.expand:hover { background: var(--accent); }
.expand svg { width: 15px; height: 15px; }
.no-clip { display: none; }
.player.empty .no-clip { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.player.empty #video, .player.empty .expand { display: none; }
/* position: relative để offsetLeft của chip tính từ dải clip (không thì tính từ panel, chọn clip đầu lại cuộn mất nó) */
.clips { position: relative; flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; cursor: grab; }
/* mờ ở phía còn clip bị khuất (JS bật more-left / more-right theo vị trí cuộn) */
.clips.more-right { mask-image: linear-gradient(90deg, #000 82%, transparent); }
.clips.more-left { mask-image: linear-gradient(90deg, transparent, #000 18%); }
.clips.more-left.more-right { mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.clips.dragging { cursor: grabbing; user-select: none; }
.clips::-webkit-scrollbar { display: none; }
.clips button {
  flex: none; white-space: nowrap;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.clips button:hover { color: var(--text); }
.clips button.on { background: var(--text); color: #12131c; border-color: var(--text); }
/* Nút trượt: ▲▼ cho list game, ‹ › cho dải clip; mờ khi tới đầu/cuối, ẩn khi không cần cuộn (class fits) */
.nudge {
  flex: none; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); background: var(--glass-2); color: var(--text);
  cursor: pointer; transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.nudge svg { width: 14px; height: 14px; }
.nudge:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.nudge:disabled { opacity: 0.3; cursor: default; }
.nudge.h { width: 26px; height: 26px; border-radius: 50%; }
.nudge.v { position: absolute; left: 0; right: 4px; height: 22px; border-radius: 8px; z-index: 1; }
#list-up { top: 0; }
#list-down { bottom: 0; }
.clip-bar { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; }
.clip-bar .clips { flex: 1; min-width: 0; }
.clip-bar.fits .nudge, .list-cell.fits .nudge { display: none; }
/* list game nằm bên trái video, cao bằng khối video */
.games-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; min-height: 0; }
.list-cell { position: relative; min-height: 150px; }
.list-cell .game-list { position: absolute; inset: 27px 0; border-top: 0; padding: 0 4px 0 0; }
.list-cell.fits .game-list { inset: 0; }
.media { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.game-list {
  list-style: none; margin: 0; padding: 2px 0 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--line); padding-top: 8px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.row {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px;
  border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s; user-select: none;
}
.row:hover { background: var(--glass-2); }
.row.on { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.row img { flex: none; width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: #1c1d28; }
.row-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.row-txt b { font-size: 10.5px; color: var(--accent); letter-spacing: 0.07em; }
.row-title { font-size: 12px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-txt small { font-size: 11px; color: var(--muted); }
.row-go { color: var(--muted); font-size: 18px; padding-right: 4px; transition: translate 0.2s; }
.row:hover .row-go { translate: 3px 0; }

/* Bên phải: thông tin game, ngắn gọn */
.info {
  right: var(--gut); top: var(--gut); width: var(--side);
  max-height: calc(100vh - 2 * var(--gut) - 30px); overflow-y: auto;
  padding: 22px 22px 18px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.info > * { opacity: 0; translate: 0 8px; transition: opacity 0.45s ease, translate 0.45s ease; }
.info.in > * { opacity: 1; translate: 0 0; }
.info.in > :nth-child(2) { transition-delay: 0.04s; }
.info.in > :nth-child(3) { transition-delay: 0.08s; }
.info.in > :nth-child(4) { transition-delay: 0.12s; }
.info.in > :nth-child(5) { transition-delay: 0.16s; }
.info.in > :nth-child(n+6) { transition-delay: 0.2s; }
.i-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.i-code { background: var(--accent); color: #fff; font-weight: 800; font-size: 11.5px; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; }
.i-plat { font-size: 12px; color: var(--muted); }
.i-title { margin: 0; font-size: 25px; line-height: 1.18; font-weight: 800; letter-spacing: -0.015em; }
.i-role { margin: 6px 0 16px; color: var(--muted); font-size: 13.5px; }
.i-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-bottom: 16px; }
.i-stats div { background: var(--glass-2); border-radius: 14px; padding: 10px 12px; }
.i-stats b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; }
.i-stats span { font-size: 11px; color: var(--muted); }
.i-hl { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.i-hl li {
  position: relative; padding-left: 16px; font-size: 13.5px; color: rgba(242, 244, 252, 0.9);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.i-hl li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.i-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.i-tags span { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; background: var(--glass-2); color: var(--muted); }
.i-stores { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.i-stores a { text-decoration: none; font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 12px; background: var(--text); color: #12131c; transition: transform 0.2s; }
.i-stores a:hover { transform: translateY(-2px); }
.i-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.i-nav button { border: 0; border-radius: 12px; padding: 8px 12px; background: var(--glass-2); cursor: pointer; font-weight: 700; font-size: 13px; transition: filter 0.2s; }
.i-nav button:hover { filter: brightness(1.2); }
.i-nav .i-next { background: var(--accent); color: #fff; }

/* Góc trái dưới: vòng ảnh */
.wheel { position: fixed; left: 0; bottom: 0; width: 460px; height: 340px; z-index: 9; }
.wheel-ring { position: absolute; pointer-events: none; }
.wheel-ring i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.38); }
.wheel-ring i + i {
  inset: 78px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 46px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 46px color-mix(in srgb, var(--accent) 22%, transparent);
}
.wheel-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; outline: none; }
.wheel-stage:active { cursor: grabbing; }
.wheel-card {
  position: absolute; left: 0; top: 0; margin: 0;
  border-radius: 14px; overflow: hidden; background: #15161f;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.65);
  transform-origin: center; will-change: transform, opacity;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.wheel-card.front {
  border-color: var(--accent); cursor: zoom-in;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 4px color-mix(in srgb, var(--accent) 38%, transparent);
}
.wheel-card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.wheel-bar {
  position: absolute; left: var(--gut); bottom: 14px; z-index: 200;
  display: flex; align-items: center; gap: 8px; max-width: 300px;
  padding: 4px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.wheel-btn { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--glass-2); cursor: pointer; font-size: 18px; line-height: 1; transition: background 0.2s; }
.wheel-btn:hover { background: var(--accent); }
.wheel-cap { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12px; }
.wheel-cap b { color: var(--accent); font-variant-numeric: tabular-nums; }
.wheel-cap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dưới cùng: 5 mode + gợi ý phím */
.dock { position: fixed; left: 50%; bottom: var(--gut); transform: translateX(-50%); z-index: 11; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hint {
  display: flex; gap: 14px; padding: 5px 12px; border-radius: 999px;
  font-size: 11.5px; color: rgba(255, 255, 255, 0.88);
  background: rgba(10, 10, 20, 0.38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  white-space: nowrap;
}
kbd { font: 600 10.5px/1 "Be Vietnam Pro", sans-serif; padding: 3px 6px; margin-right: 3px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.1); }
.modes {
  display: flex; gap: 6px; padding: 6px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}
.mode {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px;
  border: 0; border-radius: 18px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background 0.35s, color 0.35s, transform 0.2s;
}
.mode:hover { background: var(--glass-2); color: var(--text); transform: translateY(-2px); }
.mode-ico {
  width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--mc) 18%, transparent); color: var(--mc);
  transition: background 0.35s, color 0.35s, box-shadow 0.35s;
}
.mode-ico svg { width: 20px; height: 20px; }
.mode-txt { display: grid; text-align: left; line-height: 1.2; white-space: nowrap; }
.mode-txt b { font-size: 14px; color: var(--text); }
.mode-txt small { font-size: 11px; }
.mode.on { background: color-mix(in srgb, var(--mc) 22%, transparent); color: var(--text); }
.mode.on .mode-ico { background: var(--mc); color: #fff; box-shadow: 0 8px 20px -6px var(--mc); }

/* Nút Auto + thanh tiến độ thời gian dừng */
.mode-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); }
/* 2 cụm: dev chính / mentor */
.modes { align-items: flex-end; }
.mode-group { display: flex; flex-direction: column; gap: 3px; }
.mode-cap { padding: 0 10px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mode-row { display: flex; gap: 6px; }
.mode-group.mentor .mode-row { border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.i-note { margin: -8px 0 16px; padding: 8px 10px; border-radius: 10px; font-size: 12px; color: var(--muted); background: var(--glass-2); border-left: 3px solid var(--accent); }
.mode.auto { position: relative; overflow: hidden; --mc: #ffffff; }
.mode.auto .mode-ico { background: rgba(255, 255, 255, 0.1); color: #fff; }
.mode.auto .mode-ico i { display: grid; place-items: center; font-style: normal; }
.mode.auto .mode-ico .i-pause, .mode.auto.active .mode-ico .i-play { display: none; }
.mode.auto.active .mode-ico .i-pause { display: grid; }
.mode.auto.active { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
.mode.auto.active .mode-ico { background: var(--accent); box-shadow: 0 8px 20px -6px var(--accent); }
.mode.auto::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0;
}
.mode.auto.run::after { opacity: 1; animation: dwell var(--dwell, 14s) linear forwards; }
@keyframes dwell { to { transform: scaleX(1); } }

.credit {
  position: fixed; right: var(--gut); bottom: 8px; z-index: 9; margin: 0; max-width: 320px;
  font-size: 10px; line-height: 1.4; text-align: right; color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(5, 6, 12, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.25s;
}
.lightbox.open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lb-media { margin: 0; }
.lb-media img, .lb-media video { display: block; max-width: 90vw; max-height: 84vh; border-radius: 14px; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.lightbox button { position: absolute; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 24px; cursor: pointer; }
.lightbox button:hover { background: var(--accent); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: calc(50% - 23px); }
.lb-next { right: 16px; top: calc(50% - 23px); }
.lightbox.video .lb-prev, .lightbox.video .lb-next { display: none; }

/* Màn chờ lúc mở trang */
.veil {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #2b1d4b, #0d0e16 70%);
  transition: opacity 0.9s ease, visibility 0.9s;
}
body.ready .veil { opacity: 0; visibility: hidden; }
.loader { display: grid; justify-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.loader i { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #ff5d8f; animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

body.no-webgl { background: radial-gradient(circle at 50% 30%, #3a2a66, #0d0e16 75%); }
body.no-webgl #world, body.no-webgl .hint, body.no-webgl .collect { display: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Màn thấp: thu nhỏ vòng ảnh */
@media (max-height: 820px) and (min-width: 861px) {
  .wheel { height: 290px; width: 420px; }
  .games { max-height: calc(100vh - var(--gut) - var(--brand-h) - 292px); }
  .player { height: 200px; }
}
@media (max-width: 1400px) and (min-width: 861px) {
  .who span { display: none; }
}
/* Laptop: thanh chế độ (rộng ~865px) chạm cột phải -> panel info dừng phía trên nó */
@media (max-width: 1600px) and (min-width: 861px) {
  .info { max-height: calc(100vh - 132px); }
}
/* Hàng gợi ý phím: bỏ bớt gợi ý phụ để không đè panel info */
@media (max-width: 1520px) and (min-width: 861px) {
  .hint .opt { display: none; }
}
@media (max-width: 1240px) and (min-width: 861px) {
  .hint .opt2 { display: none; }
  /* panel info hẹp 300px: chữ + khoảng cách gọn hơn để khỏi phải cuộn */
  .info { padding: 18px 18px 14px; }
  .i-title { font-size: 21px; }
  .i-role { margin: 4px 0 12px; font-size: 13px; }
  .i-stats { margin-bottom: 12px; }
  .i-stats div { padding: 8px 10px; }
  .i-stats b { font-size: 19px; }
  .i-hl { margin-bottom: 12px; gap: 8px; }
  .i-hl li { font-size: 13px; }
  .i-tags, .i-stores { margin-bottom: 12px; }
  .i-nav { padding-top: 10px; }
}
/* Giữa 2 panel không đủ chỗ cho tên + nút: thanh tên lên trên cột game, panel game lùi xuống */
@media (max-width: 1300px) and (min-width: 861px) {
  :root { --brand-h: 62px; }
  .brand { left: var(--gut); right: auto; width: var(--games-w); max-width: none; margin: 0; justify-content: space-between; }
}
@media (max-width: 1240px) and (min-width: 861px) {
  :root { --side: 300px; --games-w: 420px; }
  .games-body { grid-template-columns: 124px minmax(0, 1fr); }
  .who span { display: none; }
  .mode-txt small { display: none; }
  .wheel { width: 400px; }
}

/* Điện thoại: cảnh 3D ở trên, nội dung cuộn bên dưới */
@media (max-width: 860px) {
  html, body { height: auto; }
  body { overflow-y: auto; display: flex; flex-direction: column; padding-bottom: 104px; }
  body::before { content: ""; order: 0; flex: none; height: 58vh; pointer-events: none; }
  .brand { position: absolute; top: 12px; left: 12px; right: 12px; width: auto; max-width: none; margin: 0; justify-content: space-between; padding-left: 14px; }
  .who span { display: none; }
  .links a.alt { display: none; }
  .panel { position: relative; left: auto; right: auto; top: auto; width: auto; max-height: none; min-height: 0; margin: 0 12px 12px; }
  .info { order: 1; }
  .games { order: 2; }
  .wheel { order: 3; position: relative; width: auto; height: 320px; margin: 0 0 12px; overflow: hidden; }
  .credit { order: 4; position: static; margin: 0 16px; text-align: left; max-width: none; }
  .games-body { grid-template-columns: 1fr; }
  .media { order: -1; }
  .list-cell { min-height: 0; }
  .list-cell .game-list { position: static; overflow: visible; }
  .list-cell .nudge.v { display: none; }
  .mode-sep, .mode-cap { display: none; }
  .mode-group, .mode-row { display: contents; }
  .player { height: 300px; }
  .dock { bottom: 10px; width: calc(100% - 20px); }
  .hint, .collect { display: none; }
  .modes { width: 100%; justify-content: space-between; }
  .mode { flex: 1; flex-direction: column; gap: 4px; padding: 6px 2px; }
  .mode-txt { text-align: center; }
  .mode-txt b { font-size: 11px; }
  .mode-txt small { display: none; }
}
