/* Global page layout */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600;700&display=swap");

:root {
  --text-soft: #f5e6d3;
  --text-primary: #f5e6d3;
  --text-secondary: rgba(245, 230, 211, 0.75);
  --text-dark: #3f2318;
  --btn-bg: #e8d5b7;
  --btn-text: #5c3a21;
  --type-h1: 48px;
  --type-h2: 34px;
  --type-h3: 24px;
  --type-body-lg: 20px;
  --type-body: 18px;
  --type-support: 16px;
  --type-btn: 18px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--text-primary);
  font-family: "EB Garamond", Georgia, serif;
  line-height: 1.6;
  overflow-x: hidden;
  background: #111;
}

h1,
h2,
h3,
h4,
p,
span,
label,
button,
input,
small,
figcaption {
  font-family: "EB Garamond", Georgia, serif;
}

input::placeholder {
  font-family: "EB Garamond", Georgia, serif;
}

h1 {
  font-size: var(--type-h1);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

h2 {
  font-size: var(--type-h2);
}

h3 {
  font-size: var(--type-h3);
}

img,
canvas {
  max-width: 100%;
  display: block;
}

.page-wrap {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
}

.soft-btn {
  border: 1px solid rgba(119, 45, 29, 0.36);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 10px 22px;
  text-align: center;
  font-size: var(--type-btn);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.soft-btn:hover {
  transform: translateY(-1px);
  background: #d8c2a0;
}

.soft-btn:active {
  transform: scale(0.98);
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Story page wrapper */
.page,
.story-page {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: stretch;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: url("img/background.jpg") center center / cover no-repeat;
}

/* Page frame */
.content,
.page-frame {
  position: relative;
  width: min(1200px, 100%);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  padding: 70px 90px;
  background: transparent;
}

.page-frame > * {
  width: 100%;
  height: 100%;
}

.certificate-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("img/full background.jpg") center center / cover no-repeat;
}

/* Section 1 intro */
#section-intro .page-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-fu {
  width: min(72%, 700px);
  max-height: 100%;
  object-fit: contain;
}

/* Section 2 translation */
.meaning-layout {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  align-items: end;
  gap: clamp(22px, 3vw, 46px);
}

.meaning-girl-wrap {
  align-self: end;
}

.meaning-girl {
  width: min(100%, 630px);
  margin-left: 6px;
  object-fit: contain;
}

.meaning-text {
  align-self: center;
  justify-self: end;
  width: min(610px, 100%);
  padding: clamp(16px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
  background: rgba(146, 64, 54, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(39, 10, 8, 0.12);
}

.meaning-en {
  margin: 0;
  font-size: clamp(30px, 2.2vw, 32px);
  line-height: 1.72;
  letter-spacing: 0.012em;
  font-weight: 600;
}

.meaning-fr {
  margin: 20px 0 0;
  font-size: clamp(22px, 1.7vw, 24px);
  line-height: 1.68;
  letter-spacing: 0.008em;
  color: #f2e8dc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

/* Section 3 quiz */
.quiz-wrap {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.quiz-question {
  margin: 0;
  width: min(840px, 100%);
  font-weight: 600;
  color: var(--text-primary);
  font-size: clamp(40px, 2.9vw, 44px);
  line-height: 1.34;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.quiz-subtitle {
  margin: 10px 0 24px;
  color: #f2e8dc;
  font-size: clamp(22px, 1.8vw, 24px);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lantern-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(14px, 2vw, 30px);
}

.lantern-option {
  width: min(39.44%, 324.8px);
  min-width: 218px;
  border: 0;
  background: transparent;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: transform 0.26s ease, filter 0.26s ease;
}

.firework {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 102px;
  height: 102px;
  transform: translateX(-50%) scale(0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.firework::before,
.firework::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  opacity: 0;
}

.firework::before {
  background: rgba(255, 219, 120, 0.98);
  box-shadow:
    0 -22px 0 rgba(255, 219, 120, 0.95),
    16px -14px 0 rgba(255, 204, 92, 0.92),
    22px 0 0 rgba(255, 229, 150, 0.9),
    16px 14px 0 rgba(245, 175, 72, 0.88),
    0 22px 0 rgba(255, 219, 120, 0.9),
    -16px 14px 0 rgba(255, 204, 92, 0.9),
    -22px 0 0 rgba(255, 229, 150, 0.88),
    -16px -14px 0 rgba(245, 175, 72, 0.86);
}

.firework::after {
  background: rgba(255, 239, 190, 0.96);
  box-shadow:
    0 -14px 0 rgba(255, 239, 190, 0.95),
    10px -10px 0 rgba(255, 218, 145, 0.92),
    14px 0 0 rgba(255, 239, 190, 0.9),
    10px 10px 0 rgba(255, 203, 111, 0.88),
    0 14px 0 rgba(255, 239, 190, 0.88),
    -10px 10px 0 rgba(255, 218, 145, 0.9),
    -14px 0 0 rgba(255, 239, 190, 0.88),
    -10px -10px 0 rgba(255, 203, 111, 0.86);
}

.firework.explode {
  animation: firework-burst 1.2s ease-out forwards;
}

.firework.explode::before {
  animation: firework-sparks-a 1.2s ease-out forwards;
}

.firework.explode::after {
  animation: firework-sparks-b 1.2s ease-out forwards;
}

@keyframes firework-burst {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(2.78);
  }
}

@keyframes firework-sparks-a {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(2.03) rotate(34deg);
  }
}

@keyframes firework-sparks-b {
  0% {
    opacity: 0;
    transform: scale(0.28) rotate(0deg);
  }
  18% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: scale(2.1) rotate(-28deg);
  }
}

.lantern-image {
  width: 100%;
  object-fit: contain;
}

.lantern-text {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  width: 76%;
  padding: 6px 8px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #2b1a12;
  font-size: clamp(24px, 1.9vw, 26px);
  font-weight: 600;
  line-height: 1.24;
  text-align: center;
  text-shadow: 0 1px 1px rgba(255, 235, 205, 0.35);
  backdrop-filter: none;
  box-shadow: none;
}

.lantern-row .lantern-option:nth-child(2) .lantern-text {
  background: transparent;
}

.lantern-option:hover {
  transform: scale(1.04);
  filter: brightness(1.04);
}

.lantern-option.selected {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.quiz-feedback {
  min-height: 30px;
  margin: 18px 0 10px;
  color: var(--text-primary);
  font-size: clamp(22px, 1.8vw, 24px);
  font-weight: 600;
}

/* Section 4 teaching */
#section-strokes .page-frame {
  display: flex;
  justify-content: center;
  align-items: center;
}

#section-strokes .stroke-teaching-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

#section-strokes .stroke-video-panel {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#section-strokes .stroke-title-wrap {
  width: min(60vw, 700px);
  max-width: 700px;
  text-align: center;
  margin: 0 auto 22px;
}

#section-strokes .stroke-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(40px, 2.9vw, 44px);
  font-weight: 650;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#section-strokes .stroke-subtitle {
  margin: 8px 0 0;
  color: #f2e8dc;
  font-size: clamp(22px, 1.8vw, 24px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stroke-head {
  margin-bottom: 12px;
}

.stroke-progress {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-support);
}

.stroke-current {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: var(--type-body);
  font-weight: 600;
  transform: translateX(-12px);
}

#section-strokes .stroke-video-wrap {
  width: min(60vw, 700px);
  max-width: 700px;
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255, 233, 206, 0.2);
  background: rgba(104, 28, 18, 0.14);
  padding: 10px;
}

.stroke-why-trigger {
  position: absolute;
  top: 2px;
  left: -182px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 368px;
  height: 368px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.stroke-why-trigger:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.06);
}

