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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.pokedex-container {
    position: relative;
    width: fit-content;
    height: fit-content;
}

/* ===== CLOSED POKÉDEX ===== */
.pokedex-closed {
    width: 280px;
    height: 400px;
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 50%, #c62828 100%);
    border-radius: 20px 20px 25px 25px;
    position: relative;
    cursor: pointer;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #a31f1f;
    transition: transform 0.3s ease;
}

.pokedex-closed:hover {
    transform: scale(1.02);
}

.pokedex-closed.hidden {
    animation: closePokedex 0.6s ease forwards;
}

@keyframes closePokedex {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotateY(20deg);
        display: none;
    }
}

.closed-body {
    width: 100%;
    height: 100%;
    padding: 20px;
    position: relative;
}

.top-light {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #4fc3f7, #0277bd);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 20px;
    box-shadow:
        0 0 15px rgba(79, 195, 247, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    border: 3px solid #01579b;
}

.top-light::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: shine 3s ease-in-out infinite;
}

.closed-detail-line {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 240px;
    height: 4px;
    background: linear-gradient(90deg, #a31f1f 0%, #7f1818 100%);
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.closed-detail-line.small {
    top: 115px;
    width: 180px;
    height: 3px;
}

/* ===== OPEN POKÉDEX ===== */
.pokedex-open {
    display: none;
    width: 900px;
    height: 600px;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pokedex-open.active {
    display: flex;
    animation: openPokedex 0.8s ease forwards;
}

@keyframes openPokedex {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(-20deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* ===== LEFT PANEL ===== */
.left-panel {
    width: 450px;
    height: 600px;
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 50%, #c62828 100%);
    border-radius: 20px;
    position: relative;
    padding: 30px;
    box-shadow:
        -10px 0 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #a31f1f;
    transform-origin: right center;
    animation: panelSlideInLeft 0.8s ease forwards;
}

@keyframes panelSlideInLeft {
    0% {
        transform: translateX(-100px) rotateY(-30deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
}

.hinge {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 80px;
    background: linear-gradient(90deg, #7f1818, #5f1010);
    border-radius: 3px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.hinge::before,
.hinge::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hinge::before {
    top: 15px;
}

.hinge::after {
    bottom: 15px;
}

.panel-top-light {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #4fc3f7, #0277bd);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 20px;
    box-shadow:
        0 0 15px rgba(79, 195, 247, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    border: 3px solid #01579b;
}

.panel-top-light::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Main Screen */
.main-screen-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.screen-border {
    background: linear-gradient(135deg, #f5f5dc, #e8e8c0);
    padding: 15px;
    border-radius: 15px;
    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
    border: 3px solid #8b7355;
}

.main-screen {
    width: 100%;
    height: 250px;
    background: linear-gradient(180deg, #f0f0e0, #fafaeb);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #a0937d;
}

.screen-content {
    width: 100%;
    height: 100%;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
    color: #000;
    font-family: 'Courier New', monospace;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-content::-webkit-scrollbar {
    width: 8px;
}

.screen-content::-webkit-scrollbar-track {
    background: #e0e0d0;
}

.screen-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.screen-lights {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-left: 5px;
}

.small-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.4),
        0 0 8px currentColor;
    animation: lightPulse 2s ease-in-out infinite;
}

@keyframes lightPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.small-light.red {
    background: radial-gradient(circle at 30% 30%, #ff5252, #d32f2f);
    border: 2px solid #b71c1c;
}

.small-light.yellow {
    background: radial-gradient(circle at 30% 30%, #ffeb3b, #fbc02d);
    border: 2px solid #f57f17;
}

.small-light.green {
    background: radial-gradient(circle at 30% 30%, #66bb6a, #43a047);
    border: 2px solid #2e7d32;
}

/* Controls Section */
.controls-section {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-top: 20px;
}

/* D-pad */
.dpad {
    position: relative;
    width: 120px;
    height: 120px;
}

.dpad-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.dpad-btn {
    position: absolute;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: none;
    cursor: pointer;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    color: #555;
    font-size: 16px;
    transition: all 0.1s ease;
}

.dpad-btn:hover {
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    color: #777;
}

.dpad-btn:active {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dpad-btn.pressed {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
    color: #999;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.dpad-btn span {
    display: block;
}

.dpad-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 8px 8px 0 0;
}

.dpad-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 0 8px 8px 0;
}

.dpad-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 0 0 8px 8px;
}

.dpad-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 8px 0 0 8px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-a,
.btn-b {
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: white;
    transition: all 0.1s ease;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.btn-a {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #66bb6a, #43a047);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #2e7d32;
}

.btn-a:hover {
    background: radial-gradient(circle at 30% 30%, #76cb7a, #53b057);
}

.btn-a:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-a.pressed {
    transform: translateY(2px);
    background: radial-gradient(circle at 30% 30%, #56c15a, #33903c);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-b {
    width: 50px;
    height: 30px;
    border-radius: 25px;
    background: linear-gradient(135deg, #ef5350, #e53935);
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.3),
        inset 0 -1px 3px rgba(0, 0, 0, 0.3);
    border: 2px solid #c62828;
}

.btn-b:hover {
    background: linear-gradient(135deg, #ff6360, #f54945);
}

.btn-b:active {
    transform: translateY(2px);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-b.pressed {
    transform: translateY(2px);
    background: linear-gradient(135deg, #d54340, #c52825);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Left Panel Bottom */
.left-panel-bottom {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
}

.speaker {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.speaker-line {
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #7f1818 20%, #7f1818 80%, transparent 100%);
    border-radius: 2px;
}

/* ===== RIGHT PANEL ===== */
.right-panel {
    width: 450px;
    height: 600px;
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 50%, #c62828 100%);
    border-radius: 20px;
    position: relative;
    padding: 30px;
    box-shadow:
        10px 0 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #a31f1f;
    animation: panelSlideInRight 0.8s ease forwards;
}

@keyframes panelSlideInRight {
    0% {
        transform: translateX(100px) rotateY(30deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotateY(0deg);
        opacity: 1;
    }
}

.panel-top-elements {
    margin-bottom: 20px;
}

.right-top-light {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle at 30% 30%, #4fc3f7, #0277bd);
    border-radius: 50%;
    box-shadow:
        0 0 12px rgba(79, 195, 247, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #01579b;
}

.right-top-light::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: shine 3s ease-in-out infinite;
}

/* Secondary Screen */
.secondary-screen-container {
    margin-bottom: 25px;
}

.secondary-screen {
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, #1a1a2e, #16213e);
    border-radius: 10px;
    padding: 15px;
    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #0f1419;
}

.secondary-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: bold;
    color: #4fc3f7;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
    transition: all 0.3s ease;
}

/* Number Pad */
.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.num-btn {
    width: 100%;
    height: 45px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border: 2px solid #0d47a1;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
}

.num-btn:hover {
    background: linear-gradient(135deg, #42a5f5, #2196f3);
}

.num-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.num-btn.pressed {
    transform: translateY(2px);
    background: linear-gradient(135deg, #1976d2, #1565c0);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.num-btn.clear,
.num-btn.enter {
    font-size: 12px;
}

/* Control Buttons */
.right-control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.small-btn {
    width: 60px;
    height: 25px;
    border-radius: 12px;
    border: 2px solid #ccc;
    cursor: pointer;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.1s ease;
}

.small-btn.white {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.small-btn:hover {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
}

.small-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Bottom Button */
.right-bottom-section {
    display: flex;
    justify-content: center;
}

.bottom-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
}

.bottom-btn.yellow {
    background: radial-gradient(circle at 30% 30%, #ffeb3b, #fbc02d);
    border: 3px solid #f57f17;
}

.bottom-btn:hover {
    background: radial-gradient(circle at 30% 30%, #fff176, #fdd835);
}

.bottom-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 950px) {
    .pokedex-open {
        width: 100%;
        height: auto;
        flex-direction: column;
    }

    .left-panel,
    .right-panel {
        width: 100%;
        max-width: 450px;
    }
}
