.practice-card{
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.practice-header{
  margin-bottom: 28px;
}

.practice-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.practice-label{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #20a36a;
}

.practice-counter{
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
}

.practice-progress{
  margin-bottom: 0;
}

.practice-progress .progress{
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}

.practice-progress .progress-bar{
  background: #198754 !important;
  transition: width .3s ease;
}

.practice-question{
  max-width: 760px;
  margin: 0 auto 28px;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  color: #212529;
  text-align: center;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-wrap{
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.play-circle-btn{
  width: 88px;
  height: 88px;
  border: none;
  border-radius: 50%;
  background: #198754;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(25,135,84,.18);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.play-circle-btn i{
  font-size: 40px;
  line-height: 1;
  margin-left: 4px;
}

.play-circle-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(25,135,84,.24);
}

.play-circle-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.practice-bottom{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.practice-timer-label{
  font-size: 15px;
  color: #6c757d;
  margin-bottom: 4px;
}

.practice-timer{
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  color: #198754;
  margin-bottom: 8px;
}

#statusText{
  font-size: 16px !important;
  color: #6c757d !important;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.practice-finish{
  max-width: 560px;
  margin: 32px auto 0;
  text-align: center;
}

.practice-finish h2{
  font-size: 42px;
  font-weight: 700;
  color: #212529;
}

.practice-finish p{
  color: #6c757d !important;
  font-size: 18px;
  line-height: 1.6;
}

@media (max-width: 767.98px){
  .practice-card{
    padding-top: 0;
  }

  .practice-header{
    margin-bottom: 22px;
  }

  .practice-top{
    margin-bottom: 8px;
  }

  .practice-label{
    font-size: 12px;
  }

  .practice-counter{
    font-size: 13px;
  }

  .practice-question{
    font-size: 22px;
    line-height: 1.35;
    min-height: 84px;
    margin-bottom: 22px;
    padding: 0 8px;
  }

  .play-wrap{
    margin-bottom: 18px;
  }

  .play-circle-btn{
    width: 76px;
    height: 76px;
  }

  .play-circle-btn i{
    font-size: 34px;
  }

  .practice-timer{
    font-size: 42px;
  }

  .practice-timer-label{
    font-size: 14px;
  }

  #statusText{
    font-size: 14px !important;
    padding: 0 10px;
  }

  .practice-finish h2{
    font-size: 32px;
  }

  .practice-finish p{
    font-size: 16px;
  }
}


/* POPUP */
.settings-btn{
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: .2s ease;
}

.settings-btn:hover{
  color: #198754;
  border-color: rgba(25,135,84,.25);
  background: #f8f9fa;
}

.settings-btn i{
  font-size: 18px;
  line-height: 1;
}

.settings-modal{
  position: fixed;
  inset: 0;
  z-index: 1050;
}

.settings-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}