.stroke-why-trigger:active {
  transform: translateY(0) scale(0.98);
}

.stroke-why-knot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.stroke-hint {
  position: absolute;
  left: -42px;
  top: clamp(238px, 30vh, 292px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: none;
  pointer-events: none;
  animation: none;
}

.stroke-hint-text {
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stroke-hint-arrow {
  font-size: clamp(17px, 1.5vw, 20px);
  color: rgba(255, 233, 205, 0.95);
  transform: translateY(-1px);
}

@keyframes strokeHintFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

#section-strokes #fuVideo {
  width: 100%;
  max-width: 700px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.stroke-list-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stroke-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stroke-list-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(250, 241, 226, 0.2);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 228, 195, 0.2);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  opacity: 0.38;
  transform: scale(1);
}

.stroke-list-item.active {
  background: rgba(147, 38, 27, 0.92);
  color: var(--text-primary);
  border-color: rgba(251, 230, 184, 0.85);
  opacity: 1;
  transform: scale(1.05);
}

.stroke-actions {
  display: flex;
  gap: 9px;
}

.stroke-list-panel .stroke-head {
  margin-bottom: 16px;
}

.stroke-list-panel .stroke-progress {
  color: var(--text-secondary);
  font-size: var(--type-support);
}

.stroke-list-panel .stroke-current {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: var(--type-body);
  font-weight: 600;
}

#section-strokes .stroke-video-actions {
  margin-top: 20px;
  justify-content: center;
}

/* Section 5 practice */
#section-practice .page-frame {
  overflow: visible;
  padding-left: 28px;
  padding-bottom: 24px;
}

.practice-layout,
.writing-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(14px, 2.6vw, 36px);
  align-items: center;
}

.practice-feedback,
.left-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0;
  position: relative;
  min-height: 430px;
}

.practice-girl-block {
  position: relative;
  width: min(100%, 470px);
  transform: translate(-82px, 34px);
  z-index: 2;
}

.practice-girl-wrap {
  width: 100%;
  height: 430px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}

.practice-girl {
  width: 100%;
  height: 100%;
  margin-bottom: 0;
  object-fit: contain;
  object-position: left bottom;
  position: relative;
  z-index: 2;
  transform-origin: left bottom;
  transform: translate3d(0, 0, 0) scale(1);
}

.practice-girl.girl-state-1,
.practice-girl.girl-state-2,
.practice-girl.girl-state-3 {
  transform: translate3d(0, 0, 0) scale(1);
}

.practice-message {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(30px, 2.5vw, 34px);
  line-height: 1.28;
  font-weight: 560;
  text-shadow: 0 1px 2px rgba(60, 14, 11, 0.44);
  text-align: center;
  min-height: 34px;
  position: absolute;
  z-index: 3;
  max-width: 360px;
  width: min(88vw, 360px);
  white-space: normal;
  left: 55%;
  bottom: calc(100% + 14px);
  transform: translate(-52%, 92px);
}

.practice-message.is-ready {
  font-size: clamp(26px, 2.2vw, 30px);
  line-height: 1.32;
}

.practice-message.is-almost,
.practice-message.is-ready,
.practice-message.is-other {
  left: 55%;
  bottom: calc(100% + 14px);
  transform: translate(-52%, 92px);
}

.practice-stage {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(18px, -14px);
  z-index: 0;
}

.paper-area,
.writing-board {
  width: min(100%, 610px);
  aspect-ratio: 1 / 1;
  margin: 0;
  position: relative;
  overflow: visible;
}

.paper-image {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.paper-guide {
  position: absolute;
  inset: 11% 13%;
  width: 74%;
  height: 78%;
  object-fit: contain;
  opacity: 0.14;
  pointer-events: none;
  z-index: 1;
}

#practice-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  background: transparent;
  z-index: 1;
}

.prop-zhen {
  position: absolute;
  width: 92px;
  left: 48.8%;
  top: -1.2%;
  transform: translate(-50%, -50%) scale(6.6);
  transform-origin: center center;
  object-fit: contain;
  z-index: 3;
}

.prop-container,
.ink {
  position: absolute;
  width: 118px;
  top: -30px;
  left: -228px;
  transform: translateY(24px) scale(2.04);
  transform-origin: center center;
  object-fit: contain;
  z-index: 3;
}

.prop-brush,
.brush {
  position: absolute;
  width: 152px;
  right: -64px;
  top: 52%;
  transform: translate(28px, -50%) scale(1.36);
  transform-origin: center center;
  object-fit: contain;
  z-index: 2;
}

.practice-actions {
  width: min(100%, 610px);
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.practice-actions .soft-btn {
  min-height: 46px;
  padding: 10px 34px;
  border: 1px solid rgba(112, 76, 55, 0.46);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.practice-actions .soft-btn:hover {
  background: #d8c2a0;
  filter: none;
}

.practice-actions .soft-btn:disabled {
  opacity: 0.78;
  cursor: default;
  transform: none;
}

#start-practice.is-start-pulse {
  animation: start-button-pulse 0.3s ease;
}

.finish-practice-btn {
  display: inline-flex;
}

.finish-practice-btn:not(.is-visible) {
  display: none;
}

.finish-practice-btn.is-visible {
  display: inline-flex;
}

.finish-practice-btn.is-label-switch {
  animation: finish-label-switch 0.26s ease;
}

.finish-practice-btn.is-pulse {
  animation: finish-btn-pulse 0.26s ease;
}

@keyframes finish-label-switch {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  45% {
    opacity: 0;
    transform: scale(0.96);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes finish-btn-pulse {
  0% {
    transform: scale(1);
  }

  55% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes start-button-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  45% {
    transform: scale(1.1);
    box-shadow: 0 0 18px rgba(232, 213, 183, 0.85);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }
}

/* Section 6 apply on door */
#section-apply .page-frame {
  display: flex;
  flex-direction: column;
}

.apply-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.2vw, 28px);
  align-items: center;
}

.apply-title {
  margin: 0 0 26px;
  color: var(--text-primary);
  font-size: clamp(32px, 2.5vw, 36px);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.result-paper-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.red-paper-composite {
  width: min(100%, 610px);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  transform: none;
  transform-origin: center center;
}

.result-download-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#download-fu.soft-btn {
  padding: 10px 22px;
  border-radius: 999px;
  background: #e6d3b3;
  color: var(--btn-text);
  font-weight: 600;
  border: 1px solid rgba(119, 45, 29, 0.36);
}

#download-fu.soft-btn:hover {
  background: #eddcbf;
  transform: translateY(-1px) scale(1.03);
}

.red-paper-img,
.fu-paper-bg {
  width: 100%;
  object-fit: contain;
}

.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.paper-seal {
  position: absolute;
  width: min(22%, 84px);
  right: 6%;
  bottom: 6%;
  object-fit: contain;
  opacity: 0.82;
}

.door-scene-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.door-scene {
  position: relative;
  width: min(100%, 700px);
  min-height: 510px;
  transform: translateX(44px);
}

.door {
  position: relative;
  width: min(86%, 520px);
  margin-left: auto;
  margin-right: 14px;
  z-index: 1;
  object-fit: contain;
}

