/* 森林神庙 · 页面级样式（菜单 / 画布 / 覆盖层）
 * 壳层公共件（顶栏、氛围光晕、导航）一律用 page-shell.css，本文件只管游戏自己的部分。 */

[hidden] { display: none !important; }

/* page-shell 对 .hdr-bar-right 有 display:flex!important，同优先级下会被顶掉，用 ID 加权压住 */
#gameToolbar[hidden] { display: none !important; }

.tm-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

/* ── 首屏菜单 ── */
.tm-menu { text-align: center; padding-top: 3vh; }

.tm-title {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 900;
  margin: 8px 0 6px;
  letter-spacing: 2px;
}

.tm-sub {
  color: #777;
  font-size: 15px;
  margin: 0 0 26px;
}

.tm-sub b { color: #f5a623; }
.tm-sub b.wat { color: #3aa0e8; }

.tm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 460px;
  margin: 0 auto;
}

.tm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 18px 20px;
  border: 2px solid #eee0c8;
  border-radius: 18px;
  background: #fffdf7;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  font-family: inherit;
}

.tm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(245, 179, 1, .18);
  border-color: #f5b301;
}

.tm-card:active { transform: translateY(0) scale(.98); }

.tm-card-icon { font-size: 44px; line-height: 1; }

.tm-card-name { font-size: 21px; font-weight: 800; color: #3d3d3d; }

.tm-card-sub { font-size: 13px; color: #8a8a8a; }

.tm-card-keys { font-size: 12px; color: #a0a0a0; margin-top: 4px; }

.tm-help {
  color: #999;
  font-size: 13px;
  margin: 18px 0 0;
}

.tm-help b { color: #f5a623; }

/* ── 游戏画布 ── */
.tm-canvas-wrap {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid #2e3b25;
  border-radius: 16px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 顶栏游戏工具钮 */
.tm-toolbar { gap: 8px; }

.tm-tool-btn {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
}

.tm-tool-btn:hover { background: rgba(0, 0, 0, .06); }

/* ── 覆盖层（过关） ── */
.tm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 26, 14, .5);
  border-radius: 16px;
  z-index: 5;
}

.tm-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 34px;
  border: 2px solid #eee0c8;
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
  text-align: center;
}

.tm-overlay-title { font-size: 26px; font-weight: 900; letter-spacing: 1px; }

.tm-score-line { font-size: 16px; color: #666; }

.tm-overlay-actions { display: flex; gap: 12px; margin-top: 6px; }

.tm-btn {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: 2px solid #e5d8bf;
  border-radius: 12px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.tm-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .1); }

.tm-btn-primary {
  background: #f5b301;
  border-color: #f5b301;
  color: #fff;
}

.tm-btn-primary:hover { box-shadow: 0 6px 14px rgba(245, 179, 1, .35); }

/* 窄屏 */
@media (max-width: 560px) {
  .tm-main { padding: 10px 10px 20px; }
  .tm-overlay-card { padding: 18px 20px; gap: 8px; }
  .tm-overlay-title { font-size: 21px; }
  .tm-btn { padding: 9px 16px; font-size: 14px; }
}
