/* Theme "Vườn bình minh". Mỗi màu một nghĩa:
   tím = nút chính, nốt mẫu, đang phát · vàng sao = trúng · đỏ = lệch · hồng sen = đường giọng · nâu = quãng */
:root {
  --bg: #FFF6EE;
  --ink: #3B2A5A;
  --muted: #6B5C86;
  --line: #EDE0F5;
  --soft: #F3ECFB;
  --primary: #6C47E0;
  --primary-dark: #4B2DB0;
  --primary-soft: #EFE9FF;
  --primary-edge: #D7C9FF;
  --sun: #FFC21A;
  --good: #E9A100;
  --good-dark: #7A5000;
  --good-soft: #FFF2C4;
  --miss: #D9382B;
  --miss-dark: #A52318;
  --miss-soft: #FFE5E1;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --shadow: 0 4px 14px rgba(108, 71, 224, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
/* Nền chuyển màu nằm ở một lớp cố định riêng (background-attachment: fixed bắt vẽ lại cả trang khi cuộn). */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; transform: translateZ(0);
  background: linear-gradient(180deg, #FFE3D3 0%, #FFF1F6 32%, #F1EDFF 70%, #E8F4FF 100%);
}
body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; user-select: none; -webkit-user-select: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--primary); }
h1 { font-size: 22px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 800; }
ul { list-style: none; }
.icon { display: inline-flex; }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; align-self: center; }

.screen {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 600px; margin: 0 auto;
  padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(12px + var(--safe-left));
}

.card { background: #fff; border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
/* Mỗi khung đang chơi tự lo phần vẽ của mình, thay đổi bên trong không lan ra cả trang. */
.staff-card, .roll-card, .sky, .feedback { contain: layout paint; }
.pad { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.prose p { font-weight: 500; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 8px 16px; border-radius: 999px;
  font-weight: 800; font-size: 17px; line-height: 1.15;
  background: #fff; border: 2px solid var(--primary-edge); color: var(--primary-dark);
  box-shadow: 0 4px 0 var(--primary-edge);
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-edge); }
.btn:disabled { opacity: .5; }
.btn.wide { width: 100%; min-height: 56px; font-size: 19px; }
.btn.small { min-height: 44px; font-size: 15px; padding: 6px 14px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
  color: var(--primary-dark); font-size: 24px; font-weight: 800; box-shadow: 0 3px 0 var(--line);
}
.icon-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.icon-btn:disabled { opacity: .4; }
.icon-btn.music { font-family: system-ui, sans-serif; font-weight: 600; line-height: 1; }
.link { color: var(--primary); font-weight: 800; min-height: 44px; padding: 0 8px; }

.top { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; }
.titles { text-align: center; min-width: 0; }
.titles small { display: block; color: var(--primary); font-size: 13px; font-weight: 700; }

/* ---------- Nút gạt ---------- */
.seg { display: flex; gap: 3px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 2px solid var(--line); }
.seg button {
  flex: 1; min-height: 44px; padding: 0 12px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 3px 8px rgba(108, 71, 224, .35); }
.wide-seg button { min-height: 46px; font-size: 16px; }
.seg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.seg-row.stack { flex-direction: column; align-items: stretch; gap: 4px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.tempo-value { min-width: 62px; text-align: center; font-weight: 800; font-size: 14px; }

/* ---------- Chim ---------- */
.bird { position: relative; flex: none; width: 76px; cursor: pointer; border-radius: 50%; user-select: none; -webkit-user-select: none; }
.bird svg { display: block; width: 100%; overflow: visible; }
.bird.big { width: 104px; }
.bird .b-body { display: block; transform-origin: 50% 100%; animation: b-bob 2.6s ease-in-out infinite; }
.bird .b-tail, .bird .b-wing, .bird .b-head, .bird .b-eye, .bird .b-beak-low { transform-box: fill-box; }
.bird .b-tail { transform-origin: 100% 0; }
.bird .b-wing { transform-origin: 30% 10%; }
.bird .b-head { transform-origin: 40% 80%; }
.bird .b-eye { transform-origin: center; }
.bird .b-beak-low { transform-origin: 0 0; }
.bird .b-happy { display: none; }
.bird.blink .b-eye { transform: scaleY(.12); }
.bird.wag .b-tail { transform: rotate(-14deg); }
.bird.peek .b-head { transform: rotate(9deg); }
.bird[data-mood="listen"] .b-body { animation: b-nod 1s ease-in-out infinite; }
.bird[data-mood="sing"] .b-beak-low { animation: b-beak .24s ease-in-out 3 alternate; }
.bird[data-mood="sing"] .b-body { animation: b-bounce .45s ease-in-out infinite; }
.bird[data-mood="cheer"] .b-body { animation: b-jump .72s cubic-bezier(.3, .7, .4, 1) infinite; }
.bird[data-mood="cheer"] .b-wing { animation: b-flap .18s ease-in-out infinite alternate; }
.bird[data-mood="cheer"] .b-eye { display: none; }
.bird[data-mood="cheer"] .b-happy { display: inline; }
.bird[data-mood="cheer"] .b-beak-low { animation: b-beak .2s ease-in-out infinite alternate; }
.bird[data-mood="up"] .b-head { transform: rotate(-18deg) translateY(-4px); }
.bird[data-mood="down"] .b-head { transform: rotate(16deg) translateY(3px); }
.bird[data-mood="sad"] .b-body { animation: b-shake .8s ease-in-out infinite; }
@keyframes b-bob { 50% { transform: translateY(-2px) scale(1.02, .98); } }
@keyframes b-nod { 50% { transform: rotate(5deg); } }
@keyframes b-beak { to { transform: rotate(24deg); } }
@keyframes b-bounce { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes b-jump { 0%, 100% { transform: translateY(0) scale(1.06, .94); } 45% { transform: translateY(-16px) rotate(-7deg) scale(.97, 1.04); } }
@keyframes b-flap { to { transform: rotate(-48deg); } }
@keyframes b-shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.perch-hop { transform-box: fill-box; transform-origin: 50% 100%; animation: hop .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 0% { transform: translateY(-16px) scale(.92, 1.1); } 60% { transform: translateY(1px) scale(1.12, .88); } 100% { transform: none; } }
.mark-pop { transform-box: fill-box; transform-origin: center; animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } }

.speak { display: flex; align-items: center; gap: 12px; }
.bubble {
  position: relative; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--line); font-size: 15px; font-weight: 700;
}
.bubble::before {
  content: ''; position: absolute; left: -8px; top: calc(50% - 7px); width: 13px; height: 13px; background: #fff;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg);
}
.fly-note { position: absolute; left: 75%; top: 0; pointer-events: none; z-index: 3; animation: fly 1.1s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--dx, 16px), -48px) rotate(22deg) scale(1.2); opacity: 0; } }

