/* ==========================================================================
   WP Exercices rythmiques — UI
   ========================================================================== */

.wprex{
  --wprex-panel-offset: 392px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111;
}

.wprex__layout{
  position: relative;
  min-height: 760px;
  background: #fff;
}

/* Panel drawer */
.wprex__panel{
  position: absolute;
  inset: 0 auto 0 0;
  width: 380px;
  max-width: calc(100% - 24px);
  height: auto;
  display: flex;
  flex-direction: column;
  background: #fbfbfb;
  border-right: 1px solid #eee;
  box-shadow: 0 6px 22px rgba(0,0,0,.10);
  z-index: 12;
  transform: translateX(calc(-100% - 8px));
  transition: transform 180ms ease;
  overflow: hidden;
  pointer-events: none;
}

.wprex__panel.is-open{
  transform: translateX(0);
  pointer-events: auto;
}

.wprex__panel--exercise{ z-index: 12; }
.wprex__panel--metronome{ z-index: 12; }
.wprex__panelClose{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.wprex__panelClose:hover{ background: #f4f4f4; }

.wprex__panelBody{
  flex: 1 1 auto;
  min-height: 0;
  padding: 40px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Main */
.wprex__main{
  position: relative;
  min-height: 760px;
  padding: 16px;
  transition: padding-left 180ms ease;
}

.wprex.wprex--panel-open .wprex__main{
  padding-left: calc(16px + var(--wprex-panel-offset));
}

.wprex__stage{
  position: relative;
  width: 100%;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 100px 12px 24px;
}
.wprex.wprex--fullscreen .wprex__stage{
  width: 100%;
  min-height: 100vh;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 24px;
}
.wprex.wprex--fullscreen{
  width: 100vw !important;
  max-width: none !important;
  height: 100vh;
  margin: 0 !important;
  border-radius: 0;
}
.wprex.wprex--fullscreen .wprex__layout{
  min-height: 100vh;
  height: 100vh;
}
.wprex.wprex--fullscreen .wprex__main{
  padding-left: 16px !important;
  padding-right: 16px;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.wprex.wprex--fullscreen.wprex--panel-open .wprex__main{
  padding-left: 16px !important;
}
.wprex.wprex--fullscreen .wprex__score{
  width: min(90vw, 1800px);
  max-width: min(90vw, 1800px);
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}
.wprex.wprex--fullscreen .wprex__mainControls--floating{
  left: 18px;
}
.wprex__score{
  width: 100%;
  max-width: 1800px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: -14px;
}
.wprex__score.is-hidden{
  display: none;
}

.wprex__dictation{
  --wprex-dict-cols: 4;
  width: min(100%, 1200px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}
.wprex__dictation.is-hidden{
  display: none;
}
.wprex__dictReveal{
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: repeat(var(--wprex-dict-cols), minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.wprex__dictCell{
  min-height: 82px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  overflow: hidden;
}
.wprex__dictCellPrev.wprex__cardPrev{
  height: 100%;
  padding: 2px;
}
.wprex__dictPulses{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--wprex-dict-cols), minmax(0, 1fr));
  gap: 8px;
}
.wprex__dictPulse{
  height: 34px;
  border: 1px solid #d5dce5;
  border-radius: 999px;
  background: #f3f6fb;
  color: #304356;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wprex__dictPulse:hover{
  background: #e9eff8;
}
.wprex__dictPulse.is-revealed{
  border-color: #b7d4ff;
  background: #eaf3ff;
  color: #1f5fae;
}
.wprex__dictPulse.is-error{
  border-color: #d14545;
  background: #ffe8e8;
  color: #9a2323;
  transform: scale(1.06);
}

.wprex__score svg{
  width: auto;
  max-width: 94%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.wprex__status{
  width: 100%;
  max-width: 900px;
  text-align: center;
  font-size: 12px;
  color: #444;
}
.wprex__continuousLabel{
  width: 100%;
  max-width: 900px;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #1f2f44;
  font-family: "Avenir Next", "Segoe UI", Roboto, Arial, sans-serif;
  margin-top: -2px;
}
.wprex__continuousLabel.is-hidden{ display: none; }
.wprex__continuousLabelInline{
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-left: 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #1f2f44;
  font-family: "Avenir Next", "Segoe UI", Roboto, Arial, sans-serif;
  white-space: nowrap;
}
.wprex__continuousLabelInline.is-hidden{ display: none; }

.wprex__metViz{
  width: 100%;
  max-width: 900px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
}
.wprex__metViz.is-hidden{ visibility: hidden; }
.wprex__metVizDot{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d7dfe7;
  background: #eef3f8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
  transform: scale(1);
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.wprex__metVizDot.is-hit{
  transform: scale(1.16);
  background: #2b3f55;
  border-color: #2b3f55;
}
.wprex__countinViz{
  width: 100%;
  max-width: 900px;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 16px;
}
.wprex__countinViz.is-hidden{ display: none; }
.wprex__vizDot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #cfcfcf;
  background: #f3f3f3;
  color: transparent;
  font-size: 0;
  line-height: 14px;
  transform: scale(1);
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.wprex__vizDot.is-hit{
  transform: scale(1.24);
  background: #111;
  border-color: #111;
  color: #fff;
}
.wprex__vizDot--count{
  width: 20px;
  height: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #555;
}
.wprex__score .wprex__karaoke-active{
  fill: #cf2020 !important;
  stroke: #cf2020 !important;
}
.wprex__score .wprex__karaoke-active *{
  fill: #cf2020 !important;
  stroke: #cf2020 !important;
}

/* Floating controls */
.wprex__mainControls--floating{
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 13;
  transition: left 180ms ease;
}
.wprex__controlsSep{
  width: 1px;
  height: 22px;
  background: #d9d9d9;
  opacity: .9;
}
.wprex__controlsSep.is-hidden{ display: none; }

.wprex.wprex--panel-open .wprex__mainControls--floating{
  left: calc(18px + var(--wprex-panel-offset));
}

.wprex__teacherControls{
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  z-index: 13;
}
.wprex__fab--teacher{
  width: 44px;
  min-width: 44px;
  padding: 0;
}
.wprex__teacherMenu{
  position: absolute;
  top: 52px;
  right: 0;
  width: 340px;
  max-width: min(90vw, 340px);
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wprex__teacherModeOption{
  appearance: none;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.wprex__teacherModeOption:hover{
  border-color: #bbb;
}
.wprex__teacherModeOption.is-selected{
  border-color: #8fb5ff;
  background: #eaf2ff;
}
.wprex__teacherModeSettings[hidden],
.wprex__teacherToggleRow[hidden]{
  display: none !important;
}
.wprex__teacherModeTitle{
  font-size: 13px;
  font-weight: 750;
  color: #1a1a1a;
}
.wprex__teacherModeDesc{
  font-size: 12px;
  color: #4f4f4f;
}
.wprex__teacherToggleRow{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 5px 9px;
  background: #fafafa;
}
.wprex__teacherModeOption .wprex__teacherToggleRow{
  width: 100%;
  margin-top: 4px;
}
.wprex__teacherToggleMain{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wprex__teacherToggleLabel{
  font-size: 12px;
  color: #444;
  font-weight: 650;
}
.wprex__teacherToggleHint{
  display: block;
  margin-top: -1px;
  font-size: 10px;
  line-height: 1.1;
  color: #8b8b8b;
}

/* Compact switches in teacher-mode settings only */
.wprex__teacherMenu .wprex__switch{
  width: 38px;
  height: 20px;
}
.wprex__teacherMenu .wprex__slider:before{
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
}
.wprex__teacherMenu .wprex__switch input:checked + .wprex__slider:before{
  transform: translateX(18px);
}

.wprex__fab{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}

.wprex__fab:hover{ opacity: .92; }
.wprex__fab:focus{ outline: 2px solid rgba(0,0,0,.15); outline-offset: 3px; }
.wprex__fab--secondary{ background: #fff; color: #111; }
.wprex__fab--secondary:hover{ background: #f3f3f3; }

/* Control icons */
.wprex__iconSvg{
  width: 22px;
  height: 22px;
  display: block;
}
.wprex__iconSvg--nav{
  width: 21px;
  height: 21px;
}
.wprex__iconSvg--metro{
  width: 24px;
  height: 24px;
}
.wprex__pauseGlyph{ display: none; }
.wprex__fab.is-playing .wprex__playGlyph{ display: none; }
.wprex__fab.is-playing .wprex__pauseGlyph{ display: inline; }
.wprex__fsExit{ display: none; }
.wprex__fab.is-fullscreen .wprex__fsEnter{ display: none; }
.wprex__fab.is-fullscreen .wprex__fsExit{ display: inline; }
.wprex [data-action="continuousBack"]{
  display: inline-flex;
}
.wprex [data-action="playStop"]{
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.wprex [data-action="playStop"]:hover{
  background: #0f6bdd;
  border-color: #0f6bdd;
}
.wprex [data-action="continuousBack"]{
  background: #e9f2ff;
  color: #1f5fae;
  border-color: #c6ddff;
}
.wprex [data-action="continuousBack"]:hover{
  background: #dcecff;
}
.wprex [data-action="refresh"]{
  background: #e9f2ff;
  color: #1f5fae;
  border-color: #c6ddff;
}
.wprex [data-action="refresh"]:hover{
  background: #dcecff;
}

/* Panel sections */
.wprex__section{
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wprex__section--plain{
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.wprex__sectionTitle{
  font-size: 12px;
  font-weight: 800;
  color: #222;
  opacity: .9;
}

.wprex__group{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
}
.wprex__group--split{
  gap: 12px;
}
.wprex__groupItem{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wprex__groupItem--countin{
  margin-left: auto;
}

.wprex__label{
  font-size: 12px;
  font-weight: 650;
  color: #555;
  white-space: nowrap;
}

.wprex__row2{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.wprex__seg{
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid #ddd;
  border-radius: 999px;
  overflow: hidden;
  background: #fafafa;
}

.wprex__seg input{
  position: absolute !important;
  left: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wprex__seg label{
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1;
  border-right: 1px solid #e5e5e5;
}
.wprex__seg label:last-child{ border-right: none; }
.wprex__seg label.is-selected{ background: #111; color: #fff; }

.wprex__switch{ position: relative; width: 44px; height: 24px; display: inline-block; }
.wprex__switch input{ opacity: 0; width: 0; height: 0; }
.wprex__slider{ position: absolute; inset: 0; border-radius: 999px; background: #d0d0d0; transition: 160ms; cursor: pointer; }
.wprex__slider:before{ content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.18); transition:160ms; }
.wprex__switch input:checked + .wprex__slider{ background:#111; }
.wprex__switch input:checked + .wprex__slider:before{ transform:translateX(20px); }

.wprex__tempo{ display:flex; flex-direction:row; align-items:center; gap:10px; width:100%; max-width:220px; }
.wprex__tempoRange{ width: 120px; max-width:100%; }
.wprex__tempoBox{ display:inline-flex; align-items:center; padding:6px 8px; border:1px solid #ddd; border-radius:10px; background:#fff; }
.wprex__tempoNumber{ width: 6ch; border:none; outline:none; background:transparent; font-size:14px; text-align:right; font-variant-numeric: tabular-nums; padding:0; margin:0; }
.wprex__tempoNumber::-webkit-outer-spin-button,
.wprex__tempoNumber::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.wprex__tempoNumber{ -moz-appearance:textfield; }
.wprex__instrument{
  min-width: 150px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  padding: 6px 10px;
  font-size: 13px;
  color: #222;
}
.wprex__note{
  min-width: 72px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  padding: 6px 8px;
  font-size: 13px;
  color: #222;
}
.wprex__inlineSelects{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cards */
.wprex .wprex__cells{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
.wprex .wprex__card{
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  cursor:pointer;
  transition:border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.wprex .wprex__card:hover{ border-color:#bbb; }
.wprex .wprex__card.is-selected{ border-color:#1b7f3a; background:#e8f6ee; box-shadow:0 0 0 2px rgba(27,127,58,.15); }
.wprex .wprex__cardPrev{
  padding: 4px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.wprex .wprex__cardPrev svg{
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/* Hide staff lines in card previews without touching note glyphs */
.wprex .wprex__cardPrev .abcjs-staff,
.wprex .wprex__cardPrev .abcjs-top-line{
  display: none !important;
}

@media (max-width: 980px){
  .wprex{ --wprex-panel-offset: 332px; }
  .wprex__panel{ width: 320px; }
}

@media (max-width: 720px){
  .wprex{ --wprex-panel-offset: 0px; }
  .wprex__mainControls--floating{ left: 12px; top: 12px; gap: 8px; }
  .wprex.wprex--panel-open .wprex__mainControls--floating{ left: 12px; }
  .wprex__teacherControls{ right: 12px; top: 12px; gap: 8px; }
  .wprex__teacherMenu{ top: 48px; right: 0; width: min(92vw, 340px); }
  .wprex__fab{ width: 40px; height: 40px; }
  .wprex__iconSvg{ width: 20px; height: 20px; }
  .wprex__iconSvg--metro{ width: 22px; height: 22px; }
  .wprex__panel{ inset: 0 auto 0 0; }
  .wprex.wprex--panel-open .wprex__main{ padding-left: 16px; }
  .wprex .wprex__cells{ grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .wprex__score svg{ width: auto; max-width: 94%; }
  .wprex__row2{ grid-template-columns: 1fr; }
  .wprex__inlineSelects{ flex-wrap: wrap; justify-content: flex-end; }
  .wprex__group--split{ flex-wrap: wrap; }
  .wprex__groupItem--countin{ margin-left: 0; }
}
