/* Ear trainer (/table/ear/). Shared look in /table/css/table.css.
   Signature moment: the name is spoken, you tap a tile on the felt, and it answers with a jade (right) or red (wrong)
   tube ring that lights once and settles. Local to the tile, one pulse, no flashing. */
.lede { font-size:18px; color:var(--ink); margin:6px 0 4px; }
.small { font-size:14px; }
section { margin-top:34px; }
i { font-style:normal; color:#a8f1ff; }

.ear { --frame:var(--c-cyan); padding:14px 12px 16px; scroll-margin-top:66px; margin-top:4px; }
.ear-bar { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; align-items:center; }
.ear-mute { width:44px; padding:0; font-size:20px; }
.ear-levels { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin:12px 0 0; }
.ear-levels button { min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; border:1.5px solid rgb(var(--c-cyan) / .3);
  background:rgba(0,0,0,.4); color:var(--dim); border-radius:8px; padding:4px 2px; font:inherit; font-size:12px; font-weight:650; cursor:pointer; }
.ear-levels button b { font-family:var(--f-display); color:#e3faff; font-size:22px; line-height:1; }
.ear-levels button[aria-pressed="true"] { color:#effdff; border-color:rgb(var(--c-cyan)); background:rgb(var(--c-cyan) / .14);
  box-shadow:0 0 14px -2px rgb(var(--c-cyan) / .7), inset 0 0 10px rgb(var(--c-cyan) / .35); }
.ear-levels button[aria-pressed="true"] b { color:#fff; text-shadow:0 0 6px rgb(var(--c-cyan)), 0 0 16px rgb(var(--c-cyan) / .7); }
.ear-note { margin:8px 2px 0; font-size:14px; }

.ear-stage { margin-top:14px; min-height:340px; display:flex; flex-direction:column; align-items:center; text-align:center; padding:16px 10px 18px; }
.ear-intro { margin:auto 0; padding:20px 6px; }
.ear-intro p { margin:0 0 18px; font-size:18px; }
.ear-start { font-size:22px; min-height:60px; padding:12px 40px; }
.ear-intro .small { margin:18px 0 0; }

.ear-progress { width:100%; display:flex; justify-content:space-between; align-items:center; font-size:14px; color:#e8f1ec; }
.pips { display:flex; gap:5px; }
.pips span { width:11px; height:11px; border-radius:50%; background:rgba(0,0,0,.4); box-shadow:inset 0 0 0 1px rgba(255,255,255,.25); }
.pips .y { background:rgb(var(--c-jade)); box-shadow:0 0 8px rgb(var(--c-jade)); }
.pips .n { background:rgb(var(--c-red)); box-shadow:0 0 8px rgb(var(--c-red)); }
.pips .cur { background:rgb(var(--c-amber)); box-shadow:0 0 8px rgb(var(--c-amber)); }
.ear-ask { font-family:var(--f-display); font-weight:700; font-size:22px; letter-spacing:.02em; margin:16px 0 16px; color:#fff; text-shadow:0 0 12px rgb(var(--c-cyan) / .6); }

.ear-choices { display:grid; grid-template-columns:repeat(2,auto); gap:22px 20px; justify-content:center; --tile-w:76px; }
.ear-choices.n6 { grid-template-columns:repeat(3,auto); --tile-w:66px; gap:20px 16px; }
.ear-choices .tile[disabled] { opacity:.4; }
/* Right: a jade tube ring that lights once. Wrong: a red ring and a small shake. */
.tile.is-right, .ear-choices .tile.is-right[disabled] { opacity:1; outline:3px solid rgb(var(--c-jade)); outline-offset:4px; animation:ear-right .9s ease-out both; }
.tile.is-wrong, .ear-choices .tile.is-wrong[disabled] { opacity:.85; outline:3px solid rgb(var(--c-red)); outline-offset:4px; animation:ear-wrong .45s ease-out both; }
@keyframes ear-right {
  0% { box-shadow:0 0 0 0 rgb(var(--c-jade) / .9), 0 0 0 rgb(var(--c-jade) / 0); }
  35% { box-shadow:0 0 0 10px rgb(var(--c-jade) / .25), 0 0 34px rgb(var(--c-jade) / .9); }
  100% { box-shadow:0 0 0 18px rgb(var(--c-jade) / 0), 0 0 22px rgb(var(--c-jade) / .7); } }
@keyframes ear-wrong {
  0%,100% { transform:none; box-shadow:0 0 22px rgb(var(--c-red) / .7); }
  25% { transform:translateX(-5px); } 50% { transform:translateX(4px); } 75% { transform:translateX(-2px); } }

.ear-big { --tile-w:104px; margin:2px 0 16px; }
.ear-names { width:100%; max-width:440px; display:grid; gap:9px; }
.ear-name { display:flex; gap:8px; align-items:stretch; border-radius:10px; }
.ear-name .hear { min-width:52px; padding:0 10px; }
.ear-name .pick { flex:1; min-height:52px; text-align:left; border:1.5px solid rgba(255,255,255,.2); background:rgba(0,0,0,.35); color:var(--ink); border-radius:9px; padding:8px 14px; font:inherit; font-size:18px; cursor:pointer; }
.ear-name .pick:hover:not([disabled]) { border-color:rgb(var(--c-cyan) / .8); box-shadow:0 0 12px -3px rgb(var(--c-cyan) / .7); }
.ear-name .pick .han { font-size:23px; margin-right:4px; }
.ear-name.is-right .pick { border-color:rgb(var(--c-jade)); background:rgb(var(--c-jade) / .16); animation:ear-right .9s ease-out both; }
.ear-name.is-wrong .pick { border-color:rgb(var(--c-red)); background:rgb(var(--c-red) / .12); animation:ear-wrong .45s ease-out both; }
.ear-name .pick[disabled] { cursor:default; color:var(--ink); }

.ear-reveal { min-height:24px; margin-top:16px; }
.ear-verdict { font-family:var(--f-display); font-weight:800; font-size:26px; letter-spacing:.02em; }
.ear-verdict.ok { color:#d4ffee; text-shadow:0 0 4px rgb(var(--c-jade)), 0 0 16px rgb(var(--c-jade) / .8); }
.ear-verdict.no { color:#ffe3e8; text-shadow:0 0 4px rgb(var(--c-red)), 0 0 16px rgb(var(--c-red) / .8); }
.ear-name-big { font-size:20px; margin:4px 0 0; }
.ear-en { font-size:16px; margin-bottom:4px; }
.ear-name-big .han { font-size:34px; color:#fff; text-shadow:0 0 14px rgb(var(--c-cyan) / .6); }
.ear-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin:10px 0 4px; }

.ear-result { padding:10px 4px; width:100%; }
.ear-result .big { margin:6px 0 4px; font-size:clamp(64px,20vw,96px); }
.ear-result-btns { justify-content:center; margin-top:12px; }
.ear-weak { margin:14px 0 6px; }
.ear-weak .row { justify-content:center; margin-top:8px; }
.ear-weak-tile { display:flex; align-items:center; gap:8px; min-height:52px; border:1px solid rgba(255,255,255,.22); border-radius:9px; background:rgba(0,0,0,.3); color:var(--ink); font:inherit; padding:6px 12px 6px 8px; text-align:left; cursor:pointer; }
.ear-pitch { margin:18px 0 0; font-size:15px; }

.tile-table-wrap { overflow-x:auto; }
.tile-table { width:100%; border-collapse:collapse; font-size:15px; }
.tile-table th { text-align:left; padding:8px 4px; border-bottom:1px solid rgb(var(--c-cyan) / .35); }
.tile-table th .dim { text-transform:none; letter-spacing:0; font-family:var(--f-body); font-weight:500; }
.tile-table td { padding:6px 4px; border-bottom:1px solid rgba(255,255,255,.07); vertical-align:middle; }
.tile-table tr:hover td { background:rgb(var(--c-cyan) / .04); }
.tile-table td:first-child { width:48px; }
.tile-table .tile--s { --tile-w:34px; }
.tile-table .han { font-size:19px; }
.tile-table i { display:block; font-size:13px; }
.tile-table a { color:var(--ink); }

.faq p { color:#ddd6e8; }
.next { margin-top:26px; }

@media (min-width:560px) { .ear-choices { --tile-w:92px; } .ear-choices.n6 { --tile-w:80px; } }
@media (max-width:380px) {
  .ear-choices.n6 { --tile-w:60px; gap:18px 12px; }
  .tile-table { font-size:14px; }
}
@media (prefers-reduced-motion:reduce) { .tile.is-right, .tile.is-wrong, .ear-name.is-right .pick, .ear-name.is-wrong .pick { animation:none; } }
.tile-table td:last-child a { white-space:nowrap; font-size:14px; }
.tile-table td { padding-right:8px; }