.fu-paper {
  position: absolute;
  left: 55.6%;
  top: 34.8%;
  width: 164px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#section-apply.visible .fu-paper {
  animation: fuPaperSlideIn 0.9s ease-out both;
}

@keyframes fuPaperSlideIn {
  from {
    opacity: 0;
    transform: translate(calc(-50% - 120px), -50%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.fu-paper.visible {
  opacity: 1;
}

.girl {
  position: absolute;
  right: 150px;
  bottom: 0;
  width: min(80%, 470px);
  transform: translateX(-32px) scale(1.1);
  transform-origin: bottom right;
  z-index: 3;
  object-fit: contain;
}

#section-apply.visible .girl {
  animation: girlSlideIn 0.9s ease-out both;
}

@keyframes girlSlideIn {
  from {
    transform: translateX(-180px) scale(1.1);
  }

  to {
    transform: translateX(-32px) scale(1.1);
  }
}

.apply-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.apply-actions .soft-btn {
  width: 154px;
  min-height: 40px;
  padding: 10px 22px;
  border-radius: 18px;
  font-size: var(--type-btn);
  border: 1px solid rgba(122, 84, 54, 0.45);
  background: #f1dfbf;
  color: var(--btn-text);
}

/* Section 7 certificate */
.section-certificate {
  background: url("img/full background.jpg") center center / cover no-repeat;
}

.section-certificate .page-frame {
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 14px 24px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-layout {
  width: min(1200px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.certificate-controls {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  padding: 14px 16px 12px;
  border-radius: 18px;
  background: rgba(142, 60, 51, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(39, 10, 8, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.certificate-controls label {
  color: var(--text-primary);
  font-size: clamp(22px, 1.8vw, 24px);
}

.name-row {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#name-input {
  min-width: 220px;
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(155, 76, 56, 0.4);
  padding: 10px 15px;
  background: rgba(255, 245, 232, 0.95);
  color: #5c3a21;
  font-family: inherit;
  font-size: clamp(22px, 1.8vw, 24px);
}

#name-input::placeholder {
  font-size: clamp(22px, 1.8vw, 24px);
  color: rgba(92, 58, 33, 0.6);
}

.certificate-message {
  min-height: 24px;
  margin: 2px 0 0;
  color: var(--text-secondary);
  width: 100%;
  text-align: center;
  font-size: clamp(19px, 1.5vw, 21px);
}

.certificate-controls .soft-btn {
  min-height: 34px;
  padding: 7px 16px;
  font-size: clamp(18px, 1.35vw, 20px);
}

.certificate-stage {
  width: min(1040px, 100%);
  max-height: calc(100vh - 240px);
  position: relative;
  margin: -2px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-image {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.certificate-overlay {
  position: absolute;
  left: 50%;
  top: 41%;
  transform: translate(-50%, -50%);
  width: min(76%, 640px);
  text-align: center;
}

.certificate-subtitle {
  margin: 0;
  text-align: center;
  font-size: var(--type-body);
  color: #5c3a21;
  font-weight: 600;
}

.certificate-name {
  margin: 8px 0 22px 0;
  text-align: center;
  color: #5c3a21;
  font-size: clamp(1.78rem, 2.45vw, 2.1rem);
  font-family: "EB Garamond", Georgia, serif;
  letter-spacing: 0.05em;
  line-height: 1.08;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform: translateY(-3px);
}

.certificate-text {
  margin: 0;
  color: #5c3a21;
  font-size: var(--type-support);
  line-height: 1.5;
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 1100px) {
  .page,
  .story-page {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
  }

  .content,
  .page-frame {
    width: min(1200px, 100%);
    height: 100%;
    padding: 56px 42px;
  }

  .meaning-layout,
  .stroke-teaching-layout,
  .practice-layout,
  .apply-layout {
    grid-template-columns: 1fr;
  }

  .meaning-girl {
    margin: 0 auto;
    width: min(72%, 300px);
  }

  .meaning-text,
  .quiz-question {
    width: 100%;
    text-align: center;
  }

  .lantern-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .lantern-option {
    width: min(62%, 280px);
  }

  .stroke-video-wrap {
    max-width: 560px;
  }

  .stroke-video-actions {
    justify-content: flex-start;
  }

  .practice-feedback {
    justify-content: center;
    align-items: center;
    padding: 0;
    min-height: auto;
  }

  .practice-girl-block {
    width: min(78vw, 360px);
    transform: none;
  }

  .practice-girl-wrap {
    height: 330px;
  }

  .paper-area,
  .writing-board {
    width: min(90vw, 560px);
  }

  .practice-stage {
    align-items: center;
    transform: translate(6px, -6px);
  }

  .practice-message {
    margin: 0;
    text-align: center;
    font-size: clamp(1.08rem, 2.6vw, 1.28rem);
    position: absolute;
    left: 48%;
    bottom: calc(100% + 12px);
    max-width: 92%;
    width: min(90vw, 320px);
    transform: translate(-54%, 18px);
  }

  .practice-message.is-ready {
    font-size: clamp(1rem, 2.4vw, 1.16rem);
    line-height: 1.34;
  }

  .practice-message.is-almost,
  .practice-message.is-ready,
  .practice-message.is-other {
    left: 48%;
    bottom: calc(100% + 12px);
    transform: translate(-54%, 18px);
  }

  .practice-girl {
    width: 100%;
    height: 100%;
    object-position: left bottom;
    transform-origin: left bottom;
    transform: translate3d(0, 0, 0) scale(1);
  }

  .practice-girl.girl-state-1,
  .practice-girl.girl-state-2,
  .practice-girl.girl-state-3 {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .prop-container,
  .ink {
    width: 104px;
    top: -18px;
    left: -152px;
    transform: scale(1.7);
  }

  .prop-brush,
  .brush {
    width: 148px;
    right: -52px;
    top: 52%;
    transform: translateY(-50%) scale(1.2);
  }

  .prop-zhen {
    width: 92px;
    left: 44.8%;
    top: -1.8%;
    transform: translate(-50%, -50%) scale(4.8);
  }

  .practice-actions {
    width: min(90vw, 560px);
    margin-top: 20px;
    gap: 14px;
  }

  .practice-actions .soft-btn {
    min-height: 42px;
    padding: 9px 26px;
  }

  .door-scene {
    width: min(100%, 660px);
    min-height: 480px;
    transform: translateX(34px);
  }

  .door {
    width: min(84%, 480px);
    margin-right: 10px;
  }

  .fu-paper {
    left: 53.6%;
    top: 34.8%;
    width: 146px;
    transform: translate(-50%, -50%);
  }

  #section-apply.visible .fu-paper {
    animation: fuPaperSlideInMobile 0.9s ease-out both;
  }

  @keyframes fuPaperSlideInMobile {
    from {
      opacity: 0;
      transform: translate(calc(-50% - 100px), -50%);
    }

    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }

  .girl {
    right: 135px;
    bottom: 0;
    width: min(78%, 410px);
    transform: translateX(-24px) scale(1.08);
  }

  #section-apply.visible .girl {
    animation: girlSlideInMobile 0.9s ease-out both;
  }

  @keyframes girlSlideInMobile {
    from {
      transform: translateX(-160px) scale(1.08);
    }

    to {
      transform: translateX(-24px) scale(1.08);
    }
  }

  .red-paper-composite {
    width: min(100%, 560px);
  }

  .section-certificate .page-frame {
    padding: 12px 14px;
  }

  .certificate-layout {
    gap: 0;
  }

  .certificate-controls {
    width: min(920px, 100%);
    max-height: calc(100vh - 28px);
    padding: 12px 12px 10px;
  }

  .certificate-stage {
    width: min(960px, 100%);
    max-height: calc(100vh - 236px);
  }
}

@media (max-width: 760px) {
  .content,
  .page-frame {
    height: 100%;
    padding: 44px 22px;
  }

  .intro-fu {
    width: min(86%, 560px);
  }

  .name-row {
    flex-direction: column;
  }

  #name-input {
    width: 100%;
  }

  .section-certificate .page-frame {
    padding: 10px 8px;
  }

  .certificate-controls {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 10px 8px 8px;
  }

  .certificate-stage {
    width: 100%;
    max-height: calc(100vh - 218px);
  }
}

/* ========== Floating Instrument Music Control ========== */
.instrument-player-btn {
  position: fixed;
  top: clamp(8px, 1.6vh, 18px);
  right: clamp(16px, 2.6vw, 30px);
  z-index: 999;
  width: clamp(98px, 9.2vw, 138px);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  animation: instrumentFloat 5.6s ease-in-out infinite;
  transition: transform 0.24s ease, filter 0.24s ease, opacity 0.24s ease;
  opacity: 0.92;
}

.instrument-player-btn:hover {
  transform: scale(1.04);
}

.instrument-player-btn:active {
  transform: scale(0.98);
}

.instrument-player-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.32));
  user-select: none;
  -webkit-user-drag: none;
}

.instrument-player-btn.is-playing {
  filter: brightness(1.08);
  opacity: 1;
}

.instrument-player-btn:not(.is-playing) {
  filter: grayscale(0.08) brightness(0.9);
  opacity: 0.86;
}

@keyframes instrumentFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

.stroke-why-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.stroke-why-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stroke-why-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.52);
  cursor: pointer;
}

.stroke-why-content {
  position: relative;
  z-index: 999;
  
  display: flex;
  align-items: center;
  justify-content: center;
}

.stroke-why-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 28px;
  cursor: pointer;
  
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  transform-origin: top right;
  z-index: 1000;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

.stroke-why-close:hover {
  color: #5c3a21;
  background: #d8c2a0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.stroke-why-close:active {
  background: #cfb693;
}

.stroke-why-image {
  max-width: min(90vw, 1080px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transform: scale(1.5);
}

/* Mobile layout refinement */
@media (max-width: 768px) {
  .page-wrap {
    height: 100dvh;
  }

  .page,
  .story-page {
    min-height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
  }

  .content,
  .page-frame {
    width: 100%;
    height: auto;
    min-height: 100%;
    padding: 18px 14px 22px;
    overflow: visible;
  }

  h1 {
    font-size: clamp(30px, 8vw, 38px);
  }

  h2 {
    font-size: clamp(25px, 6.8vw, 32px);
  }

  h3 {
    font-size: clamp(21px, 5.8vw, 26px);
  }

  .soft-btn {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 18px;
  }

  .intro-fu {
    width: min(94vw, 560px);
  }

  .meaning-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
  }

  .meaning-girl-wrap {
    justify-self: center;
  }

  .meaning-girl {
    width: min(78vw, 340px);
    margin: 0 auto;
  }

  .meaning-text {
    width: 100%;
    justify-self: center;
    text-align: left;
    padding: 14px 14px;
  }

  .meaning-en {
    font-size: clamp(24px, 6.2vw, 30px);
    line-height: 1.5;
  }

  .meaning-fr {
    margin-top: 12px;
    font-size: clamp(19px, 4.8vw, 23px);
    line-height: 1.5;
  }

  .quiz-wrap {
    padding-top: 6px;
  }

  .quiz-question {
    width: 100%;
    font-size: clamp(29px, 7.2vw, 36px);
    line-height: 1.28;
  }

  .quiz-subtitle,
  .quiz-feedback {
    font-size: clamp(18px, 4.8vw, 22px);
  }

  .lantern-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .lantern-option {
    width: min(88vw, 340px);
    min-width: 0;
  }

  .lantern-text {
    width: 74%;
    font-size: clamp(20px, 5vw, 24px);
    line-height: 1.25;
  }

  #section-strokes .stroke-teaching-layout {
    height: auto;
    min-height: 100%;
  }

  #section-strokes .stroke-title-wrap,
  #section-strokes .stroke-video-wrap {
    width: min(94vw, 640px);
  }

  #section-strokes .stroke-title {
    font-size: clamp(31px, 7.6vw, 39px);
  }

  #section-strokes .stroke-subtitle {
    font-size: clamp(18px, 4.9vw, 22px);
  }

  .stroke-why-trigger {
    width: 164px;
    height: 164px;
    left: -46px;
    top: -40px;
  }

  .stroke-hint {
    left: 8px;
    top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(42, 15, 10, 0.22);
  }

  .stroke-hint-text {
    font-size: 14px;
  }

  .stroke-hint-arrow {
    font-size: 15px;
  }

  #section-strokes .stroke-video-actions {
    width: 100%;
    margin-top: 14px;
    justify-content: center;
  }

  .stroke-video-actions .soft-btn {
    min-width: 128px;
  }

  #section-practice .page-frame {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 20px;
  }

  .practice-layout,
  .writing-section {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }

  .practice-feedback,
  .left-panel {
    align-items: center;
    justify-content: center;
    min-height: auto;
  }

  .practice-girl-block {
    width: min(84vw, 350px);
    transform: none;
  }

  .practice-girl-wrap {
    height: 260px;
    justify-content: center;
  }

  .practice-girl {
    object-position: center bottom;
  }

  .practice-message,
  .practice-message.is-almost,
  .practice-message.is-ready,
  .practice-message.is-other {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    margin: 0 0 10px;
    width: 100%;
    max-width: none;
    min-height: auto;
    text-align: center;
    font-size: clamp(20px, 5.3vw, 27px);
    line-height: 1.35;
  }

  .practice-stage {
    width: 100%;
    transform: none;
  }

  .paper-area,
  .writing-board {
    width: min(92vw, 460px);
  }

  .prop-zhen {
    width: 80px;
    left: 50%;
    top: -1.4%;
    transform: translate(-50%, -50%) scale(4.6);
  }

  .prop-container,
  .ink {
    width: 86px;
    top: -14px;
    left: -98px;
    transform: translateY(18px) scale(1.45);
  }

  .prop-brush,
  .brush {
    width: 124px;
    right: -28px;
    top: 52%;
    transform: translate(8px, -50%) scale(1.02);
  }

  .practice-actions {
    width: min(92vw, 460px);
    margin-top: 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .practice-actions .soft-btn {
    flex: 1 1 140px;
    min-height: 48px;
    padding: 10px 14px;
  }

  #section-apply .page-frame {
    padding-bottom: 26px;
  }

  .apply-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .apply-title {
    margin-bottom: 14px;
    font-size: clamp(24px, 6vw, 32px);
  }

  .red-paper-composite {
    width: min(92vw, 460px);
  }

  .result-download-wrap {
    margin-top: 12px;
  }

  .door-scene {
    width: min(92vw, 460px);
    min-height: 320px;
    transform: none;
    margin: 0 auto;
  }

  .door {
    width: min(88%, 360px);
    margin: 0 auto;
  }

  .fu-paper {
    left: 50.5%;
    top: 36%;
    width: clamp(106px, 26vw, 136px);
  }

  .girl {
    right: 6%;
    bottom: 0;
    width: min(58vw, 250px);
    transform: translateX(0) scale(1);
  }

  #section-apply.visible .girl {
    animation: girlSlideInCompact 0.8s ease-out both;
  }

  @keyframes girlSlideInCompact {
    from {
      transform: translateX(-90px) scale(1);
    }

    to {
      transform: translateX(0) scale(1);
    }
  }

  .apply-actions {
    margin-top: 10px;
  }

  .apply-actions .soft-btn,
  #download-fu.soft-btn {
    min-height: 46px;
    padding: 10px 16px;
  }

  .section-certificate .page-frame {
    padding: 12px 10px;
  }

  .certificate-controls {
    width: 100%;
    max-height: none;
    padding: 12px 10px;
    overflow: visible;
  }

  .certificate-controls label {
    font-size: clamp(18px, 4.8vw, 22px);
  }

  .name-row {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  #name-input {
    width: 100%;
    min-width: 0;
    font-size: 18px;
  }

  #name-input::placeholder {
    font-size: 18px;
  }

  .certificate-controls .soft-btn {
    width: 100%;
    min-height: 46px;
    font-size: 18px;
  }

  .certificate-message {
    font-size: 16px;
  }

  .certificate-stage {
    width: 100%;
    max-height: 56vh;
    margin-top: 2px;
  }

  .certificate-overlay {
    top: 43%;
    width: min(82%, 620px);
  }

  .certificate-name {
    margin: 6px 0 14px;
    font-size: clamp(1.35rem, 5.3vw, 1.95rem);
  }

  .certificate-subtitle {
    font-size: clamp(15px, 4vw, 18px);
  }

  .certificate-text {
    font-size: clamp(13px, 3.4vw, 16px);
  }

  .instrument-player-btn {
    top: 10px;
    right: 10px;
    width: clamp(78px, 20vw, 102px);
    z-index: 1001;
  }

  .stroke-why-content {
    width: min(94vw, 640px);
  }

  .stroke-why-image {
    transform: none;
    width: 100%;
    height: auto;
    max-width: 94vw;
    max-height: 82vh;
  }

  .stroke-why-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .content,
  .page-frame {
    padding: 14px 10px 18px;
  }

  .meaning-text {
    padding: 12px;
  }

  .meaning-en {
    font-size: clamp(22px, 6.1vw, 27px);
  }

  .meaning-fr {
    font-size: clamp(17px, 4.6vw, 21px);
  }

  .lantern-option {
    width: min(90vw, 320px);
  }

  .stroke-why-trigger {
    width: 138px;
    height: 138px;
    left: -38px;
    top: -34px;
  }

  .practice-girl-wrap {
    height: 236px;
  }

  .paper-area,
  .writing-board,
  .practice-actions,
  .red-paper-composite,
  .door-scene {
    width: min(94vw, 420px);
  }

  .prop-container,
  .ink {
    left: -74px;
    width: 78px;
    transform: translateY(14px) scale(1.2);
  }

  .prop-brush,
  .brush {
    width: 108px;
    right: -14px;
    transform: translate(0, -50%) scale(0.95);
  }

  .practice-actions .soft-btn {
    flex-basis: 100%;
  }

  .door-scene {
    min-height: 292px;
  }

  .girl {
    width: min(56vw, 220px);
  }

  .certificate-stage {
    max-height: 51vh;
  }

  .instrument-player-btn {
    width: 76px;
    right: 8px;
  }
}

