/* =========================================================
   BRUSH TEETH — Life Skills Activity
   kdhfamea.gr
   ========================================================= */

.bt-app {
  --bt-bg: #f4f7fa;
  --bt-surface: #ffffff;
  --bt-text: #203040;
  --bt-muted: #667482;
  --bt-border: #dce4ea;
  --bt-primary: #286da8;
  --bt-primary-dark: #1e5686;
  --bt-soft: #edf5fb;
  --bt-success: #287a55;
  --bt-shadow: 0 12px 34px rgba(32, 48, 64, 0.1);

  min-height: 100%;
  background: var(--bt-bg);
  color: var(--bt-text);
  font-family: inherit;
  box-sizing: border-box;
}

.bt-app *,
.bt-app *::before,
.bt-app *::after {
  box-sizing: border-box;
}

.bt-app.bt-high-contrast {
  --bt-bg: #ffffff;
  --bt-surface: #ffffff;
  --bt-text: #000000;
  --bt-muted: #202020;
  --bt-border: #000000;
  --bt-primary: #004e92;
  --bt-primary-dark: #00345f;
  --bt-soft: #ffffff;
}

.bt-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px;
}

/* ---------- HEADER ---------- */

.bt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.bt-topbar-left,
.bt-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bt-icon-btn,
.bt-btn {
  min-height: 48px;
  border: 2px solid var(--bt-border);
  background: var(--bt-surface);
  color: var(--bt-text);
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.bt-icon-btn {
  min-width: 48px;
  padding: 10px 14px;
}

.bt-btn {
  padding: 12px 20px;
}

.bt-icon-btn:hover,
.bt-btn:hover {
  border-color: var(--bt-primary);
}

.bt-icon-btn:active,
.bt-btn:active {
  transform: scale(0.98);
}

.bt-icon-btn:focus-visible,
.bt-btn:focus-visible,
.bt-mode-card:focus-visible,
.bt-seq-card:focus-visible {
  outline: 4px solid rgba(40, 109, 168, 0.3);
  outline-offset: 3px;
}

/* ---------- COMMON ---------- */

.bt-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0;
}

.bt-subtitle {
  color: var(--bt-muted);
  font-size: 1.08rem;
  line-height: 1.6;
  margin: 8px 0 0;
}

.bt-center {
  text-align: center;
}

.bt-card {
  background: var(--bt-surface);
  border: 2px solid var(--bt-border);
  border-radius: 24px;
  box-shadow: var(--bt-shadow);
}

/* ---------- HOME ---------- */

.bt-home {
  padding: 18px 0 40px;
}

.bt-home-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 30px;
}

.bt-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}

.bt-mode-card {
  appearance: none;
  text-align: left;
  padding: 26px;
  border-radius: 22px;
  border: 2px solid var(--bt-border);
  background: var(--bt-surface);
  color: var(--bt-text);
  cursor: pointer;
  min-height: 165px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.bt-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--bt-primary);
  box-shadow: var(--bt-shadow);
}

.bt-mode-number {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bt-soft);
  color: var(--bt-primary-dark);
  font-weight: 800;
  margin-bottom: 16px;
}