/* ---------- Sao, hoa giấy ---------- */
.stars { display: flex; align-items: center; justify-content: center; gap: 4px; }
.star { display: inline-flex; width: 34px; height: 34px; }
.star:nth-child(2) { width: 42px; height: 42px; margin-top: -6px; }
.star svg { width: 100%; height: 100%; fill: var(--soft); stroke: #C9BCE4; }
.star.on { animation: pop .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.star.on svg { fill: var(--sun); stroke: #B97C00; }
.points { margin-left: 8px; font-size: 20px; color: var(--primary-dark); }
.cheer-pop {
  position: fixed; left: 50%; top: 38%; z-index: 35; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 26px; border-radius: 30px; background: #fff; border: 4px solid var(--sun);
  box-shadow: 0 16px 40px rgba(59, 42, 90, .3); pointer-events: none; transform: translate(-50%, -50%);
  animation: cheer 1.9s ease-in-out forwards;
}
.cheer-pop strong { font-size: 24px; color: var(--primary-dark); }
.cheer-pop .star { width: 52px; height: 52px; }
.cheer-pop .star:nth-child(2) { width: 66px; height: 66px; margin-top: -12px; }
@keyframes cheer {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  14% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  22%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -75%) scale(.9); opacity: 0; }
}
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 10px; height: 10px; border-radius: 50%; animation: fall 1.9s ease-in forwards; }
.confetti i.petal { width: 13px; height: 9px; border-radius: 90% 0; }
.confetti i.ribbon { width: 6px; height: 16px; border-radius: 3px; }
@keyframes fall { to { transform: translate(var(--drift, 0), 105dvh) rotate(560deg); opacity: .7; } }

