/* allenshih.com — Under Construction 可愛蓋樓小遊戲
   奶油底粉彩畫風;圓角卡片;背景淡色字海;遊戲本體在 canvas(粉彩積木+小表情)。 */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
/* 真機 Safari 動態工具列:用動態視口高度,避免底部被吃掉 */
@supports (height: 100dvh) { body { height: 100dvh; } }
body {
  font-family: "Arial Rounded MT Bold", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #5A4A42;
  background: #FFF6EC;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── 頂欄/頁尾 ── */
.bar, .ftr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 2.3vw, 33px);
  font-size: 14px;
  z-index: 5;
}
.wordmark { font-size: 17px; }
.bar a, .ftr a { color: #5A4A42; text-decoration: none; }
.bar a:hover, .ftr a:hover { text-decoration: underline; }
.ftr { font-size: 12px; color: rgba(90, 74, 66, .55); }
.ftr a { color: rgba(90, 74, 66, .55); }

/* ── 背景字海(改淡粉彩) ── */
.uc { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.rows {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 1vh;
  user-select: none; pointer-events: none;
  opacity: .5;
}
.row { overflow: hidden; white-space: nowrap; }
.track { display: inline-flex; will-change: transform; }
.track span {
  font-size: clamp(64px, 11vw, 150px);
  line-height: 1.04;
  padding-right: .3em;
  color: transparent;
  -webkit-text-stroke: 2px #F5DBC8;
}
.r1 .track { animation: mLeft 38s linear infinite; }
.r2 .track { animation: mRight 46s linear infinite; }
.r3 .track { animation: mLeft 30s linear infinite; }
.r4 .track { animation: mRight 54s linear infinite; }
@keyframes mLeft  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes mRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ── 遊戲卡片(圓角軟陰影) ── */
.card {
  position: relative; z-index: 3;
  background: #fff;
  border: 3px solid #5A4A42;
  border-radius: 22px;
  box-shadow: 0 14px 0 rgba(90, 74, 66, .16);
  width: min(92vw, 440px);
  padding: clamp(16px, 2.5vh, 24px) clamp(18px, 3vw, 26px);
  text-align: center;
  display: flex; flex-direction: column;
  max-height: 88%;
}
.card-t { font-size: clamp(20px, 2.6vw, 28px); }
.card-t .uc-emoji { font-size: .85em; }
.card-s { margin-top: 4px; font-size: 11px; letter-spacing: .22em; color: rgba(90, 74, 66, .6); }
.hud {
  display: flex; justify-content: space-between;
  margin: 12px 2px 8px;
  font-size: 12px; letter-spacing: .1em;
  color: rgba(90, 74, 66, .6);
}
.hud b { color: #5A4A42; font-size: 17px; margin-left: .3em; }

/* ── 遊戲舞台 ── */
.stage {
  position: relative;
  border: 3px solid #5A4A42;
  border-radius: 16px;
  flex: 1; min-height: 300px; height: min(48vh, 430px);
  cursor: pointer;
  touch-action: none;
  overflow: hidden;
  background: linear-gradient(180deg, #EAF6FF 0%, #FFF9F0 100%);
}
#game { display: block; width: 100%; height: 100%; }
.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255, 252, 246, .88);
  transition: opacity .25s ease;
  pointer-events: none;
}
.overlay.hide { opacity: 0; }
.ov-t { font-size: clamp(17px, 2.2vw, 22px); }
.ov-s { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(90, 74, 66, .6); }

.card-mail { margin-top: 12px; font-size: 13px; }
.card-mail a { color: #5A4A42; text-decoration: none; border-bottom: 2px solid #FFB5A7; padding-bottom: 1px; }
.card-mail a:hover { background: #FFB5A7; color: #fff; }

@media (prefers-reduced-motion: reduce) { .track { animation: none; } }
@media (max-width: 600px) {
  body { overflow-y: auto; overflow-x: hidden; } /* 保底:萬一超高,允許捲動而不是被裁掉 */
  .card { width: 94vw; box-shadow: 0 10px 0 rgba(90, 74, 66, .16); margin: 8px 0; }
  .stage { height: min(48dvh, 420px); min-height: 200px; }
  .track span { font-size: 17vw; }
}
/* 矮螢幕(真機開著瀏覽器工具列)整體緊湊化 */
@media (max-height: 740px) {
  .bar, .ftr { padding-top: 10px; padding-bottom: 10px; }
  .card { padding-top: 10px; padding-bottom: 10px; }
  .card-t { font-size: 18px; }
  .card-s { display: none; }
  .hud { margin: 8px 2px 4px; }
  #shelf { height: 32px; margin-bottom: 4px; }
  .stage { height: min(46dvh, 360px); min-height: 180px; }
}

/* ── 車庫縮圖列 ── */
#shelf { width: 100%; height: 40px; display: block; margin-bottom: 8px; }

/* ── 開箱圖鑑卡 ── */
.unboxcard {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  background: #fff;
  border: 2.5px solid #5A4A42;
  border-radius: 14px;
  padding: 12px 14px 10px;
  text-align: center;
  box-shadow: 0 6px 0 rgba(90, 74, 66, .15);
  transition: transform .25s ease, opacity .25s ease;
}
.unboxcard.hide { opacity: 0; pointer-events: none; transform: translateY(14px); }
.ub-badge {
  display: inline-block;
  font-size: 10px; letter-spacing: .18em;
  padding: 2px 12px; border-radius: 999px;
  background: #EAE4DC; color: #5A4A42;
}
.ub-badge.new { background: #B7E4C7; }
.ub-badge.rare { background: #F5C518; }
.ub-name { font-size: 16px; margin-top: 6px; }
.ub-insp { font-size: 10px; letter-spacing: .22em; color: rgba(90,74,66,.55); margin: 2px 0 8px; }
.ub-specs { display: flex; justify-content: center; gap: 20px; font-size: 10px; color: rgba(90,74,66,.6); }
.ub-specs b { font-size: 14px; color: #5A4A42; }
.ub-fact { font-size: 12px; margin-top: 8px; }
.ub-cont { font-size: 10px; letter-spacing: .15em; color: rgba(90,74,66,.5); margin-top: 8px; }

/* 視覺饗宴版極簡卡 */
.unboxcard.mini { padding: 10px 14px; }
.unboxcard.mini .ub-name { font-size: 15px; }
