/* ═══════════════════════════════════════════════════
   老崔摇滚诊所 H5 — 完整样式
   从 miniapp-rx wxss 转换，rpx → vw (1rpx ≈ 0.1333vw)
   ═══════════════════════════════════════════════════ */

:root {
  --red: #cc0000;
  --red-player: #c0392b;
  --paper: #f5ecd7;
  --cream: #faf4e6;
  --dark: #0d0b08;
  --dark-splash: #1a0808;
  --text-dark: #1a1410;
  --text-muted: #8a7e6e;
  --text-body: #3d3428;
  --text-sub: #6f6559;
  --text-dim: #555;
  --text-faint: #333;
  --serif: "Noto Serif SC", "STSong", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif CN", serif;
  --mono: "Courier New", Courier, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--serif);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ═══ Screen system ═══ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
  z-index: 1;
}
.screen.active {
  display: flex;
  z-index: 10;
}

/* ═══════════════════════════════════════════════════
   SPLASH
   ═══════════════════════════════════════════════════ */
.splash {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--dark-splash);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8vw;
  width: 100%;
}

.clinic-sign {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(170deg, var(--cream) 0%, #e8dfc8 100%);
  border: 3px solid var(--red);
  border-radius: 1.07vw;
  padding: clamp(24px, 8.53vw, 48px) clamp(18px, 6.4vw, 36px);
  text-align: center;
  box-shadow: 0 0 0 0.8vw rgba(204,0,0,0.08), 0 2.67vw 10.67vw rgba(0,0,0,0.5);
}

.sign-headline {
  font-size: clamp(16px, 4.8vw, 24px);
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: 0.53vw;
  line-height: 1.6;
  margin-bottom: clamp(12px, 4.27vw, 24px);
}

.sign-divider {
  width: 80%;
  height: 2px;
  margin: 0 auto clamp(10px, 3.73vw, 20px);
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  border-radius: 1px;
}
.sign-divider-sm { width: 60%; margin-top: clamp(8px, 3.2vw, 18px); margin-bottom: clamp(8px, 3.2vw, 18px); }

.sign-cross {
  display: block;
  font-size: clamp(14px, 4.53vw, 22px);
  color: var(--red);
  font-weight: 700;
  line-height: 1;
  margin-bottom: clamp(6px, 1.87vw, 10px);
}

.sign-subtitle {
  display: block;
  font-size: clamp(13px, 3.73vw, 20px);
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.8vw;
  margin-bottom: clamp(4px, 1.33vw, 8px);
}

.sign-en {
  font-family: var(--mono);
  font-size: clamp(10px, 2.67vw, 14px);
  color: var(--text-muted);
  letter-spacing: 0.53vw;
  margin-bottom: 0.53vw;
}

.sign-scope {
  font-size: clamp(12px, 3.47vw, 18px);
  color: var(--text-dark);
  letter-spacing: 0.27vw;
  line-height: 1.8;
}

.sign-years {
  font-size: clamp(10px, 2.93vw, 15px);
  color: var(--text-muted);
  margin-top: 1.07vw;
  letter-spacing: 0.27vw;
}

/* CTA */
.splash-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(24px, 8.53vw, 48px);
  width: 100%;
}

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  max-width: 320px;
  padding: clamp(12px, 4.27vw, 24px) 0;
  border: 2px solid var(--red);
  border-radius: 1.6vw;
  background: rgba(204,0,0,0.12);
  animation: glow 2.4s ease-in-out infinite;
  cursor: pointer;
}

.cta-cross {
  font-size: clamp(14px, 4.27vw, 22px);
  color: var(--red);
  margin-right: 2.13vw;
  font-weight: 700;
}

.cta-text {
  font-size: clamp(18px, 5.33vw, 28px);
  color: #f5e6d0;
  font-weight: 700;
  letter-spacing: 1.6vw;
}

.cta-hint {
  font-size: clamp(11px, 3.2vw, 16px);
  color: rgba(245,236,215,0.6);
  margin-top: clamp(10px, 3.2vw, 18px);
  letter-spacing: 0.53vw;
  animation: nudge 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 2.67vw rgba(204,0,0,0.3), 0 0 8vw rgba(204,0,0,0.1); }
  50% { box-shadow: 0 0 4vw rgba(204,0,0,0.6), 0 0 13.33vw rgba(204,0,0,0.2); }
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-1.07vw); opacity: 1; }
}

