
/* =========================================================
   GATE 100 CHALLENGE — SHADOWING 100
   challenge-shadowing.css
   ========================================================= */

:root {
  --shadowing-primary: #5b5cf0;
  --shadowing-primary-dark: #4647d8;
  --shadowing-primary-soft: #eeeeff;
  --shadowing-primary-pale: #f7f7ff;
  --shadowing-text: #111827;
  --shadowing-muted: #758096;
  --shadowing-line: #e6e9f2;
  --shadowing-panel: rgba(255, 255, 255, 0.96);
  --shadowing-success: #16a36a;
  --shadowing-danger: #ef5a63;
  --shadowing-gold: #f5b82e;
  --shadowing-radius-xl: 30px;
  --shadowing-radius-lg: 22px;
  --shadowing-radius-md: 16px;
  --shadowing-shadow: 0 24px 70px rgba(34, 42, 76, 0.10);
  --shadowing-shadow-soft: 0 12px 35px rgba(34, 42, 76, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f7f8fc;
}

body.shadowing-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--shadowing-text);
  background:
    radial-gradient(circle at 50% -10%, rgba(91, 92, 240, 0.10), transparent 38%),
    linear-gradient(180deg, #fbfbff 0%, #f6f7fb 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(91, 92, 240, 0.24);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   BACKGROUND
   ========================================================= */

.shadowing-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.shadowing-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.shadowing-bg-orb-1 {
  width: 420px;
  height: 420px;
  top: 5%;
  right: -170px;
  background: rgba(91, 92, 240, 0.07);
}

.shadowing-bg-orb-2 {
  width: 300px;
  height: 300px;
  left: -150px;
  top: 44%;
  background: rgba(139, 140, 255, 0.06);
}

.shadowing-bg-orb-3 {
  width: 520px;
  height: 520px;
  left: 38%;
  bottom: -360px;
  background: rgba(91, 92, 240, 0.045);
}

/* =========================================================
   HEADER
   ========================================================= */

.shadowing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(222, 226, 238, 0.85);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.shadowing-back,
.shadowing-hall-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 42px;
  color: #4b556b;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.shadowing-back:hover,
.shadowing-hall-link:hover {
  color: var(--shadowing-primary);
}

.shadowing-hall-link {
  justify-self: end;
}

.shadowing-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shadowing-header-title strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.shadowing-header-label {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--shadowing-primary);
  background: var(--shadowing-primary-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

/* =========================================================
   APP / SCREEN
   ========================================================= */

.shadowing-app {
  position: relative;
  z-index: 2;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 46px 24px 80px;
}

.shadowing-screen {
  display: none;
  width: 100%;
  animation: shadowingScreenIn 0.36s ease both;
}

.shadowing-screen.is-active {
  display: block;
}

@keyframes shadowingScreenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shadowing-panel,
.shadowing-stage-panel,
.shadow-ready-panel,
.shadowing-result-panel,
.shadowing-intro-card {
  width: min(100%, 760px);
  margin: 0 auto;
  border: 1px solid rgba(226, 229, 240, 0.95);
  border-radius: var(--shadowing-radius-xl);
  background: var(--shadowing-panel);
  box-shadow: var(--shadowing-shadow);
}

.shadowing-panel,
.shadowing-stage-panel,
.shadow-ready-panel,
.shadowing-result-panel {
  padding: 42px;
}

/* =========================================================
   INTRO
   ========================================================= */

.shadowing-intro-card {
  position: relative;
  overflow: hidden;
  padding: 48px 48px 42px;
  text-align: center;
}

.shadowing-intro-card::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -145px;
  right: -90px;
  border-radius: 50%;
  background: rgba(91, 92, 240, 0.07);
}

.shadowing-intro-badge,
.step-label,
.stage-step,
.shadow-ready-small,
.evaluation-small,
.invite-small {
  color: var(--shadowing-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.shadowing-hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  margin: 8px auto 0;
}

.shadowing-score-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 190px;
  height: 190px;
  border: 2px solid #dfe0ff;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 10px rgba(91, 92, 240, 0.035),
    0 20px 55px rgba(91, 92, 240, 0.12);
}

.shadowing-score-hero span {
  color: #9ca3c7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.shadowing-score-hero strong {
  margin-top: 3px;
  color: var(--shadowing-primary);
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.shadowing-wave {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 82px;
}

.shadowing-wave span,
.shadowing-waveform span,
.recording-waveform span {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: currentColor;
}

.shadowing-wave span:nth-child(1) { height: 18px; }
.shadowing-wave span:nth-child(2) { height: 34px; }
.shadowing-wave span:nth-child(3) { height: 55px; }
.shadowing-wave span:nth-child(4) { height: 76px; }
.shadowing-wave span:nth-child(5) { height: 48px; }
.shadowing-wave span:nth-child(6) { height: 30px; }
.shadowing-wave span:nth-child(7) { height: 16px; }

.shadowing-wave-back {
  left: calc(50% - 260px);
  color: rgba(91, 92, 240, 0.22);
}

.shadowing-wave-front {
  right: calc(50% - 260px);
  color: rgba(91, 92, 240, 0.38);
  transform: scaleX(-1);
}

.shadowing-intro-card h1,
.shadow-ready-panel h1,
.invite-accept-panel h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.shadowing-intro-card h1 span,
.shadow-ready-panel h1 span {
  color: var(--shadowing-primary);
}

.shadowing-main-tagline {
  margin: 15px 0 0;
  color: var(--shadowing-primary);
  font-size: 18px;
  font-weight: 900;
}

.shadowing-intro-copy,
.screen-description,
.stage-instruction {
  color: var(--shadowing-muted);
  line-height: 1.75;
}

.shadowing-intro-copy {
  max-width: 500px;
  margin: 14px auto 28px;
}

.shadowing-intro-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
}

.intro-flow-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 86px;
}