@media (max-width: 390px) {
  .quiz-question {
    font-size: clamp(26px, 7.4vw, 30px);
  }

  .practice-message,
  .practice-message.is-almost,
  .practice-message.is-ready,
  .practice-message.is-other {
    font-size: clamp(19px, 5.4vw, 24px);
  }

  .door-scene {
    min-height: 278px;
  }

  .fu-paper {
    top: 36.5%;
    width: clamp(96px, 24vw, 122px);
  }

  .certificate-name {
    font-size: clamp(1.25rem, 5.1vw, 1.7rem);
  }
}

@media (max-width: 950px) and (orientation: landscape) and (max-height: 540px) {
  .page-wrap {
    scroll-snap-type: y proximity;
  }

  .page,
  .story-page {
    height: auto;
    min-height: 100dvh;
  }

  .content,
  .page-frame {
    padding: 10px 14px 14px;
  }

  .intro-fu {
    width: min(64vh, 520px);
    max-height: 86dvh;
  }

  .meaning-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 12px;
    align-items: center;
  }

  .meaning-girl {
    width: min(44vh, 280px);
  }

  .meaning-en {
    font-size: clamp(20px, 3.1vw, 27px);
    line-height: 1.4;
  }

  .meaning-fr {
    font-size: clamp(16px, 2.5vw, 21px);
    line-height: 1.4;
  }

  .quiz-question {
    font-size: clamp(24px, 3.8vw, 32px);
  }

  .quiz-subtitle,
  .quiz-feedback {
    font-size: clamp(16px, 2.5vw, 21px);
  }

  .lantern-row {
    flex-direction: row;
    gap: 8px;
  }

  .lantern-option {
    width: min(28vw, 250px);
    min-width: 150px;
  }

  #section-strokes .stroke-title {
    font-size: clamp(26px, 3.9vw, 34px);
  }

  #section-strokes .stroke-subtitle {
    font-size: clamp(15px, 2.3vw, 19px);
  }

  #section-strokes .stroke-video-wrap {
    width: min(62vh, 560px);
  }

  .stroke-why-trigger {
    width: 126px;
    height: 126px;
    left: -38px;
    top: -30px;
  }

  .stroke-hint {
    top: 6px;
    left: 8px;
  }

  .practice-layout,
  .writing-section {
    grid-template-columns: 0.84fr 1.16fr;
    gap: 10px;
    align-items: center;
  }

  .practice-girl-block {
    width: min(42vh, 240px);
  }

  .practice-girl-wrap {
    height: min(48vh, 250px);
  }

  .practice-message,
  .practice-message.is-almost,
  .practice-message.is-ready,
  .practice-message.is-other {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    margin: 0 0 8px;
    font-size: clamp(16px, 2.3vw, 21px);
    line-height: 1.3;
  }

  .practice-stage {
    transform: none;
  }

  .paper-area,
  .writing-board {
    width: min(58vh, 390px);
  }

  .prop-container,
  .ink {
    left: -68px;
    width: 70px;
    transform: translateY(10px) scale(1.05);
  }

  .prop-brush,
  .brush {
    width: 96px;
    right: -10px;
    transform: translate(0, -50%) scale(0.88);
  }

  .practice-actions {
    width: min(58vh, 390px);
    margin-top: 10px;
    gap: 8px;
  }

  .practice-actions .soft-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 16px;
  }

  .apply-layout {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .apply-title {
    margin-bottom: 8px;
    font-size: clamp(21px, 3vw, 28px);
  }

  .red-paper-composite {
    width: min(50vh, 360px);
  }

  .door-scene {
    width: min(56vh, 400px);
    min-height: 250px;
  }

  .door {
    width: min(88%, 320px);
  }

  .fu-paper {
    width: clamp(88px, 14vh, 122px);
    top: 36.2%;
  }

  .girl {
    width: min(31vh, 180px);
    right: 4%;
  }

  .section-certificate .page-frame {
    padding: 8px 10px;
  }

  .certificate-controls {
    padding: 8px 10px;
    gap: 6px;
  }

  .name-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 6px;
    width: 100%;
    align-items: center;
  }

  #name-input {
    min-width: 0;
    font-size: 16px;
    padding: 8px 12px;
  }

  .certificate-controls .soft-btn {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 15px;
  }

  .certificate-stage {
    max-height: 46vh;
  }

  .certificate-overlay {
    top: 43%;
  }

  .certificate-name {
    margin: 2px 0 8px;
    font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  }

  .instrument-player-btn {
    width: clamp(62px, 11vh, 84px);
    top: 6px;
    right: 8px;
  }

  .stroke-why-image {
    max-height: 88dvh;
  }
}

