/* Teens Book layout aligned with Adults Book */

:root{
  --a-bg:#07080b;
  --a-panel:#0c0f16;
  --a-stroke: rgba(255,255,255,.10);
  --a-text: rgba(255,255,255,.92);
  --a-muted: rgba(255,255,255,.72);
  --a-gold: rgba(255,215,0,.92);
  --a-cyan: rgba(0,180,255,.75);
  --a-shadow: 0 18px 40px rgba(0,0,0,.55);
  --a-radius: 18px;
  --kids-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body.teens-book-page,
body.adults-book-page{
  margin:0;
  font-family: var(--kids-font);
  color: var(--a-text);
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(255,215,0,.10), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(0,180,255,.08), transparent 60%),
    var(--a-bg);
}

.container{ width:min(1180px, 92vw); margin:0 auto; }
.kids-page{ padding: 18px 0 26px; }

.kids-hero-card{
  border-radius: var(--a-radius);
  border: 1px solid var(--a-stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.22));
  padding: 18px;
  box-shadow: var(--a-shadow);
}

.kids-badge{
  display:inline-flex; align-items:center; gap:10px;
  padding:8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  font-weight: 950;
  letter-spacing: .3px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  text-transform: uppercase;
}

.kids-title{
  margin: 10px 0 4px;
  font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.06;
  letter-spacing: .2px;
  font-weight: 1100;
}

.kids-subtitle{
  margin: 0 0 14px;
  color: var(--a-muted);
  font-weight: 800;
  line-height: 1.7;
  max-width: 70ch;
}

.kids-howto{
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  padding: 14px;
}
.kids-howto h2{ margin:0 0 10px; font-size: 16px; font-weight: 1100; }
.kids-howto ol{ margin:0; padding-left: 18px; }
.kids-howto li{ margin: 7px 0; font-weight: 850; color: rgba(255,255,255,.88); }

.card, .kids-card{
  border-radius: var(--a-radius);
  border: 1px solid var(--a-stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.22));
  box-shadow: var(--a-shadow);
}

.section{ margin-top: 14px; }

.workout-layout{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px){
  .workout-layout{ grid-template-columns: 1fr; }
}

.muted{ color: var(--a-muted); }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--a-text);
  font-weight: 1000;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.03); border-color: rgba(255,255,255,.20); }

.btn-primary{
  color: #101827;
  border: 1px solid rgba(16,24,39,.25);
  background: linear-gradient(180deg, rgba(255,215,0,.95), rgba(255,170,0,.95));
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.btn-kids-listen{
  color:#101827;
  border: 1px solid rgba(16,24,39,.25);
  background: #f7c40f;
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.btn-kids-rec{
  color:#101827;
  border: 1px solid rgba(16,24,39,.25);
  background: linear-gradient(180deg, rgba(255,59,48,.98), rgba(255,122,0,.98));
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.btn-kids-next{
  color:#101827;
  border: 1px solid rgba(16,24,39,.25);
  background: linear-gradient(180deg, rgba(255,215,0,.95), rgba(255,122,0,.95));
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.btn-kids-pt, .btn-kids-prev{
  background: rgba(255,255,255,.06);
  color: var(--a-text);
  border: 1px solid rgba(255,255,255,.14);
}

.kids-workout{ margin-top: 12px; }
.kids-stage{
  border-radius: var(--a-radius);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.kids-flip-wrap{ perspective: 1200px; width: 100%; }
.kids-flip-card{
  position: relative;
  width: 100%;
  min-height: 210px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
  border-radius: var(--a-radius);
}
.kids-flip-card.no-flip-transition{ transition: none; }
.kids-face{
  position: absolute; inset: 0;
  border-radius: var(--a-radius);
  padding: 16px 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.10));
}
.kids-face.front{ transform: rotateY(0deg); }
.kids-face.back{ transform: rotateY(180deg); }
.kids-flip-card.is-flipped{ transform: rotateY(180deg); }

.kids-en, .kids-pt{
  margin:0;
  text-align:center;
  font-weight: 1100;
  letter-spacing: .2px;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.kids-en{ font-size: clamp(28px, 4.2vw, 56px); line-height: 1.06; }
.kids-pt{
  font-size: clamp(18px, 2.8vw, 30px);
  line-height: 1.12;
  opacity: .95;
  color: rgba(255,255,255,.88);
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,215,0,.55);
  background: rgba(0,0,0,.12);
}

.kids-dash{
  margin: 8px auto 0;
  width: min(520px, 92%);
  height: 0;
  border-top: 2px dashed rgba(255,215,0,.50);
  opacity: .9;
}

.kids-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin-top: 12px;
}

.kids-controls.kids-controls-4{
  display:grid;
  grid-template-columns: 1fr 1.4fr 1fr 1fr;
  gap:10px;
  align-items:center;
}
.kids-controls.kids-controls-4 .btn{ width:100%; }
@media (max-width: 520px){
  .kids-controls.kids-controls-4{ grid-template-columns: 1fr 1fr; }
}

.kids-progress{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: rgba(255,255,255,.92);
  font-weight: 900;
  font-size: 13px;
}

.kids-bar{
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
}
.kids-bar i{
  display:block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,215,0,.85), rgba(0,180,255,.75));
}