.intro-flow-item strong {
  color: #b4bad0;
  font-size: 11px;
}

.intro-flow-item span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.intro-flow-arrow {
  color: #c6cad7;
  font-weight: 900;
}

.shadowing-small-note {
  margin: 14px 0 0;
  color: #a0a7b8;
  font-size: 11px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.shadowing-primary-button,
.shadowing-secondary-button,
.shadowing-secondary-link,
.challenge-friend-button,
.modal-button {
  min-height: 54px;
  border-radius: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.shadowing-primary-button,
.challenge-friend-button,
.shadowing-modal-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(135deg, #6667f5 0%, #5152e8 100%);
  box-shadow: 0 12px 28px rgba(91, 92, 240, 0.22);
  cursor: pointer;
}

.shadowing-primary-button:hover,
.challenge-friend-button:hover,
.shadowing-modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(91, 92, 240, 0.27);
}

.shadowing-primary-button:disabled {
  color: #aab0c2;
  background: #e9ebf2;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.shadowing-primary-button.compact {
  width: auto;
  min-width: 220px;
}

.shadowing-secondary-button,
.shadowing-secondary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 22px;
  border: 1px solid #dde1ec;
  color: #3f4759;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}

.shadowing-secondary-button:hover,
.shadowing-secondary-link:hover {
  border-color: #c9cbee;
  color: var(--shadowing-primary);
  background: #fafaff;
}

.shadowing-text-button,
.shadowing-text-link {
  display: inline-block;
  margin-top: 18px;
  padding: 10px;
  border: 0;
  color: #7a8397;
  background: transparent;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

/* =========================================================
   PARTICIPANT
   ========================================================= */

.participant-panel {
  max-width: 620px;
}

.shadowing-panel h2,
.shadowing-stage-panel h2,
.shadowing-result-panel h2 {
  margin: 9px 0 10px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.screen-description {
  margin: 0 0 30px;
}

.shadowing-input-label {
  display: block;
  margin-bottom: 9px;
  color: #4f596d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.shadowing-name-input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1px solid #dfe3ed;
  border-radius: 14px;
  color: var(--shadowing-text);
  background: #fff;
  font-size: 17px;
  font-weight: 700;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.shadowing-name-input:focus {
  border-color: #9b9cf8;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(91, 92, 240, 0.08);
}

.input-meta {
  display: flex;
  justify-content: space-between;
  min-height: 30px;
  padding: 7px 2px 0;
  color: #a1a8b8;
  font-size: 11px;
}

#participantNameError {
  color: var(--shadowing-danger);
}

.gate-verification-box,
.gate-verified-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 24px;
  padding: 17px 18px;
  border: 1px solid #e3e5ef;
  border-radius: 16px;
  background: #fafbfe;
}

.gate-verification-copy {
  flex: 1;
}

.gate-verification-title {
  font-size: 13px;
  font-weight: 900;
}

.gate-verification-copy p {
  margin: 4px 0 0;
  color: #7e8799;
  font-size: 12px;
  line-height: 1.55;
}

.gate-verify-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #d8daf6;
  border-radius: 10px;
  color: var(--shadowing-primary);
  background: #fff;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.gate-verified-box {
  color: #167b59;
  border-color: #ccecdf;
  background: #f2fbf7;
}

.gate-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-success);
  font-weight: 900;
}