@media (max-width: 768px) {
  .page,
  .story-page {
    min-height: 100svh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .content,
  .page-frame {
    width: 100%;
    min-height: 100%;
    height: auto;
    padding: 24px 16px;
    overflow: visible;
  }

  h1,
  .stroke-title,
  .quiz-question,
  .apply-title {
    font-size: clamp(22px, 6.4vw, 26px);
    line-height: 1.32;
  }

  h2,
  h3,
  .meaning-en,
  .certificate-controls label {
    font-size: clamp(20px, 5.8vw, 24px);
    line-height: 1.4;
  }

  p,
  .meaning-fr,
  .quiz-subtitle,
  .quiz-feedback,
  .practice-message,
  .certificate-message,
  .certificate-text,
  .certificate-subtitle {
    font-size: clamp(14px, 3.9vw, 16px);
    line-height: 1.6;
  }

  #section-meaning .meaning-layout,
  #section-strokes .stroke-teaching-layout,
  #section-practice .practice-layout,
  #section-practice .writing-section,
  #section-apply .apply-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .intro-inner,
  .meaning-girl-wrap,
  .quiz-wrap,
  .stroke-video-panel,
  .result-paper-wrap,
  .door-scene-wrap,
  .certificate-layout {
    width: 100%;
    margin-top: 24px;
    margin-bottom: 24px;
  }

  .intro-fu {
    width: min(78vw, 380px);
    margin: 0 auto;
  }

  .meaning-girl,
  .practice-girl {
    width: min(68vw, 290px);
    margin: 0 auto;
    object-fit: contain;
    object-position: center bottom;
  }

  .meaning-text {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 16px;
    text-align: left;
  }

  .lantern-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .lantern-option {
    width: min(80vw, 320px);
    min-width: 0;
  }

  .lantern-image {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  #section-strokes .stroke-title-wrap,
  #section-strokes .stroke-video-wrap {
    width: min(92vw, 540px);
  }

  .stroke-why-trigger {
    width: 138px;
    height: 138px;
    left: -30px;
    top: -30px;
  }

  .stroke-hint {
    top: 6px;
    left: 8px;
  }

  #section-strokes .stroke-video-actions,
  .practice-actions,
  .apply-actions,
  .result-download-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
  }

  .stroke-video-actions .soft-btn,
  .practice-actions .soft-btn,
  .apply-actions .soft-btn,
  #download-fu.soft-btn {
    width: min(90%, 360px);
    min-height: 48px;
    padding: 12px 16px;
  }

  .practice-feedback,
  .left-panel,
  .practice-girl-block,
  .practice-stage {
    width: 100%;
    max-width: 560px;
    transform: none;
    margin: 0 auto;
  }

  .practice-girl-wrap {
    height: auto;
    min-height: 210px;
    justify-content: center;
  }

  .practice-message,
  .practice-message.is-almost,
  .practice-message.is-ready,
  .practice-message.is-other {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 520px;
    min-height: 0;
    margin: 16px auto 0;
    text-align: center;
    padding: 0 8px;
  }

  .paper-area,
  .writing-board {
    width: min(78vw, 360px);
    margin: 0 auto;
  }

  .prop-zhen {
    transform: translate(-50%, -50%) scale(4.2);
  }

  .prop-container,
  .ink {
    width: 78px;
    left: -70px;
    top: -14px;
    transform: translateY(12px) scale(1.1);
  }

  .prop-brush,
  .brush {
    width: 104px;
    right: -18px;
    top: 52%;
    transform: translate(0, -50%) scale(0.92);
  }

  .red-paper-composite {
    width: min(78vw, 360px);
    margin: 0 auto;
  }

  .door-scene {
    width: min(78vw, 360px);
    min-height: 300px;
    transform: none;
    margin: 0 auto;
  }

  .door {
    width: min(70vw, 300px);
    margin: 0 auto;
  }

  .fu-paper {
    width: min(34vw, 122px);
    left: 50.2%;
    top: 36.2%;
  }

  .girl {
    width: min(66vw, 250px);
    right: 50%;
    transform: translateX(50%) scale(1);
    bottom: -6px;
  }

  .section-certificate .page-frame {
    padding: 24px 16px;
  }

  .certificate-controls {
    width: min(92vw, 560px);
    max-height: none;
    padding: 18px 16px;
    gap: 12px;
  }

  .name-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  #name-input,
  .certificate-controls .soft-btn {
    width: min(90%, 360px);
    margin: 0 auto;
  }

  #name-input {
    min-width: 0;
    font-size: 16px;
    padding: 12px 14px;
  }

  .certificate-controls .soft-btn {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
  }

  .certificate-stage {
    width: 90%;
    max-height: 52vh;
    margin: 8px auto 0;
  }

  .certificate-image {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .stroke-why-content {
    width: min(94vw, 620px);
  }

  .stroke-why-image {
    width: 100%;
    max-width: 92vw;
    max-height: 78vh;
    transform: none;
  }

  .stroke-why-close {
    top: 10px;
    right: 10px;
  }

  .instrument-player-btn {
    width: 80px;
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 480px) {
  .content,
  .page-frame {
    padding: 20px 12px;
  }

  .intro-inner,
  .meaning-girl-wrap,
  .quiz-wrap,
  .stroke-video-panel,
  .result-paper-wrap,
  .door-scene-wrap,
  .certificate-layout {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .meaning-girl,
  .practice-girl {
    width: min(66vw, 260px);
  }

  .lantern-option,
  .paper-area,
  .writing-board,
  .red-paper-composite,
  .door-scene {
    width: min(82vw, 320px);
  }

  .door {
    width: min(68vw, 260px);
  }

  .stroke-video-actions .soft-btn,
  .practice-actions .soft-btn,
  .apply-actions .soft-btn,
  #download-fu.soft-btn,
  #name-input,
  .certificate-controls .soft-btn {
    width: min(92%, 320px);
  }

  .certificate-stage {
    width: 90%;
    max-height: 46vh;
  }

  .certificate-name {
    font-size: clamp(1.2rem, 5.8vw, 1.6rem);
  }

  .instrument-player-btn {
    width: 72px;
  }
}

/* Mobile refinement v2: spacing, scale, hierarchy */
@media (max-width: 768px) {
  .content,
  .page-frame {
    padding: 24px 16px;
  }

  .page-frame > * {
    margin-top: 24px;
    margin-bottom: 28px;
  }

  .meaning-layout,
  .stroke-teaching-layout,
  .practice-layout,
  .writing-section,
  .apply-layout,
  .certificate-layout,
  .name-row,
  .practice-actions,
  .apply-actions,
  .stroke-video-actions,
  .result-download-wrap,
  .lantern-row {
    gap: 14px;
  }

  .meaning-text,
  .quiz-wrap,
  .stroke-title-wrap,
  .certificate-controls,
  .practice-feedback,
  .practice-stage,
  .result-paper-wrap,
  .door-scene-wrap {
    width: 100%;
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
  }

  .meaning-text,
  .certificate-controls {
    padding: 16px;
  }

  .meaning-en,
  .meaning-fr,
  .quiz-subtitle,
  .quiz-feedback,
  .practice-message,
  .certificate-message,
  .certificate-text {
    line-height: 1.6;
  }

  .intro-fu,
  .red-paper-composite,
  .paper-area,
  .writing-board {
    width: min(70vw, 360px);
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
  }

  .meaning-girl,
  .practice-girl,
  .girl {
    width: min(60vw, 260px);
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
  }

  .lantern-option {
    width: min(60vw, 280px);
    max-width: 60%;
  }

  .door {
    width: min(65vw, 290px);
    max-width: 65%;
    margin-left: auto;
    margin-right: auto;
  }

  .certificate-stage {
    width: 90%;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .certificate-image {
    width: 100%;
    max-width: 100%;
  }

  .practice-girl-wrap {
    min-height: 190px;
  }

  .practice-stage {
    margin-top: 8px;
  }

  .practice-actions,
  .apply-actions,
  .stroke-video-actions,
  .result-download-wrap,
  .name-row {
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
  }

  .practice-actions .soft-btn,
  .apply-actions .soft-btn,
  .stroke-video-actions .soft-btn,
  #download-fu.soft-btn,
  .certificate-controls .soft-btn,
  #name-input {
    width: min(88%, 340px);
    margin-left: auto;
    margin-right: auto;
  }

  .practice-actions .soft-btn,
  .apply-actions .soft-btn,
  .stroke-video-actions .soft-btn,
  #download-fu.soft-btn,
  .certificate-controls .soft-btn {
    min-height: 48px;
    padding: 12px 16px;
  }

  #name-input {
    padding: 12px 14px;
    font-size: 16px;
  }

  .door-scene {
    width: 100%;
    min-height: 280px;
    margin-top: 6px;
  }

  .fu-paper {
    width: min(30vw, 118px);
  }

  .girl {
    right: 50%;
    transform: translateX(50%) scale(1);
    bottom: -4px;
  }
}

@media (max-width: 480px) {
  .content,
  .page-frame {
    padding: 20px 12px;
  }

  .page-frame > * {
    margin-top: 20px;
    margin-bottom: 24px;
  }

  .meaning-layout,
  .stroke-teaching-layout,
  .practice-layout,
  .writing-section,
  .apply-layout,
  .certificate-layout,
  .name-row,
  .practice-actions,
  .apply-actions,
  .stroke-video-actions,
  .result-download-wrap,
  .lantern-row {
    gap: 12px;
  }

  .meaning-text,
  .quiz-wrap,
  .stroke-title-wrap,
  .certificate-controls,
  .practice-feedback,
  .practice-stage,
  .result-paper-wrap,
  .door-scene-wrap {
    max-width: 88%;
  }

  .intro-fu,
  .red-paper-composite,
  .paper-area,
  .writing-board {
    max-width: 74%;
  }

  .meaning-girl,
  .practice-girl,
  .girl {
    max-width: 62%;
  }

  .lantern-option {
    max-width: 62%;
  }

  .door {
    max-width: 66%;
  }

  .practice-actions .soft-btn,
  .apply-actions .soft-btn,
  .stroke-video-actions .soft-btn,
  #download-fu.soft-btn,
  .certificate-controls .soft-btn,
  #name-input {
    width: min(90%, 320px);
  }
}

