@font-face {
  font-family: GEETYPE;
  src: url(../font/GEETYPE.ttf);
  font-display: swap;
}

:root {
  --bg0: #0b0b0d;
  --bg1: #141418;
  --ink: #f3f3f5;
  --muted: #7a7a86;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #e8c27a;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", GEETYPE, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 禁止双击放大（iOS/Android 连点木鱼会触发） */
  touch-action: manipulation;
  background:
    radial-gradient(120% 80% at 50% -10%, #22222a 0%, transparent 55%),
    radial-gradient(90% 60% at 80% 110%, #1a1814 0%, transparent 50%),
    var(--bg0);
}

button,
a,
.fish-wrap,
.chip,
.dock,
.panel {
  touch-action: manipulation;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: max(10px, env(safe-area-inset-top, 0px)) 14px calc(96px + var(--safe-b));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.logo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.logo {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(20px, 5.2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 4px 0;
}

.logo-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(232, 194, 122, 0.16);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  animation: hintPulse 1.6s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}

.logo-hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(232, 194, 122, 0.55);
}

@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.75;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(1px);
  }
}

.top-actions {
  display: flex;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip.on,
.chip[aria-pressed="true"] {
  color: #111;
  background: var(--ink);
  border-color: var(--ink);
}

.main {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  display: none;
  width: min(520px, 100%);
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.5vh, 22px);
}

.panel.active {
  display: flex;
}

.score {
  text-align: center;
  position: relative;
  z-index: 2;
}

.score .count {
  font-size: clamp(48px, 14vw, 84px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: transform 0.12s cubic-bezier(0.5, 0.35, 0.15, 1.4);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.12);
}

.score .count.pop {
  transform: scale(1.08);
}

.score .subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.2em;
}

.merit-hint {
  margin: 8px 0 0;
  color: rgba(232, 194, 122, 0.82);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.combo {
  margin-top: 6px;
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.fish-wrap {
  position: relative;
  width: min(300px, 72vw);
  aspect-ratio: 247 / 197;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ececef;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.fish-glow {
  position: absolute;
  inset: 18% 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  filter: blur(8px);
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.woodenFish {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.1s cubic-bezier(0.5, 0.35, 0.15, 1.4);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.fish-wrap:active .woodenFish,
.fish-wrap.hit .woodenFish {
  transform: scale(0.94);
}

.fish-wrap:active .fish-glow,
.fish-wrap.hit .fish-glow {
  opacity: 1;
  transform: scale(1.08);
}

.tip-layer {
  position: absolute;
  inset: -40% 0 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.float-tip {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  animation: tipUp 0.9s ease-out forwards;
}

@keyframes tipUp {
  from {
    top: 58%;
    opacity: 1;
  }
  to {
    top: 8%;
    opacity: 0;
  }
}

.panel-tips {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.tip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #c8c8d0;
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.tip-pill svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.85;
}

.tip-pill.tip-accent {
  border-color: rgba(232, 194, 122, 0.35);
  background: rgba(232, 194, 122, 0.1);
  color: #f0d9a6;
  font-size: 14px;
  font-weight: 600;
}

.tip-pill.tip-accent svg {
  color: var(--accent);
}

.guide[hidden] {
  display: none !important;
}

.guide {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  animation: guideIn 0.28s ease;
}

@keyframes guideIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.guide-card {
  width: min(360px, 100%);
  padding: 22px 20px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #1a1a20 0%, #121216 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.guide-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.guide-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
  letter-spacing: 0.06em;
}

.guide-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.guide-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  background: rgba(232, 194, 122, 0.12);
  color: var(--accent);
}

.guide-ico svg {
  width: 20px;
  height: 20px;
}

.guide-list strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.guide-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guide-card .btn {
  width: 100%;
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.card p {
  margin: 0 0 16px;
  color: #b5b5be;
  line-height: 1.6;
  font-size: 14px;
}

.card .muted {
  color: var(--muted);
}

.card strong {
  color: var(--accent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--ink);
  color: #111;
  border-color: var(--ink);
}

.btn-lg {
  min-width: 132px;
  padding: 12px 20px;
  font-size: 15px;
}

.btn-auto {
  min-width: 148px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f0d59a 0%, #e8c27a 100%);
  color: #1a1408;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(232, 194, 122, 0.28);
}

.btn-auto:active {
  transform: scale(0.98);
}

.incense-actions {
  margin-top: 6px;
  gap: 12px;
}

.incense-card {
  padding: 32px 22px 28px;
  max-width: 420px;
  width: 100%;
}

.incense-hero {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 22px rgba(232, 194, 122, 0.4));
}

.panel-incense .card h2 {
  font-size: 28px;
}

.panel-incense .card p {
  font-size: 15px;
  margin: 8px 0 18px;
}

.fortune-box {
  min-height: 140px;
  margin: 8px 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
  line-height: 1.7;
  font-size: 15px;
}

.fortune-box.empty {
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-box .title {
  font-size: 18px;
  margin-bottom: 8px;
}

.fortune-box .meta {
  color: #aaa;
  font-size: 13px;
  margin-top: 10px;
}

.incense-game {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

#incenseCanvas {
  width: min(560px, 94vw);
  height: auto;
  max-height: min(62vh, 560px);
  touch-action: none;
  cursor: crosshair;
  background:
    radial-gradient(circle at 50% 42%, rgba(232, 194, 122, 0.12), transparent 42%),
    radial-gradient(circle at center, #1c1c22, #09090b);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.incense-bar {
  width: min(560px, 94vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.incense-game .hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  flex: 1;
  text-align: left;
}

.reborn-latest {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 12px;
  color: var(--accent);
}

.reborn-stats {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.reborn-log {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-height: 28vh;
  overflow: auto;
  text-align: left;
  width: 100%;
}

.reborn-log li {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #ccc;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(30px + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 8px;
  background: rgba(18, 18, 22, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(10px);
  z-index: 50;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.4);
}

.dock-item {
  flex: 0 0 70px;
  width: 70px;
  height: 78px;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 8px 4px 6px;
  border-radius: 16px;
  transition: color 0.15s ease, background 0.15s ease;
}

.dock-item img {
  display: block;
  width: 28px;
  height: 46px;
  object-fit: contain;
  object-position: center;
  opacity: 0.72;
  flex: 0 0 46px;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.dock-item span {
  display: block;
  height: 14px;
  line-height: 14px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dock-item.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.dock-item.active img {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.22));
}

.toast {
  position: fixed;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  pointer-events: none;
  animation: fadeToast 1.5s ease forwards;
}

@keyframes fadeToast {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

body.immersive .logo {
  opacity: 0.35;
}

@media (max-height: 640px) {
  .score .count {
    font-size: clamp(40px, 11vw, 64px);
  }
  .fish-wrap {
    width: min(240px, 58vw);
  }
  .tip-pill {
    font-size: 12px;
    padding: 6px 10px;
  }

  .tip-pill.tip-accent {
    font-size: 13px;
  }
}
