/* ============================================================
   games.css - 各小游戏专属样式（全部限定在模态内部）
   ============================================================ */

/* ---------- 连连看（生日花园） ---------- */
.onet-head { display: flex; justify-content: space-between; width: 100%; align-items: center; font-size: 0.95rem; }
.onet-props { display: flex; gap: 8px; }
.onet-prop-btn {
    background: #fff; border: 2px solid var(--pink); border-radius: 10px;
    padding: 4px 10px; cursor: pointer; font-size: 0.85rem;
}
.onet-prop-btn:disabled { opacity: 0.4; }
.onet-grid {
    display: grid; gap: 5px; width: 100%; max-width: 340px;
    background: rgba(255,255,255,0.75); padding: 8px; border-radius: 14px;
    position: relative;
}
.onet-tile {
    aspect-ratio: 1; background: #fff; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(18px, 6vw, 30px); cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08); transition: transform 0.12s, background 0.12s;
}
.onet-tile.selected { background: var(--butter); transform: scale(1.08); box-shadow: 0 0 10px var(--butter); }
.onet-tile.hinted { animation: gb-wobble 0.5s 2; background: #d9f2e8; }
.onet-tile.gone { visibility: hidden; pointer-events: none; }
.onet-canvas-layer { position: absolute; inset: 0; pointer-events: none; z-index: 10; }

/* ---------- 打雷云（月光森林） ---------- */
.cloud-arena {
    position: relative; width: 100%; max-width: 360px; height: 320px;
    border-radius: var(--radius-md); overflow: hidden;
    background: linear-gradient(180deg, #21315c, #35507e 60%, #4a6b78);
}
.cloud-arena .moonlit { position: absolute; right: 10%; top: 8%; font-size: 1.8rem; opacity: 0.9; }
.monster-cloud {
    position: absolute; font-size: 2.6rem; cursor: pointer; line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35)); will-change: top;
}
.monster-cloud:active { transform: scale(0.8); }
.cloud-hud { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; color: #eef4ff; font-size: 0.9rem; z-index: 5; }
.bar-bg { width: 110px; height: 10px; background: rgba(255,255,255,0.3); border-radius: 5px; overflow: hidden; border: 1px solid rgba(255,255,255,0.6); display: inline-block; vertical-align: middle; }
.bar-fill { height: 100%; background: #ff6b6b; transition: width 0.25s; }

/* ---------- Flappy / 节奏等 canvas 游戏共用 ---------- */
.canvas-wrap { position: relative; width: 100%; max-width: 360px; }
.canvas-wrap canvas { background: transparent; }

/* ---------- 蓄力跳 ---------- */
/* 全部逻辑在 canvas 内绘制，无额外样式 */

/* ---------- 旋转拼图 ---------- */
.spin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: min(84vw, 264px); }
.spin-piece {
    aspect-ratio: 1; background: #fff; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.3rem; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.spin-piece.ok { box-shadow: 0 0 0 2px var(--mint), 0 4px 10px rgba(0,0,0,0.1); }

/* ---------- 打恶魔 ---------- */
.boss-stage { position: relative; width: 100%; height: 300px; display: flex; align-items: center; justify-content: center; }
.boss-btn { font-size: 6.2rem; cursor: pointer; line-height: 1; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.2)); touch-action: none; }
.boss-btn:active { transform: scale(0.85); }
.boss-btn.shake { animation: gb-hardshake 0.25s; }
.click-effect {
    position: absolute; font-size: 1.3rem; color: var(--pink-deep);
    pointer-events: none; animation: gb-note-float 0.7s forwards; z-index: 20; font-weight: bold;
}