/* ---------- Trang chủ ---------- */
.scene { position: relative; height: 270px; border-radius: 30px; overflow: hidden; box-shadow: 0 10px 28px rgba(108, 71, 224, .22); border: 4px solid #fff; contain: layout paint; }
.scene-sky, .scene-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.sun svg, .cloud svg, .butterfly svg, .flower .petals svg { display: block; width: 100%; height: auto; }
.scene-title { position: absolute; left: 16px; top: 10px; z-index: 2; color: #fff; text-shadow: 0 2px 8px rgba(59, 42, 90, .55); pointer-events: none; }
.scene-title h1 { font-size: 30px; }
.scene-title p { font-size: 13px; }
.sun, .cloud, .butterfly { position: absolute; pointer-events: none; }
.sun { right: 5%; top: 12px; width: 108px; height: 108px; }
.sun .rays, .sun .face { position: absolute; inset: 0; }
.sun .rays > div { width: 100%; height: 100%; }
.sun .rays { animation: spin 28s linear infinite; }
.cloud { width: 62px; }
.cloud.c1 { left: 4%; top: 24px; animation: drift 26s ease-in-out infinite alternate; }
.cloud.c2 { left: 52%; top: 8px; width: 44px; animation: drift 34s ease-in-out -8s infinite alternate-reverse; }
.cloud.c3 { right: -6px; top: 118px; width: 52px; animation: drift 30s ease-in-out -15s infinite alternate-reverse; }
.butterfly { width: 28px; height: 28px; left: 0; top: 0; }
.butterfly .flap { animation: wings .32s ease-in-out infinite alternate; }
.butterfly.f1 { left: 62%; top: 44%; animation: flutter1 13s ease-in-out infinite; }
.butterfly.f2 { left: 14%; top: 34%; width: 22px; height: 22px; animation: flutter2 17s ease-in-out infinite; }
.scene .b-body, .flower .petals, .scene-bubble, .sun .rays, .cloud, .butterfly, .butterfly .flap { will-change: transform; }
.scene.paused *, .scene.paused .bird .b-body { animation-play-state: paused !important; }
.scene .scene-bird { position: absolute; left: 16%; bottom: 84px; width: 96px; }
.scene-bubble {
  position: absolute; left: calc(16% + 98px); bottom: 140px; z-index: 2; max-width: 150px; padding: 6px 12px; border-radius: 18px 18px 18px 4px;
  background: #fff; font-size: 13px; font-weight: 800; box-shadow: var(--shadow); animation: float 3.4s ease-in-out infinite;
}
.flowers { position: absolute; left: 4px; right: 4px; bottom: 2px; z-index: 2; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.flower { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 76px; padding: 0; }
.flower .petals { display: block; width: 100%; max-width: 50px; transform-origin: 50% 100%; animation: sway 3.2s ease-in-out var(--sway, 0s) infinite; }
.flower.bloom .petals { animation: bloom .5s cubic-bezier(.3, 1.8, .5, 1); }
.flower-name { margin-top: -4px; padding: 0 7px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 800; }
.flower .fly-note { left: 55%; color: #fff; }
.flower .fly-note svg { width: 22px; height: 22px; }
@keyframes drift { to { transform: translateX(60px); } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes bloom { 40% { transform: scale(1.28) rotate(18deg); } }
@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes wings { to { transform: scaleX(.35); } }
@keyframes flutter1 { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-60px, -34px); } 65% { transform: translate(70px, 20px); } }
@keyframes flutter2 { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(100px, -34px); } 70% { transform: translate(-24px, 28px); } }

.home-bar { display: flex; flex-direction: column; gap: 10px; }
.voice { display: flex; align-items: center; gap: 12px; padding: 8px 14px; text-align: left; }
.voice-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #FFE1EC; color: #B4245C; }
.voice-text { flex: 1; }
.voice small { display: block; color: var(--muted); font-size: 13px; }
.voice strong { font-size: 18px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; min-height: 76px; }
.tile {
  position: relative; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 176px; padding: 14px 12px;
  border-radius: 28px; background: var(--tile-bg); border: 3px solid #fff; box-shadow: 0 6px 0 var(--tile-edge), 0 12px 22px rgba(59, 42, 90, .12);
  transition: transform .15s;
}
.tile:hover { transform: translateY(-3px) rotate(-.6deg); }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--tile-edge); }
.tile-1 { --tile-bg: #FFE0E9; --tile-edge: #FFB0C6; --tile-art: #FF5D8F; }
.tile-2 { --tile-bg: #FFEBD2; --tile-edge: #FFCB8F; --tile-art: #FF8C1A; }
.tile-3 { --tile-bg: #DDF1FF; --tile-edge: #A9DBFF; --tile-art: #2E9BE8; }
.tile-4 { --tile-bg: #ECE3FF; --tile-edge: #C9B5FF; --tile-art: #7B55E8; }
.tile-art { display: block; width: 60px; height: 60px; border-radius: 22px; background: var(--tile-art); padding: 5px; transform: rotate(-5deg); }
.tile-art svg { display: block; width: 100%; height: 100%; }
.tile:hover .tile-art { animation: wiggle .5s ease-in-out; }
@keyframes wiggle { 30% { transform: rotate(10deg) scale(1.08); } 65% { transform: rotate(-12deg); } }
.mode-text { flex: 1; min-width: 0; }
.mode-text strong { display: block; font-size: 17px; line-height: 1.15; }
.mode-text small { display: block; color: var(--muted); font-size: 13px; line-height: 1.25; }
.ws { position: absolute; top: 12px; right: 12px; padding: 1px 9px; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 800; color: var(--muted); }
.tile-go { position: absolute; top: 48px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--tile-art); }
.foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.foot .btn { min-height: 46px; font-size: 15px; }

/* ---------- Màn chơi ---------- */
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chips button, .steps button {
  min-height: 44px; border-radius: 999px; border: 2px solid var(--primary-edge); background: #fff;
  color: var(--primary-dark); font-size: 15px; font-weight: 800;
}
.chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.steps button[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--ink); box-shadow: 0 3px 0 #D99A00; }
.play-grid, .stage, .side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.duo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.staff-card { padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.staff { display: block; width: 100%; height: auto; max-height: 230px; margin: 0 auto; }
.roll-card { padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.card-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.roll { display: block; width: 100%; height: clamp(130px, 19dvh, 190px); transform: translateZ(0); }
.feedback {
  min-height: 92px; padding: 8px 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; text-align: center;
}
.big { font-size: 20px; font-weight: 800; line-height: 1.15; }
.big.count { font-size: 52px; color: var(--primary); animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }
.big.ok { color: var(--good-dark); }
.big.miss { color: var(--miss-dark); }
.live { display: flex; align-items: center; gap: 12px; text-align: left; }
.live .icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; }
.live.ok { color: var(--good-dark); }
.live.ok .icon { background: var(--good-soft); animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.live.miss { color: var(--miss-dark); }
.live.miss .icon { background: var(--miss-soft); }
.verdicts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
.verdict { padding: 5px 2px; border-radius: 14px; line-height: 1.15; }
.verdict strong { display: block; font-size: 16px; }
.verdict span { font-size: 12px; font-weight: 700; }
.verdict.ok { background: var(--good-soft); color: var(--good-dark); }
.verdict.miss { background: var(--miss-soft); color: var(--miss-dark); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }

/* Tùy chọn phụ: nhỏ gọn, không tranh chỗ với bài hát. */
.toggles { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1.5px dashed #CDBFE8; background: rgba(255, 255, 255, .55); color: var(--muted); font-size: 13px; font-weight: 700;
}
.chip[aria-pressed="true"] { border-style: solid; border-color: var(--primary-edge); background: var(--primary-soft); color: var(--primary-dark); }
.toggles .seg-row { gap: 4px; }
.toggles .icon-btn { width: 44px; height: 44px; font-size: 20px; }
.toggles > .seg-row .seg-label { display: none; }
.toggles > .tone-row .seg-label { display: block; font-size: 12px; }
.toggles .seek { flex-basis: 100%; }
.round-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }

/* Thanh điều khiển: nút tròn, biểu tượng to. */
.actions {
  display: flex; align-items: flex-start; justify-content: center; gap: 22px; position: sticky; bottom: 0; z-index: 4;
  padding: 10px 0 calc(8px + var(--safe-bottom)); margin-bottom: calc(-8px - var(--safe-bottom));
  background: linear-gradient(transparent, rgba(241, 237, 255, .96) 34%);
}
.actions .btn.round {
  flex: 0 1 auto; flex-direction: column; justify-content: flex-start; gap: 6px; min-width: 76px; min-height: 76px;
  padding: 0; border: 0; border-radius: 22px; background: none; box-shadow: none; color: var(--ink); font-size: 13px;
}
.actions .btn.round:active:not(:disabled) { transform: none; box-shadow: none; }
.actions .disc {
  display: grid; place-items: center; width: 58px; height: 58px; margin-top: 12px; border-radius: 50%;
  background: #fff; color: var(--primary); border: 3px solid var(--primary-edge); box-shadow: 0 5px 0 var(--primary-edge);
  transition: transform .1s;
}
.actions .btn.main .disc {
  width: 82px; height: 82px; margin-top: 0; background: var(--primary); color: #fff; border: 4px solid #fff;
  box-shadow: 0 6px 0 var(--primary-dark), 0 10px 24px rgba(108, 71, 224, .4);
}
.actions .btn.main .disc svg { width: 40px; height: 40px; }
.actions .btn.main { font-size: 16px; min-width: 100px; }
/* Nút chính nảy vài lần để mời bấm rồi nghỉ. */
.actions .btn.main:not(:disabled) .disc { animation: beckon 2.4s ease-in-out 3; }
.actions .btn:active:not(:disabled) .disc { animation: none; transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-dark); }
.actions .caption { max-width: 100px; text-align: center; line-height: 1.1; }
.actions .icon-only .caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.actions .btn { position: relative; }
/* Đang phát / hát: tắt những thứ bắt vẽ lại liên tục (hiệu ứng trong hình khuông, bóng mờ của thẻ). */
.play.playing .actions .btn .disc, .play.playing .mark-pop, .play.playing .perch-hop { animation: none; }
.play.playing .card { box-shadow: none; }
@keyframes beckon { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.08); } 90% { transform: scale(.98); } }

/* Điện thoại: nút chính nằm dưới cùng, trong tầm ngón cái. */
@media (max-width: 899px) {
  .play .side { display: contents; }
  .play .feedback { order: 0; }
  .play .toggles { order: 1; }
  .play .round-row { order: 2; }
  .play .actions { order: 3; }
  .play .speak .bird { width: 56px; }
  .play .roll { height: clamp(124px, 17dvh, 170px); }
  .play .feedback { scroll-margin-bottom: 118px; }
}

/* Đang phát / hát (điện thoại, iPad dọc, điện thoại ngang): chỉ giữ bài nhạc, biểu đồ và một thanh đáy
   gồm chim · phản hồi trực tiếp · nút Dừng, để phản hồi luôn nằm trong tầm mắt và không gì che bài. */
@media (max-width: 899px), (orientation: landscape) and (max-height: 520px) {
  .play { --dock: 76px; }
  .screen.play.playing { padding-bottom: calc(var(--dock) + 16px + var(--safe-bottom)); }
  .play.playing .config, .play.playing .speak .bubble, .play.playing .practice-row, .play.playing .voice-seg { display: none; }
  .play.playing .speak { position: fixed; left: calc(6px + var(--safe-left)); bottom: calc(12px + var(--safe-bottom)); z-index: 6; }
  .play.playing .speak .bird { width: 54px; }
  .play.playing .feedback {
    position: fixed; z-index: 5; left: calc(66px + var(--safe-left)); right: calc(94px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom)); height: var(--dock); min-height: 0; overflow: hidden;
    flex-flow: row wrap; align-content: center; justify-content: center; gap: 0 10px; padding: 4px 8px;
  }
  .play.playing .feedback .big { font-size: 17px; }
  .play.playing .feedback .big.count { font-size: 38px; }
  .play.playing .feedback .muted { font-size: 12.5px; line-height: 1.2; }
  .play.playing .feedback .big.count + .muted { flex: 1 1 0; text-align: left; }
  .play.playing .feedback .live { gap: 8px; }
  .play.playing .feedback .live .icon { width: 38px; height: 38px; flex: none; }
  .play.playing .feedback .live .icon svg { width: 26px; height: 26px; }
  .play.playing .actions {
    position: fixed; z-index: 6; left: auto; right: calc(8px + var(--safe-right)); bottom: calc(8px + var(--safe-bottom));
    width: 78px; height: var(--dock); margin: 0; padding: 0; align-items: center; background: none;
  }
  .play.playing .actions .btn.main { min-width: 0; min-height: 0; }
  .play.playing .actions .btn.main .disc { width: 66px; height: 66px; margin: 0; }
  .play.playing .actions .btn.main .disc svg { width: 32px; height: 32px; }
}
@media (max-width: 899px), (orientation: landscape) and (max-height: 520px) {
  /* Nền mờ sau thanh đáy để chữ cuộn bên dưới không lẫn vào. */
  .play.playing::after {
    content: ''; position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; height: calc(var(--dock) + 22px + var(--safe-bottom));
    background: linear-gradient(transparent, rgba(241, 237, 255, .97) 22%); pointer-events: none;
  }
}
@media (max-width: 899px) {
  .play.playing .roll { height: clamp(120px, 17dvh, 170px); }
}