.settings-dialog{
  position: relative;
  z-index: 2;
  width: calc(100% - 32px);
  max-width: 420px;
  margin: 80px auto 0;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.settings-dialog-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.settings-title{
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #212529;
}

.settings-close-btn{
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-close-btn:hover{
  background: #f3f4f6;
  color: #212529;
}

.settings-group{
  margin-top: 6px;
}

.settings-label{
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
}

.timer-options{
  display: flex;
  gap: 10px;
}

.timer-option{
  flex: 1;
  cursor: pointer;
}

.timer-option input{
  display: none;
}

.timer-option span{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 12px;
  background: #fff;
  color: #212529;
  font-weight: 600;
  transition: .2s ease;
}

.timer-option input:checked + span{
  background: #198754;
  border-color: #198754;
  color: #fff;
}

@media (max-width: 767.98px){
  .settings-dialog{
    margin-top: 60px;
    padding: 18px;
  }
}

/* сетка для количества вопросов */
.timer-options-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.settings-hint{
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #6c757d;
}

@media (max-width: 767.98px){
  .timer-options-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* disabled choicing question count */
.timer-option input:disabled + span{
  opacity: .5;
  cursor: not-allowed;
  background: #f1f3f5;
  color: #6c757d;
  border-color: rgba(0,0,0,.08);
}

.timer-option input:disabled:checked + span{
  opacity: .65;
  background: #198754;
  color: #fff;
}

/* For part transition  */

.part-transition {
    margin: 2rem 0;
}

.part-label {
    font-size: 2rem;
    font-weight: 800;
    color: #198754;
    margin-bottom: 0.5rem;
}

.part-subtext {
    font-size: 1rem;
    color: #6c757d;
}

.question-part {
    font-size: 0.78rem;
    font-weight: 700;
    color: #198754;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.05rem;
}


/* =========================================
   ivEng — SPEAKING PAGE BACKGROUND
========================================= */

.speaking-page {
    position: relative;
    isolation: isolate;

    min-height: 100vh;
    min-height: 100dvh;

    background: #ffffff;
    overflow: hidden;
}

/* Контент поверх фона */
.speaking-page > .container {
    position: relative;
    z-index: 1;
}

/* Верхняя декоративная волна */
.speaking-page::before {
    content: "";
    position: absolute;
    z-index: 0;

    top: -190px;
    left: -230px;

    width: 580px;
    height: 390px;

    border-radius: 42% 58% 68% 32% / 55% 38% 62% 45%;

    background: #c9f7da;

    transform: rotate(-18deg);

    opacity: 0.55;
    pointer-events: none;
}

/* Нижняя декоративная волна */
.speaking-page::after {
    content: "";
    position: absolute;
    z-index: 0;

    bottom: -210px;
    right: -220px;

    width: 620px;
    height: 420px;

    border-radius: 65% 35% 38% 62% / 45% 65% 35% 55%;

    background: #8be7b1;

    transform: rotate(-15deg);

    opacity: 0.45;
    pointer-events: none;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 991.98px) {

    .speaking-page::before {
        top: -155px;
        left: -180px;
        width: 440px;
        height: 310px;
    }

    .speaking-page::after {
        bottom: -160px;
        right: -170px;
        width: 450px;
        height: 320px;
    }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 575.98px) {

    .speaking-page::before {
        top: -105px;
        left: -145px;
        width: 310px;
        height: 220px;
        opacity: 0.6;
    }

    .speaking-page::after {
        bottom: -115px;
        right: -145px;
        width: 320px;
        height: 240px;
        opacity: 0.5;
    }

    .speaking-page > .container {
        padding-bottom: 80px !important;
    }
}

body.speaking-practice-body {
    padding-top: 0 !important;
}

/* =========================================
   ivEng — SPEAKING EXTRA CARDS
========================================= */

.speaking-extra {
    width: 100%;
    max-width: 760px;
    position: relative;
    z-index: 1;
}

/* Карточки */

.speaking-info-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e0eee5;
    border-radius: 18px;

    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.025);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.speaking-info-card:hover {
    transform: translateY(-4px);
    border-color: #b4e8c8;

    box-shadow:
        0 12px 30px rgba(22, 163, 74, 0.09);
}

/* Заголовки */

.speaking-info-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.speaking-info-heading h3 {
    font-size: 16px;
    font-weight: 700;
    color: #064e3b;
    margin: 0;
}

/* Иконки */

.speaking-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border-radius: 12px;
    background: #e4f9ec;
    color: #16a34a;

    font-size: 19px;
    flex-shrink: 0;
}

/* Текст */

.speaking-info-card p {
    color: #52675b;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Подпись */

.speaking-info-caption {
    color: #8a9b91;
    font-size: 12px;
}

/* Useful phrases */

.speaking-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.speaking-phrases span {
    padding: 7px 11px;
    border-radius: 8px;

    background: #f0fbf4;
    border: 1px solid #e0f3e7;

    color: #166534;
    font-size: 13px;
    font-weight: 500;
}

/* =========================================
   PROGRESS
========================================= */
/* =========================================
   SPEAKING STATISTICS
========================================= */

.speaking-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;

    padding: 12px;

    background: #ffffff;
    border: 1px solid #e0eee5;
    border-radius: 18px;

    box-shadow:
        0 4px 20px rgba(6, 78, 59, 0.025);
}


/* Отдельная статистика */

.speaking-stat-item {
    display: flex;
    align-items: center;
    gap: 13px;

    min-width: 0;
    padding: 15px 16px;

    border-radius: 13px;
    background: #f8fcf9;

    transition:
        background-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


.speaking-stat-item:hover {
    background: #f0fbf4;
    transform: translateY(-2px);

    box-shadow:
        0 6px 16px rgba(22, 163, 74, .07);
}


/* Иконка */

.speaking-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    border-radius: 11px;

    background: #dcfce7;
    color: #16a34a;

    font-size: 18px;
}


/* Число + подпись */

.speaking-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.speaking-stat-content strong {
    color: #064e3b;

    font-size: 21px;
    font-weight: 750;
    line-height: 1.1;

    margin-bottom: 3px;
}


.speaking-stat-content span {
    color: #7b8f84;

    font-size: 11px;
    line-height: 1.25;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 767.98px) {

    .speaking-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .speaking-stat-item {
        padding: 13px 15px;
    }

}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 575.98px) {

    .speaking-info-card {
        padding: 20px;
        border-radius: 15px;
    }

    .speaking-stats {
        padding: 16px;
        gap: 12px;
    }

    .speaking-stats-value span {
        font-size: 11px;
        text-align: right;
    }

    .speaking-info-heading h3 {
        font-size: 15px;
    }
}



