/* ============================================================
   婚礼游戏厅 · NES/FC 像素街机风（单一主题）
   纯静态 / 无存储 / 移动端优先
   ============================================================ */

:root {
  --bg: #14142b;
  --surface: #232347;
  --surface2: #2c2c54;
  --line: #3a3a66;
  --text: #f4f4ff;
  --muted: #9aa0c7;
  --gold: #ffd23f;
  --pink: #ff5d8f;
  --mint: #6ee7b7;
  --danger: #ff6b6b;
  --sky: #7bdff2;
  --shadow: 4px 4px 0 #0b0b18;
  --shadow-sm: 2px 2px 0 #0b0b18;
  --font-pixel: "Press Start 2P", "PingFang SC", "Microsoft YaHei", monospace;
  --font-body: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --maxw: 760px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  /* 像素网格底纹 */
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 16px 16px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-user-select: none;
  user-select: none;
}
/* CRT 扫描线 */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  opacity: .35;
}
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; min-height: 100dvh;
}

/* ---------- 顶部霓虹招牌 ---------- */
.arcade-header { text-align: center; padding: 8px 0 18px; }
.marquee {
  display: inline-block; padding: 12px 22px;
  border: 3px solid var(--gold);
  background: #1b1b38;
  box-shadow: var(--shadow), 0 0 22px rgba(255, 210, 63, .28);
}
.marquee-text {
  font-family: var(--font-body); font-weight: 800;
  font-size: clamp(20px, 6vw, 30px); letter-spacing: 2px; color: var(--gold);
  text-shadow: 2px 2px 0 #0b0b18;
}
.marquee-text .heart { color: var(--pink); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.marquee-sub {
  font-family: var(--font-pixel); font-size: 9px; letter-spacing: 1px;
  color: var(--muted); margin: 14px 0 0;
}

/* ---------- 视图 ---------- */
.view { flex: 1; padding: 2px 0 20px; }

/* ---------- 倒计时英雄区 ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border: 3px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); padding: 20px 14px 22px; margin-bottom: 18px;
}
.hero-label { font-family: var(--font-pixel); font-size: 9px; color: var(--sky); margin: 0 0 14px; letter-spacing: 1px; }
.countdown { display: flex; justify-content: center; gap: 7px; flex-wrap: nowrap; }
.cd-cell {
  background: var(--surface2); border: 2px solid var(--line);
  box-shadow: var(--shadow-sm); padding: 10px 4px; min-width: 58px;
}
.cd-num { font-family: var(--font-pixel); font-size: 20px; color: var(--gold); }
.cd-label { font-size: 10px; color: var(--muted); margin-top: 6px; }
.hero-done { font-family: var(--font-pixel); font-size: 15px; color: var(--pink); line-height: 1.8; }
.hero-date { font-size: 11px; color: var(--muted); margin: 14px 0 0; }

/* 装饰飘字（纯 CSS，无输入无存储） */
.float-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float-word {
  position: absolute; left: 100%; white-space: nowrap;
  font-size: 12px; color: var(--muted);
  opacity: .5; animation: floatAcross linear infinite;
}
/* 用 left 位移：transform 百分比只相对自身宽度，不足以横穿屏幕 */
@keyframes floatAcross {
  from { left: 100%; } to { left: -75%; }
}

/* ---------- 街机卡片宫格 ---------- */
.arcade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.arcade-card {
  cursor: pointer; border: 3px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); padding: 0; text-align: left;
  transition: transform .07s, border-color .15s;
}
.arcade-card:active { transform: translate(2px, 2px); }
.arcade-card:hover { border-color: var(--gold); }
.card-screen {
  height: 84px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: #1b1b38; border-bottom: 3px solid var(--line);
}
.card-body { padding: 12px 13px 14px; }
.card-name {
  font-family: var(--font-body); font-weight: 800; font-size: 15px;
  color: var(--text); margin: 0 0 6px;
}
.card-desc { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0; }
.card-tag {
  display: inline-block; margin-top: 9px; font-family: var(--font-pixel);
  font-size: 7px; letter-spacing: .5px; color: var(--gold);
  border: 1px solid var(--gold); padding: 4px 6px;
}