.gate-verified-box div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gate-verified-box span:last-child {
  color: #6f8f83;
  font-size: 11px;
}

/* =========================================================
   STAGE HEADING / PLAYER
   ========================================================= */

.stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.stage-heading h2 {
  margin-top: 6px;
}

.stage-mode-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--shadowing-primary);
  background: var(--shadowing-primary-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.shadow-mode-badge {
  color: #fff;
  background: var(--shadowing-primary);
}

.stage-instruction {
  margin: 0 0 26px;
}

.shadowing-player {
  padding: 22px;
  border: 1px solid #e2e4f1;
  border-radius: 20px;
  background: linear-gradient(145deg, #fbfbff, #f5f5ff);
}

.player-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-play-button,
.recording-playback-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-primary);
  box-shadow: 0 10px 25px rgba(91, 92, 240, 0.22);
  cursor: pointer;
}

.player-center {
  flex: 1;
  min-width: 0;
}

.player-top-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
  color: #8991a5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.shadowing-waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  overflow: hidden;
  color: #b9baf8;
}

.shadowing-waveform span {
  flex: 1 1 0;
  min-width: 3px;
}

.shadowing-waveform span:nth-child(3n + 1) { height: 13px; }
.shadowing-waveform span:nth-child(3n + 2) { height: 27px; }
.shadowing-waveform span:nth-child(3n) { height: 18px; }

.player-progress-track {
  position: relative;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e3ed;
  cursor: pointer;
}

.player-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--shadowing-primary);
  transition: width 0.12s linear;
}

#sourceAudio,
#shadowSourceAudio,
#recordedAudio {
  display: none;
}

/* =========================================================
   LISTEN STATUS / SCRIPT
   ========================================================= */

.listen-status-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 16px;
  color: #60697d;
  background: #f7f8fb;
}

.listen-status-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(25, 35, 60, 0.06);
}

.listen-status-box div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.listen-status-box strong {
  color: #30384a;
  font-size: 13px;
}

.listen-status-box span:last-child {
  font-size: 11px;
}

.listen-status-box.is-complete {
  color: #4b816f;
  background: #f1faf6;
}

.listen-script-box {
  margin: 0 0 20px;
  overflow: hidden;
  border: 1px solid #e5e7f0;
  border-radius: 16px;
}