.splash-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 5.33vw, 30px));
  text-align: center;
  font-size: clamp(10px, 2.93vw, 15px);
  color: rgba(245,236,215,0.2);
  letter-spacing: 0.27vw;
}

/* ═══════════════════════════════════════════════════
   REGISTER
   ═══════════════════════════════════════════════════ */
.register {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.register-inner {
  padding: clamp(60px, 16vw, 90px) clamp(20px, 7.47vw, 42px) calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 5.33vw, 30px));
  max-width: 480px;
  margin: 0 auto;
}

.rx-header {
  display: flex;
  align-items: baseline;
  gap: clamp(8px, 2.67vw, 16px);
  padding-top: 2.67vw;
  margin-bottom: clamp(24px, 8.53vw, 48px);
}

.rx-symbol {
  font-family: var(--mono);
  font-size: clamp(32px, 9.6vw, 52px);
  font-weight: 700;
  color: var(--red);
  font-style: italic;
  line-height: 1;
}

.rx-label {
  font-size: clamp(14px, 4.27vw, 22px);
  color: var(--text-muted);
  letter-spacing: 1.07vw;
}

.form-section { margin-bottom: clamp(30px, 10.67vw, 60px); }
.form-field { margin-bottom: clamp(20px, 7.47vw, 42px); }

.field-label {
  display: block;
  font-size: clamp(13px, 3.73vw, 19px);
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.53vw;
  margin-bottom: clamp(10px, 3.73vw, 20px);
}

.field-optional {
  font-weight: 400;
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--text-muted);
}

.gen-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 2.67vw, 14px);
}

.gen-btn {
  flex: 0 0 calc(33.333% - clamp(6px, 1.87vw, 10px));
  height: clamp(36px, 10.67vw, 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(26,20,16,0.2);
  border-radius: 4px;
  font-size: clamp(13px, 3.73vw, 19px);
  font-family: var(--serif);
  color: var(--text-dark);
  background: transparent;
  letter-spacing: 0.27vw;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.gen-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 700;
  box-shadow: 0 0.53vw 2.67vw rgba(204,0,0,0.25);
}

/* City */
.city-picker-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(40px, 11.73vw, 56px);
  padding: 0 clamp(10px, 3.73vw, 20px);
  border: 1px solid rgba(26,20,16,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.4);
  position: relative;
}

.city-select {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(13px, 3.73vw, 19px);
  color: var(--text-dark);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.city-arrow {
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--text-muted);
  position: absolute;
  right: clamp(10px, 3.73vw, 20px);
  pointer-events: none;
}