/* ---------- 接食物 ---------- */
.catch-arena {
    position: relative; width: 100%; max-width: 400px; height: 380px;
    border-radius: var(--radius-md); overflow: hidden; touch-action: none;
    background: linear-gradient(180deg, #ffeccf 0%, #ffdfba 72%, #e8b880 72.5%, #dc9f66 100%);
}
.catch-arena .faller { position: absolute; font-size: 1.9rem; line-height: 1; will-change: top; pointer-events: none; }
.catch-dog {
    position: absolute; bottom: 6px; width: 86px; height: 86px;
    transform: translateX(-50%); pointer-events: none;
}
.catch-dog svg { width: 100%; height: 100%; }
.keyboard-hint { font-size: 0.8rem; color: var(--text-soft); }

/* ---------- 戳气球 ---------- */
.balloon-field {
    position: relative; width: 100%; max-width: 400px; height: 380px;
    border-radius: var(--radius-md); overflow: hidden; touch-action: none;
    background: linear-gradient(180deg, #d7f0ff 0%, #ffe7ee 100%);
}
.balloon-item { position: absolute; cursor: pointer; line-height: 1; will-change: top; text-align: center; }
.balloon-item .ball { font-size: 2.6rem; animation: gb-balloondrift 3.2s ease-in-out infinite; display: block; }
.balloon-item.bomb .ball { font-size: 2.2rem; }
.balloon-item.secret .ball { opacity: 0.55; font-size: 2.3rem; }
.balloon-item.pop .ball { animation: gb-sparkle-out 0.35s forwards; }
.balloon-score-pop {
    position: absolute; font-size: 1.1rem; font-weight: bold; pointer-events: none;
    animation: gb-note-float 0.8s forwards;
}

/* ---------- 记忆翻牌 ---------- */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; width: min(88vw, 300px); }
.mcard { aspect-ratio: 0.85; perspective: 500px; cursor: pointer; }
.mcard .inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; transition: transform 0.4s cubic-bezier(0.4, 1.4, 0.6, 1);
}
.mcard.flipped .inner, .mcard.matched .inner { transform: rotateY(180deg); }
.mcard .face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.mcard .back { background: linear-gradient(135deg, #ffb3ba, #ffc9a8); color: #fff; font-size: 1.2rem; }
.mcard .front { background: #fffdf4; transform: rotateY(180deg); }
.mcard.matched .front { background: #e9f9f0; box-shadow: 0 0 0 2px var(--mint); }

/* ---------- 找找狗宝 ---------- */
.find-scene {
    position: relative; width: 100%; max-width: 420px; height: 380px;
    border-radius: var(--radius-md); overflow: hidden;
    background: linear-gradient(180deg, #fff2dc 0%, #f3ddb8 66%, #d9ab74 66.5%, #c99357 100%);
}
.find-item { position: absolute; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: transform 0.15s; }
.find-item:hover { transform: scale(1.15); }
.find-item.decoy { cursor: default; }
.find-item.found { animation: gb-sparkle-out 0.6s forwards; pointer-events: none; }
.find-item.wrong { animation: gb-wobble 0.4s; }

/* ---------- 节奏 ---------- */
.rhythm-wrap { width: 100%; max-width: 360px; }
.rhythm-judge {
    position: absolute; top: 30%; left: 50%; transform: translate(-50%,-50%);
    font-size: 1.5rem; color: var(--pink-deep); opacity: 0; pointer-events: none;
    transition: opacity 0.15s; text-shadow: 1px 1px 0 #fff;
}
.rhythm-judge.show { opacity: 1; animation: gb-pop 0.3s ease; }
.rhythm-pads { display: flex; gap: 10px; justify-content: center; width: 100%; }
.rhythm-pad {
    flex: 1; max-width: 110px; padding: 12px 0; border-radius: 14px; border: 2px solid var(--pink);
    background: #fff; font-size: 1.2rem; cursor: pointer;
}
.rhythm-pad:active { background: var(--butter); transform: scale(0.95); }

/* ---------- 礼物钥匙 / 开礼物 ---------- */
.gift-status { display: flex; gap: 14px; font-size: 2rem; margin: 6px 0; }
.gift-status .slot { opacity: 0.25; filter: grayscale(1); transition: all 0.4s; }
.gift-status .slot.got { opacity: 1; filter: none; animation: gb-pop 0.5s; }
.gift-box-big { font-size: 4.5rem; line-height: 1; cursor: pointer; }
.gift-box-big.open { animation: gb-pop 0.55s ease; }

/* ---------- 吹蜡烛 ---------- */
.candle-cake { font-size: 6.5rem; line-height: 1; position: relative; cursor: default; user-select: none; }
.blow-meter { width: 220px; height: 14px; background: rgba(255,255,255,0.8); border: 2px solid var(--pink); border-radius: 8px; overflow: hidden; }
.blow-meter i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ffd97a, #ff9aa2); transition: width 0.08s linear; }
.mic-note { font-size: 0.78rem; color: var(--text-soft); }

/* ---------- 蛋糕工坊 ---------- */
.studio-wrap { width: 100%; max-width: 400px; }
#cake-studio { background: #fffdf5; border-radius: var(--radius-md); touch-action: none; width: 100%; height: auto; display: block; }
.decor-palette { display: flex; justify-content: space-around; padding: 8px 4px; background: #fff0f3; border-radius: 0 0 14px 14px; border-top: 2px dashed var(--pink); flex-wrap: wrap; }
.decor-item { font-size: 1.7rem; cursor: pointer; padding: 4px; transition: transform 0.15s; }
.decor-item:active { transform: scale(1.3); }
.studio-tools { display: flex; gap: 8px; width: 100%; max-width: 400px; }
.studio-tools .gb-btn { flex: 1; padding: 10px 0; font-size: 0.9rem; }

/* ---------- 隐藏页 / 档案 ---------- */
.archive-page { text-align: left; width: 100%; max-width: 400px; }
.archive-page .row { display: flex; justify-content: space-between; border-bottom: 1px dashed #d8c3ad; padding: 7px 2px; font-size: 0.95rem; }
.archive-page .row b { font-weight: normal; color: var(--pink-deep); }

/* ---------- 结局彩带 ---------- */
.confetti {
    position: fixed; top: -5vh; font-size: 1.1rem; z-index: 1100; pointer-events: none;
    animation: gb-rise linear forwards;
}

/* ---------- 通用遮罩提示（游戏内胜利浮层） ---------- */
.stage-overlay {
    position: absolute; inset: 0; z-index: 60;
    background: rgba(255, 253, 247, 0.92); border-radius: var(--radius-md);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    text-align: center; padding: 16px;
}
.stage-overlay .big { font-size: 3rem; animation: gb-cakereveal 0.6s ease; }
.stage-overlay p { margin: 0; font-size: 1.05rem; line-height: 1.6; }
