/* Gacha Capsule Machine — cyan x violet toy accent */
body[data-theme] {
    --color-primary-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.45);
    --shadow-glow-lg: 0 0 40px rgba(139, 92, 246, 0.55);
    --accent-blue: #06b6d4;
}

.emoji-icon { font-size: 20px; }
.btn-add-item {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 8px; padding: 9px; border-radius: var(--radius-sm);
    border: 1px dashed var(--color-border); background: transparent;
    color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: var(--transition-fast); width: 100%;
}
.btn-add-item:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(6, 182, 212, 0.08); }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.empty-hint { font-size: 0.82rem; color: var(--text-muted); text-align: center; padding: 20px 0; }
.history-row {
    display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;
    background: rgba(15, 23, 42, 0.55); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm);
    font-size: 0.82rem; animation: rowIn 0.3s ease;
}
.history-row .h-idx { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; }
.history-row .h-name { font-weight: 700; color: var(--text-primary); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Gacha machine stage ---------- */
.gacha-stage { flex-direction: column; }

.gacha-machine {
    position: relative;
    width: min(80vw, 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gacha-machine::before { content: 'LUCKY\A PICK'; white-space: pre; position: absolute; z-index: 5; top: 228px; left: 50%; transform: translateX(-50%); text-align: center; font-family: var(--font-display); font-weight: 900; font-size: .82rem; line-height: .85; letter-spacing: .08em; color: #fff; text-shadow: 0 2px 0 rgba(67,56,202,.55); pointer-events: none; }

.gacha-dome {
    position: relative;
    width: 220px; height: 190px;
    border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at 26% 18%, rgba(255,255,255,.82) 0 5%, transparent 18%), radial-gradient(ellipse at 35% 31%, rgba(255,255,255,0.38), rgba(224,242,254,0.2) 38%, rgba(94,234,212,.20) 76%, rgba(14,116,144,.25) 100%);
    border: 4px solid rgba(255,255,255,0.7);
    box-shadow: inset 0 -10px 20px rgba(6, 182, 212, 0.15), 0 10px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 2;
}
.gacha-dome::after { content: ''; position: absolute; inset: 10px 16px 42%; border-radius: 50%; border-top: 2px solid rgba(255,255,255,.75); transform: rotate(-18deg); }

.capsule-dot {
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    box-shadow: inset -3px -3px 0 rgba(0,0,0,0.12), inset 2px 2px 0 rgba(255,255,255,0.4);
    animation: capsuleFloat 3.2s ease-in-out infinite;
}
@keyframes capsuleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(8deg); }
}
.gacha-dome.tumbling .capsule-dot {
    animation: capsuleTumble 0.35s ease-in-out infinite;
}
@keyframes capsuleTumble {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(6px, -8px) rotate(90deg); }
    50% { transform: translate(-5px, 4px) rotate(180deg); }
    75% { transform: translate(4px, 8px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.gacha-dome-rim {
    position: relative;
    width: 236px; height: 20px;
    background: linear-gradient(180deg, #a5f3fc, #67e8f9);
    border-radius: 12px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
    z-index: 3;
    margin-top: -8px;
}
.gacha-dome-rim::before, .gacha-dome-rim::after { content: ''; position: absolute; top: 50%; width: 10px; height: 10px; transform: translateY(-50%); border-radius: 50%; background: #fff; box-shadow: inset 0 -2px 0 rgba(14,116,144,.28); }
.gacha-dome-rim::before { left: 14px; } .gacha-dome-rim::after { right: 14px; }

.gacha-body {
    position: relative;
    width: 260px; height: 150px;
    background: radial-gradient(circle at 20% 16%, rgba(255,255,255,.34), transparent 18%), linear-gradient(135deg, #2dd4bf 0%, #159ec0 45%, #7c3aed 100%);
    border-radius: 20px;
    box-shadow: 0 16px 30px rgba(0,0,0,0.25), inset 0 4px 0 rgba(255,255,255,0.25);
    z-index: 2;
    margin-top: -4px;
}
.gacha-body::before { content: ''; position: absolute; left: 50%; bottom: 26px; width: 84px; height: 42px; transform: translateX(-50%); border-radius: 10px; border: 3px solid rgba(49,46,129,.5); background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(30,41,100,.18)); }
.gacha-body::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 8px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.28); }

.gacha-crank {
    position: absolute;
    right: -22px; top: 30px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    border: 3px solid #b45309;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.gacha-crank::after { content: ''; position: absolute; inset: 8px; border: 2px dotted rgba(120,53,15,.55); border-radius: 50%; }
.gacha-crank .crank-knob {
    position: absolute; left: 50%; top: -14px; transform: translateX(-50%);
    width: 10px; height: 18px; background: #b45309; border-radius: 4px;
}
.gacha-crank.turning { transform: rotate(360deg); }
.gacha-crank:disabled { opacity: .55; cursor: not-allowed; }
.gacha-crank:active { filter: brightness(0.92); }

.gacha-coin-slot {
    position: absolute; left: 30px; top: 30px;
    width: 36px; height: 10px;
    background: #1e1b4b;
    border-radius: 4px;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.6);
}

.gacha-chute {
    position: absolute;
    left: 50%; bottom: -18px; transform: translateX(-50%);
    width: 60px; height: 30px;
    background: linear-gradient(180deg, #7c3aed, #5b21b6);
    clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
}

.gacha-tray {
    position: relative;
    width: 200px; height: 54px;
    background: linear-gradient(180deg, #fff, #c7d2fe 56%, #a5b4fc);
    border: 3px solid #a5b4fc;
    border-radius: 0 0 16px 16px;
    margin-top: 6px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.12);
}

/* Candy-toy machine material: acrylic dome, enamel body, and a small floor shadow. */
.gacha-stage { background: radial-gradient(ellipse at 50% 92%, rgba(88, 56, 198, .2), transparent 38%), radial-gradient(circle at 13% 18%, rgba(255,255,255,.45) 0 3px, transparent 4px) 0 0 / 42px 42px, linear-gradient(180deg, #dff6ff, #ebdcff); }
.gacha-machine { filter: drop-shadow(0 19px 12px rgba(66,46,135,.2)); }
.gacha-dome { box-shadow: inset 12px 10px 0 rgba(255,255,255,.3), inset -12px -10px 0 rgba(37,99,235,.13), 0 8px 0 rgba(79,70,229,.22); }
.gacha-body { box-shadow: inset 8px 5px 0 rgba(255,255,255,.24), inset -8px -9px 0 rgba(49,46,129,.14), 0 12px 0 rgba(67,56,202,.18); }

.dispensed-capsule {
    position: relative;
    width: 70px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    animation: capsuleDrop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dispensed-capsule.hidden { display: none; }
@keyframes capsuleDrop {
    0% { transform: translateY(-90px) scale(0.6); opacity: 0; }
    70% { transform: translateY(4px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); }
}
.capsule-half {
    position: absolute; width: 70px; height: 22px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.capsule-half.top { top: 0; border-radius: 35px 35px 0 0; box-shadow: inset -4px -4px 0 rgba(0,0,0,0.1); }
.capsule-half.bottom { bottom: 0; border-radius: 0 0 35px 35px; box-shadow: inset -4px 4px 0 rgba(0,0,0,0.08); }
.dispensed-capsule.opened .capsule-half.top { transform: translateY(-30px) rotate(-15deg); }
.dispensed-capsule.opened .capsule-half.bottom { transform: translateY(30px) rotate(10deg); }

.capsule-ticket {
    position: relative; z-index: 2;
    max-width: 150px;
    padding: 6px 12px;
    background: #fffbeb;
    border: 2px dashed #f59e0b;
    border-radius: 8px;
    font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; color: #78350f;
    text-align: center;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s, opacity 0.3s ease 0.25s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dispensed-capsule.opened .capsule-ticket { opacity: 1; transform: scale(1); }

@media (max-width: 640px) {
    .gacha-dome { width: 180px; height: 156px; }
    .gacha-dome-rim { width: 196px; }
    .gacha-body { width: 216px; height: 128px; }
    .gacha-tray { width: 170px; }
}
.game-help { margin: 0 0 28px; padding: 26px; }.game-help h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 16px; }.game-help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }.game-help article { padding: 16px; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); background: var(--color-surface-hover); }.game-help h3 { color: var(--accent-blue); font-family: var(--font-display); font-size: 1rem; margin-bottom: 7px; }.game-help p { color: var(--text-secondary); font-size: .88rem; line-height: 1.75; }@media (max-width:720px){.game-help{padding:20px 16px}.game-help-grid{grid-template-columns:1fr}}