.script-toggle-button,
.shadow-script-toggle,
.transcript-toggle {
  width: 100%;
  padding: 16px 18px;
  color: #596176;
  background: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.script-toggle-button {
  display: flex;
  justify-content: space-between;
}

.listen-script-content {
  padding: 0 18px 18px;
  color: #596176;
  font-size: 14px;
  line-height: 1.8;
}

/* =========================================================
   READY
   ========================================================= */

.shadow-ready-panel {
  max-width: 680px;
  text-align: center;
}

.shadow-ready-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 18px auto 22px;
  border-radius: 50%;
  background: var(--shadowing-primary-soft);
  font-size: 38px;
}

.shadow-ready-panel p {
  max-width: 490px;
  margin: 18px auto 26px;
  color: var(--shadowing-muted);
  line-height: 1.7;
}

.shadow-ready-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 25px 0;
}

.shadow-ready-rules > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 10px;
  border: 1px solid #e4e6f0;
  border-radius: 16px;
  background: #fafbfe;
}

.shadow-ready-rules > div > span {
  font-size: 22px;
}

.shadow-ready-rules strong {
  font-size: 12px;
}

.shadow-ready-rules small {
  color: #939bad;
  font-size: 10px;
}

.shadow-ready-tip {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: left;
  background: #f5f5ff;
}

.shadow-ready-tip > span {
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  background: var(--shadowing-primary);
  font-size: 8px;
  font-weight: 900;
}

.shadow-ready-tip p {
  margin: 0;
  color: #687085;
  font-size: 11px;
  line-height: 1.5;
}

/* =========================================================
   SHADOW / RECORDING
   ========================================================= */

.shadow-script-card {
  margin-bottom: 25px;
  overflow: hidden;
  border: 1px solid #e1e3f1;
  border-radius: 18px;
  background: #fbfbff;
}

.shadow-script-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e8e9f2;
  color: #747d92;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.shadow-script-toggle {
  width: auto;
  padding: 5px 8px;
  background: transparent;
}

.shadow-script-content {
  padding: 18px;
}

.shadow-script-content p {
  margin: 0;
  color: #3f475a;
  font-size: 15px;
  line-height: 1.9;
}

.recording-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 0 18px;
}

.recording-pulse {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(91, 92, 240, 0.08);
  box-shadow: 0 0 0 14px rgba(91, 92, 240, 0.035);
}

.recording-mic {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-primary);
  font-size: 34px;
}

.recording-visual.is-recording .recording-pulse,
.recording-pulse.is-recording {
  animation: shadowingPulse 1.25s ease-in-out infinite;
}

@keyframes shadowingPulse {
  0%, 100% {
    box-shadow: 0 0 0 8px rgba(91, 92, 240, 0.06);
  }
  50% {
    box-shadow: 0 0 0 22px rgba(91, 92, 240, 0.025);
  }
}

.recording-state-label {
  margin-top: 22px;
  color: var(--shadowing-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.recording-timer {
  margin-top: 4px;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.recording-duration-hint {
  margin-top: 5px;
  color: #9ba2b3;
  font-size: 11px;
}

.recording-waveform {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 56px;
  margin: 6px 0 20px;
  color: #c1c2f7;
}

.recording-waveform span {
  width: 6px;
  height: 12px;
}

.recording-waveform.is-active span {
  animation: recordingWave 0.8s ease-in-out infinite alternate;
}

.recording-waveform.is-active span:nth-child(2n) { animation-delay: -0.2s; }
.recording-waveform.is-active span:nth-child(3n) { animation-delay: -0.45s; }

@keyframes recordingWave {
  from { height: 10px; }
  to { height: 48px; }
}

.shadowing-record-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  border-radius: 16px;
  color: #fff;
  background: #20263a;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.shadowing-record-button:hover {
  transform: translateY(-1px);
  background: #151a2a;
}

.shadowing-record-button.is-recording {
  background: #e75060;
}

.record-button-icon {
  color: #ff5d6c;
  font-size: 15px;
}

.shadowing-record-button.is-recording .record-button-icon {
  color: #fff;
}

.recording-help-text {
  margin: 12px 0 0;
  color: #9aa1b2;
  text-align: center;
  font-size: 11px;
}

/* =========================================================
   RECORDED
   ========================================================= */

.recorded-panel {
  max-width: 650px;
  text-align: center;
}

.recorded-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-success);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(22, 163, 106, 0.18);
}

