/* Zenith Fold: 禅意折叠 Stylesheet */
:root {
  --bg-top: #e0f2fe;
  --bg-bottom: #fce7f3;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --accent-pink: #f472b6;
  --accent-mint: #34d399;
  --accent-blue: #38bdf8;
  --card-bg: rgba(255, 255, 255, 0.78);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow-soft: 0 10px 30px rgba(100, 116, 139, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(170deg, var(--bg-top) 0%, #fdf4ff 50%, var(--bg-bottom) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, sans-serif;
  color: var(--text-dark);
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* --- HUD Overlay --- */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 16px) 18px env(safe-area-inset-bottom, 16px) 18px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.sanctuary-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

.sanctuary-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.5px;
}

.sanctuary-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.steps-card {
  text-align: right;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

.steps-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-pink);
}

.steps-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Bottom Zen Controls */
.bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  margin-bottom: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-fold {
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-fold:active {
  transform: scale(0.95);
  background: #ffffff;
  color: var(--accent-pink);
}

.hint-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Quick Corner Buttons */
.utility-btns {
  position: absolute;
  top: 96px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  z-index: 15;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.btn-icon:active {
  transform: scale(0.92);
}

/* --- Modals --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(224, 242, 254, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: auto;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  width: min(440px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(100, 116, 139, 0.18), 0 0 40px rgba(244, 114, 182, 0.15);
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-pink);
  margin-bottom: 8px;
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-item {
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 10px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 2px;
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent-pink), #ec4899);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244, 114, 182, 0.35);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  filter: brightness(1.1);
}

.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

.btn-secondary:active {
  background: rgba(0, 0, 0, 0.04);
}

.keys-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
}
