/* 静水 · 钓鱼 —— 界面样式 */

:root {
  --ink: #070d0b;
  --paper: #e8e2d3;
  --paper-dim: #a9b3a9;
  --gold: #d8ab68;
  --danger: #d0573a;
  --safe: #7fb08a;
  --panel: rgba(10, 17, 14, 0.72);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

canvas#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ---------------- 顶部信息 ---------------- */

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: baseline;
  gap: 26px;
  padding: 22px 30px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

#topbar .stat { display: flex; align-items: baseline; gap: 8px; }
#topbar .k {
  color: rgba(232, 226, 211, 0.42);
  font-size: 11px;
  letter-spacing: 0.22em;
}
#topbar .v { font-variant-numeric: tabular-nums; }

#openLog {
  pointer-events: auto;
  margin-left: auto;
}

/* ---------------- 通用按钮 ---------------- */

.ghost {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--paper);
  background: rgba(232, 226, 211, 0.05);
  border: 1px solid rgba(232, 226, 211, 0.22);
  padding: 7px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.ghost:hover { background: rgba(232, 226, 211, 0.12); border-color: rgba(216, 171, 104, 0.6); color: var(--gold); }

.primary {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.3em;
  color: #14200f;
  background: linear-gradient(180deg, #e3c391, #c99c58);
  border: none;
  padding: 13px 34px 13px 40px;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(201, 156, 88, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(201, 156, 88, 0.38); }

/* ---------------- 抛投力度 ---------------- */

#chargeWrap {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  width: min(340px, 62vw);
  animation: fadeUp 0.25s ease-out;
}

.charge-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(232, 226, 211, 0.6);
  margin-bottom: 8px;
}

.charge-track {
  position: relative;
  height: 8px;
  background: rgba(6, 12, 9, 0.55);
  border: 1px solid rgba(232, 226, 211, 0.18);
  border-radius: 1px;
  overflow: hidden;
}
#chargeFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7fb08a, #d8c07a 62%, #d0573a);
  transition: width 0.03s linear;
}
.charge-track .mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: rgba(232, 226, 211, 0.5);
}

/* ---------------- 遛鱼仪表 ---------------- */

#fight {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  animation: fadeIn 0.3s ease-out;
}

.fight-tip {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(238, 232, 218, 0.86);
  white-space: nowrap;
  background: rgba(6, 12, 9, 0.46);
  padding: 4px 8px;
  border-radius: 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.meters {
  display: flex;
  align-items: stretch;
  gap: 14px;
  height: 208px;
}

.meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.meter-track {
  position: relative;
  width: 12px;
  flex: 1;
  min-height: 0;
  background: rgba(6, 12, 9, 0.5);
  border: 1px solid rgba(232, 226, 211, 0.16);
  border-radius: 1px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.meter-track.thin { width: 5px; }

.meter-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(232, 226, 211, 0.42);
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  line-height: 1;
}

#tensionFill {
  width: 100%;
  height: 12%;
  background: linear-gradient(180deg, #d0573a, #b8923d 60%, #6f9a76);
  transition: height 0.06s linear;
}
#staminaFill {
  width: 100%;
  height: 100%;
  background: rgba(163, 190, 172, 0.55);
  transition: height 0.2s linear;
}
.meter-track .danger {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12%;
  border-bottom: 1px dashed rgba(208, 87, 58, 0.55);
}

#distWrap {
  position: absolute;
  right: 36px;
  top: calc(50% + 138px);
  display: flex;
  align-items: baseline;
  gap: 5px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease-out;
}
.dist-k { font-size: 10px; letter-spacing: 0.2em; color: rgba(232, 226, 211, 0.45); }
.dist-v { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.dist-u { font-size: 11px; color: rgba(232, 226, 211, 0.5); }

/* ---------------- 提示语 ---------------- */

#prompt {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(232, 226, 211, 0.78);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  transition: opacity 0.45s ease;
  text-align: center;
}
#prompt.dim { opacity: 0.34; }
#prompt.alert { color: #f0c98a; }

/* ---------------- 上鱼卡片 ---------------- */

#card {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(6, 11, 9, 0.35), rgba(4, 8, 6, 0.82));
  animation: fadeIn 0.4s ease-out;
}

