/* =====================================================================
   Sección "Práctica" del alumno
   ===================================================================== */
/* Menú del alumno: Mi portal | Práctica */
.stu-bar.has-nav { flex-wrap: wrap; }
.stu-nav { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.stu-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-weight: 800; color: var(--muted); text-decoration: none; white-space: nowrap; }
.stu-nav a:hover { color: var(--ink); }
.stu-nav a.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
@media (max-width: 640px) {
  .stu-bar.has-nav { padding: 10px 14px; row-gap: 10px; }
  .stu-bar.has-nav .stu-nav { order: 3; flex: 1 1 100%; }
  .stu-bar.has-nav .stu-nav a { flex: 1; justify-content: center; }
}

/* Página principal de práctica */
.pr-page { display: grid; gap: 16px; padding-bottom: 40px; }
.pr-group h2 { margin: 0; }
.pr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.pr-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.pr-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.pr-tile > .ico:last-child { color: var(--muted); }
.pr-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.pr-tile-body { display: grid; gap: 2px; }
.pr-tile-body small { color: var(--muted); line-height: 1.35; }
.pr-tile-body .pr-stat { color: var(--ok); font-weight: 800; }
.pr-tile-body .pr-stat:empty { display: none; }
.pr-note { display: flex; align-items: center; gap: 6px; }
.hub-tile.pr-go { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.hub-tile.pr-go svg { color: var(--ok); }

/* Aviso cuando no está en ese instrumento */
.gate-card { justify-items: center; text-align: center; padding: 32px 20px; margin-top: 24px; }
.gate-card h1 { font-size: 1.6rem; margin: 0; }
.gate-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.gate-card .row { justify-content: center; }

/* Herramienta */
.pr-tabs { margin-bottom: 4px; }
.pr-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.pr-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.pr-choose { display: grid; gap: 4px; min-width: 160px; flex: 1 1 160px; max-width: 280px; }
.pr-choose small { font-weight: 800; color: var(--muted); }
.pr-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.pr-title b { font: 700 1.5rem var(--display); }
.pr-staff .staff-wrap { max-width: 100%; }
.pr-kb, .pr-fb { max-width: 100%; }
.pr-fb .fb-wrap { max-width: 100%; }
.pr-wheel { display: grid; justify-items: center; }
.pr-wheel .cof-svg { max-width: 380px; }
.pr-modes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.pr-modes .ear-mode { justify-items: center; text-align: center; }
.pk.hint.b { background: color-mix(in srgb, var(--ok) 70%, #000); box-shadow: none; }
.ip-metro { display: grid; justify-items: center; }

/* Acordes de guitarra */
.gc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.gc-card { display: grid; justify-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 8px 6px 10px; color: inherit; text-align: center; }
.gc-card:hover { border-color: var(--accent); }
.gc-card .chord-svg { width: 100%; max-width: 110px; height: auto; }
.gc-card small { font-size: .74rem; }
.gc-one { display: grid; justify-items: center; }
.gc-one .chord-svg { width: 100%; max-width: 200px; height: auto; }
.gc-one.edit .chord-svg { max-width: 240px; }
.gc-compare { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; text-align: center; }
.gc-compare .chord-svg { width: 150px; height: auto; }

/* =====================================================================
   Exámenes, quizzes y clase en vivo en horizontal (teléfono)
   ===================================================================== */
.rotate-overlay { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px);
  display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.rotate-overlay b { font: 700 1.5rem var(--display); }
.rotate-overlay p { max-width: 320px; margin: 0; }
.rotate-overlay small { color: var(--muted); max-width: 300px; }
.ro-phone { width: 70px; height: 116px; border: 6px solid var(--ink); border-radius: 16px; position: relative; animation: ro-turn 2.2s ease-in-out infinite; }
.ro-phone span { position: absolute; left: 50%; bottom: 6px; width: 14px; height: 4px; margin-left: -7px; border-radius: 2px; background: var(--ink); }
@keyframes ro-turn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); border-color: var(--accent); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .ro-phone { animation: none; transform: rotate(-90deg); } }

/* Pantalla baja y ancha: todo más compacto para que quepa el instrumento */
@media (orientation: landscape) and (max-height: 520px) {
  body.in-landscape-mode .take-bar { padding: 4px 14px; gap: 4px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; }
  body.in-landscape-mode .take-bar .nav-grid { grid-column: 1 / -1; }
  body.in-landscape-mode .take-title { font-size: .9rem; }
  body.in-landscape-mode .take-main { max-width: min(1100px, 100%); padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  body.in-landscape-mode .q-card { padding: 10px 16px; gap: 8px; border-radius: 14px; }
  body.in-landscape-mode .q-prompt { font-size: 1rem; margin: 0; }
  body.in-landscape-mode .q-head { font-size: .85rem; }
  body.in-landscape-mode .kb { height: 118px; }
  body.in-landscape-mode .p88 { height: 112px; }
  body.in-landscape-mode .take-nav .btn { padding: 6px 14px; min-height: 36px; }
  body.in-landscape-mode .stu-bar { padding: 4px 14px; }
  body.in-landscape-mode .lvs .q-card { padding: 10px 16px; }
  body.in-landscape-mode .wrap.narrow { max-width: min(1100px, 100%); }
  body.in-landscape-mode .q-card .hint, body.in-landscape-mode .q-card .muted.small { font-size: .8rem; margin: 0; }
  body.in-landscape-mode .q-card .pk-target { font-size: .95rem; margin: 0; }
  body.in-landscape-mode .q-card .stack { gap: 6px; }
  body.in-landscape-mode .q-card .staff-wrap { padding: 0 6px; }
  body.in-landscape-mode .q-card .staff-svg { max-height: 120px; }
  body.in-landscape-mode .oct-pick, body.in-landscape-mode .q-card .row.wrap { gap: 4px; }
  body.in-landscape-mode .q-card .btn { padding: 5px 12px; min-height: 34px; font-size: .9rem; }
  body.in-landscape-mode .q-card .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.in-landscape-mode .q-card .choices > * { min-height: 44px; padding-top: 6px; padding-bottom: 6px; margin: 0; }
  body.in-landscape-mode .ear-card { padding: 8px 12px; }
  body.in-landscape-mode .ear-ico { width: 40px; height: 40px; }
}

/* =====================================================================
   Afinador
   ===================================================================== */
.tn-card { justify-items: center; text-align: center; gap: 10px; }
.tn-gauge { width: min(100%, 360px); height: auto; }
.tn-arc { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; }
.tn-ok-arc { fill: none; stroke: var(--ok); stroke-width: 10; stroke-linecap: round; }
.tn-tick { stroke: var(--muted); stroke-width: 2; }
.tn-needle { stroke: var(--bad); stroke-width: 4; stroke-linecap: round; transition: transform .12s linear; }
.tn-gauge.in .tn-needle { stroke: var(--ok); }
.tn-gauge.idle .tn-needle { stroke: var(--line); }
.tn-hub { fill: var(--ink); }
.tn-read { display: grid; gap: 2px; margin-top: -10px; }
.tn-note { font: 700 3.4rem var(--display); line-height: 1; }
.tn-sub, .tn-hz { color: var(--muted); font-weight: 700; }
.tn-hint { font-weight: 800; min-height: 1.4em; margin: 0; }
.tn-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tn-str { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 4px; display: grid; gap: 2px; color: var(--ink); }
.tn-str b { font: 700 1.2rem var(--display); }
.tn-str small { color: var(--muted); }
.tn-str.on { border-color: var(--accent); background: var(--accent-soft); }
.tn-target { font-size: 1.1rem; } .tn-target b { font: 700 1.6rem var(--display); color: var(--accent); }
.tn-score { font-weight: 800; color: var(--warn); }

/* =====================================================================
   Entrenamiento diario
   ===================================================================== */
.pr-tile.hot { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--warn-soft) 70%, var(--surface)), var(--surface)); }
.pr-tile.hot .pr-ico { background: var(--warn); color: #fff; }
.hub-tile.pr-train { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.hub-tile.pr-train svg { color: var(--warn); }
.tr-page { display: grid; gap: 16px; padding-bottom: 48px; }
.tr-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 22px; border-radius: var(--r);
  background: linear-gradient(135deg, #1B11A8, #2350D8 60%, #3E7BFA); color: #fff; box-shadow: var(--shadow); }
.tr-hero h1 { color: #fff; margin: 0 0 6px; font-size: clamp(1.4rem, 4vw, 2rem); }
.tr-hero small { opacity: .9; font-weight: 700; }
.tr-lv { width: 84px; height: 84px; border-radius: 50%; background: #fff; color: #1B11A8; display: grid; place-items: center; align-content: center; line-height: 1; box-shadow: 0 0 0 6px rgba(255,255,255,.25); }
.tr-lv small { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.tr-lv b { font: 700 2.3rem var(--display); }
.tr-xpbar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-bottom: 4px; }
.tr-xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #F5B83D, #FFD978); border-radius: 99px; transition: width .6s; }
.tr-streak { display: grid; justify-items: center; gap: 0; text-align: center; opacity: .7; }
.tr-streak.on { opacity: 1; }
.tr-streak b { font: 700 2rem var(--display); line-height: 1; }
.tr-flame { width: 34px; height: 42px; background: radial-gradient(circle at 50% 70%, #FFE08A 0 22%, #F5B83D 23% 48%, #F26B5B 49%); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; transform: rotate(-4deg); filter: grayscale(1); }
.tr-streak.on .tr-flame { filter: none; animation: tr-flick 1.6s ease-in-out infinite; }
@keyframes tr-flick { 50% { transform: rotate(4deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .tr-streak.on .tr-flame { animation: none; } }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tr-row h2 { font-size: 1.1rem; margin: 0; display: flex; align-items: center; gap: 6px; }
.tr-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0; }
.tr-day { display: grid; justify-items: center; gap: 4px; font-weight: 800; color: var(--muted); font-size: .8rem; }
.tr-day i { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-style: normal; font-size: .72rem; color: var(--ink); }
.tr-day.on i { background: var(--accent-soft); color: var(--accent); }
.tr-day.full i { background: var(--ok); color: #fff; }
.tr-day.today span { color: var(--accent); }
.tr-challenge { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.tr-challenge h2 svg { color: var(--warn); }
.tr-challenge.done { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.tr-mins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tr-mins button { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px; display: grid; justify-items: center; color: var(--ink); }
.tr-mins b { font: 700 1.6rem var(--display); line-height: 1; }
.tr-mins small { color: var(--muted); font-weight: 800; }
.tr-mins button.on { border-color: var(--accent); background: var(--accent-soft); }
.tr-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-plan li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.tr-plan li span:nth-child(2) { display: grid; }
.tr-plan li small { color: var(--muted); }
.tr-plan li.done { opacity: .65; } .tr-plan li.done svg:last-child { color: var(--ok); }
.tr-min { font-weight: 800; color: var(--muted); font-size: .85rem; }
.tr-k, .tr-kind { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tr-kind { width: auto; height: auto; display: inline-flex; gap: 6px; padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: .85rem; }
.k-tec { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.k-lec { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.k-teo { background: color-mix(in srgb, #7C4DDB 16%, var(--surface)); color: #7C4DDB; }
.k-rep, .k-rev { background: var(--accent-soft); color: var(--accent); }
.k-cre { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.k-pau, .k-act { background: var(--surface-2); color: var(--muted); }
/* Camino */
.tr-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.tr-node { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; position: relative; }
.tr-node:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 50px; bottom: -10px; width: 3px; background: var(--line); }
.tr-node.mastered:not(:last-child)::after { background: var(--ok); }
.tr-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--surface-2); color: var(--muted); position: relative; z-index: 1; border: 3px solid var(--line); }
.tr-node.mastered .tr-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tr-node.current .tr-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 6px var(--accent-soft); }
.tr-node.open .tr-dot { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.tr-node.locked { opacity: .55; }
.tr-bpm { display: grid; grid-template-columns: minmax(0, 220px) auto; gap: 8px; align-items: center; margin-top: 4px; }
.tr-bpm .ts-bar { display: block; margin: 0; }
.tr-bpm small { font-weight: 800; color: var(--muted); }
/* Logros y ranking */
.tr-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tr-badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); }
.tr-badge span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.tr-badge small { font-size: .78rem; }
.tr-badge.on { border-style: solid; border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--ink); background: color-mix(in srgb, var(--warn-soft) 40%, var(--surface)); }
.tr-badge.on span { background: var(--warn); color: #fff; }
.tr-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-board li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.tr-board li.me { background: var(--accent-soft); outline: 2px solid var(--accent); }
.tr-pos { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--surface); }
.tr-pos.p1 { background: #F5B83D; color: #fff; } .tr-pos.p2 { background: #A9B4C8; color: #fff; } .tr-pos.p3 { background: #D08A4E; color: #fff; }
/* Reproductor */
.tr-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.tr-steps { display: flex; gap: 4px; }
.tr-steps i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); }
.tr-steps i.done { background: var(--ok); } .tr-steps i.cur { background: var(--accent); }
.tr-step { gap: 14px; }
.tr-title { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.tr-clock { font: 700 1.8rem var(--display); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.tr-clock.over { color: var(--ok); }
.tr-ex-head { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-tempo { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 14px; border-radius: 12px; background: var(--accent-soft); justify-self: start; }
.tr-tempo span { font-weight: 800; color: var(--muted); font-size: .85rem; }
.tr-tempo b { font: 700 1.6rem var(--display); color: var(--accent); }
.tr-tempo small { color: var(--muted); font-weight: 700; }
.tr-staff { display: grid; gap: 6px; }
.tr-metro .metro { max-width: 520px; }
.tr-how { display: grid; gap: 4px; } .tr-how p { margin: 0; }
.tr-focus { background: var(--warn-soft); border-radius: 12px; padding: 8px 12px; margin: 0; }
.tr-focus svg { color: var(--warn); vertical-align: -2px; }
.tr-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.tr-prompt { font: 600 1.25rem var(--display); background: var(--surface-2); border-radius: 14px; padding: 14px 16px; margin: 0; }
.tr-rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tr-rate > small { grid-column: 1 / -1; font-weight: 800; }
.tr-r { border: 2px solid var(--line); border-radius: 14px; padding: 12px 8px; font-weight: 800; background: var(--surface); color: var(--ink); min-height: 56px; }
.tr-r.ok { border-color: var(--ok); color: var(--ok); } .tr-r.ok:hover { background: var(--ok-soft); }
.tr-r.mid { border-color: var(--accent); color: var(--accent); } .tr-r.mid:hover { background: var(--accent-soft); }
.tr-r.low { border-color: var(--warn); color: var(--warn); } .tr-r.low:hover { background: var(--warn-soft); }
.tr-score { font: 700 2rem var(--display); margin: 0; }
/* Resumen */
.tr-sum { justify-items: center; text-align: center; gap: 12px; position: relative; overflow: hidden; padding: 30px 20px; }
.tr-sum-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 460px); }
.tr-sum-stats div { display: grid; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.tr-sum-stats b { font: 700 2rem var(--display); color: var(--accent); }
.tr-sum-stats small { color: var(--muted); font-weight: 800; }
.tr-confetti { position: absolute; inset: 0; pointer-events: none; }
.tr-confetti i { position: absolute; top: -10px; width: 10px; height: 16px; border-radius: 3px; animation: tr-fall 2.6s ease-in forwards; }
.tr-confetti i:nth-child(4n) { background: #F5B83D; } .tr-confetti i:nth-child(4n+1) { background: #2350D8; } .tr-confetti i:nth-child(4n+2) { background: #2BB3A3; } .tr-confetti i:nth-child(4n+3) { background: #F26B5B; }
.tr-confetti i:nth-child(1) { left: 5%; animation-delay: .1s; } .tr-confetti i:nth-child(2) { left: 12%; animation-delay: .5s; } .tr-confetti i:nth-child(3) { left: 20%; animation-delay: .2s; }
.tr-confetti i:nth-child(4) { left: 28%; animation-delay: .7s; } .tr-confetti i:nth-child(5) { left: 36%; } .tr-confetti i:nth-child(6) { left: 44%; animation-delay: .4s; }
.tr-confetti i:nth-child(7) { left: 52%; animation-delay: .9s; } .tr-confetti i:nth-child(8) { left: 60%; animation-delay: .3s; } .tr-confetti i:nth-child(9) { left: 68%; animation-delay: .6s; }
.tr-confetti i:nth-child(10) { left: 76%; animation-delay: .15s; } .tr-confetti i:nth-child(11) { left: 84%; animation-delay: .8s; } .tr-confetti i:nth-child(12) { left: 90%; animation-delay: .35s; }
.tr-confetti i:nth-child(13) { left: 95%; animation-delay: 1s; } .tr-confetti i:nth-child(14) { left: 48%; animation-delay: 1.2s; }
@keyframes tr-fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tr-confetti { display: none; } }
@media (max-width: 720px) {
  .tr-row { grid-template-columns: minmax(0, 1fr); }
  .tr-hero { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .tr-hero .tr-streak { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; gap: 8px; align-items: center; }
  .tr-lv { width: 64px; height: 64px; } .tr-lv b { font-size: 1.8rem; }
  .tr-rate { grid-template-columns: minmax(0, 1fr); }
  .tr-day i { width: 30px; height: 30px; }
  .tn-strings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
