@tailwind base;
@tailwind components;
@tailwind utilities;

.font-fredoka {
    font-family: 'Fredoka', sans-serif;
}

/* Grid Cells */
.cell {
    background-color: #334155;
    /* slate-700 */
    border-radius: 8px;
    border: 2px solid #475569;
    /* slate-600 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cell.path {
    background-color: #475569;
    /* Lighter path visual if desired */
}

/* Obstacles */
.obstacle {
    background: url('https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/1fae8.png') center/70% no-repeat;
    /* Rock emoji */
    /* Alternatively utilize emoji directly in HTML, but CSS bg is cleaner for grid logic */
}

/* Target */
.target {
    position: relative;
}

.target::after {
    content: '🔋';
    font-size: 2rem;
    filter: drop-shadow(0 0 10px #22c55e);
    animation: bounce 2s infinite;
}

.target.locked::before {
    content: '🔒';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 2px;
}

.key {
    background-color: #334155;
}

.key::after {
    content: '🔑';
    font-size: 2rem;
    animation: spin 3s infinite linear;
    filter: drop-shadow(0 0 5px #fbbf24);
}

@keyframes spin {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-15deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Robot */
.robot {
    width: 80%;
    height: 80%;
    background-color: #cbd5e1;
    /* slate-300 body */
    border-radius: 20%;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    /* Smooth movement */
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Robot Face (Directional) */
.robot::before {
    content: '';
    position: absolute;
    top: 10%;
    width: 60%;
    height: 30%;
    background-color: #0f172a;
    /* Visor */
    border-radius: 4px;
    box-shadow: 0 0 5px #3b82f6;
    /* Glow */
}

/* Wheels / Tracks */
.robot::after {
    content: '';
    position: absolute;
    bottom: -10%;
    width: 90%;
    height: 20%;
    background-color: #475569;
    border-radius: 4px;
    z-index: -1;
}

/* Control Buttons */
.control-btn {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    transition: all 0.1s;
}

.control-btn:active {
    transform: translateY(4px);
    border-bottom-width: 0;
}

/* Command Queue Items */
.cmd-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cmd-forward {
    background-color: #22c55e;
}

.cmd-left {
    background-color: #3b82f6;
}

.cmd-right {
    background-color: #3b82f6;
}

.cmd-active {
    border: 3px solid #fbbf24;
    transform: scale(1.1);
    box-shadow: 0 0 15px #fbbf24;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}