/* PSP Simulator Styles */

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

.animate-loading {
    animation: loading 3s ease-in-out;
}

.psp-container {
    position: relative;
    width: 480px;
    height: 320px;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.psp-screen {
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    bottom: 80px;
    background: #000;
    border-radius: 8px;
    border: 3px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(0, 100, 255, 0.1),
        0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.psp-controls {
    position: absolute;
    inset: 0;
}

/* Analog Stick */
.analog-stick {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #444, #222);
    border-radius: 50%;
    border: 2px solid #333;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.analog-stick:active {
    transform: scale(0.95);
}

/* D-Pad */
.dpad {
    position: relative;
    width: 60px;
    height: 60px;
}

.dpad-button {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #333, #111);
    border: 1px solid #444;
    border-radius: 3px;
    color: #888;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dpad-button:hover {
    background: linear-gradient(145deg, #444, #222);
    color: #aaa;
}

.dpad-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dpad-up {
    top: 0;
    left: 20px;
}

.dpad-down {
    bottom: 0;
    left: 20px;
}

.dpad-left {
    left: 0;
    top: 20px;
}

.dpad-right {
    right: 0;
    top: 20px;
}

/* Face Buttons */
.face-buttons {
    position: relative;
    width: 80px;
    height: 80px;
}

.face-button {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #333;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.face-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.face-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.triangle {
    top: 0;
    left: 28px;
    background: linear-gradient(145deg, #4ade80, #16a34a);
    color: #fff;
}

.square {
    left: 0;
    top: 28px;
    background: linear-gradient(145deg, #f472b6, #be185d);
    color: #fff;
}

.circle {
    right: 0;
    top: 28px;
    background: linear-gradient(145deg, #60a5fa, #1d4ed8);
    color: #fff;
}

.x {
    bottom: 0;
    left: 28px;
    background: linear-gradient(145deg, #fb7185, #be123c);
    color: #fff;
}

/* Shoulder Buttons */
.shoulder-button {
    background: linear-gradient(145deg, #444, #222);
    border: 2px solid #333;
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.shoulder-button:hover {
    background: linear-gradient(145deg, #555, #333);
    color: #ccc;
}

.shoulder-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* System Buttons */
.system-button {
    background: linear-gradient(145deg, #333, #111);
    border: 1px solid #444;
    border-radius: 4px;
    color: #888;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.system-button:hover {
    background: linear-gradient(145deg, #444, #222);
    color: #aaa;
}

.system-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.home-button {
    font-size: 12px;
    padding: 4px 8px;
}

/* Grid for Snake Game */
.grid-cols-20 {
    grid-template-columns: repeat(20, minmax(0, 1fr));
}

/* XMB Animation */
.xmb-category {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Screen Effects */
.psp-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 48%, 
        rgba(255, 255, 255, 0.03) 49%, 
        rgba(255, 255, 255, 0.03) 51%, 
        transparent 52%
    );
    pointer-events: none;
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 640px) {
    .psp-container {
        transform: scale(0.7);
        transform-origin: center;
    }
}

@media (max-width: 480px) {
    .psp-container {
        transform: scale(0.5);
        transform-origin: center;
    }
}