.recording-playback {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
  padding: 17px;
  border: 1px solid #e3e5ef;
  border-radius: 17px;
  text-align: left;
  background: #fafbfe;
}

.recording-playback-button {
  width: 48px;
  height: 48px;
}

.recording-playback-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.recording-playback-copy span {
  color: #9299aa;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.recording-playback-copy strong {
  font-size: 16px;
}

.recorded-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 12px;
}

/* =========================================================
   EVALUATING
   ========================================================= */

.shadowing-evaluating {
  width: min(100%, 620px);
  margin: 70px auto;
  text-align: center;
}

.evaluation-animation {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto 26px;
}

.evaluation-ring {
  position: absolute;
  inset: 0;
  border: 5px solid #e5e6fa;
  border-top-color: var(--shadowing-primary);
  border-radius: 50%;
  animation: shadowingSpin 1s linear infinite;
}

@keyframes shadowingSpin {
  to { transform: rotate(360deg); }
}

.evaluation-score {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  color: var(--shadowing-primary);
  background: #fff;
  font-size: 31px;
  font-weight: 900;
  box-shadow: var(--shadowing-shadow-soft);
}

.shadowing-evaluating h2 {
  margin: 9px 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.shadowing-evaluating p {
  color: var(--shadowing-muted);
}

.evaluation-progress {
  height: 7px;
  margin: 28px 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7ef;
}

.evaluation-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--shadowing-primary);
  transition: width 0.35s ease;
}

.evaluation-steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  color: #b2b7c5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.evaluation-steps .is-active {
  color: var(--shadowing-primary);
}

/* =========================================================
   RESULT
   ========================================================= */

.shadowing-result-panel {
  max-width: 760px;
  text-align: center;
}

.result-status-badge {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--shadowing-primary);
  background: var(--shadowing-primary-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.result-name {
  margin: 20px 0 12px;
  color: #838b9e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.final-score-circle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 190px;
  height: 190px;
  margin: 0 auto 22px;
  border: 2px solid #dfe0fa;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 16px 45px rgba(91, 92, 240, 0.11);
}

.final-score-circle span {
  color: #9ca3b5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.final-score-circle strong {
  color: var(--shadowing-primary);
  font-size: 70px;
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.final-score-circle small {
  color: #9ba2b2;
  font-size: 11px;
}

.shadowing-result-panel > #resultMessage {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--shadowing-muted);
  line-height: 1.65;
}

.score-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin: 28px 0;
  text-align: left;
}

.score-breakdown-item {
  padding: 16px;
  border: 1px solid #e5e7f0;
  border-radius: 15px;
  background: #fafbfe;
}

.score-breakdown-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.score-breakdown-heading strong {
  color: var(--shadowing-primary);
  font-size: 15px;
}

.breakdown-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e8ef;
}

.breakdown-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--shadowing-primary);
  transition: width 0.5s ease;
}

.feedback-card,
.transcript-card,
.hall-success-box,
.hall-full-box,
.retry-available-box,
.invite-retry-box {
  margin-top: 16px;
  border-radius: 18px;
  text-align: left;
}

.feedback-card {
  padding: 20px;
  border: 1px solid #e2e3f3;
  background: #f8f8ff;
}

.feedback-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--shadowing-primary);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.feedback-card > p {
  margin: 12px 0 0;
  color: #50596d;
  line-height: 1.7;
}

.feedback-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.feedback-detail-item {
  padding: 13px;
  border-radius: 12px;
  background: #fff;
}

