:root {
  --bg0: #13141a;
  --bg1: #1b1d25;
  --panel: #23262f;
  --line: #3a3e4a;
  --text: #ddd8d0;
  --dim: #8f8a83;
  --accent: #c4b49a;
  --accent2: #6d655c;
  --teal: #6a9a90;
  --gold: #cbb889;
  --danger: #c48a7a;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg0);
}
button, input { font-family: inherit; color: inherit; }
a { color: var(--accent); }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--sat)) 16px 10px;
}
.topbar a.back {
  color: var(--dim); text-decoration: none; font-size: 14px;
  padding: 6px 4px;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 650; color: var(--accent); flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px; cursor: pointer;
}
.btn {
  display: block; width: 100%; margin-top: 10px; border: none; border-radius: 14px;
  padding: 12px; font-size: 16px; background: var(--accent2); color: #f4eee6; cursor: pointer;
}
.btn.alt { background: #2c3140; color: var(--text); }
.btn.ghost { background: transparent; color: var(--dim); }
.card {
  background: var(--panel); border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 16px;
}
.ov {
  position: fixed; inset: 0; z-index: 30; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(10,12,16,.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ov.show { display: flex; }
.ov .sheet {
  width: 100%; max-width: 340px; max-height: 100%; overflow: auto;
  background: var(--panel); border-radius: 22px; padding: 22px 20px 18px; text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 0 0 1px var(--line);
}
.ov .sheet h2 { margin: 0 0 8px; color: var(--accent); font-size: 20px; }
.ov .sheet p { color: var(--dim); font-size: 14px; line-height: 1.65; margin: 0 0 8px; }