/* Điện thoại dọc loại thấp: đưa bài nhạc lên trước lời chim, nút bấm gọn lại. */
@media (max-width: 899px) and (orientation: portrait) and (max-height: 700px) {
  .screen.play { gap: 8px; }
  .play .stage .speak { order: 1; }
  .play.mode3 .stage .speak { order: 2; }
  .play.mode3 .note-pad { order: 0; }
  .play.mode3 .listen-row { order: 1; }
  .play.mode3 .note-pad button { min-height: 52px; }
  .play .actions .btn.round { min-height: 60px; min-width: 70px; gap: 3px; }
  .play .actions .disc { width: 46px; height: 46px; margin-top: 10px; }
  .play .actions .btn.main .disc { width: 62px; height: 62px; margin-top: 0; }
  .play .actions .btn.main .disc svg { width: 30px; height: 30px; }
}
/* Điện thoại cầm dọc, đang chơi: cất thanh tên và các bước để bài và biểu đồ hiện trọn. */
@media (max-width: 899px) and (orientation: portrait) and (max-height: 760px) {
  .play.playing .top, .play.playing .steps, .play.playing .passes { display: none; }
  .play.mode4.playing .roll { height: 128px; }
}
@media (max-width: 359px) {
  .listen-row .btn { font-size: 14px; padding: 6px 8px; }
  .flower-name { padding: 0 4px; font-size: 11px; }
}