.card-inner {
  width: min(380px, 84vw);
  padding: 30px 34px 26px;
  background: var(--panel);
  border: 1px solid rgba(216, 171, 104, 0.28);
  border-radius: 2px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: riseIn 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.card-tag {
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 10px;
}
.card-inner h2 {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.24em;
  margin-bottom: 4px;
  text-indent: 0.24em;
}
.card-figure {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
  min-height: 64px;
}
.card-figure canvas { display: block; }

.card-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  border-top: 1px solid rgba(232, 226, 211, 0.12);
  border-bottom: 1px solid rgba(232, 226, 211, 0.12);
  padding: 12px 0;
  margin-bottom: 14px;
}
.card-stats div { text-align: center; }
.card-stats dt { font-size: 10px; letter-spacing: 0.2em; color: rgba(232, 226, 211, 0.42); margin-bottom: 4px; }
.card-stats dd { font-size: 16px; font-variant-numeric: tabular-nums; }

.card-note {
  font-size: 12px;
  line-height: 1.8;
  color: rgba(232, 226, 211, 0.62);
  margin-bottom: 18px;
  min-height: 22px;
}

/* ---------------- 渔获册 ---------------- */

#logPanel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  z-index: 40;
  padding: 26px 28px;
  background: rgba(8, 14, 11, 0.9);
  border-left: 1px solid rgba(216, 171, 104, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  animation: slideIn 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.log-head h2 { font-size: 19px; font-weight: 400; letter-spacing: 0.3em; }

.log-list { list-style: none; }
.log-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(232, 226, 211, 0.08);
  font-size: 13px;
}
.log-list .nm { flex: 1; letter-spacing: 0.1em; }
.log-list .wt { font-variant-numeric: tabular-nums; color: var(--gold); font-size: 14px; }
.log-list .ct { font-size: 11px; color: rgba(232, 226, 211, 0.38); min-width: 34px; text-align: right; }
.log-list .lock { color: rgba(232, 226, 211, 0.22); letter-spacing: 0.2em; font-size: 12px; }

.log-progress {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin: -12px 0 14px;
}

.log-list li.fb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(232, 226, 211, 0.08);
}

.fb-fish { flex: 0 0 auto; opacity: 0.92; }
.fb-info { flex: 1; min-width: 0; }

.fb-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.fb-top .nm { font-size: 13px; letter-spacing: 0.10em; }
.fb-top .wt { font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; }

.fb-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(232, 226, 211, 0.40);
}

.log-list li.unk .fb-top .nm,
.log-list li.unk .fb-top .wt {
  color: rgba(232, 226, 211, 0.26);
  letter-spacing: 0.20em;
}
.log-list li.unk .fb-sub { color: rgba(232, 226, 211, 0.34); }

.log-empty {
  font-size: 12.5px;
  line-height: 2;
  color: rgba(232, 226, 211, 0.4);
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* ---------------- 开场 ---------------- */

#intro {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 120%, rgba(60, 92, 74, 0.35), transparent 60%),
    linear-gradient(180deg, #060b09, #0b1310 60%, #050a08);
  transition: opacity 0.7s ease, visibility 0.7s;
}
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-inner { text-align: center; padding: 24px; animation: riseIn 0.9s cubic-bezier(0.2, 0.9, 0.25, 1); }
.intro-kicker { font-size: 11px; letter-spacing: 0.5em; color: rgba(232, 226, 211, 0.4); margin-bottom: 18px; }
.intro-inner h1 {
  font-size: clamp(52px, 12vw, 92px);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  line-height: 1.1;
  color: #f0e9d8;
  text-shadow: 0 0 60px rgba(216, 171, 104, 0.28);
}
.intro-sub {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: rgba(232, 226, 211, 0.45);
  margin: 18px 0 34px;
  text-indent: 0.4em;
}
.intro-tips {
  list-style: none;
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 38px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: rgba(232, 226, 211, 0.55);
  text-align: left;
}
.intro-tips li::before { content: "—"; margin-right: 10px; color: rgba(216, 171, 104, 0.6); }
.intro-foot { margin-top: 26px; font-size: 10.5px; letter-spacing: 0.24em; color: rgba(232, 226, 211, 0.26); }

/* ---------------- 动画 ---------------- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 640px) {
  #topbar { gap: 14px; padding: 16px 16px; font-size: 12px; }
  #topbar .k { letter-spacing: 0.12em; }
  #fight { left: auto; right: 20px; }
  .meters { height: 168px; }
  #distWrap { left: auto; right: 20px; top: calc(50% + 108px); }
  #prompt { bottom: 30px; font-size: 12px; }
  #chargeWrap { bottom: 72px; }
}