/* Mobile-only fine tune: section 4 + section 5 */
@media (max-width: 768px) {
  /* Section 4: Follow the Strokes */
  #section-strokes .page-frame {
    padding-top: 16px;
  }

  #section-strokes .stroke-video-panel {
    gap: 0;
  }

  #section-strokes .stroke-title-wrap {
    margin: 0 auto 6px;
    width: min(92vw, 520px);
  }

  #section-strokes .stroke-title {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: clamp(26px, 7vw, 32px);
    line-height: 1.28;
  }

  #section-strokes .stroke-subtitle {
    margin: 0;
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.5;
  }

  #section-strokes .stroke-hint {
    display: none;
  }

  #section-strokes .stroke-video-wrap {
    width: min(92vw, 520px);
    margin-top: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  #section-strokes .stroke-why-trigger {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    padding: 0;
    transform: none;
    align-self: center;
  }

  #section-strokes .stroke-why-knot {
    width: min(44vw, 170px);
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  }

  #section-strokes #fuVideo {
    width: 100%;
    margin: 0;
  }

  #section-strokes .stroke-video-actions,
  #section-strokes .stroke-actions {
    margin-top: 14px;
    gap: 12px;
    justify-content: center;
  }

  #section-strokes .stroke-video-actions .soft-btn,
  #section-strokes .stroke-actions .soft-btn {
    min-height: 42px;
    padding: 9px 16px;
    width: min(82vw, 260px);
  }

  /* Section 5: Practice page */
  #section-practice .page-frame {
    padding-top: 14px;
    padding-bottom: 18px;
  }

  #section-practice .practice-layout,
  #section-practice .writing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  #section-practice .practice-feedback,
  #section-practice .left-panel {
    width: 100%;
    min-height: auto;
    align-items: center;
    justify-content: center;
  }

  #section-practice .practice-girl-block {
    width: min(62vw, 250px);
    transform: none;
  }

  #section-practice .practice-girl-wrap {
    height: min(36vw, 190px);
    min-height: 150px;
    justify-content: center;
  }

  #section-practice .practice-girl {
    width: 100%;
    height: 100%;
    object-position: center bottom;
  }

  #section-practice .practice-message,
  #section-practice .practice-message.is-almost,
  #section-practice .practice-message.is-ready,
  #section-practice .practice-message.is-other {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: min(86vw, 360px);
    max-width: 360px;
    margin: 8px auto 0;
    min-height: 0;
    text-align: center;
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.52;
  }

  #section-practice .practice-stage {
    width: 100%;
    transform: none;
    align-items: center;
    gap: 0;
  }

  #section-practice .paper-area,
  #section-practice .writing-board {
    width: min(84vw, 360px);
    margin: 8px auto 0;
  }

  #section-practice .prop-container,
  #section-practice .ink {
    width: 72px;
    left: -50px;
    top: 34%;
    transform: translateY(-50%) scale(1.02);
    z-index: 2;
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    width: 94px;
    right: -38px;
    top: 56%;
    transform: translateY(-50%) scale(0.9);
    z-index: 2;
  }

  #section-practice .practice-actions {
    width: min(84vw, 360px);
    margin-top: 16px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  #section-practice .practice-actions .soft-btn {
    width: 44%;
    min-width: 132px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 15px;
    border-radius: 999px;
  }
}