.next-btn {
  width: 100%;
  padding: clamp(12px, 3.73vw, 20px) 0;
  border: 2px solid var(--red);
  border-radius: 4px;
  font-size: clamp(15px, 4.53vw, 24px);
  font-weight: 700;
  font-family: var(--serif);
  letter-spacing: 1.07vw;
  text-align: center;
  color: var(--paper);
  background: var(--red);
  box-shadow: 0 1.6vw 5.33vw rgba(204,0,0,0.2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.next-btn-disabled {
  opacity: 0.3;
  background: var(--text-muted);
  border-color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   SYMPTOM
   ═══════════════════════════════════════════════════ */
.symptom-page {
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, var(--cream), var(--paper));
  padding: clamp(60px, 16vw, 90px) clamp(16px, 6.4vw, 36px) env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.symptom-title {
  display: block;
  font-size: clamp(18px, 5.87vw, 30px);
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.53vw;
  margin-bottom: 1.07vw;
  flex-shrink: 0;
}

.symptom-hint {
  display: block;
  font-size: clamp(12px, 3.47vw, 18px);
  color: var(--text-muted);
  letter-spacing: 0.27vw;
  margin-bottom: clamp(10px, 3.2vw, 18px);
  flex-shrink: 0;
}

.symptom-scroll {
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(26,20,16,0.10);
  border-radius: 6px;
  background: rgba(255,255,255,0.2);
  padding: 1.6vw 0;
  margin-bottom: clamp(10px, 3.2vw, 18px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.symptom-options {
  display: flex;
  flex-direction: column;
  gap: 1.6vw;
  padding: 0 2.13vw;
}

.symptom-btn {
  display: flex;
  align-items: flex-start;
  padding: clamp(10px, 3.2vw, 18px) clamp(12px, 3.73vw, 20px);
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(26,20,16,0.10);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.symptom-btn.selected {
  border-color: var(--red);
  background: rgba(204,0,0,0.08);
}

.symptom-check {
  font-family: var(--mono);
  font-size: clamp(14px, 4vw, 20px);
  color: var(--text-muted);
  margin-right: 2.13vw;
  line-height: 1.4;
  flex-shrink: 0;
}

.symptom-btn.selected .symptom-check { color: var(--red); }

.symptom-text {
  font-size: clamp(14px, 4vw, 20px);
  color: var(--text-body);
  line-height: 1.4;
}

.symptom-btn.selected .symptom-text { color: var(--text-dark); }

.scroll-fade-hint {
  text-align: center;
  font-size: clamp(10px, 2.93vw, 15px);
  color: #b0a898;
  padding: 2.13vw 0 1.07vw;
  letter-spacing: 0.27vw;
}

.symptom-free {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6vw;
  margin-bottom: 2.13vw;
}

.symptom-input {
  width: 100%;
  padding: clamp(10px, 3.2vw, 18px);
  font-size: clamp(14px, 4vw, 20px);
  font-family: var(--serif);
  border: 1px solid rgba(26,20,16,0.12);
  border-radius: 4px;
  background: rgba(255,255,255,0.5);
  color: var(--text-dark);
  line-height: 1.5;
  resize: none;
  outline: none;
}

.bottom-action {
  flex-shrink: 0;
  padding: 2.13vw 0 2.67vw;
}

/* Shared buttons */
.btn-primary {
  width: 100%;
  padding: clamp(12px, 3.73vw, 20px) 0;
  border: 2px solid var(--red);
  border-radius: 4px;
  font-size: clamp(15px, 4.53vw, 24px);
  font-weight: 700;
  font-family: var(--serif);
  letter-spacing: 1.07vw;
  text-align: center;
  color: var(--paper);
  background: var(--red);
  box-shadow: 0 1.6vw 5.33vw rgba(204,0,0,0.2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary:disabled {
  opacity: 0.3;
  background: var(--text-muted);
  border-color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: clamp(12px, 3.73vw, 20px) 0;
  border: 2px solid rgba(245,236,215,0.15);
  border-radius: 4px;
  font-size: clamp(14px, 4.27vw, 22px);
  font-weight: 700;
  font-family: var(--serif);
  letter-spacing: 0.8vw;
  text-align: center;
  color: rgba(245,236,215,0.6);
  background: rgba(245,236,215,0.08);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* ═══════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════ */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 7.47vw, 42px);
  background: linear-gradient(180deg, var(--cream), var(--paper));
}

.loading-paper {
  width: clamp(220px, 64vw, 320px);
  background: var(--cream);
  border: 2px solid rgba(26,20,16,0.12);
  padding: clamp(20px, 6.4vw, 36px) clamp(16px, 5.33vw, 30px);
  position: relative;
  box-shadow: 0 3.2vw 10.67vw rgba(0,0,0,0.15);
  transform: rotate(-1.5deg);
}

.loading-header {
  font-size: clamp(14px, 4vw, 20px);
  color: var(--red);
  letter-spacing: 1.07vw;
  text-align: center;
  margin-bottom: clamp(16px, 5.33vw, 30px);
  font-weight: 700;
}

.loading-lines {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 4.27vw, 24px);
  min-height: clamp(80px, 24vw, 120px);
}

.writing-line {
  height: clamp(12px, 3.73vw, 20px);
  background: linear-gradient(90deg, var(--text-body), transparent);
  border-radius: 1px;
  opacity: 0;
  transform-origin: left center;
  transform: scaleX(0);
}

.line-1 { width: 85%; animation: writeLine 1.2s 0.3s ease-out forwards; }
.line-2 { width: 70%; animation: writeLine 1.2s 1.2s ease-out forwards; }
.line-3 { width: 55%; animation: writeLine 1.2s 2.1s ease-out forwards; }

@keyframes writeLine {
  0% { opacity: 0.6; transform: scaleX(0); }
  100% { opacity: 0.15; transform: scaleX(1); }
}

.loading-pen {
  position: absolute;
  bottom: clamp(20px, 6.67vw, 38px);
  right: clamp(20px, 6.67vw, 38px);
  font-size: clamp(18px, 5.33vw, 28px);
  animation: penMove 2s ease-in-out infinite;
}

@keyframes penMove {
  0%, 100% { transform: translate(0, 0) rotate(-30deg); }
  25% { transform: translate(-4vw, -1.07vw) rotate(-35deg); }
  50% { transform: translate(-8vw, 0) rotate(-25deg); }
  75% { transform: translate(-2.67vw, 1.07vw) rotate(-30deg); }
}

.loading-text {
  font-size: clamp(16px, 4.8vw, 24px);
  color: var(--text-body);
  letter-spacing: 0.8vw;
}

.dot { animation: dotPulse 1.4s ease-in-out infinite; }
.d1 { animation-delay: 0s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   RESULT
   ═══════════════════════════════════════════════════ */
.result-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1a0e08, #0d0705);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, 10.67vw, 60px) clamp(12px, 3.73vw, 20px) clamp(24px, 8vw, 48px);
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.rx-card {
  width: 100%;
  background: linear-gradient(180deg, var(--cream), var(--paper) 72%, #efe4cf);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--red);
  box-shadow: 0 3.73vw 12vw rgba(0,0,0,0.32);
  animation: cardIn 0.8s ease-out;
}

.rx-card-inner-border {
  position: absolute;
  top: 7px; left: 7px; right: 7px; bottom: 7px;
  border: 1px solid rgba(204,0,0,0.5);
  pointer-events: none;
}

@keyframes cardIn {
  0% { opacity: 0; transform: translateY(8vw) rotate(-1deg); }
  100% { opacity: 1; transform: translateY(0) rotate(-0.5deg); }
}

.rx-card-header {
  padding: clamp(14px, 4.53vw, 26px) clamp(20px, 7.2vw, 40px) clamp(10px, 3.2vw, 18px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rx-card-headline {
  display: block;
  font-size: clamp(18px, 6.13vw, 32px);
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: 0.13vw;
  line-height: 1.28;
  margin-bottom: clamp(8px, 2.4vw, 14px);
  white-space: pre-line;
}

.rx-card-divider {
  height: 1px;
  background: rgba(204,0,0,0.55);
  width: 86%;
  margin-bottom: clamp(8px, 2.4vw, 14px);
}

.rx-card-cross {
  display: block;
  font-size: clamp(14px, 4.53vw, 24px);
  color: var(--red);
  line-height: 1;
  margin-bottom: clamp(6px, 1.6vw, 10px);
}

.rx-card-title {
  display: block;
  font-size: clamp(14px, 4vw, 20px);
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.67vw;
  margin-bottom: 1.07vw;
}

.rx-card-en {
  display: block;
  font-family: var(--mono);
  font-size: clamp(8px, 2.13vw, 12px);
  color: #9d8f7d;
  letter-spacing: 0.4vw;
  margin-bottom: 1.87vw;
}

.rx-card-body {
  padding: 1.6vw clamp(20px, 7.2vw, 40px) clamp(10px, 2.93vw, 16px);
}

.rx-row {
  display: flex;
  gap: clamp(8px, 2.4vw, 14px);
  margin-bottom: clamp(10px, 3.47vw, 20px);
  align-items: baseline;
}

.rx-label-sm {
  font-size: clamp(11px, 3.33vw, 17px);
  color: #a09080;
  letter-spacing: 0.53vw;
  flex-shrink: 0;
  min-width: clamp(36px, 11.2vw, 56px);
}

.rx-value {
  font-size: clamp(16px, 5.07vw, 26px);
  color: var(--text-dark);
  line-height: 1.6;
}

.rx-value-sm { font-size: clamp(14px, 4.13vw, 22px); }
.rx-value-bold { font-size: clamp(15px, 4.53vw, 24px); font-weight: 700; }
.rx-value-note {
  font-size: clamp(14px, 4.4vw, 23px);
  color: #990000;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-line;
}

.rx-thin-line {
  height: 1px;
  background: rgba(26,20,16,0.12);
  margin-bottom: clamp(10px, 3.47vw, 20px);
}

/* Songs in card */
.rx-songs { margin-bottom: 1.6vw; }

.rx-song-entry {
  display: flex;
  gap: clamp(8px, 2.4vw, 14px);
  align-items: flex-start;
  margin-bottom: clamp(8px, 2.4vw, 14px);
}

.rx-song-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.07vw;
}

.rx-song-name {
  font-size: clamp(20px, 6.67vw, 34px);
  font-weight: 700;
  color: #990000;
  line-height: 1.28;
}

.rx-song-lyric {
  font-size: clamp(14px, 4.13vw, 22px);
  color: var(--text-sub);
  line-height: 1.55;
}

.rx-song-dosage {
  font-size: clamp(13px, 3.73vw, 19px);
  color: var(--text-body);
  margin-top: 0.27vw;
  line-height: 1.45;
}

.rx-song-reason {
  font-size: clamp(11px, 3.33vw, 17px);
  color: var(--text-sub);
  line-height: 1.6;
}

.rx-song-sep {
  height: 1px;
  background: rgba(204,0,0,0.08);
  margin: clamp(10px, 2.93vw, 16px) 0 clamp(10px, 2.93vw, 16px) clamp(44px, 13.6vw, 68px);
}

/* Card footer */
.rx-card-footer {
  padding: 1.07vw clamp(20px, 7.2vw, 40px) clamp(16px, 5.6vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.rx-footer-copy {
  font-size: clamp(8px, 2.4vw, 13px);
  color: rgba(26,20,16,0.18);
  text-align: center;
  letter-spacing: 0.13vw;
  margin: clamp(16px, 5.6vw, 32px) 0 clamp(8px, 2.4vw, 14px);
}

.sig-stamp-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-height: clamp(60px, 20.53vw, 100px);
}

.rx-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.53vw;
  position: relative;
  z-index: 1;
}

.sig-name { font-size: clamp(26px, 8.27vw, 42px); color: var(--text-dark); }
.sig-role { font-size: clamp(11px, 3.2vw, 16px); color: var(--text-muted); letter-spacing: 0.53vw; }

.rx-stamp {
  position: absolute;
  top: -2.4vw;
  right: clamp(36px, 9.33vw, 52px);
  width: clamp(70px, 22.4vw, 112px);
  height: clamp(70px, 22.4vw, 112px);
  transform: rotate(-10deg);
  opacity: 0.68;
  z-index: 2;
  animation: stampIn 0.4s 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-10deg) scale(0.3); }
  100% { opacity: 0.68; transform: rotate(-10deg) scale(1); }
}

.stamp-ring {
  width: 100%;
  height: 100%;
  border: 3px solid var(--red);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stamp-ring::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px solid var(--red);
  border-radius: 50%;
}

.stamp-star { font-size: clamp(16px, 5.33vw, 28px); color: var(--red); line-height: 1; }
.stamp-top-text { font-size: clamp(6px, 1.87vw, 10px); color: var(--red); font-weight: 900; letter-spacing: 0.13vw; }
.stamp-bottom-text { font-size: clamp(5px, 1.33vw, 8px); color: var(--red); font-weight: 700; }

/* Actions */
.actions {
  margin-top: clamp(14px, 4.8vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.4vw, 14px);
  width: 100%;
}

.actions-note {
  display: block;
  font-size: clamp(11px, 3.2vw, 16px);
  color: rgba(245,236,215,0.3);
  text-align: center;
  letter-spacing: 0.8vw;
  padding: 1.07vw 0 2.67vw;
}

/* ═══════════════════════════════════════════════════
   PLAYER
   ═══════════════════════════════════════════════════ */
#screen-player {
  width: 100%;
  background: var(--dark);
}

.player-page {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + clamp(8px, 2.67vw, 16px)) clamp(10px, 3.2vw, 18px) clamp(6px, 1.6vw, 10px);
  background: linear-gradient(to bottom, var(--dark) 60%, transparent);
}

.back-btn {
  display: flex;
  align-items: center;
  padding: 1.6vw 1.07vw;
  cursor: pointer;
}

.back-arrow { font-size: clamp(16px, 4.8vw, 24px); color: var(--red-player); margin-right: 1.07vw; }
.back-text { font-size: clamp(12px, 3.47vw, 18px); color: #a09080; }

.top-badge {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--red-player);
  border: 1px solid rgba(192,57,43,0.5);
  padding: 0.8vw 2.67vw;
  border-radius: 4vw;
  letter-spacing: 0.53vw;
}

.player-scroll {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + clamp(44px, 12vw, 60px));
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: var(--dark);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scroll-inner {
  padding: clamp(10px, 3.2vw, 18px) 0 clamp(48px, 16vw, 80px);
  max-width: 480px;
  margin: 0 auto;
}

/* Hero: vinyl + song info */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.67vw 0 0;
}

.vinyl-wrap {
  width: clamp(160px, 50.67vw, 260px);
  height: clamp(160px, 50.67vw, 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(12px, 4.27vw, 24px);
  position: relative;
}

.vinyl-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(188px, 58.67vw, 300px);
  height: clamp(188px, 58.67vw, 300px);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  transform-origin: center;
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
  background:
    radial-gradient(circle,
      rgba(192,57,43,0.62) 0%,
      rgba(192,57,43,0.32) 18%,
      rgba(192,57,43,0.14) 40%,
      rgba(192,57,43,0.05) 58%,
      rgba(192,57,43,0) 74%);
  filter: blur(clamp(10px, 3.2vw, 20px));
  will-change: transform, opacity;
}

.vinyl {
  width: clamp(150px, 48vw, 240px);
  height: clamp(150px, 48vw, 240px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    #1a1a1a 0%, #222 30%, #111 31%, #1a1a1a 32%,
    #222 50%, #111 51%, #1a1a1a 52%,
    #222 70%, #111 71%, #1a1a1a 72%, #333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8vw rgba(192,57,43,0.12);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.vinyl.spinning { animation: spin 8s linear infinite; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-label {
  width: clamp(72px, 22.4vw, 108px);
  height: clamp(72px, 22.4vw, 108px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: #171311;
  box-shadow:
    inset 0 0 0 1px rgba(245,230,208,0.08),
    0 0 0 1px rgba(0,0,0,0.28);
}

.vinyl-label::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(0,0,0,0.04) 0%,
      rgba(0,0,0,0.10) 42%,
      rgba(0,0,0,0.22) 70%,
      rgba(0,0,0,0.42) 100%);
  z-index: 1;
  pointer-events: none;
}

.vinyl-cover,
.vinyl-placeholder {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.vinyl-cover {
  object-fit: cover;
  z-index: 0;
  transform: scale(1.04);
}

.vinyl-placeholder {
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.08), rgba(255,255,255,0) 34%),
    linear-gradient(135deg, rgba(177,0,0,0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(26,20,16,0.98), rgba(16,10,8,0.98));
  z-index: 0;
}

.vinyl-cross {
  position: absolute;
  z-index: 2;
  font-size: clamp(20px, 6.4vw, 32px);
  color: var(--red-player);
  line-height: 1;
  text-shadow: 0 0 12px rgba(177,0,0,0.28);
}

.song-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(16px, 6.4vw, 36px);
}

.song-title {
  font-size: clamp(17px, 5.07vw, 26px);
  color: #f5e6d0;
  font-weight: bold;
  margin-bottom: 1.6vw;
  letter-spacing: 0.53vw;
}

.song-lyric-quote {
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 1.07vw;
  font-style: italic;
}

.song-dosage {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--red-player);
  opacity: 0.75;
}

/* Lyrics */
.lyrics-section { margin: clamp(12px, 3.73vw, 20px) clamp(12px, 4.27vw, 24px); }

.lyrics-box {
  height: clamp(140px, 48vw, 240px);
  border-radius: clamp(6px, 2.13vw, 12px);
  background: rgba(255,255,255,0.03);
  padding: 0 clamp(10px, 3.2vw, 18px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.lyrics-box-manual .lyrics-pad { height: clamp(18px, 6.4vw, 32px); }

.lyrics-pad { height: clamp(56px, 18.67vw, 96px); }

.lyric-line {
  font-size: clamp(12px, 3.47vw, 18px);
  color: var(--text-dim);
  text-align: center;
  line-height: 2;
  transition: color 0.3s, font-size 0.3s;
}

.lyric-active {
  color: #f5e6d0;
  font-size: clamp(14px, 4vw, 20px);
  font-weight: bold;
}

.lyric-manual-line {
  text-align: left;
  color: rgba(245,230,208,0.84);
  line-height: 1.85;
  font-size: clamp(12px, 3.47vw, 18px);
}

.lyric-note-line {
  text-align: center;
  color: rgba(165,124,104,0.92);
  font-size: clamp(10px, 2.93vw, 14px);
  margin-bottom: clamp(6px, 2.13vw, 12px);
}

.lyric-empty-line {
  text-align: center;
  color: rgba(245,230,208,0.56);
}

.lyrics-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lyrics-quote-big {
  font-size: clamp(14px, 4.27vw, 22px);
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.8;
  margin-bottom: 2.67vw;
}

.lyrics-hint {
  font-size: clamp(9px, 2.67vw, 14px);
  color: #444;
}

/* Unavailable */
.unavailable-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(24px, 8vw, 48px) clamp(16px, 6.4vw, 36px);
}

.unavail-icon { font-size: clamp(28px, 8.53vw, 44px); margin-bottom: clamp(10px, 3.2vw, 18px); }

.unavail-msg {
  font-size: clamp(13px, 3.73vw, 19px);
  color: var(--red-player);
  text-align: center;
  line-height: 1.7;
  margin-bottom: clamp(12px, 4.27vw, 24px);
  font-weight: bold;
}

.unavail-btn {
  font-size: clamp(11px, 3.2vw, 16px);
  color: #f5e6d0;
  background: rgba(192,57,43,0.2);
  border: 1px solid rgba(192,57,43,0.4);
  padding: clamp(6px, 2.13vw, 12px) clamp(16px, 5.33vw, 30px);
  border-radius: 6px;
  letter-spacing: 0.27vw;
  cursor: pointer;
}

.unavail-btn-sub {
  margin-top: clamp(6px, 2.13vw, 12px);
  background: transparent;
  border-color: rgba(192,57,43,0.2);
  color: rgba(245,230,208,0.5);
}

/* Loading (player) */
.loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(24px, 8vw, 48px) 0;
}

.loading-ring {
  width: clamp(24px, 7.47vw, 38px);
  height: clamp(24px, 7.47vw, 38px);
  border: 2px solid var(--text-faint);
  border-top-color: var(--red-player);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 2.67vw;
}

.loading-text-sm {
  font-size: clamp(11px, 3.2vw, 16px);
  color: #666;
  letter-spacing: 0.53vw;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.07vw clamp(16px, 5.33vw, 30px) 0;
}

.progress-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: clamp(12px, 3.73vw, 20px);
}

.time-text {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--text-dim);
  width: clamp(30px, 9.6vw, 48px);
  text-align: center;
  font-family: var(--mono);
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--text-faint);
  border-radius: 2px;
  margin: 0 1.6vw;
  position: relative;
  padding: clamp(8px, 2.67vw, 14px) 0;
  background-clip: content-box;
  cursor: pointer;
  touch-action: none;
}