/* ---------- Nhiều dòng nhạc, Chế độ 2–4 ---------- */
/* Chiều cao của .score do app/ui/score.js đặt theo số dòng nhìn thấy. */
.score { position: relative; width: 100%; overflow-y: auto; overflow-x: hidden; }
.score-lines { display: flex; flex-direction: column; gap: 2px; }
.score-bird { position: absolute; left: 0; top: 0; pointer-events: none; transition: transform .16s ease-out; will-change: transform; }
.score-bird > span { display: block; transform-origin: 50% 100%; }
.score-bird svg { display: block; width: 100%; overflow: visible; }
.score-line { flex: none; }
.score-line .staff { max-height: none; }
.note-hit { cursor: pointer; }
.secret { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 130px; text-align: center; color: var(--muted); }
.secret strong { font-size: 22px; color: var(--ink); }
.config { display: flex; flex-direction: column; gap: 8px; }
.config-row { display: flex; gap: 8px; flex-wrap: wrap; }
.config-row .seg { flex: 1; min-width: 140px; }
.passes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pass { padding: 3px; border-radius: 999px; border: 2px dashed #CDBFE8; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.pass.now { border-style: solid; border-color: var(--sun); background: var(--good-soft); color: var(--ink); }
.seek { display: flex; flex-direction: column; gap: 2px; }
.seek input { width: 100%; height: 44px; accent-color: var(--primary); }
.chips.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listen-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.note-pad { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.note-pad button { min-height: 62px; border-radius: 999px; font-size: 18px; font-weight: 800; border: 3px solid #fff; box-shadow: 0 5px 0 rgba(59, 42, 90, .22); }
.note-pad button:active { transform: translateY(4px) scale(1.06); box-shadow: 0 1px 0 rgba(59, 42, 90, .22); }
.songs { display: grid; gap: 10px; }
.songs .mode { width: 100%; border-radius: 24px; }
.songs .mode::before {
  content: '♪'; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 16px;
  background: #ECE3FF; color: var(--primary); font-size: 26px; transform: rotate(-6deg);
}
.songs li:nth-child(4n+2) .mode::before { background: #FFE0E9; color: #D6336C; }
.songs li:nth-child(4n+3) .mode::before { background: #FFEBD2; color: #B45F00; }
.songs li:nth-child(4n+4) .mode::before { background: #DDF1FF; color: #1668A8; }
.mode.chosen { border-color: var(--primary); }
.sky { position: relative; padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(#CDBBFF 0%, #FFD3DD 55%, #FFF4DE 100%); min-width: 0; }
.practice-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 999px; background: var(--good-soft); }
.weak { display: grid; gap: 8px; }
.weak .btn { justify-content: space-between; }

/* ---------- Giọng và quãng ---------- */
.voice-button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
  padding: 2px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .7);
  font-size: 13px; font-weight: 700; color: var(--muted); text-align: left;
}
.voice-button strong { color: var(--primary); }
.note-value { min-width: 70px; min-height: 46px; font-size: 18px; font-weight: 800; }
.sheet .staff { max-height: 150px; }

/* ---------- Kết quả ---------- */
.hero { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 12px; background: linear-gradient(135deg, #FFF2C4, #FFE0E9 60%, #ECE3FF); border-color: #fff; }
.hero-text { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-text > strong { font-size: 18px; text-align: center; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.stat { padding: 10px 4px; text-align: center; }
.stat strong { display: block; font-size: 24px; color: var(--primary); }
.stat span { font-size: 12px; font-weight: 700; color: var(--muted); }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 64px; align-items: center; gap: 8px; }
.bar-row span { text-align: right; font-size: 14px; }
.bar-row.wide-name { grid-template-columns: 132px 1fr 64px; }
.bar-row.wide-name strong { font-size: 13px; }
.bar { height: 16px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; animation: grow .8s ease-out; }
.bar > .ok { background: linear-gradient(90deg, #FFD45C, var(--good)); }
.bar > .miss { background: var(--miss); }
@keyframes grow { from { width: 0; } }
.recordings { display: grid; gap: 6px; margin-top: 6px; }
.recordings li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.recordings small { display: block; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--primary); }

/* ---------- Đo âm vực, cài đặt ---------- */
.big-note { font-size: 40px; font-weight: 800; color: var(--primary); }
.progress { width: 100%; height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress div { width: 0; height: 100%; background: linear-gradient(90deg, #FF5D8F, var(--primary)); }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.form .seg-row .seg-label { display: block; }

/* ---------- Tấm nổi, thông báo ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(59, 42, 90, .45);
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px calc(18px + var(--safe-bottom)); border-radius: 30px 30px 0 0; background: var(--bg);
  animation: rise .28s cubic-bezier(.3, 1.3, .5, 1);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
.sheet-actions .btn { flex: 1; min-width: 140px; }
.help { padding-left: 22px; display: grid; gap: 6px; font-weight: 500; }
.spinner { align-self: center; width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 30px; }
}
#toast {
  position: fixed; left: 50%; bottom: calc(120px + var(--safe-bottom)); z-index: 30;
  width: max-content; max-width: calc(100% - 28px); padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 15px; text-align: center;
  transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: 1; }

/* ---------- Máy tính: khuông nhạc và biểu đồ ngang hàng ---------- */
@media (min-width: 700px) {
  .scene { height: 320px; }
  .scene .scene-bird { width: 124px; bottom: 96px; }
  .scene-bubble { left: calc(16% + 128px); bottom: 180px; max-width: 220px; font-size: 15px; }
  .scene-title h1 { font-size: 38px; }
  .scene-title p { font-size: 16px; }
  .flower { min-height: 90px; }
  .flower .petals { max-width: 58px; }
}
@media (min-width: 900px) {
  .screen.home { max-width: 1000px; }
  .home-bar { flex-direction: row; }
  .home-bar > * { flex: 1; }
  .home-bar .seg { align-items: center; }
  .home .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .screen.play { max-width: 1280px; padding-left: 24px; padding-right: 24px; }
  .play .chips, .play .voice-seg { width: 100%; max-width: 520px; align-self: center; }
  /* Cấp (hoặc số ô, nhịp) và giọng nằm cùng một hàng. */
  .config { flex-direction: row; align-items: center; justify-content: center; }
  .config > .chips, .config > .config-row { flex: 1 1 0; max-width: 620px; }
  .config > .voice-row { flex: 0 1 430px; }
  .duo { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 12px; align-items: stretch; }
  .play .roll { flex: 1 1 0; height: 0; min-height: 250px; }
  .play .staff { max-height: 300px; }
  .play .score .staff { max-height: none; }
  .play .side {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px 20px; align-items: center;
    grid-template-areas: "box actions toggles" "box actions round";
  }
  .play .feedback { grid-area: box; align-self: stretch; }
  .play .toggles { grid-area: toggles; }
  .play .round-row { grid-area: round; justify-content: center; }
  .play .actions { grid-area: actions; position: static; margin: 0; padding: 0; background: none; }
  .play.mode4 .side { grid-template-areas: "box actions toggles" "box actions toggles"; }
}

/* ---------- Trên lớp: chiếu lên máy chiếu, đọc được từ cuối lớp ---------- */
@media (min-width: 700px) {
  body.classroom .screen.play { max-width: 1800px; }
  body.classroom .play h1 { font-size: 30px; }
  body.classroom .play .titles small { font-size: 17px; }
  body.classroom .play .bubble { font-size: 20px; }
  body.classroom .play .speak .bird { width: 70px; }
  body.classroom .play .chips button, body.classroom .play .steps button { min-height: 52px; font-size: 21px; }
  body.classroom .play .voice-button { font-size: 17px; }
  body.classroom .play .seg button { min-height: 50px; font-size: 19px; }
  body.classroom .play .tempo-value, body.classroom .play .chip { font-size: 17px; }
  body.classroom .play .big { font-size: 30px; }
  body.classroom .play .big.count { font-size: 60px; }
  body.classroom .play .actions .disc { margin-top: 6px; }
  body.classroom .play .muted { font-size: 18px; }
  body.classroom .play .verdict strong { font-size: 26px; }
  body.classroom .play .verdict span { font-size: 17px; }
  body.classroom .play .card-label { font-size: 16px; }
  body.classroom .play .actions .btn { font-size: 18px; }
  body.classroom .play .btn:not(.round) { font-size: 20px; }
  body.classroom .play .note-pad button { min-height: 96px; font-size: 32px; }
  body.classroom .play .pass { font-size: 18px; }
  body.classroom .play.playing .speak { display: none; }
}
@media (min-width: 900px) {
  body.classroom .play .staff { max-height: 44vh; }
  body.classroom .play .score .staff { max-height: none; }
  body.classroom .play .roll { min-height: max(180px, 26vh); }
  body.classroom .play .feedback { min-height: 80px; }
  body.classroom .play .config-row .seg button { min-height: 44px; }
}

/* ---------- Màn ngang thấp: iPad nằm ngang, laptop nhỏ ---------- */
@media (min-width: 900px) and (min-height: 521px) and (max-height: 820px) {
  .screen.play { gap: 7px; padding-top: calc(6px + var(--safe-top)); padding-bottom: calc(6px + var(--safe-bottom)); }
  .play .stage { gap: 7px; }
  .play .speak .bird { width: 52px; }
  .play .bubble { padding: 5px 14px; }
  .play .staff { max-height: 26dvh; }
  .play .score .staff { max-height: none; }
  .play .roll { min-height: 150px; }
  .play .feedback { min-height: 76px; padding: 4px 12px; gap: 2px; }
  .play .feedback .star { width: 24px; height: 24px; }
  .play .feedback .star:nth-child(2) { width: 30px; height: 30px; }
  .play .feedback .big.count { font-size: 40px; }
  .play .verdict { padding: 2px; }
  .play .actions .btn.round { min-height: 64px; }
  .play .actions .disc { margin-top: 8px; width: 50px; height: 50px; }
  .play .actions .btn.main .disc { width: 70px; height: 70px; margin-top: 0; }
  .play .note-pad button { min-height: 50px; }
  /* Còn thiếu chỗ thì cụm nút dính ở đáy, không bao giờ trôi khỏi màn hình. */
  .play .side { position: sticky; bottom: 0; z-index: 4; background: linear-gradient(transparent, rgba(241, 237, 255, .97) 18px); }
  body.classroom .play h1 { font-size: 24px; }
  body.classroom .play .titles small { font-size: 14px; }
  body.classroom .play .bubble { font-size: 17px; }
  body.classroom .play .speak .bird { width: 52px; }
  body.classroom .play .staff { max-height: 28dvh; }
  body.classroom .play .score .staff { max-height: none; }
  body.classroom .play .roll { min-height: 150px; }
  body.classroom .play .big { font-size: 24px; }
  body.classroom .play .note-pad button { min-height: 60px; font-size: 26px; }
}

/* ---------- Điện thoại xoay ngang: cột trái là nút quay lại, cột phải là nút chơi, giữa là bài và biểu đồ ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .screen.play {
    max-width: none; gap: 6px;
    padding: calc(6px + var(--safe-top)) calc(100px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(62px + var(--safe-left));
  }
  .play .top { position: fixed; z-index: 7; left: calc(8px + var(--safe-left)); top: calc(6px + var(--safe-top)); display: flex; flex-direction: column; gap: 10px; }
  .play .titles { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .play .play-grid, .play .stage { gap: 6px; }
  .play .side { display: contents; }
  /* Thứ cần để chơi nằm màn đầu; cấp, giọng, lời chim nằm bên dưới. */
  .play .play-grid { order: 1; }
  .play > .config, .play > .chips, .play > .voice-seg { order: 2; }
  .play .stage .speak { order: 1; }
  .play .stage .practice-row { order: 1; }
  .play .config { flex-direction: row; align-items: center; }
  .play .config > * { flex: 1 1 0; }
  .play .duo { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 8px; align-items: stretch; }
  .play .staff { max-height: calc(100dvh - 84px); }
  .play .score .staff { max-height: none; }
  .play .roll-card { padding: 4px 8px; }
  .play .card-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .play .staff-card { padding: 4px; }
  .play .roll { flex: 1 1 0; height: 0; min-height: max(110px, calc(100dvh - 120px)); }
  .play .actions {
    position: fixed; z-index: 6; left: auto; right: calc(6px + var(--safe-right)); top: 0; bottom: 0; width: 88px;
    flex-direction: column; justify-content: center; align-items: center; gap: 4px; margin: 0; padding: 0; background: none;
  }
  .play .actions .btn.round { min-width: 0; min-height: 0; width: 100%; gap: 2px; font-size: 12px; }
  .play .actions .btn.main { font-size: 13px; }
  .play .actions .disc { width: 46px; height: 46px; margin-top: 4px; }
  .play .actions .btn.main .disc { width: 62px; height: 62px; margin-top: 0; }
  .play .actions .btn.main .disc svg { width: 30px; height: 30px; }

  /* Bài nhiều dòng cần bề ngang hơn biểu đồ. */
  .play.mode4 .duo { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }

  .play.mode3 .staff-card { order: 0; }
  .play.mode3 .staff { max-height: calc(100dvh - 130px); }
  .play.mode3 .note-pad { order: 0; }
  .play.mode3 .listen-row { order: 0; }
  .play.mode3 .note-pad button { min-height: 46px; font-size: 16px; }
  .play.mode3 .listen-row .btn { min-height: 44px; }

  /* Đang chơi: bài và biểu đồ chiếm cả màn, thanh đáy là phản hồi, cột phải là chim và nút Dừng. */
  .play { --dock: 56px; }
  .screen.play.playing { padding-left: calc(10px + var(--safe-left)); padding-bottom: calc(var(--dock) + 10px + var(--safe-bottom)); }
  .play.playing::after { height: calc(var(--dock) + 8px + var(--safe-bottom)); }
  .play.playing .top, .play.playing .steps, .play.playing .passes, .play.playing .config { display: none; }
  .play.playing .staff { max-height: calc(100dvh - 90px); }
  .play.playing .score .staff { max-height: none; }
  .play.playing .roll { min-height: calc(100dvh - 120px); }
  .play.playing .stage { min-height: calc(100dvh - var(--dock) - 12px - var(--safe-top) - var(--safe-bottom)); }
  .play.playing .speak { left: auto; right: calc(23px + var(--safe-right)); bottom: auto; top: calc(10px + var(--safe-top)); }
  .play.playing .feedback { left: calc(10px + var(--safe-left)); right: calc(100px + var(--safe-right)); bottom: calc(6px + var(--safe-bottom)); }
  .play.playing .feedback .big.count { font-size: 32px; }
  .play.playing .feedback .big.count + .muted { flex: 0 1 auto; }
  .play.playing .actions { top: 0; bottom: 0; right: calc(6px + var(--safe-right)); width: 88px; height: auto; justify-content: center; }

  /* Trang chủ: vườn bên trái, bốn trò chơi bên phải, thấy ngay không phải cuộn. */
  .screen.home {
    max-width: none; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-content: start; gap: 8px 12px;
  }
  .home .scene { grid-column: 1; grid-row: 1 / span 2; height: calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom)); position: relative; }
  .home .scene-title h1 { font-size: 24px; }
  .home .scene-title p { font-size: 12px; max-width: 62%; }
  .home .sun { width: 70px; height: 70px; }
  .home .scene .scene-bird { width: 78px; bottom: 74px; left: 8%; }
  .home .scene-bubble { left: calc(8% + 70px); bottom: 142px; max-width: 120px; font-size: 12px; }
  .home .flower { min-height: 60px; }
  .home .flower-name { font-size: 10px; padding: 0 3px; }
  .home .modes { grid-column: 2; grid-row: 1; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
  .home .tile { min-height: calc((100dvh - 108px) / 2); gap: 4px; padding: 8px 10px; border-radius: 20px; justify-content: center; }
  .home .tile-art { width: 40px; height: 40px; border-radius: 15px; padding: 3px; }
  .home .mode-text strong { font-size: 15px; }
  .home .mode-text small { display: none; }
  .home .tile-go { top: 12px; right: 44px; width: 28px; height: 28px; }
  .home .ws { top: 14px; right: 8px; }
  .home .home-bar { grid-column: 2; grid-row: 2; flex-direction: row; gap: 8px; }
  .home .home-bar > * { flex: 1; min-width: 0; }
  .home .home-bar .seg { align-items: center; }
  .home .voice { padding: 4px 8px; gap: 6px; }
  .home .voice-icon { display: none; }
  .home .voice .link { padding: 0 2px; }
  .home h2 { display: none; }
  .home .foot { grid-column: 1 / -1; }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 699px) {
  .play .duo { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
  .home .voice small { display: none; }
  .home .flower-name { font-size: 9px; padding: 0 2px; }
  .home .seg button { padding: 0 6px; font-size: 13px; }
  .home .voice strong { font-size: 14px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
