/* 寶島煉成 —— 基礎版面（原本來自共用 engine，獨立專案後只留這個遊戲用得到的部分）。
   顏色 token 由 index.html 的 :root 覆寫成「手帖」色系，這裡只定義結構與預設值。 */

:root {
  --bg: #0b0c10;
  --bg-elev: rgba(255, 255, 255, 0.06);
  --bg-elev-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f2f3f5;
  --text-dim: rgba(242, 243, 245, 0.62);
  --text-faint: rgba(242, 243, 245, 0.38);
  --accent: #ffc65c;
  --accent-ink: #241a04;
  --good: #6ee7a8;
  --bad: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --dock-h: 76px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
}

/* 三段式版面：頂欄／舞台／底欄。
   minmax(0,1fr)：不加的話子元素的 min-content 會把欄寬撐得比視窗還大，窄螢幕上舞台會被推出畫面外。 */
.app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  overflow: visible;
  position: relative;
  z-index: 50;
}

.topbar .title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar .sub {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spacer {
  flex: 1 1 auto;
}

.muted {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.4;
}

.stat {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.stat b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.stat span {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.dock {
  display: none;
}

.btn {
  flex: none;
  height: 34px;
  padding: 0 13px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s;
}

.btn:hover {
  background: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: transparent;
  border-color: transparent;
  color: var(--accent-ink);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(20, 22, 29, 0.94);
  border: 1px solid var(--line);
  font-size: 13px;
  animation: toast 2.2s ease both;
  pointer-events: none;
  white-space: nowrap;
}

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