.archive-item{
  display:block;
  width:100%;
  padding:12px 12px;
  margin:10px 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.92);
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, filter .12s ease;
}
.archive-item:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.archive-item.is-active,
.archive-item.active{
  border-color: rgba(255,215,0,.55);
  box-shadow: 0 0 0 2px rgba(255,215,0,.10);
}

.archive-item.exercise{
  margin-top: -6px;
  margin-left: 12px;
  padding: 10px 12px;
  border-style: dashed;
  background: rgba(0,0,0,.24);
  font-size: 12px;
}
.archive-item.exercise .archive-topic{
  font-size: 12px;
  font-weight: 900;
}

.pgate{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
}
.pgate-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content: center;
}
.pgate-btn{
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: inherit;
  cursor: pointer;
  font-weight: 1000;
  min-width: 130px;
  transition: transform .12s ease, filter .12s ease;
}
.pgate-btn:hover{ transform: translateY(-1px); filter: brightness(1.02); }
.pgate-btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; }

.pgate-btn-rec{
  color:#101827;
  background: linear-gradient(180deg, rgba(255,59,48,.98), rgba(255,122,0,.98));
  border: 1px solid rgba(16,24,39,.25);
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
  font-weight: 1100;
  letter-spacing: .2px;
}

.pgate-score{ flex:1; min-width: 220px; max-width: 520px; }
.pgate-score-top{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}
.pgate-mini{ opacity: .82; font-size: 12px; font-weight: 800; }
.pgate-mini.is-ok{ color: #86efac; }
.pgate-mini.is-bad{ color: #fca5a5; }

.pgate-bar{
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
}
.pgate-bar-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,215,0,.90), rgba(0,180,255,.65));
}

