:root {
    --console-body: #c0c0c0;
    --console-dark: #8b8b8b;
    --console-accent: #6b6b6b;
    --screen-bg: #9bbc0f;
    --screen-dark: #306230;
    --screen-medium: #8bac0f;
    --screen-light: #0f380f;
    --button-a: #8b0000;
    --button-b: #8b0000;
    --dpad-color: #2d2d2d;
    --select-start: #5d5d5d;
    --shadow-light: rgba(255, 255, 255, 0.4);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a1a2e;
    font-family: 'Press Start 2P', monospace;
    margin: 0;
    overflow: hidden;
}

.console {
    width: 420px;
    background: linear-gradient(145deg, var(--console-body), var(--console-dark));
    border-radius: 8px 8px 40px 40px;
    border: 3px solid var(--console-accent);
    padding: 15px 25px 20px;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px var(--shadow-light),
        inset 0 -2px 4px var(--shadow-dark);
}

.brand-text {
    font-size: 9px;
    color: #444;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.battery-indicator {
    position: absolute;
    top: 15px;
    left: 25px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 6px;
    color: #444;
    z-index: 10;
}

.battery-light {
    width: 6px;
    height: 8px;
    background: #555;
    border-radius: 1px;
}

.battery-light.active {
    background: #4caf50;
    box-shadow: 0 0 6px #4caf50;
}

.screen-border {
    background: #888;
    border-radius: 4px;
    padding: 3px;
    margin-bottom: 4px;
}

.screen {
    background: var(--screen-bg);
    aspect-ratio: 10/9;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.power-led {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 4px;
    height: 4px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50, 0 0 12px #4caf50;
    animation: ledPulse 2s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.screen-content {
    flex: 1;
    padding: 20px 12px 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.menu-item {
    font-size: 8px;
    color: var(--screen-dark);
    padding: 4px 6px;
    margin: 2px 0;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.menu-item:hover {
    opacity: 0.8;
}

.menu-item.active {
    opacity: 1;
    background: var(--screen-dark);
    color: var(--screen-bg);
    animation: selectPulse 0.5s ease infinite alternate;
}

@keyframes selectPulse {
    from { transform: scaleX(1); }
    to { transform: scaleX(0.98); }
}

.info-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--screen-bg);
    padding: 20px 12px 12px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.info-panel.visible {
    transform: translateX(0);
}

.info-content {
    font-size: 7px;
    line-height: 1.8;
    color: var(--screen-dark);
}

.info-content h3 {
    margin: 0 0 8px 0;
    font-size: 9px;
}

.info-content p {
    margin: 6px 0;
}

.info-content .skill-rating {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 6px 0;
}

.info-content .skill-rating > span {
    min-width: 110px;
    flex-shrink: 0;
    font-size: 7px;
    line-height: 1.8;
}

.info-content .stars {
    display: flex;
    gap: 3px;
    align-items: baseline;
    flex-shrink: 0;
    line-height: 1;
    min-width: calc(5 * 16px + 4 * 3px); /* 5 stars * 16px width + 4 gaps * 3px */
}

.info-content .star {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    position: relative;
    vertical-align: baseline;
}

.info-content .star-full {
    color: var(--screen-dark);
}

.info-content .star-half {
    color: var(--screen-bg);
    opacity: 0.3;
    position: relative;
    overflow: hidden;
}

.info-content .star-half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 16px;
    color: var(--screen-dark);
    display: block;
    overflow: hidden;
}

.info-content .star-empty {
    color: var(--screen-bg);
    opacity: 0.3;
}

.cursor-blink {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 6px;
    height: 8px;
    background: var(--screen-dark);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.screen-text {
    font-size: 6px;
    color: #666;
    text-align: center;
    letter-spacing: 2px;
}

.speaker-grille {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 8px auto;
}

.grille-line {
    width: 3px;
    height: 40px;
    background: linear-gradient(to bottom, 
        var(--console-dark) 0%, 
        var(--console-dark) 20%, 
        transparent 20%, 
        transparent 40%, 
        var(--console-dark) 40%, 
        var(--console-dark) 60%, 
        transparent 60%, 
        transparent 80%, 
        var(--console-dark) 80%, 
        var(--console-dark) 100%);
}

.controls-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 10px;
    position: relative;
}

.d-pad-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dpad-row {
    display: flex;
}

.dpad-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, var(--dpad-color), #1a1a1a);
    border: none;
    color: #555;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.dpad-btn:hover {
    color: #888;
}

.dpad-btn:active, .dpad-btn.pressed {
    transform: scale(0.95);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dpad-center {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #3d3d3d, var(--dpad-color));
}

.action-buttons {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.select-btn, .start-btn {
    width: 28px;
    height: 10px;
    background: linear-gradient(145deg, var(--select-start), #3d3d3d);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.select-btn:active, .start-btn:active {
    transform: scale(0.95);
}

.btn-label {
    font-size: 6px;
    color: #555;
}

.ab-buttons {
    display: flex;
    gap: 12px;
    transform: rotate(-15deg);
}

.ab-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #5a5a5a;
    background: linear-gradient(145deg, #a02020, var(--button-a));
    color: #ddd;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ab-btn:hover {
    background: linear-gradient(145deg, #b83030, #9b2020);
}

.ab-btn:active {
    transform: scale(0.95) rotate(-15deg);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cartridge-slot {
    height: 8px;
    background: linear-gradient(to bottom, #333, #1a1a1a, #333);
    margin: 12px 15px 0;
    border-radius: 2px;
}

.bottom-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 0;
}

.power-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 7px;
    color: #555;
}

.switch {
    width: 24px;
    height: 10px;
    background: linear-gradient(to bottom, #333, #1a1a1a);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 1px;
    transition: left 0.2s ease;
}

.switch.active::after {
    left: 14px;
    background: #4caf50;
}

.on-label {
    opacity: 0.3;
}

.link-port {
    width: 40px;
    height: 12px;
    background: #333;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.link-port span {
    font-size: 6px;
    color: #444;
}

.footer-links {
    display: none;
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(145deg, #4a4a4a, #333);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

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

.info-content .contact-option {
    padding: 6px 8px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid transparent;
}

.info-content .contact-option:hover {
    background: rgba(48, 98, 48, 0.1);
}

.info-content .contact-option.active {
    background: var(--screen-dark);
    color: var(--screen-bg);
    animation: selectPulse 0.5s ease infinite alternate;
}

.info-content .contact-option .option-icon {
    margin-right: 6px;
}

.btn-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #ddd;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
}

@media (max-width: 480px) {
    .console {
        width: 95vw;
        max-width: 380px;
        padding: 10px 15px 15px;
    }
    
    .menu-item {
        font-size: 7px;
    }
    
    .dpad-btn {
        width: 30px;
        height: 30px;
    }
    
    .ab-btn {
        width: 38px;
        height: 38px;
    }
}

@keyframes screenFlicker {
    0% { opacity: 1; }
    95% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
    98% { opacity: 0.95; }
    100% { opacity: 1; }
}

.screen {
    animation: screenFlicker 4s linear infinite;
}

.info-content .project-item {
    margin: 10px 0;
    padding: 8px;
    background: rgba(48, 98, 48, 0.1);
    border-left: 2px solid var(--screen-dark);
}

.info-content .project-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.info-content .project-title a {
    color: var(--screen-dark);
    text-decoration: none;
    font-weight: bold;
}

.info-content .project-title a:hover {
    opacity: 0.8;
}

.info-content .project-desc {
    font-size: 6px;
    opacity: 0.9;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(2px); }
}