/* =========================================
   MOBILE COMPACT LAYOUT
========================================= */

@media (max-width: 575.98px) {

    /* Общий контейнер */
    .speaking-page .container {
        padding-top: 14px !important;
        padding-bottom: 18px !important;
    }

    /* Верхняя строка */
    .speaking-page .container > .mb-4:first-child {
        margin-bottom: 14px !important;
    }

    /* Заголовок темы */
    #topicHeader {
        margin-bottom: 18px !important;
    }

    #topicHeader h1 {
        font-size: 1.8rem;
        line-height: 1.1;
        margin-bottom: 6px !important;
    }

    #topicHeader p {
        font-size: 0.95rem;
        line-height: 1.35;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Верхняя часть practice */
    .practice-card > .d-flex:first-child {
        margin-bottom: 10px !important;
    }

    .practice-label {
        font-size: 12px;
        letter-spacing: .04em;
    }

    .practice-counter {
        font-size: 12px;
    }

    .practice-progress {
        margin-bottom: 18px !important;
    }

    /* Главный вопрос */
    .practice-question {
        font-size: 1.45rem;
        line-height: 1.2;
        min-height: auto !important;
    }

    /* Start */
    #startWrap {
        margin-top: 20px !important;
    }

    #startBtn {
        font-size: 16px;
        padding: 10px 24px !important;
    }

    /* Таймер */
    .practice-bottom {
        margin-top: 16px !important;
    }

    .practice-timer-label {
        font-size: 12px;
        margin-bottom: 0 !important;
    }

    .practice-timer {
        font-size: 2.6rem;
        line-height: 1;
    }

    #statusText {
        font-size: 12px !important;
        margin-top: 6px !important;
    }

    /* =====================================
       HELP CARDS — COMPACT
    ===================================== */

    .speaking-extra {
        margin-top: 16px !important;
    }

    .speaking-extra .row {
        --bs-gutter-y: 8px;
    }

    .speaking-info-card {
        padding: 14px 15px;
        border-radius: 14px;
    }

    .speaking-info-heading {
        gap: 8px;
        margin-bottom: 8px;
    }

    .speaking-info-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        border-radius: 9px;
        font-size: 15px;
    }

    .speaking-info-heading h3 {
        font-size: 13px;
    }

    .speaking-info-card p {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 8px;
    }

    .speaking-info-caption {
        display: none;
    }

    .speaking-phrases {
        gap: 6px;
        margin-bottom: 0;
    }

    .speaking-phrases span {
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 7px;
    }

    /* =====================================
       STATS — 3 COLUMNS
    ===================================== */

    .speaking-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 8px;
        border-radius: 14px;
    }

    .speaking-stat-item {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 5px;
        padding: 9px 5px;
        border-radius: 10px;
    }

    .speaking-stat-icon {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 8px;
        font-size: 13px;
    }

    .speaking-stat-content {
        align-items: center;
    }

    .speaking-stat-content strong {
        font-size: 17px;
        margin-bottom: 1px;
    }

    .speaking-stat-content span {
        font-size: 9px;
        line-height: 1.15;
        text-align: center;
    }
}

