:root {
    --primary-pink: #f472b6;
    --primary-navy: #1e3a8a;
    --zia-bg: rgba(244, 114, 182, 0.1);
    --zio-bg: rgba(30, 58, 138, 0.1);
    --glass-white: rgba(255, 255, 255, 0.4);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
    --premium-font: 'Inter', 'Gowun Dodum', sans-serif;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--premium-font);
    background: linear-gradient(135deg, #fdf2f8 0%, #eff6ff 100%);
    color: #374151;
    overflow: hidden;
    height: 100vh;
}

#app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Header */
.glass-header {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.premium-logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-pink), #8b5cf6, var(--primary-navy));
    -webkit-background-clip: text;
    -webkit-fill-color: transparent;
    color: transparent; /* Fallback */
}

.stat-box {
    display: inline-block;
    background: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 10px;
    box-shadow: var(--shadow-md);
}

/* Main Playing Section */
.game-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px 0;
}

.character-panel {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.character-image-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.character-image-wrapper:hover {
    transform: scale(1.05);
}

.cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.label-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
}

.zio-bg { background-color: var(--primary-navy); }
.zia-bg { background-color: var(--primary-pink); }

.card-stack-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Center stage for messages */
.center-stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#message-toast {
    padding: 15px 30px;
    background: white;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: all 0.5s ease;
}

.toast-hidden { opacity: 0; transform: translateY(-20px); }

/* Bottom Tray Slots */
.matching-tray-wrapper {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.glass-tray {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border: var(--glass-border);
    padding: 20px;
    border-radius: 30px;
    display: flex;
    gap: 15px;
    box-shadow: var(--shadow-lg);
}

.tray-slot {
    width: 65px;
    height: 65px;
    background: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* Individual Card Styling */
.game-card {
    width: 55px;
    height: 55px;
    background: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.game-card:active {
    transform: translateY(0) scale(0.95);
}

/* Matching Animation */
.match-anim {
    animation: sparkle 0.6s ease-out;
}

@keyframes sparkle {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4) rotate(15deg); filter: brightness(1.5); }
    100% { transform: scale(0); opacity: 0; }
}

/* Modals */
.modal-hidden { display: none; }
#game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 { margin-bottom: 20px; color: #ef4444; }
.modal-content button {
    padding: 10px 40px;
    background: var(--primary-pink);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