.feedback-detail-item span {
  color: #989fb0;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.feedback-detail-item p {
  margin: 5px 0 0;
  color: #596176;
  font-size: 12px;
  line-height: 1.55;
}

.transcript-card {
  overflow: hidden;
  border: 1px solid #e4e6ee;
  background: #fff;
}

.transcript-toggle {
  display: flex;
  justify-content: space-between;
  text-align: left;
}

.transcript-content {
  padding: 0 18px 18px;
  color: #596176;
  font-size: 13px;
  line-height: 1.75;
}

.hall-success-box,
.hall-full-box,
.retry-available-box,
.invite-retry-box {
  padding: 19px;
}

.hall-success-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #f1d98c;
  background: #fffaf0;
}

.hall-success-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-gold);
}

.hall-success-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hall-success-copy span {
  color: #a67d17;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.hall-success-copy p {
  margin: 3px 0 0;
  color: #8c7a4e;
  font-size: 11px;
}

.hall-rank-badge {
  color: #a37500;
  font-size: 25px;
  font-weight: 900;
}

.hall-full-box {
  border: 1px solid #dfe1ef;
  background: #f8f9fc;
}

.hall-full-box p {
  margin-bottom: 0;
  color: #7b8497;
  line-height: 1.6;
}

.retry-available-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border: 1px solid #dfe0f7;
  background: #f8f8ff;
}

.retry-available-box > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.retry-available-box span {
  color: var(--shadowing-primary);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.retry-available-box .shadowing-primary-button {
  width: auto;
  min-width: 150px;
}

.invite-retry-box {
  text-align: center;
  border: 1px solid #e2e4ef;
  background: #fafbfe;
}

.invite-retry-box h3 {
  margin: 7px 0;
  font-size: 25px;
}

.invite-retry-box p {
  color: var(--shadowing-muted);
  line-height: 1.6;
}

.challenge-friend-button {
  margin-top: 8px;
}

.result-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 18px;
}

/* =========================================================
   INVITE
   ========================================================= */

.invite-panel,
.invite-accept-panel {
  max-width: 640px;
  text-align: center;
}

.invite-created-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--shadowing-primary);
  font-size: 28px;
}

.invite-link-box {
  display: flex;
  margin: 26px 0 14px;
  overflow: hidden;
  border: 1px solid #dfe2ed;
  border-radius: 14px;
  background: #fff;
}

.invite-link-box input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 15px;
  border: 0;
  outline: 0;
  color: #60697d;
  background: transparent;
}

.invite-link-box button {
  padding: 0 18px;
  color: var(--shadowing-primary);
  background: #f4f4ff;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.invite-accept-panel h1 {
  margin-top: 15px;
  font-size: clamp(32px, 6vw, 48px);
}

.invite-100 {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  margin: 26px auto;
  border: 2px solid #dedfff;
  border-radius: 50%;
  color: var(--shadowing-primary);
  background: #fff;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: 0 15px 45px rgba(91, 92, 240, 0.12);
}

.invite-accept-panel > p {
  color: var(--shadowing-muted);
}

/* =========================================================
   LOADER
   ========================================================= */

.challenge-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  background: rgba(249, 250, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.challenge-loader.is-visible {
  display: grid;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e4f5;
  border-top-color: var(--shadowing-primary);
  border-radius: 50%;
  animation: shadowingSpin 0.9s linear infinite;
}

.loader-text {
  color: var(--shadowing-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

/* =========================================================
   MODALS
   ========================================================= */

.challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  place-items: center;
  padding: 22px;
}

.challenge-modal[aria-hidden="false"],
.challenge-modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 23, 39, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 32px;
  border-radius: 24px;
  text-align: center;
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.24);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: var(--shadowing-primary);
  background: var(--shadowing-primary-soft);
  font-size: 25px;
  font-weight: 900;
}

