:root {
    --phone-bg: #f8f9fa;
    --phone-border: #e0e0e0;
    --screen-bg: #121212;
    --screen-text: #ffffff;
    --key-bg: #ffffff;
    --key-text: #333333;
    --accent-blue: #2196F3;
    --accent-green: #4CAF50;
    --accent-red: #f44336;
    --soft-key-bar-bg: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    background: #eef1f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.simulator-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

/* Feature Phone Frame */
.feature-phone {
    width: 240px;
    background: var(--phone-bg);
    border-radius: 30px;
    padding: 20px 15px 30px 15px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px white,
        inset 0 0 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--phone-border);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo {
    font-size: 10px;
    font-weight: bold;
    color: #aaa;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* Screen Area */
.phone-screen {
    width: 100%;
    height: 300px;
    background: var(--screen-bg);
    border: 4px solid #000;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    color: var(--screen-text);
    display: flex;
    flex-direction: column;
}

.screen-status-bar {
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-size: 10px;
    color: #fff;
}

.screen-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: 'Roboto', sans-serif;
}

.screen-content.hidden {
    display: none;
}

/* Wallpaper / Dialer Screen */
.wallpaper-time {
    font-size: 42px;
    font-weight: 300;
    text-align: center;
    margin-top: 40px;
    color: #fff;
}

.wallpaper-date {
    font-size: 12px;
    text-align: center;
    opacity: 0.8;
    margin-bottom: auto;
    letter-spacing: 0.5px;
}

.dialer-number {
    font-size: 28px;
    text-align: center;
    min-height: 40px;
    margin-bottom: 5px;
    font-weight: 500;
}

.dialer-hint {
    font-size: 11px;
    text-align: center;
    color: #888;
    margin-bottom: 40px;
    /* Space for soft keys */
}

/* USSD Screen */
.ussd-header {
    background: #333;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ussd-body {
    flex: 1;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

#ussd-text {
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    margin: 0;
    color: #eee;
}

#ussd-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #555;
    color: #fff;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
    outline: none;
    font-family: 'Roboto Mono', monospace;
}

/* On-Screen Soft Keys */
.screen-soft-keys {
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
}

#label-center {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
}

/* Controls Area */
.controls-area {
    width: 100%;
    margin-bottom: 20px;
}

.controls-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-btn {
    width: 45px;
    height: 35px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 0 #eee;
    transition: active 0.1s;
}

.control-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.control-btn.soft-btn {
    font-weight: bold;
    font-size: 12px;
}

.control-btn.call-btn {
    border-color: #4CAF50;
    color: #4CAF50;
    font-size: 16px;
}

.control-btn.end-btn {
    border-color: #f44336;
    color: #f44336;
    font-size: 16px;
}

/* D-Pad */
.d-pad-container {
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    /* The ring color */
    border-radius: 20px;
    /* Squaricle shape */
    position: relative;
    border: 2px solid #ccc;
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.8),
        inset 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.d-pad-center {
    width: 40px;
    height: 40px;
    background: #222;
    border-radius: 12px;
    border: 2px solid #555;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
}

.d-btn {
    position: absolute;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.d-btn:hover {
    color: #333;
}

.d-btn.up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 20px;
    width: 40px;
}

.d-btn.down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 20px;
    width: 40px;
}

.d-btn.left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
}

.d-btn.right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
}


/* Physical Keypad */
.physical-keypad {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.p-key {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    /* Slightly rounded */
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 0 #eee;
}

.p-key:active {
    transform: translateY(2px);
    box-shadow: none;
    background: #f5f5f5;
}

.p-key .num {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    line-height: 1;
}

.p-key .letters {
    font-size: 8px;
    color: #999;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* Debug Panel */
.debug-panel {
    background: white;
    padding: 25px;
    border-radius: 16px;
    width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.panel-section {
    margin-bottom: 25px;
}

h2 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

h3 {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 5px 0;
}

pre {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
    font-family: 'Roboto Mono', monospace;
}

.reset-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #eee;
    color: #333;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablets and smaller desktops */
@media (max-width: 768px) {
    .simulator-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding: 20px;
    }

    .debug-panel {
        order: 2;
        width: 240px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        background: #1a1a2e;
        min-height: 100vh;
        padding: 0;
    }

    .simulator-container {
        gap: 0;
        padding: 0;
        justify-content: flex-start;
        min-height: 100vh;
    }

    .feature-phone {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 10px 10px 20px 10px;
        box-shadow: none;
        border: none;
        min-height: 100vh;
    }

    .phone-screen {
        border-radius: 4px;
        height: 220px;
    }

    .debug-panel {
        display: none;
    }

    .brand-logo {
        display: none;
    }

    .physical-keypad {
        gap: 10px;
    }

    .p-key {
        height: 50px;
    }

    .p-key .num {
        font-size: 20px;
    }

    .controls-area {
        margin-bottom: 15px;
    }

    .d-pad-container {
        width: 90px;
        height: 90px;
    }

    .d-pad-center {
        width: 45px;
        height: 45px;
    }
}