/* Poring Smash Custom Styles */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Itim&display=swap');

:root {
    --ps-primary: #a855f7;
    --ps-secondary: #ec4899;
    --ps-dark: #1e1b4b;
    --ps-light: #fdf4ff;
    --ps-glass-bg: rgba(255, 255, 255, 0.1);
    --ps-glass-border: rgba(255, 255, 255, 0.2);
}

.ps-wrapper {
    font-family: 'Itim', cursive;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: url('../images/minigame/bg.png') no-repeat center center;
    background-size: cover;
}

/* Glassmorphism Panel */
.ps-panel {
    background: var(--ps-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ps-glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    z-index: 10;
    max-width: 600px;
    width: 100%;
}

/* Titles */
.ps-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    font-weight: 400;
    background: linear-gradient(to right, #ff7eb3, #ff758c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ps-subtitle {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Custom Cursor */
.ps-game-area {
    cursor: url('/assets/images/minigame/hammer_cursor.png') 16 16, pointer;
    position: relative;
}
.ps-game-area * {
    cursor: url('/assets/images/minigame/hammer_cursor.png') 16 16, pointer;
}

/* Game Grid */
.ps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0 auto;
    max-width: 450px;
}

.ps-hole {
    width: 100%;
    aspect-ratio: 1/1;
    position: relative;
    background: url('../images/minigame/hole.png') no-repeat center bottom;
    background-size: contain;
    overflow: hidden;
    border-radius: 50%;
}

.ps-monster {
    width: 80%;
    height: 80%;
    position: absolute;
    bottom: -100%;
    left: 10%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    transition: bottom 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; /* Let the hole capture clicks if needed, or JS handles it */
}

.ps-hole.active .ps-monster {
    bottom: 10%;
    pointer-events: auto; /* Clickable when up */
}

/* Monster Types */
.ps-monster.poring { background-image: url('../images/minigame/poring.png'); }
.ps-monster.poporing { background-image: url('../images/minigame/poporing.png'); }
.ps-monster.ghostring { background-image: url('../images/minigame/ghostring.png'); }
.ps-monster.bombring { background-image: url('../images/minigame/bombring.png'); }

/* Hit Animation */
.ps-monster.hit {
    transform: scale(0.9) translateY(20px);
    filter: brightness(0.5) sepia(1) hue-rotate(-50deg) saturate(5);
    opacity: 0.5;
    transition: all 0.1s;
}

/* HUD */
.ps-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 1rem;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.ps-hud-item span {
    color: #ffeb3b;
}

/* Buttons */
.ps-btn {
    background: linear-gradient(135deg, var(--ps-primary), var(--ps-secondary));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.5);
    transition: all 0.2s;
    font-family: 'Itim', cursive;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ps-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 25px -5px rgba(236, 72, 153, 0.6);
}

.ps-btn:active {
    transform: translateY(1px);
}

/* Floating Text */
.ps-float-text {
    position: absolute;
    color: white;
    font-weight: 900;
    font-size: 2rem;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    text-shadow: 0 3px 6px rgba(0,0,0,0.8);
    z-index: 50;
}
.ps-float-text.positive { color: #4ade80; }
.ps-float-text.negative { color: #f87171; }
.ps-float-text.super { color: #facc15; font-size: 2.5rem; }

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

/* Leaderboard */
.ps-leaderboard {
    margin-top: 2rem;
    text-align: left;
    background: rgba(0,0,0,0.5);
    border-radius: 1rem;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}
.ps-leaderboard h3 {
    color: #facc15;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.ps-lb-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-weight: 700;
}
.ps-lb-row:last-child { border-bottom: none; }
.ps-lb-row.top-1 { color: #facc15; }
.ps-lb-row.top-2 { color: #e2e8f0; }
.ps-lb-row.top-3 { color: #d97706; }

/* Responsive */
@media (max-width: 640px) {
    .ps-title { font-size: 2rem; }
    .ps-grid { max-width: 320px; gap: 0.5rem; }
    .ps-hud { font-size: 1.2rem; }
    .ps-btn { font-size: 1.2rem; padding: 0.8rem 2rem; }
}
/* Frenzy Mode Overlay */
.ps-frenzy {
    animation: frenzyPulse 0.5s infinite alternate;
}

@keyframes frenzyPulse {
    from { box-shadow: inset 0 0 10px rgba(225, 29, 72, 0.1); }
    to { box-shadow: inset 0 0 50px rgba(225, 29, 72, 0.4); }
}

/* Hit Particles */
.ps-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    animation: particleOut 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes particleOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}