@media (max-width: 480px) {
  #section-strokes .stroke-title-wrap {
    margin-bottom: 4px;
  }

  #section-strokes .stroke-video-wrap {
    gap: 10px;
    margin-top: 8px;
  }

  #section-strokes .stroke-why-knot {
    width: min(46vw, 154px);
  }

  #section-practice .practice-girl-block {
    width: min(64vw, 220px);
  }

  #section-practice .practice-message,
  #section-practice .practice-message.is-almost,
  #section-practice .practice-message.is-ready,
  #section-practice .practice-message.is-other {
    width: min(88vw, 330px);
    font-size: clamp(14px, 4.1vw, 17px);
  }

  #section-practice .paper-area,
  #section-practice .writing-board,
  #section-practice .practice-actions {
    width: min(86vw, 330px);
  }

  #section-practice .prop-container,
  #section-practice .ink {
    width: 64px;
    left: -42px;
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    width: 84px;
    right: -32px;
  }

  #section-practice .practice-actions .soft-btn {
    width: 45%;
    min-width: 122px;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 14px;
  }
}

/* Mobile patch: restore Why button + practice final-state controls */
@media (max-width: 768px) {
  /* Section 4: make Why this order visible and clickable in title flow */
  #section-strokes .stroke-why-trigger {
    position: static;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 16px;
    padding: 0;
    opacity: 1;
    visibility: visible;
    z-index: 5;
    transform: none;
  }

  #section-strokes .stroke-why-knot {
    display: none;
  }

  #section-strokes .stroke-why-trigger::after {
    content: "Why this order?";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 225, 184, 0.6);
    background: rgba(125, 40, 27, 0.56);
    color: #f9ead2;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  }

  #section-strokes .stroke-video-wrap {
    margin-top: 14px;
    gap: 14px;
  }

  #section-strokes .stroke-video-actions {
    margin-top: 16px;
  }

  /* Section 5: stable hierarchy + larger paper + balanced ornaments */
  #section-practice .practice-layout,
  #section-practice .writing-section {
    gap: 12px;
  }

  #section-practice .paper-area,
  #section-practice .writing-board {
    width: min(90vw, 410px);
    margin: 10px auto 0;
  }

  #section-practice .prop-container,
  #section-practice .ink {
    left: -62px;
    top: 34%;
    transform: translateY(-50%) scale(1.02);
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    right: -48px;
    top: 56%;
    transform: translateY(-50%) scale(0.9);
  }

  #section-practice .practice-actions {
    width: min(90vw, 410px);
    margin-top: 18px;
    gap: 12px;
  }

  #section-practice .practice-actions .soft-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 15px;
  }

  #section-practice .practice-actions.is-finished {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
  }

  #section-practice .practice-actions.is-finished .soft-btn {
    width: min(80vw, 300px);
  }
}