.modal-panel h2 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.modal-panel p {
  color: var(--shadowing-muted);
  line-height: 1.65;
}

.modal-button {
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
}

.modal-cancel-button {
  margin-top: 10px;
  padding: 10px 15px;
  color: #858d9e;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #8b92a3;
  background: #f5f6f9;
  font-size: 20px;
  cursor: pointer;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.confirm-actions .modal-button,
.confirm-actions .shadowing-secondary-button {
  margin-top: 0;
}

/* =========================================================
   TOAST
   ========================================================= */

.shadowing-toast {
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 13px 17px;
  border-radius: 999px;
  color: #fff;
  background: #202638;
  box-shadow: 0 15px 40px rgba(17, 24, 39, 0.2);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shadowing-toast[aria-hidden="false"],
.shadowing-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   NOSCRIPT
   ========================================================= */

.noscript-message {
  position: fixed;
  z-index: 1200;
  inset: auto 20px 20px;
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  text-align: center;
  background: #202638;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 720px) {
  .shadowing-header {
    min-height: 64px;
    grid-template-columns: auto 1fr auto;
    padding: 10px 14px;
  }

  .shadowing-back span:last-child,
  .shadowing-hall-link span {
    display: none;
  }

  .shadowing-header-title {
    justify-self: center;
    gap: 7px;
  }

  .shadowing-header-title strong {
    font-size: 13px;
  }

  .shadowing-app {
    padding: 24px 14px 52px;
  }

  .shadowing-intro-card,
  .shadowing-panel,
  .shadowing-stage-panel,
  .shadow-ready-panel,
  .shadowing-result-panel {
    padding: 28px 20px;
    border-radius: 23px;
  }

  .shadowing-hero-visual {
    min-height: 210px;
  }

  .shadowing-score-hero {
    width: 155px;
    height: 155px;
  }

  .shadowing-score-hero strong {
    font-size: 58px;
  }

  .shadowing-wave {
    transform: scale(0.8);
  }

  .shadowing-wave-back {
    left: calc(50% - 205px);
  }

  .shadowing-wave-front {
    right: calc(50% - 205px);
    transform: scaleX(-1) scale(0.8);
  }

  .shadowing-intro-flow {
    gap: 7px;
  }

  .intro-flow-item {
    min-width: 66px;
  }

  .stage-heading {
    align-items: center;
  }

  .player-main {
    gap: 13px;
  }

  .player-play-button {
    width: 50px;
    height: 50px;
  }

  .player-top-row {
    flex-direction: column;
    gap: 3px;
  }

  .shadow-ready-rules {
    gap: 7px;
  }

  .shadow-ready-rules > div {
    padding: 14px 5px;
  }

  .recording-timer {
    font-size: 36px;
  }

  .recorded-actions,
  .result-share-actions {
    grid-template-columns: 1fr;
  }

  .shadowing-primary-button.compact {
    width: 100%;
    min-width: 0;
  }

  .score-breakdown,
  .feedback-details {
    grid-template-columns: 1fr;
  }

  .retry-available-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .retry-available-box .shadowing-primary-button {
    width: 100%;
  }

  .hall-success-box {
    grid-template-columns: auto 1fr;
  }

  .hall-rank-badge {
    grid-column: 1 / -1;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .shadowing-header-label {
    display: none;
  }

  .shadowing-intro-card,
  .shadowing-panel,
  .shadowing-stage-panel,
  .shadow-ready-panel,
  .shadowing-result-panel {
    padding: 24px 16px;
  }

  .shadowing-intro-card h1 {
    font-size: 38px;
  }

  .shadowing-main-tagline {
    font-size: 16px;
  }

  .shadowing-intro-flow {
    margin: 23px -4px;
  }

  .intro-flow-arrow {
    font-size: 11px;
  }

  .shadow-ready-rules small {
    display: none;
  }

  .shadowing-player {
    padding: 16px;
  }

  .final-score-circle {
    width: 165px;
    height: 165px;
  }

  .final-score-circle strong {
    font-size: 60px;
  }

  .confirm-actions {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   PRACTICE / FINAL MODE SELECT
   ========================================================= */

.shadowing-mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.shadowing-mode-actions .shadowing-primary-button,
.shadowing-mode-actions .shadowing-secondary-button {
  width: 100%;
}

.shadowing-final-button {
  min-height: 54px;
}


/* =========================================================
   TIMESTAMP SCRIPT — SENTENCE SYNC
   ========================================================= */

.timestamp-script {
  margin: 0;
  color: #3f475a;
  font-size: 15px;
  line-height: 2;
}

/*
 * 기본 상태
 * 아무 문장도 강조하지 않습니다.
 */
.timestamp-script .timestamp-sentence {
  display: inline;
  padding: 2px 1px;
  border-radius: 4px;

  color: inherit;
  background: transparent;
  box-shadow: none;
  font-weight: inherit;

  transition:
    color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}

/*
 * 현재 재생 중인 문장만 강조합니다.
 */
.timestamp-script .timestamp-sentence.is-active {
  color: var(--shadowing-primary-dark);
  background: rgba(91, 92, 240, 0.14);
  box-shadow:
    0 0 0 2px rgba(91, 92, 240, 0.05);
  font-weight: 800;
}


/* =========================================================
   SYNCED SCRIPT SCROLL
   ========================================================= */

.shadowing-synced-script {
  position: relative;
}

.listen-script-content {
  max-height: 230px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.shadow-script-content {
  max-height: 260px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.listen-script-content,
.shadow-script-content {
  scrollbar-width: thin;
  scrollbar-color:
    rgba(91, 92, 240, 0.25)
    transparent;
}

.listen-script-content::-webkit-scrollbar,
.shadow-script-content::-webkit-scrollbar {
  width: 6px;
}

.listen-script-content::-webkit-scrollbar-track,
.shadow-script-content::-webkit-scrollbar-track {
  background: transparent;
}

.listen-script-content::-webkit-scrollbar-thumb,
.shadow-script-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(91, 92, 240, 0.22);
}


/* =========================================================
   RECORDING MODE STATES
   ========================================================= */

.recording-stage-panel[data-recording-mode="practice"]
  .shadow-mode-badge {
  color: #fff;
  background: var(--shadowing-primary);
}

.recording-stage-panel[data-recording-mode="final"]
  .shadow-mode-badge {
  color: #fff;
  background: #20263a;
}

.recording-stage-panel[data-recording-mode="final"]
  .recording-pulse {
  background: rgba(32, 38, 58, 0.08);
  box-shadow:
    0 0 0 14px rgba(32, 38, 58, 0.035);
}

.recording-stage-panel[data-recording-mode="final"]
  .recording-mic {
  background: #20263a;
}


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

.practice-recorded-panel {
  max-width: 650px;
}

.practice-recorded-actions {
  grid-template-columns: 1fr 1.45fr;
}

#practiceRecordedAudio {
  display: none;
}


/* =========================================================
   FINAL EVALUATION SCRIPT
   ========================================================= */

.shadow-script-content.is-final-mode
  .timestamp-sentence,
.shadow-script-content.is-final-mode
  .timestamp-sentence.is-active {
  color: inherit;
  background: transparent;
  box-shadow: none;
  font-weight: inherit;
}


/* =========================================================
   MOBILE — NEW SHADOWING UI
   ========================================================= */

@media (max-width: 720px) {

  .shadowing-mode-actions {
    grid-template-columns: 1fr;
  }

  .practice-recorded-actions {
    grid-template-columns: 1fr;
  }

  .listen-script-content {
    max-height: 210px;
  }

  .shadow-script-content {
    max-height: 230px;
  }

  .timestamp-script {
    font-size: 14px;
    line-height: 1.9;
  }

}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