.progress-fill {
  height: 100%;
  background: var(--red-player);
  border-radius: 2px;
  width: 0%;
}

.progress-dot {
  position: absolute;
  top: 50%;
  width: clamp(10px, 3.2vw, 16px);
  height: clamp(10px, 3.2vw, 16px);
  background: var(--red-player);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 1.33vw rgba(192,57,43,0.6);
  left: 0%;
}

.play-btn {
  width: clamp(44px, 13.33vw, 66px);
  height: clamp(44px, 13.33vw, 66px);
  border-radius: 50%;
  background: var(--red-player);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 4vw rgba(192,57,43,0.35);
  cursor: pointer;
}

.play-icon {
  font-size: clamp(18px, 5.33vw, 28px);
  color: #fff;
  margin-left: 0.53vw;
}

/* Section titles */
.section-title {
  display: block;
  font-size: clamp(10px, 2.93vw, 15px);
  color: #665e55;
  letter-spacing: 1.6vw;
  text-align: center;
  margin-bottom: 2.67vw;
}

/* Song list */
.songlist-section {
  margin: clamp(20px, 6.4vw, 36px) clamp(12px, 4.27vw, 24px) 0;
  padding-top: clamp(12px, 4.27vw, 24px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.songlist {
  border-radius: clamp(6px, 2.13vw, 12px);
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.songlist-item {
  display: flex;
  align-items: center;
  padding: clamp(10px, 3.2vw, 18px) clamp(12px, 3.73vw, 20px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
}

.songlist-item:last-child { border-bottom: none; }
.songlist-active { background: rgba(192,57,43,0.08); }

.songlist-num {
  font-size: clamp(13px, 3.73vw, 19px);
  color: var(--text-dim);
  width: clamp(20px, 6.4vw, 32px);
  text-align: center;
  font-weight: bold;
}

.songlist-active .songlist-num { color: var(--red-player); }

.songlist-info {
  flex: 1;
  margin-left: 2.13vw;
  overflow: hidden;
}

.songlist-name {
  font-size: clamp(13px, 3.73vw, 19px);
  color: #d4c8b0;
  display: block;
  margin-bottom: 0.53vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songlist-active .songlist-name { color: #f5e6d0; font-weight: bold; }

.songlist-sub {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--text-dim);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songlist-badge {
  font-size: clamp(8px, 2.4vw, 13px);
  color: var(--red-player);
  border: 1px solid rgba(192,57,43,0.4);
  padding: 0.53vw 1.87vw;
  border-radius: 2.67vw;
  flex-shrink: 0;
  margin-left: 1.6vw;
}

.unavail-badge { color: #666; border-color: #444; }

/* Rx detail card */
.rx-detail-card {
  background: rgba(255,255,255,0.03);
  border-radius: clamp(6px, 2.13vw, 12px);
  padding: clamp(12px, 3.73vw, 20px);
}

.rx-detail-reason {
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--text-muted);
  line-height: 1.8;
}

/* Comment */
.comment-section {
  margin: clamp(20px, 6.4vw, 36px) clamp(12px, 4.27vw, 24px) 0;
  padding-top: clamp(12px, 4.27vw, 24px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.comment-card {
  background: rgba(255,255,255,0.04);
  border-radius: clamp(6px, 2.13vw, 12px);
  padding: clamp(10px, 3.2vw, 18px);
  display: flex;
  flex-direction: column;
}

.comment-input {
  width: 100%;
  min-height: clamp(48px, 16vw, 80px);
  max-height: clamp(80px, 32vw, 160px);
  font-size: clamp(12px, 3.47vw, 18px);
  font-family: var(--serif);
  color: #d4c8b0;
  background: transparent;
  border: none;
  line-height: 1.7;
  resize: none;
  outline: none;
}

.comment-input::placeholder { color: #665e55; }

.comment-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.13vw;
  padding-top: 2.13vw;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.comment-count {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--text-dim);
}

.comment-submit {
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--dark);
  background: var(--red-player);
  padding: 1.6vw 5.33vw;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.comment-done { padding: clamp(12px, 3.73vw, 20px); }

.comment-my-text {
  font-size: clamp(12px, 3.47vw, 18px);
  color: var(--text-muted);
  line-height: 1.7;
  display: block;
  margin-bottom: 2.67vw;
  font-style: italic;
}

.comment-reply-wrap {
  background: rgba(192,57,43,0.08);
  border-left: 3px solid var(--red-player);
  padding: 2.13vw 2.67vw;
  border-radius: 0 6px 6px 0;
  margin-bottom: 2.13vw;
}

.comment-reply-label {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--red-player);
  display: block;
  margin-bottom: 0.8vw;
}

.comment-reply-text {
  font-size: clamp(12px, 3.47vw, 18px);
  color: #d4c8b0;
  line-height: 1.6;
}

.comment-reset {
  font-size: clamp(10px, 2.93vw, 15px);
  color: #666;
  text-align: right;
  text-decoration: underline;
  cursor: pointer;
}

/* Bottom */
.bottom-area {
  padding: clamp(24px, 8vw, 48px) 0 clamp(16px, 5.33vw, 30px);
  text-align: center;
}

.bottom-hint {
  font-size: clamp(9px, 2.67vw, 14px);
  color: var(--text-faint);
  letter-spacing: 0.53vw;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE + SAFE AREA
   ═══════════════════════════════════════════════════ */
@supports (padding-top: env(safe-area-inset-top)) {
  .top-bar { padding-top: calc(env(safe-area-inset-top) + clamp(8px, 2.67vw, 16px)); }
  .player-scroll { top: calc(env(safe-area-inset-top) + clamp(44px, 12vw, 60px)); }
  .splash-footer { padding-bottom: calc(env(safe-area-inset-bottom) + clamp(16px, 5.33vw, 30px)); }
}

@media (min-width: 481px) {
  .register-inner,
  .symptom-page,
  .result-inner,
  .scroll-inner {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .clinic-sign { max-width: 400px; margin: 0 auto; }
  .cta-btn { max-width: 320px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .vinyl-wrap {
    width: clamp(100px, 30vw, 160px);
    height: clamp(100px, 30vw, 160px);
  }
  .vinyl {
    width: clamp(90px, 28vw, 150px);
    height: clamp(90px, 28vw, 150px);
  }
  .lyrics-box { height: clamp(80px, 30vw, 140px); }
}