/* ---------- 通用 ---------- */
.card {
  background: var(--surface); border: 3px solid var(--line);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.btn {
  font-family: var(--font-body); font-weight: 800; font-size: 15px;
  cursor: pointer; padding: 13px 18px;
  border: 3px solid var(--gold); background: var(--gold); color: #221a05;
  box-shadow: var(--shadow-sm); transition: transform .07s;
}
.btn:active { transform: translate(2px, 2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--gold); }
.btn.block { width: 100%; }
.btn.pink { border-color: var(--pink); background: var(--pink); color: #2a0a16; }
.center { text-align: center; }
.muted { color: var(--muted); }
.h2 { font-family: var(--font-pixel); font-size: 12px; margin: 0 0 14px; color: var(--gold); line-height: 1.7; }

/* 返回按钮 */
.back-btn {
  cursor: pointer; font-family: var(--font-pixel); font-size: 9px;
  padding: 9px 13px; margin-bottom: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.back-btn:active { transform: translate(2px, 2px); }

/* HUD */
.hud { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hud-item {
  flex: 1; text-align: center; background: var(--surface2);
  border: 2px solid var(--line); box-shadow: var(--shadow-sm); padding: 8px 6px;
}
.hud-val { font-family: var(--font-pixel); font-size: 16px; color: var(--gold); }
.hud-key { font-size: 10px; color: var(--muted); margin-top: 5px; }

/* ---------- 接捧花 ---------- */
.catch-stage {
  position: relative; height: 340px; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, #1b1b38 0%, #171732 100%);
  border: 3px solid var(--line); box-shadow: var(--shadow); margin-bottom: 12px;
}
.basket {
  position: absolute; bottom: 8px; font-size: 34px; line-height: 1;
  will-change: transform; transition: transform .05s linear; pointer-events: none;
}
.falling {
  position: absolute; font-size: 28px; line-height: 1;
  will-change: transform; pointer-events: none;
}
.catch-controls { display: flex; gap: 10px; }
.ctrl-btn {
  flex: 1; cursor: pointer; font-size: 26px; padding: 12px 0;
  border: 3px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
}
.ctrl-btn:active { transform: translate(2px, 2px); }

/* ---------- 默契配对 ---------- */
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.mcard {
  aspect-ratio: 3 / 4; perspective: 600px; cursor: pointer; background: none;
  border: none; padding: 0;
}
.mcard-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .28s;
}
.mcard.flipped .mcard-inner { transform: rotateY(180deg); }
.mcard-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--line); box-shadow: var(--shadow-sm); font-size: 26px;
}
.mcard-back { background: var(--surface2); color: var(--gold); font-family: var(--font-pixel); font-size: 11px; }
.mcard-front { background: var(--surface); transform: rotateY(180deg); }
.mcard.matched .mcard-face { border-color: var(--mint); background: #1f3a30; }

/* ---------- 转盘 ---------- */
.wheel-stage { display: flex; flex-direction: column; align-items: center; }
.wheel-pointer { font-size: 30px; color: var(--gold); margin-bottom: -8px; filter: drop-shadow(0 2px 0 #0b0b18); }
.wheel-canvas { width: min(78vw, 300px); height: min(78vw, 300px); touch-action: manipulation; }

/* ---------- 弹窗 ---------- */
.modal-root { position: fixed; inset: 0; display: none; z-index: 500; }
.modal-root.show { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(5,5,15,.78); }
.modal-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(86vw, 350px); background: var(--surface); color: var(--text);
  border: 3px solid var(--gold); box-shadow: var(--shadow); padding: 24px 20px; text-align: center;
}
.modal-title { font-family: var(--font-pixel); font-size: 11px; color: var(--gold); margin: 0 0 16px; line-height: 1.8; }
.modal-text { font-size: 15px; line-height: 1.8; margin: 0 0 20px; white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ---------- 页脚 ---------- */
.arcade-footer { text-align: center; font-size: 11px; color: var(--muted); padding: 10px 0 2px; }

/* ---------- 分区标题 ---------- */
.section-title {
  font-family: var(--font-pixel); font-size: 9px; color: var(--sky);
  letter-spacing: 1px; margin: 0 0 12px;
}

/* ---------- 叠蛋糕 ---------- */
.stack-stage {
  position: relative; height: 340px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #1b1b38 0%, #171732 100%);
  border: 3px solid var(--line); box-shadow: var(--shadow); touch-action: manipulation;
}
.stack-inner { position: absolute; left: 0; bottom: 0; width: 100%; transition: transform .18s ease-out; }
.cake-layer {
  position: absolute; height: 26px;
  background: linear-gradient(180deg, #ffe0ec, #ffb3cd);
  border: 2px solid #b3688a; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.cake-layer.moving { background: linear-gradient(180deg, #fff2dc, #ffd79a); border-color: #b98b46; }
.cake-crumb { position: absolute; height: 26px; background: #ffb3cd; border: 2px solid #b3688a; opacity: .9; }

/* ---------- 套圈圈 ---------- */
.toss-stage {
  position: relative; height: 320px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #1b1b38 0%, #171732 100%);
  border: 3px solid var(--line); box-shadow: var(--shadow); touch-action: manipulation;
}
.toss-peg { position: absolute; font-size: 30px; line-height: 1; }
.toss-ring {
  position: absolute; width: 36px; height: 36px; border-radius: 50%;
  border: 6px solid var(--gold); box-shadow: 0 0 0 2px #0b0b18 inset, var(--shadow-sm);
}
.toss-launcher { position: absolute; bottom: 4px; font-size: 22px; line-height: 1; }
.toss-aim { position: absolute; bottom: 0; width: 2px; background: var(--gold); opacity: .55; }

/* ---------- 抢捧花拔河 ---------- */
.tug-stage {
  position: relative; height: 300px; display: flex; overflow: hidden;
  border: 3px solid var(--line); box-shadow: var(--shadow); touch-action: manipulation;
}
.tug-half {
  flex: 1; position: relative; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  -webkit-user-select: none; user-select: none;
}
.tug-half.left { background: linear-gradient(180deg, #1b2a4a, #16223a); }
.tug-half.right { background: linear-gradient(180deg, #4a1b33, #3a1626); }
.tug-half:active { filter: brightness(1.3); }
.tug-name { font-family: var(--font-pixel); font-size: 10px; color: var(--gold); }
.tug-taps { font-family: var(--font-pixel); font-size: 9px; color: var(--muted); }
.tug-rope { position: absolute; top: 66%; left: 0; width: 100%; height: 4px; background: var(--line); }
.tug-marker {
  position: absolute; top: 66%; left: 50%;
  width: 46px; height: 46px; margin-top: -21px;
  font-size: 32px; line-height: 1; text-align: center;
  will-change: transform; transition: transform .07s linear;
}
.tug-center { position: absolute; top: 66%; left: 50%; width: 2px; height: 26px; margin-top: -13px; background: var(--line); }

/* ---------- 放飞白鸽 ---------- */
.dove-stage {
  position: relative; height: 340px; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, #1b1b38 0%, #171732 100%);
  border: 3px solid var(--line); box-shadow: var(--shadow); touch-action: manipulation;
}
.dove-canvas { display: block; width: 100%; height: 100%; }

/* ---------- 拼出囍字 ---------- */
.pz-stage {
  position: relative; width: min(92vw, 320px); aspect-ratio: 1 / 1;
  margin: 0 auto; overflow: hidden;
  background: #1b1b38; border: 3px solid var(--line); box-shadow: var(--shadow);
}
.pz-tile {
  position: absolute; left: 0; top: 0; overflow: hidden; cursor: pointer;
  background: var(--surface2); border: 1px solid #0b0b18;
  transition: transform .16s ease-out;
}
.pz-tile:active { filter: brightness(1.25); }
.pz-tile.done { border-color: var(--gold); cursor: default; }
.pz-inner {
  position: absolute; text-align: center; color: var(--pink);
  font-weight: 700; text-shadow: 0 0 8px rgba(255, 93, 143, .45);
  -webkit-user-select: none; user-select: none;
}

/* ---------- 双按钮行 ---------- */
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- 窄屏 ---------- */
@media (max-width: 360px) {
  .arcade-grid { grid-template-columns: 1fr; }
  .cd-cell { min-width: 50px; }
  .cd-num { font-size: 17px; }
}
@media (min-width: 560px) {
  .arcade-grid { grid-template-columns: repeat(4, 1fr); }
  .card-screen { height: 96px; }
}
