/* Quest 专属样式. 全站基础 pixel 风在 style.css; 这里只放 quest 卡片 / 像素 icon /
 * 解锁条件进度条 / arcade-title 等 quest-page 独有的组件.
 * (跟 style.css 重复的 body 调色板/nav 已移除, 现在统一走 style.css.)
 */

.quest-arcade {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
}

.arcade-title {
  font-size: 28px;
  text-align: center;
  color: #FFD66B;
  text-shadow: 3px 3px 0 #0F0F1E, 6px 6px 0 #FF61D2;
  margin: 0 0 12px;
  animation: arcade-blink 2s steps(2, end) infinite;
}

@keyframes arcade-blink {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.arcade-subtitle {
  text-align: center;
  font-size: 13px;
  color: #B8B8D0;
  margin: 0 0 32px;
  line-height: 1.8;
}

/* Circuit breaker banner */
.breaker-banner {
  background: #FF3B30;
  color: #FFFFFF;
  border: 3px solid #1A1A2E;
  box-shadow: 4px 4px 0 #1A1A2E;
  padding: 16px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  font-size: 13px;
}
.breaker-icon { font-size: 24px; grid-row: span 2; }
.breaker-text { font-weight: bold; font-size: 15px; }
.breaker-detail { color: rgba(255,255,255,0.85); font-size: 12px; }

/* Quest grid */
.quest-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.quest-card {
  background: #16213E;
  border: 4px solid #0F3460;
  box-shadow: 6px 6px 0 #0A0A18;
  padding: 24px;
  position: relative;
  transition: transform 0.2s steps(3);
}

.quest-card.is-unlocked {
  border-color: #FFB84D;
  box-shadow: 6px 6px 0 #B87A1F;
}
.quest-card.is-active {
  border-color: #FF61D2;
  box-shadow: 6px 6px 0 #B83AA0;
  background: linear-gradient(180deg, #1F1A2E 0%, #16213E 100%);
}
.quest-card.is-active::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border: 2px solid #FF61D2;
  opacity: 0.5;
  animation: active-pulse 1.2s steps(6) infinite;     /* steps 比 ease-in-out 省 paint */
  pointer-events: none;
}
@keyframes active-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}
.quest-card.is-locked { opacity: 0.65; }
.quest-card.is-progress { /* default */ }

.quest-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.quest-emblem {
  width: 48px; height: 48px;
  background: #0F0F1E;
  border: 2px solid #0F3460;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}
.quest-card.is-unlocked .quest-emblem { border-color: #FFB84D; }
.quest-card.is-active .quest-emblem { border-color: #FF61D2; }

.pixel-icon {
  width: 32px; height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.quest-stage-no {
  font-size: 9px;
  color: #6E6E8C;
  letter-spacing: 2px;
}
.quest-name {
  margin: 4px 0 0;
  font-size: 16px;
  color: #FFD66B;
}
.quest-card.is-active .quest-name { color: #FF61D2; }

.quest-badge { align-self: start; }
.badge {
  display: inline-block;
  padding: 6px 10px;
  font-size: 9px;
  letter-spacing: 1px;
  border: 2px solid;
  white-space: nowrap;
}
.badge-progress { color: #B8B8D0; border-color: #6E6E8C; }
.badge-unlocked { color: #FFB84D; border-color: #FFB84D; background: #1F1A0A; }
.badge-active   { color: #FF61D2; border-color: #FF61D2; background: #1F0A1A; animation: active-blink 1s steps(2) infinite; }
.badge-locked   { color: #6E6E8C; border-color: #6E6E8C; }
@keyframes active-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.quest-lore {
  font-size: 13px;
  color: #C8C8E0;
  margin: 16px 0;
  line-height: 1.8;
  padding-left: 8px;
  border-left: 3px solid #FFD66B;
}
.quest-card.is-active .quest-lore { border-left-color: #FF61D2; }

.quest-scope {
  font-size: 12px;
  color: #8C8CB0;
  background: #0F0F1E;
  padding: 12px;
  margin-bottom: 20px;
  border-left: 2px solid #7CB518;
}
.quest-scope strong {
  color: #7CB518;
  letter-spacing: 1px;
}

/* Conditions */
.condition-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.cond {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #2F2F4F;
  font-size: 12px;
}
.cond:last-child { border-bottom: none; }
.cond-icon {
  display: inline-block;
  width: 20px; height: 20px;
  text-align: center;
  line-height: 20px;
  background: #0F0F1E;
  color: #6E6E8C;
  border: 1px solid #2F2F4F;
}
.cond.met .cond-icon {
  color: #7CB518;
  border-color: #7CB518;
  background: #1A2A0F;
}
.cond-label {
  color: #C8C8E0;
}
.cond.met .cond-label {
  color: #FFFFFF;
}
.cond-bar {
  grid-column: 2 / 3;
  margin-top: 4px;
  font-family: 'Press Start 2P', monospace;
  color: #6E6E8C;
  position: relative;
}
.cond-bar-fill { display: none; }    /* 用文字 block 表示进度, 不用 div 宽度 */
.cond-bar-blocks {
  font-size: 12px;
  letter-spacing: 2px;
  color: #2F2F4F;
}
.cond.met .cond-bar-blocks {
  color: #7CB518;
}
.cond:not(.met) .cond-bar-blocks::first-line {
  /* fallback */
}
/* 由于 block 字符是文字, 用 background image 模拟更优, 简化:
   .cond-bar-blocks 整串显示, 已 fill 的 █ 字符前面 -> :nth-child 无效 (是文本不是元素)
   退而求其次: 整串 cond-bar-blocks 用底色 + ::after 叠绿色 fill ? */
.cond-bar {
  background: #0F0F1E;
  padding: 6px 10px;
  border: 1px solid #2F2F4F;
  position: relative;
  overflow: hidden;
}
.cond-bar-fill {
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #7CB518 0%, #B5E03A 100%);
  z-index: 1;
}
.cond-bar-blocks {
  position: relative;
  z-index: 2;
  color: rgba(232, 232, 240, 0.85);
}
.cond.met .cond-bar-blocks { color: #FFFFFF; }
.cond-value {
  font-size: 9px;
  color: #8C8CB0;
  white-space: nowrap;
}
.cond.met .cond-value { color: #B5E03A; }

/* Actions */
.quest-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.pixel-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  padding: 12px 20px;
  border: 3px solid #0A0A18;
  background: #2F2F4F;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 4px 4px 0 #0A0A18;
  transition: transform 0.05s steps(2), box-shadow 0.05s steps(2);
  letter-spacing: 2px;
}
.pixel-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #0A0A18;
}
.pixel-btn.btn-on {
  background: #7CB518;
  border-color: #4A6B0E;
}
.pixel-btn.btn-on:hover {
  background: #94D420;
}
.pixel-btn.btn-off {
  background: #C8453E;
  border-color: #6E2521;
}
.pixel-btn.btn-off:hover {
  background: #E0524A;
}

.quest-hint {
  font-size: 9px;
  color: #6E6E8C;
  font-style: italic;
  padding: 10px 0;
}

/* Footer */
.quest-footer {
  margin-top: 40px;
  padding: 16px;
  background: #0A0A18;
  border-top: 2px solid #2F2F4F;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #6E6E8C;
}
.quest-footer code {
  background: #16213E;
  padding: 2px 6px;
  color: #FFD66B;
  font-family: 'Press Start 2P', monospace;
}

/* Desktop: 2 cols on wide */
@media (min-width: 900px) {
  .quest-grid {
    grid-template-columns: 1fr;
  }
}
