/* Station Boss Dialogue Challenges */
.drawer-boss-section {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(212, 163, 89, 0.08) 0%, rgba(45, 106, 79, 0.05) 100%);
  border: 1.5px dashed var(--gold);
  position: relative;
}

.drawer-boss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.boss-avatar {
  font-size: 28px;
  line-height: 1;
}

.boss-reward-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  color: var(--jade-deep);
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
}

.boss-reward-tag .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.drawer-boss-audio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.boss-audio-copy {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.boss-audio-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.boss-audio-hanzi {
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
}

.boss-audio-pinyin {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--jade);
}

.boss-listen-btn {
  font-size: 13px;
  min-height: 36px;
  padding: 6px 12px;
}

.drawer-boss-prompt {
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 12px;
}

.drawer-boss-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.drawer-boss-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  min-height: 46px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.boss-opt-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.boss-opt-pinyin {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--jade);
}

.drawer-boss-opt:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--cream);
  transform: translateY(-1px);
}

.drawer-boss-opt.is-correct {
  border-color: #2d6a4f !important;
  background: #e8f5e9 !important;
  color: #1b5e20 !important;
  font-weight: 700;
}

.drawer-boss-opt.is-wrong {
  border-color: #c62828 !important;
  background: #ffebee !important;
  color: #c62828 !important;
}

.drawer-boss-opt:disabled {
  cursor: default;
}

.drawer-boss-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  display: none;
}

.drawer-boss-feedback.show-correct {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.drawer-boss-feedback.show-wrong {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Certificate Modal & Canvas */
.adventure-cert-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 20, 16, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.adventure-cert-dialog[open],
.adventure-cert-dialog.is-open {
  display: flex;
}

.adventure-cert-box {
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 22px;
  max-width: 780px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  animation: certModalPop 0.25s ease;
}

@keyframes certModalPop {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.adventure-cert-content {
  padding: 26px;
  text-align: center;
}

.adventure-cert-customize {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cert-customize-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cert-customize-field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.cert-name-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.cert-customize-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cert-code-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--jade-deep);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 8px;
}

.cert-canvas-wrapper {
  margin: 16px 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line);
  line-height: 0;
}

#adventure-cert-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.adventure-cert-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* HSK 2 Chapter 2 Adventure Banner */
.hsk2-chapter2-banner {
  margin: 28px 0;
  border-radius: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #182e26 0%, #0d1e18 100%);
  border: 1.5px solid var(--gold);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(10, 25, 20, 0.25);
}

.hsk2-chapter2-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(199, 154, 65, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.chapter2-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  background: rgba(199, 154, 65, 0.2);
  border: 1px solid var(--gold);
  color: #ffdb80;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.chapter2-portal-btn:hover {
  background: var(--gold);
  color: #182e26;
  transform: translateY(-1px);
}

/* Dark Mode Extensions for Boss & Certificate */
html[data-theme=dark] .drawer-boss-section {
  background: rgba(199, 154, 65, 0.06);
  border-color: #c99a41;
}
html[data-theme=dark] .drawer-boss-audio-bar {
  background: #152720;
  border-color: #2b493c;
}
html[data-theme=dark] .drawer-boss-opt {
  background: #1a2f27;
  border-color: #2b493c;
  color: var(--cream);
}
html[data-theme=dark] .boss-opt-main {
  color: var(--cream);
}
html[data-theme=dark] .adventure-cert-box {
  background: #182e26;
}
html[data-theme=dark] .adventure-cert-customize {
  background: #14251e;
  border-color: #2b493c;
}
html[data-theme=dark] .cert-name-input,
html[data-theme=dark] .cert-code-status {
  background: #192e26;
  border-color: #2b493c;
  color: var(--cream);
}