.bt-mode-title {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.bt-mode-desc {
  display: block;
  color: var(--bt-muted);
  line-height: 1.5;
}

/* ---------- LEARN / REAL MODE ---------- */

.bt-step-layout {
  max-width: 920px;
  margin: 0 auto;
}

.bt-progress-wrap {
  margin-bottom: 16px;
}

.bt-progress-text {
  font-weight: 800;
  text-align: center;
  margin-bottom: 9px;
}

.bt-progress {
  height: 10px;
  background: #dfe7ed;
  border-radius: 100px;
  overflow: hidden;
}

.bt-progress-bar {
  height: 100%;
  background: var(--bt-primary);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.bt-step-card {
  overflow: hidden;
}

.bt-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eef2f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-step-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bt-step-content {
  padding: 24px;
  text-align: center;
}

.bt-step-title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
}

.bt-step-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.bt-primary {
  background: var(--bt-primary);
  border-color: var(--bt-primary);
  color: #fff;
}

.bt-primary:hover {
  background: var(--bt-primary-dark);
  border-color: var(--bt-primary-dark);
}

.bt-success {
  background: var(--bt-success);
  border-color: var(--bt-success);
  color: #fff;
}

.bt-big-done {
  width: min(520px, 100%);
  min-height: 72px;
  font-size: 1.3rem;
}

/* ---------- SEQUENCE ---------- */

.bt-levels {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.bt-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.bt-slot {
  min-height: 175px;
  border: 3px dashed #b8c5cf;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
}

.bt-slot-number {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.85rem;
  color: var(--bt-muted);
  font-weight: 800;
}

.bt-seq-bank {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.bt-seq-card {
  background: var(--bt-surface);
  border: 2px solid var(--bt-border);
  border-radius: 18px;
  padding: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.bt-seq-card.bt-selected {
  border-color: var(--bt-primary);
  box-shadow: 0 0 0 4px rgba(40, 109, 168, 0.15);
}

.bt-seq-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.bt-seq-card span {
  display: block;
  padding: 9px 5px 3px;
  font-weight: 750;
  text-align: center;
  line-height: 1.3;
}

.bt-slot .bt-seq-card {
  width: 100%;
  cursor: default;
}

.bt-feedback {
  min-height: 30px;
  text-align: center;
  font-weight: 800;
  margin: 16px 0;
  color: var(--bt-primary-dark);
}

.bt-hint {
  animation: bt-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes bt-pulse {
  from {
    box-shadow: 0 0 0 0 rgba(40, 109, 168, 0.08);
  }
  to {
    box-shadow: 0 0 0 7px rgba(40, 109, 168, 0.17);
  }
}

/* ---------- BRUSH SIMULATION ---------- */

.bt-mouth-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px;
}

.bt-mouth {
  position: relative;
  min-height: 520px;
  border-radius: 38% 38% 30% 30%;
  background: #d98a8a;
  padding: 70px 28px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.bt-teeth-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
}

.bt-teeth-row + .bt-teeth-row {
  margin-top: 56px;
}

.bt-tooth {
  height: 102px;
  background: #fffdf8;
  border: 2px solid #e8e2d9;
  border-radius: 16px 16px 27px 27px;
  position: relative;
  overflow: hidden;
}

.bt-teeth-row.bt-lower .bt-tooth {
  border-radius: 27px 27px 16px 16px;
}

.bt-plaque {
  position: absolute;
  width: 45%;
  height: 38%;
  border-radius: 50%;
  background: rgba(215, 186, 98, 0.72);
  left: 28%;
  top: 35%;
  transition: opacity 0.15s linear;
  pointer-events: none;
}

.bt-brush-cursor {
  position: absolute;
  width: 105px;
  height: 26px;
  border-radius: 13px;
  background: var(--bt-primary);
  pointer-events: none;
  transform: translate(-15px, -50%);
  display: none;
  z-index: 5;
}

.bt-brush-cursor::after {
  content: "";
  position: absolute;
  right: -22px;
  top: 2px;
  width: 28px;
  height: 22px;
  background:
    repeating-linear-gradient(
      90deg,
      #fff 0 3px,
      #9dd8f5 3px 6px
    );
  border-radius: 4px;
}

.bt-brush-progress {
  max-width: 600px;
  margin: 22px auto 0;
}

/* ---------- COMPLETION ---------- */

.bt-complete {
  max-width: 680px;
  margin: 60px auto;
  text-align: center;
  padding: 40px;
}

.bt-complete h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 12px;
}

/* ---------- DIALOG ---------- */

.bt-dialog {
  width: min(720px, calc(100% - 30px));
  border: none;
  padding: 0;
  border-radius: 24px;
  color: var(--bt-text);
}

.bt-dialog::backdrop {
  background: rgba(20, 30, 40, 0.5);
}

.bt-dialog-inner {
  padding: 26px;
}

.bt-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.bt-dialog h2 {
  margin: 0;
}

.bt-settings-grid {
  display: grid;
  gap: 14px;
}

.bt-setting {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bt-border);
}

.bt-step-settings {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.bt-step-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.bt-step-check input {
  width: 20px;
  height: 20px;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 760px) {
  .bt-shell {
    padding: 12px;
  }

  .bt-mode-grid {
    grid-template-columns: 1fr;
  }

  .bt-topbar {
    align-items: flex-start;
  }

  .bt-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .bt-mouth {
    min-height: 390px;
    padding: 48px 14px;
  }

  .bt-tooth {
    height: 75px;
  }

  .bt-teeth-row + .bt-teeth-row {
    margin-top: 38px;
  }

  .bt-step-content {
    padding: 18px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-app *,
  .bt-app *::before,
  .bt-app *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}