/* sorter.css */
:root {
    --bg-main: #0f172a;
    --bg-panel: #1e293b;
    --embedded-color: #ec4899;
    /* Pink/Reddish */
    --general-color: #3b82f6;
    /* Blue */
    --text-main: #e2e8f0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    width: 100%;
}

/* Header / Score */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-display {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

#score-val {
    color: var(--embedded-color);
}

/* Play Area */
#play-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex-grow: 1;
}

.drop-zone {
    background: rgba(30, 41, 59, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.drop-zone h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    z-index: 2;
}

.drop-zone.embedded {
    border-color: var(--embedded-color);
}

.drop-zone.general {
    border-color: var(--general-color);
}

.drop-zone.embedded h2 {
    color: var(--embedded-color);
}

.drop-zone.general h2 {
    color: var(--general-color);
}

.drop-zone.hovered {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
}

.zone-icon {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 10rem;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

/* Draggable Cards */
#card-deck {
    height: 180px;
    background: var(--bg-panel);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card {
    width: 140px;
    height: 140px;
    background: #334155;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 50;
    touch-action: none;
    /* Critical for mobile drag */
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    background: #475569;
}

.game-card:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.card-icon {
    font-size: 3rem;
    color: white;
    margin-bottom: 10px;
}

.card-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: #cbd5e1;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out;
    border-color: #ef4444 !important;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.pop {
    animation: pop 0.3s ease-in-out;
}

/* Success/Fail Overlay in Zone */
.feedback-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.feedback-overlay.active {
    opacity: 1;
}