/* Đàn gõ */
body[data-scene="dan-go"] { --sky1: #ffd3ea; --sky2: #fff1c4; }

/* --gm-btn: chỗ dành cho nút "Nghe bài mẫu" + khoảng hở; thanh đàn lấy phần chiều cao còn lại */
.gm-wrap { --gm-btn: 128px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gm-xylo { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(3px, 1.2vw, 14px);
  width: 100%; max-width: 720px; height: clamp(120px, calc(var(--vh) - var(--over) - var(--gm-btn)), 440px);
  touch-action: none; user-select: none; -webkit-user-select: none; }
/* wave 7: đàn gõ đồ chơi thật — khung gỗ (hình SVG do js vẽ, hai thanh đỡ chụm dần), thanh đàn sơn bóng bo tròn có hai đinh tán, số in trên miếng tròn màu kem */
.gm-frame { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.gm-frame svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 4px rgba(30, 42, 94, .28)); }

.gm-bar { position: relative; z-index: 1; display: grid; place-items: center; flex: 1 1 0; min-width: 34px; max-width: 78px; height: var(--h, 100%); margin: 0; padding: 0;
  border: 0; border-radius: 14px; color: var(--navy, #1E2A5E);
  /* thân thanh đàn như ống sơn bóng: vệt sáng chạy dọc bên trái, tối dần về hai mép và phía dưới */
  background: linear-gradient(90deg, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, 0) 13%, rgba(255, 255, 255, .55) 27%, rgba(255, 255, 255, .14) 42%, rgba(0, 0, 0, 0) 64%, rgba(0, 0, 0, .24) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .32) 0, rgba(255, 255, 255, 0) 7%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, .22) 100%), var(--c, #ff6fb5);
  font: inherit; font-weight: 800; font-size: clamp(24px, min(7vw, 8vh), 52px); line-height: 1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .2), 0 6px 0 rgba(0, 0, 0, .38), 0 6px 0 var(--c, #ff6fb5), 0 13px 10px rgba(60, 30, 10, .34);
  cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
/* hai đinh tán thép giữ thanh đàn trên khung (cách mỗi đầu 20% chiều dài, đúng chỗ thanh đỡ chạy qua) */
.gm-bar::before, .gm-bar::after { content: ''; position: absolute; left: 50%; top: 20%; width: 30%; max-width: 20px; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 36% 30%, #fff 0, #E3E7F2 26%, #9BA4C0 62%, #5F6889 100%); box-shadow: 0 2px 2px rgba(0, 0, 0, .4), inset 0 -1px 1px rgba(0, 0, 0, .3); }
.gm-bar::after { top: 80%; }
.gm-n { position: relative; display: grid; place-items: center; width: 1.5em; max-width: 92%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 36% 28%, #fff 0, #FFFDF2 50%, #EFE6CB 100%); font-size: .82em;
  box-shadow: inset 0 -2px 2px rgba(120, 90, 30, .22), 0 2px 0 rgba(0, 0, 0, .25), 0 0 0 2px rgba(255, 255, 255, .45); }
.gm-bar.gm-lit { filter: brightness(1.16) saturate(1.25);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .2), 0 6px 0 rgba(0, 0, 0, .38), 0 6px 0 var(--c, #ff6fb5), 0 0 0 4px #fff, 0 0 24px 8px var(--c, #ff6fb5); }
.gm-bar.gm-hit { animation: gm-hit .3s ease-out; }
@keyframes gm-hit { 0% { transform: none; } 35% { transform: translateY(7px) scale(.95, .97); } 70% { transform: translateY(-3px); } 100% { transform: none; } }

.btn.gm-demo { --c: var(--pink, #ff6fb5); flex: none; }
.btn.gm-demo.gm-on { --c: var(--red, #ff5a5f); }

@media (max-height: 560px) {
  .gm-wrap { --gm-btn: 100px; gap: 8px; }
  .gm-bar { border-radius: 11px; }
}
@media (prefers-reduced-motion: reduce) { .gm-bar.gm-hit { animation: none; } }
/* đàn thật to: màn rộng thì đàn rộng và cao hết chỗ, thanh đàn to hơn */
.gm-xylo { max-width: 1100px; height: clamp(120px, calc(var(--vh) - var(--over) - var(--gm-btn)), 600px); }
.gm-bar { max-width: 124px; font-size: clamp(24px, min(7vw, 8vh), 72px); }
@media (min-width: 700px) { .gm-wrap { --gm-btn: 78px; } }
@media (min-width: 700px) and (max-height: 560px) { .gm-wrap { --gm-btn: 56px; } }

/* hình trên thẻ ở trang chủ: mấy thanh đàn nhỏ */
.gm-mini { display: inline-flex; align-items: center; gap: .07em; height: 1em; vertical-align: middle; }
.gm-mini { position: relative; padding: 0 .05em; font-size: 1.7em;
  background: linear-gradient(#E9BD82, #A8733B) left 34% / 100% .07em no-repeat, linear-gradient(#E9BD82, #A8733B) left 68% / 100% .07em no-repeat; }
.gm-mini i { position: relative; display: block; width: .19em; height: 100%; border-radius: .06em; background-color: #ff5a5f;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, .18) 0, rgba(255, 255, 255, .55) 30%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .22) 100%);
  box-shadow: 0 .04em 0 rgba(0, 0, 0, .3), 0 .08em .08em rgba(30, 42, 94, .3); }
.gm-mini i:nth-child(2) { height: 88%; background-color: #ff9838; }
.gm-mini i:nth-child(3) { height: 76%; background-color: #f2b90f; }
.gm-mini i:nth-child(4) { height: 64%; background-color: #56c956; }
.gm-mini i:nth-child(5) { height: 52%; background-color: #4aa3ff; }

/* ---------- wave 7: 3D (hai dùi gõ nằm cạnh nút, chỉ để trang trí) ---------- */
.gm-wrap { position: relative; }
.gm-mallet { display: none; position: absolute; bottom: 20px; left: 50%; width: 190px; height: 14px; border-radius: 99px; pointer-events: none;
  background: linear-gradient(180deg, #FBE3B6 0, #E2B273 45%, #B78348 100%); box-shadow: 0 5px 5px rgba(30, 42, 94, .25); }
.gm-mallet::after { content: ''; position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 22%), radial-gradient(circle at 38% 30%, #FF8A90 0, #F2434E 45%, #B81F35 100%);
  box-shadow: 0 5px 5px rgba(30, 42, 94, .3); }
.gm-m0 { margin-left: -390px; transform: rotate(-9deg); }
.gm-m0::after { left: -18px; }
.gm-m1 { margin-left: 200px; transform: rotate(9deg); }
.gm-m1::after { right: -18px; background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 22%), radial-gradient(circle at 38% 30%, #7FC2FF 0, #2F86F2 45%, #1B55B8 100%); }
@media (min-width: 900px) and (min-height: 561px) { .gm-mallet { display: block; } }

/* ---------- wave 6: compat (trình duyệt cũ) ---------- */
/* Bản dự phòng cho máy cũ của các luật phía trên (giải thích ở cuối css/style.css); sửa luật gốc thì sửa luôn dòng tương ứng ở đây. */
/* chưa có color-mix() (thanh đàn wave 7 không còn dùng color-mix(), chỉ còn nút bấm) */
@supports not (color: color-mix(in srgb, red, blue)) {
  .btn.gm-demo { --ck: var(--k-pink); }
  .btn.gm-demo.gm-on { --ck: var(--k-red); }
}
