/* ============================================================
   shell.css —— 小游戏合集统一视觉
   所有页面共用：<link rel="stylesheet" href="../common/shell.css">
   ============================================================ */

:root{
  /* 主色系 */
  --c-bg1     : #fdfcf8;
  --c-bg2     : #faf8ef;
  --c-bg3     : #f2ecdf;
  --c-main    : #8f7a66;
  --c-main-d  : #7c6a58;
  --c-text    : #776e65;
  --c-sub     : #bbada0;
  --c-line    : rgba(120,108,94,0.12);

  /* 卡片 */
  --c-card    : #ffffff;
  --c-card-sh : 0 2px 12px rgba(120,108,94,0.10);
  --c-card-sh2: 0 6px 22px rgba(120,108,94,0.16);

  /* 圆角 */
  --r-sm : 10px;
  --r-md : 14px;
  --r-lg : 20px;
}

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body{
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--c-bg1) 0%, var(--c-bg2) 50%, var(--c-bg3) 100%);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 通用容器 ---------- */
#app{
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- 顶栏 ---------- */
.topbar{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
  gap: 10px;
}

.topbar .tb-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar .tb-title{
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .tb-sub{
  font-size: 11px;
  font-weight: 600;
  color: var(--c-sub);
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.topbar .tb-right{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* 返回按钮 */
.btn-back{
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(187,173,160,0.20);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  flex: 0 0 auto;
}
.btn-back:active{
  transform: scale(0.92);
  background: rgba(187,173,160,0.34);
}

/* 圆形图标按钮 */
.btn-icon{
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(187,173,160,0.20);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  flex: 0 0 auto;
}
.btn-icon:active{
  transform: scale(0.92);
  background: rgba(187,173,160,0.34);
}
.btn-icon.off{ opacity: 0.45; }

/* 分数盒 */
.score-box{
  background: var(--c-sub);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  min-width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-box .lb{
  font-size: 10px;
  font-weight: 700;
  color: #eee4da;
  letter-spacing: 1px;
  line-height: 1;
}
.score-box .vl{
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* ---------- 主体区 ---------- */
.stage{
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.stage canvas{
  display: block;
  touch-action: none;
}

/* ---------- 主按钮 ---------- */
.btn-main{
  padding: 13px 46px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--c-main);
  color: #f9f6f2;
  font: 700 15px/1 -apple-system, "PingFang SC", sans-serif;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-main:active{
  transform: scale(0.95);
  background: var(--c-main-d);
}

.btn-ghost{
  padding: 12px 32px;
  border: 2px solid rgba(143,122,102,0.30);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-main);
  font: 700 14px/1 -apple-system, "PingFang SC", sans-serif;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-ghost:active{
  transform: scale(0.95);
  background: rgba(143,122,102,0.10);
}

/* ---------- 遮罩弹层 ---------- */
.overlay{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(250,248,239,0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.overlay.show{
  display: flex;
  animation: ovFadeIn 0.28s ease;
}
@keyframes ovFadeIn{
  from{ opacity: 0; }
  to  { opacity: 1; }
}

.overlay .ov-title{
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--c-text);
  text-align: center;
}
.overlay .ov-sub{
  font-size: 13px;
  font-weight: 600;
  color: var(--c-sub);
  margin: 12px 0 28px;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.6;
}
.overlay .ov-actions{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ---------- 底部提示 ---------- */
.hint{
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  color: #c3b6a8;
  letter-spacing: 1px;
  padding: 10px 18px 18px;
  transition: opacity 0.4s ease;
}

/* ---------- 分数飘字 ---------- */
.float-add{
  position: fixed;
  left: 50%;
  font-size: 19px;
  font-weight: 800;
  color: var(--c-text);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  z-index: 50;
  font-variant-numeric: tabular-nums;
}

/* ---------- 通用工具类 ---------- */
.hidden{ display: none !important; }
.no-pointer{ pointer-events: none; }