/* Ещё чуть компактнее на телефонах */
@media (max-width: 575.98px) {

    /* -4px */
    #topicHeader {
        margin-bottom: 14px !important;
    }

    /* -4px */
    .practice-progress {
        margin-bottom: 14px !important;
    }

    /* -4px */
    #startWrap {
        margin-top: 16px !important;
    }

    /* -3px */
    .speaking-extra {
        margin-top: 13px !important;
    }
    .play-circle-btn {
      width: 54px;
      height: 54px;
      font-size: 24px;
  }
}

/* =========================================
   COMPACT LAYOUT — LAPTOPS
   Для экранов с небольшой высотой
========================================= */

@media (min-width: 768px) and (max-height: 900px) {

    /* Вся страница */
    .speaking-page .container {
        padding-top: 20px !important;
        padding-bottom: 24px !important;
    }

    /* Back to topics + settings */
    .speaking-page .container > .mb-4:first-child {
        margin-bottom: 12px !important;
    }

    /* Заголовок темы */
    #topicHeader {
        margin-bottom: 20px !important;
    }

    #topicHeader h1 {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 5px !important;
    }

    #topicHeader p {
        font-size: 14px;
        line-height: 1.35;
    }


    /* =====================================
       PRACTICE
    ===================================== */

    .practice-card {
        padding-top: 0;
        padding-bottom: 0;
    }

    .practice-card > .d-flex:first-child {
        margin-bottom: 10px !important;
    }

    .practice-progress {
        margin-bottom: 18px !important;
    }

    .practice-question {
        min-height: auto !important;
        font-size: 1.65rem;
        line-height: 1.2;
    }


    /* Start */
    #startWrap {
        margin-top: 20px !important;
    }

    #startBtn {
        padding: 8px 22px !important;
        font-size: 16px;
    }


    /* Play */
    #controlsWrap .mt-4 {
        margin-top: 16px !important;
    }


    /* =====================================
       TIMER
    ===================================== */

    .practice-bottom {
        margin-top: 16px !important;
    }

    .practice-timer-label {
        margin-bottom: 0 !important;
        font-size: 12px;
    }

    .practice-timer {
        font-size: 2.7rem;
        line-height: 1;
    }

    #statusText {
        margin-top: 6px !important;
        font-size: 12px;
    }


    /* =====================================
       SPEAKING EXTRA
    ===================================== */

    .speaking-extra {
        margin-top: 14px !important;
    }

    .speaking-info-card {
        padding: 14px 16px;
    }

    .speaking-info-heading {
        margin-bottom: 8px;
    }

    .speaking-info-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 15px;
    }

    .speaking-info-heading h3 {
        font-size: 13px;
    }

    .speaking-info-card p {
        margin-bottom: 8px;
        font-size: 12px;
        line-height: 1.4;
    }

    .speaking-info-caption {
        font-size: 10px;
    }

    .speaking-phrases {
        gap: 5px;
        margin-bottom: 8px;
    }

    .speaking-phrases span {
        padding: 4px 8px;
        font-size: 11px;
    }


    /* =====================================
       STATISTICS
    ===================================== */

    .speaking-stats {
        margin-top: 10px !important;
        padding: 8px;
        gap: 8px;
    }

    .speaking-stat-item {
        padding: 9px 12px;
        gap: 10px;
    }

    .speaking-stat-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 14px;
    }

    .speaking-stat-content strong {
        font-size: 18px;
    }

    .speaking-stat-content span {
        font-size: 10px;
    }
}

/* Ещё -10px по высоте на мобильных */
@media (max-width: 575.98px) {

    /* -3px */
    #topicHeader {
        margin-bottom: 11px !important;
    }

    /* -2px */
    .practice-progress {
        margin-bottom: 12px !important;
    }

    /* -2px */
    #startWrap {
        margin-top: 14px !important;
    }

    /* -3px */
    .speaking-extra {
        margin-top: 10px !important;
    }
}