.pgate-transcript{
  margin-top: 10px;
  text-align: left;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.pgate-transcript-box{
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  min-height: 38px;
  white-space: pre-wrap;
  font-weight: 800;
  opacity: .95;
}

.teens-status{
  padding: 0 16px 16px;
  margin: 0;
  font-size: 13px;
  color: var(--a-muted);
}
.teens-status.is-error{ color: #fca5a5; }

.teens-data-note{ margin-top: 12px; font-size: 12px; }

/* Teens book page (full lines) */
.teens-page{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  padding: 14px;
  margin: 0 16px 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}

.teens-page-tools{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.teens-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.86);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.teens-lines{
  display:grid;
  gap: 12px;
}

.teens-line{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.15));
  padding: 12px 12px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.teens-line:hover{
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}
.teens-line.is-open{
  border-color: rgba(255,215,0,.45);
  box-shadow: 0 0 0 1px rgba(255,215,0,.12) inset;
}
.teens-line.is-correct{
  border-color: rgba(134,239,172,.55);
  box-shadow: 0 0 0 1px rgba(134,239,172,.18) inset;
}
.teens-line.is-wrong{
  border-color: rgba(252,165,165,.55);
  box-shadow: 0 0 0 1px rgba(252,165,165,.18) inset;
}

.teens-line-head{
  display:grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.teens-line-num{
  min-width: 44px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .12em;
  color: rgba(255,255,255,.85);
}

.teens-line-text{ min-width: 0; }

.teens-line-en{
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 900;
  color: rgba(255,255,255,.92);
}

.teens-line-actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-self: end;
}
.teens-line-actions .btn{
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.teens-line-pt{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255,215,0,.35);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.86);
  line-height: 1.6;
  display: none;
}
.teens-line.is-open .teens-line-pt{ display:block; }

.teens-line-rec{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.teens-line-rec-label{
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 900;
  color: rgba(255,255,255,.7);
  font-size: 10px;
}
.teens-line-rec-text{
  font-weight: 900;
  color: rgba(255,255,255,.9);
  min-height: 18px;
}
.teens-line-rec-score{
  font-weight: 900;
  color: rgba(255,255,255,.7);
}
.teens-line-rec-score.is-ok{ color: #86efac; }
.teens-line-rec-score.is-bad{ color: #fca5a5; }

.teens-lesson-done{
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(134,239,172,.45);
  background: rgba(0,0,0,.3);
  color: #86efac;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 720px){
  .teens-line-head{
    grid-template-columns: auto 1fr;
  }
  .teens-line-actions{
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Right panel tabs */
.teens-panel{
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.teens-panel-tabs{
  display:flex;
  gap: 8px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  padding: 6px;
}

.teens-tab{
  flex:1 1 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,.8);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
}
.teens-tab.is-active{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,215,0,.4);
  color: rgba(255,255,255,.95);
}

.teens-panel-body{
  display:block;
}
.teens-pane{
  display:none;
}
.teens-pane.is-active{
  display:block;
}

/* Exercises */
.teens-ex-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.teens-ex-title{
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.82);
}

.teens-ex-section{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.teens-ex-section:first-child{
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.teens-ex-section h3{
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 1000;
}

.teens-ex-list{
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  line-height: 1.7;
}

.teens-ex-input{
  min-width: 110px;
  width: 140px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  font-weight: 800;
  outline: none;
}
.teens-ex-input.small{ width: 90px; }
.teens-ex-input.wide{ width: 180px; }
.teens-ex-input.is-correct{ border-color: rgba(134,239,172,.7); box-shadow: 0 0 0 1px rgba(134,239,172,.2) inset; }
.teens-ex-input.is-wrong{ border-color: rgba(252,165,165,.7); box-shadow: 0 0 0 1px rgba(252,165,165,.2) inset; }

.teens-ex-lines .teens-ex-input{
  width: 100%;
}

.teens-ex-textarea{
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  font-weight: 800;
  outline: none;
  resize: vertical;
}
.teens-ex-textarea.is-correct{ border-color: rgba(134,239,172,.7); box-shadow: 0 0 0 1px rgba(134,239,172,.2) inset; }
.teens-ex-textarea.is-wrong{ border-color: rgba(252,165,165,.7); box-shadow: 0 0 0 1px rgba(252,165,165,.2) inset; }

.teens-ex-actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.teens-ex-note{
  font-size: 12px;
  color: rgba(255,255,255,.7);
}

.teens-sub-card{
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 10px;
  display:grid;
  gap: 8px;
}
.teens-sub-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items:center;
}
.teens-sub-label{
  font-weight: 900;
  color: rgba(255,255,255,.8);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.teens-sub-pill{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.28);
  font-weight: 800;
}
.teens-sub-status{
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