@media (max-width: 480px) {
  #section-strokes .stroke-why-trigger {
    margin-top: 6px;
    margin-bottom: 14px;
  }

  #section-strokes .stroke-why-trigger::after {
    min-height: 32px;
    padding: 7px 12px;
    font-size: 13px;
  }

  #section-practice .paper-area,
  #section-practice .writing-board,
  #section-practice .practice-actions {
    width: min(88vw, 360px);
  }

  #section-practice .prop-container,
  #section-practice .ink {
    left: -52px;
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    right: -42px;
  }

  #section-practice .practice-actions.is-finished .soft-btn {
    width: min(82vw, 286px);
    min-height: 38px;
    font-size: 14px;
  }
}

/* Page 5 mobile-only final refinement */
@media (max-width: 768px) {
  #section-practice .practice-feedback,
  #section-practice .left-panel,
  #section-practice .practice-girl-block,
  #section-practice .practice-stage,
  #section-practice .practice-actions {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  #section-practice .practice-message,
  #section-practice .practice-message.is-almost,
  #section-practice .practice-message.is-ready,
  #section-practice .practice-message.is-other {
    width: min(88vw, 380px);
    max-width: 380px;
    margin: 10px auto 0;
    text-align: center;
    line-height: 1.6;
  }

  #section-practice .paper-area,
  #section-practice .writing-board {
    width: min(90vw, 430px);
    margin: 12px auto 0;
  }

  #section-practice .prop-container,
  #section-practice .ink {
    left: -74px;
    top: 34%;
    transform: translateY(-50%) scale(1.02);
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    right: -58px;
    top: 56%;
    transform: translateY(-50%) scale(0.9);
  }

  #section-practice .practice-actions {
    width: min(90vw, 430px);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
  }

  #section-practice .practice-actions .soft-btn {
    width: 74%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1;
    font-size: 15px;
  }

  #section-practice .practice-actions.is-finished .soft-btn {
    width: 74%;
  }
}

@media (max-width: 480px) {
  #section-practice .practice-message,
  #section-practice .practice-message.is-almost,
  #section-practice .practice-message.is-ready,
  #section-practice .practice-message.is-other {
    width: min(90vw, 340px);
    font-size: clamp(14px, 4vw, 17px);
  }

  #section-practice .paper-area,
  #section-practice .writing-board,
  #section-practice .practice-actions {
    width: min(92vw, 360px);
  }

  #section-practice .prop-container,
  #section-practice .ink {
    left: -62px;
  }

  #section-practice .prop-brush,
  #section-practice .brush {
    right: -50px;
  }

  #section-practice .practice-actions .soft-btn,
  #section-practice .practice-actions.is-finished .soft-btn {
    width: 76%;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 14px;
  }
}

/* Final mobile unify: section 5 buttons match certificate button language */
@media (max-width: 768px) {
  #section-practice .practice-actions {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  #section-practice .practice-actions .soft-btn,
  #section-practice .practice-actions.is-finished .soft-btn,
  #section-practice #start-practice,
  #section-practice #finish-practice {
    width: min(72%, 320px);
    min-width: 0;
    height: auto;
    min-height: 46px;
    padding: 10px 14px;
    margin: 0 auto;

    border-radius: 999px;
    border: 1px solid rgba(119, 45, 29, 0.36);
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: none;
    opacity: 1;

    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #section-practice .practice-actions .soft-btn:hover,
  #section-practice #start-practice:hover,
  #section-practice #finish-practice:hover {
    background: #d8c2a0;
    transform: translateY(-1px);
    filter: none;
  }

  #section-practice .practice-actions .soft-btn:active,
  #section-practice #start-practice:active,
  #section-practice #finish-practice:active {
    transform: scale(0.98);
  }

  #section-practice .practice-actions .soft-btn:disabled,
  #section-practice #finish-practice:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  #section-practice .practice-actions {
    width: 100%;
    margin-top: 20px;
    gap: 14px;
    align-items: center;
  }

  #section-practice .practice-actions .soft-btn,
  #section-practice .practice-actions.is-finished .soft-btn,
  #section-practice #start-practice,
  #section-practice #finish-practice {
    width: min(90%, 360px);
    min-width: 0;
    height: auto;
    min-height: 48px;
    padding: 12px 16px;
    margin: 0 auto;

    border-radius: 999px;
    border: 1px solid rgba(119, 45, 29, 0.36);
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: none;
    opacity: 1;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    font-size: 16px;
    font-weight: 600;
  }

  #section-practice .practice-actions .soft-btn:hover,
  #section-practice #start-practice:hover,
  #section-practice #finish-practice:hover {
    background: #d8c2a0;
    transform: translateY(-1px);
    filter: none;
  }

  #section-practice .practice-actions .soft-btn:active,
  #section-practice #start-practice:active,
  #section-practice #finish-practice:active {
    transform: scale(0.98);
  }

  #section-practice .practice-actions .soft-btn:disabled,
  #section-practice #finish-practice:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
    box-shadow: none;
  }
}
