/* 星纱 — Chrome 61 baseline + safe-area */

html {
  touch-action: manipulation;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0e1a;
  color: #f5e6c8;
  -webkit-touch-callout: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #070b16;
}

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

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  pointer-events: none;
  padding: 24px;
  padding-top: 24px;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  padding-bottom: 24px;
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

.screen.overlay {
  background: rgba(6, 10, 22, 0.72);
  pointer-events: auto;
}

.screen > * {
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

/* —— Title —— */
.title-glow {
  position: absolute;
  top: 28%;
  left: 50%;
  width: 280px;
  height: 280px;
  margin-left: -140px;
  margin-top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 196, 120, 0.22) 0%, rgba(120, 160, 255, 0.08) 42%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.title-block {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8px 16px;
}

.game-title {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: 0.28em;
  margin-left: 0.28em;
  color: #f3e2b8;
  text-shadow:
    0 0 24px rgba(232, 196, 120, 0.55),
    0 0 60px rgba(140, 170, 255, 0.35);
  line-height: 1.2;
}

.tagline {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: rgba(220, 200, 160, 0.78);
}

.best-line {
  margin-top: 28px;
  font-size: 13px;
  color: rgba(180, 200, 255, 0.7);
  letter-spacing: 0.12em;
}

.hint-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  bottom: calc(28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  text-align: center;
  font-size: 12px;
  color: rgba(180, 190, 220, 0.45);
  letter-spacing: 0.08em;
  pointer-events: none;
}

.primary-btn {
  display: inline-block;
  margin-top: 36px;
  padding: 14px 40px;
  border: 1px solid rgba(232, 196, 120, 0.55);
  border-radius: 999px;
  background: rgba(232, 196, 120, 0.12);
  color: #f5e6c8;
  font-size: 16px;
  letter-spacing: 0.2em;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
}

.primary-btn:focus {
  border-color: rgba(255, 230, 170, 0.9);
  background: rgba(232, 196, 120, 0.22);
}

.primary-btn:active {
  opacity: 0.72;
}

.primary-btn.pulse {
  -webkit-animation: softPulse 2.4s ease-in-out infinite;
  animation: softPulse 2.4s ease-in-out infinite;
}

@-webkit-keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 196, 120, 0.35); }
  50% { box-shadow: 0 0 22px 4px rgba(232, 196, 120, 0.18); }
}

@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 196, 120, 0.35); }
  50% { box-shadow: 0 0 22px 4px rgba(232, 196, 120, 0.18); }
}

.ghost-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 28px;
  border: 1px solid rgba(160, 180, 220, 0.28);
  border-radius: 999px;
  background: transparent;
  color: rgba(210, 220, 245, 0.85);
  font-size: 14px;
  letter-spacing: 0.14em;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.ghost-btn:focus {
  border-color: rgba(200, 210, 255, 0.55);
}

.ghost-btn:active {
  opacity: 0.7;
}

/* —— Cards —— */
.card {
  width: 100%;
  max-width: 320px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: rgba(14, 20, 40, 0.92);
  border: 1px solid rgba(232, 196, 120, 0.22);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

@supports ((-webkit-backdrop-filter: blur(14px)) or (backdrop-filter: blur(14px))) {
  .card {
    background: rgba(14, 20, 40, 0.78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.card-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #f3e2b8;
  margin-bottom: 20px;
}

.tips {
  list-style: none;
  text-align: left;
  padding: 0 4px;
}

.tips li {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(220, 210, 190, 0.88);
  margin-bottom: 14px;
}

.tips li:last-child {
  margin-bottom: 0;
}

.tip-num {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(232, 196, 120, 0.18);
  border: 1px solid rgba(232, 196, 120, 0.45);
  color: #f3e2b8;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.over-label {
  font-size: 13px;
  letter-spacing: 0.28em;
  color: rgba(180, 190, 220, 0.65);
}

.over-score {
  margin-top: 10px;
  font-size: 52px;
  font-weight: 300;
  color: #f5e6c8;
  text-shadow: 0 0 28px rgba(232, 196, 120, 0.4);
  letter-spacing: 0.04em;
}

.over-best {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(160, 180, 230, 0.7);
  letter-spacing: 0.1em;
}

.over-actions {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  margin-top: 8px;
}

.over-actions .primary-btn {
  margin-top: 22px;
}

.over-actions .ghost-btn {
  margin-top: 10px;
}

/* —— HUD —— */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  pointer-events: none;
  padding-top: 10px;
  padding-top: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-left: 14px;
  padding-right: 14px;
}

.hud-top {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: flex-start;
  align-items: flex-start;
}

.hud-stat {
  min-width: 72px;
}

.hud-center {
  text-align: center;
}

.hud-right {
  text-align: right;
}

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(170, 185, 230, 0.55);
  margin-bottom: 2px;
}

.hud-value {
  display: block;
  font-size: 20px;
  font-weight: 500;
  color: #f0e4c8;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hud-value.combo {
  color: #ffe09a;
  text-shadow: 0 0 12px rgba(255, 200, 100, 0.45);
}

.icon-btn {
  pointer-events: auto;
  position: absolute;
  top: 52px;
  top: calc(52px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(180, 190, 230, 0.28);
  background: rgba(10, 14, 28, 0.45);
  color: rgba(220, 220, 240, 0.85);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  line-height: 34px;
  text-align: center;
  padding: 0;
}

.icon-btn.help-btn {
  right: 56px;
}

.icon-btn:active {
  opacity: 0.7;
}

.icon-btn.muted {
  color: rgba(140, 150, 180, 0.55);
  border-color: rgba(140, 150, 180, 0.22);
}

/* —— Toast —— */
.toast {
  position: absolute;
  left: 50%;
  bottom: 48px;
  bottom: calc(48px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  z-index: 30;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 28, 48, 0.92);
  border: 1px solid rgba(232, 196, 120, 0.3);
  color: #f0e4c8;
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 520px) {
  .game-title {
    font-size: 68px;
  }
  .card {
    max-width: 360px;
  }
}
