/* 叶初小游戏 · 统一视觉基础样式
 * 所有重写后的游戏都引用这个文件，保证风格一致。
 * 配色：#0b1220 深底 / #4f9cf9 主蓝 / #ffd166 金色高亮 / #e9f1fb 文字
 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #16243a 0%, #080b12 72%);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  color: #e9f1fb; user-select: none; -webkit-user-select: none;
}
#wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; }
/* flex: 0 0 auto —— 画布万一一比容器宽（视口极窄 / 缩放算错），也别让舞台被 flex 压扁：
   压扁之后画布只能往右溢出，被 overflow:hidden 以方角裁掉，遮罩的圆角就盖不住右上 / 右下两个角。 */
#stage { position: relative; overflow: hidden; flex: 0 0 auto; }
canvas {
  display: block; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(120,180,255,.12) inset;
}
#hud {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none; font-size: 14px; letter-spacing: .3px;
}
.chip {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(8,14,24,.55); border: 1px solid rgba(120,180,255,.18);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.chip b { color: #9fe0ff; font-variant-numeric: tabular-nums; }
.chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.overlay {
  position: absolute; inset: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(6,10,18,.78);
  /* iOS Safari 18 之前只认带前缀的写法，没有这一行手机上就没有毛玻璃 */
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 10; padding: 16px;
}
.overlay.hidden { display: none; }
.panel { padding: 20px 26px; max-width: 92%; }
.panel h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: 2px; }
.panel p { margin: 6px 0; font-size: 13px; line-height: 1.8; color: #a7bbd8; }
.panel kbd {
  display: inline-block; min-width: 22px; padding: 2px 7px; margin: 0 1px;
  border-radius: 6px; font-size: 12px; font-weight: 700; font-family: inherit;
  background: #253247; border: 1px solid #3a4c69; border-bottom-width: 3px; color: #dce7f7;
}
.btn {
  margin-top: 16px; padding: 11px 26px; font-family: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: 1px; color: #fff; background: linear-gradient(135deg, #2f7bf6, #4f9cf9);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(47,123,246,.45);
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); box-shadow: none; color: #cfe0f7; }
#banner {
  position: absolute; left: 0; right: 0; top: 42%; transform: translateY(-50%);
  font-size: clamp(14px, 3.8vw, 21px); font-weight: 800; letter-spacing: clamp(1px, .6vw, 3px);
  color: #ffd166; text-align: center; white-space: nowrap;
  text-shadow: 0 4px 20px rgba(0,0,0,.85); opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
#banner.show { opacity: 1; }
#hint {
  position: absolute; left: 0; right: 0; bottom: 8px; padding: 0 12px;
  font-size: clamp(10px, 2.6vw, 12px); color: rgba(200,220,245,.75); letter-spacing: 1px;
  text-align: center; pointer-events: none; white-space: nowrap;
}

/* 小屏（手机 / 矮窗口）：压紧说明面板，保证内容不超出画布；
   极端情况下面板内部滚动，不会再把上下两端切掉。 */
@media (max-width: 760px), (max-height: 620px) {
  .overlay { padding: 5px; }
  .panel { padding: 6px 10px; max-height: 100%; overflow-y: auto; }
  .panel h1 { font-size: 16px; letter-spacing: 1px; margin: 0 0 3px; }
  .panel p { font-size: 10.5px; line-height: 1.35; margin: 1px 0; }
  .panel kbd { font-size: 10px; min-width: 16px; padding: 1px 4px; border-bottom-width: 2px; }
  .btn { margin-top: 7px; padding: 7px 16px; font-size: 12.5px; }
  #hud { font-size: 11px; top: 5px; left: 5px; right: 5px; }
  .chip {
    padding: 3px 8px;
    /* 手机上关掉毛玻璃：部分机型 backdrop-filter 会在图标下面糊出一层阴影 */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(8,14,24,.72);
  }
  .chip .dot { width: 7px; height: 7px; margin-right: 5px; flex: 0 0 auto; vertical-align: 0; }
  /* 底部提示允许换行，避免长句被截断 */
  #hint {
    bottom: 6px; padding: 0 8px; white-space: normal;
    line-height: 1.35; font-size: 10px; letter-spacing: 0;
  }
}
