* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    /* Prevent scrolling */
    background: #eef2f5;
    font-family: Arial, sans-serif;
    padding: 0;
}

.container {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.qr-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 280px;
}

.qr-section h2 {
    margin: 0 0 15px 0;
    color: #2a3f5f;
    font-size: 18px;
}

.qr-section p {
    margin: 15px 0 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

#qrcode {
    display: inline-block;
    padding: 10px;
    background: white;
}

#qrcode img {
    display: block;
}

/* Calculator Body */
.calculator {
    width: 340px;
    background: #334455;
    /* Slightly adjusted dark blue */
    border-radius: 25px 25px 35px 35px;
    /* Tapered shape */
    padding: 15px 20px 30px 20px;
    /* Reduced top/bottom padding */
    box-shadow:
        0 0 0 2px #223344,
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    position: relative;
    user-select: none;
}

/* Header / Branding */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.brand {
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
}

.model {
    font-size: 11px;
    color: #ffd700;
    /* Gold color for contrast */
    font-style: italic;
    font-family: "Times New Roman", serif;
}

.svpam {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: #ec5b6e;
    letter-spacing: 2px;
    margin: 0;
}

/* Display Screen */
.display {
    background: #9ea892;
    /* Classic LCD Green-Grey */
    border: 6px solid #2a3845;
    border-bottom: 15px solid #2a3845;
    /* Thicker bottom bezel */
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 25px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.display-top {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #000;
    min-height: 18px;
    text-align: left;
    opacity: 0.8;
}

.display-main {
    font-size: 28px;
    font-family: 'Courier New', monospace;
    /* LCD Segment feel */
    color: #000;
    text-align: right;
    margin-top: 5px;
    min-height: 35px;
    word-wrap: break-word;
    letter-spacing: 1px;
}

/* Button Sections */
.keys-upper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px 8px;
    margin-bottom: 15px;
}

.keys-lower {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px 10px;
}

button {
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    font-family: Arial, sans-serif;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* Control Buttons (Top Row) - Small Ovals */
.btn-small {
    height: 24px;
    border-radius: 12px;
    background: #8b9bb4;
    color: #000;
    font-size: 9px;
}

/* Replay Button (Big Circle/Pad) */
.replay-pad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 60px;
}

.btn-replay {
    background: #b0bec5;
    border-radius: 50%;
    width: 50px;
    /* Slightly larger for better spacing */
    height: 45px;
    position: relative;
    border: none;
    box-shadow: 0 4px 0 #78909c;
    /* Cursor not pointer for container, but for arrows */
}

.arrow-up,
.arrow-down,
.arrow-left,
.arrow-right {
    position: absolute;
    color: #333;
    font-size: 7px;
    /* Larger arrows */
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
    /* Ensure on top */
    padding: 0px;
    /* Larger hit area */
}

.arrow-up {
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
}

.arrow-down {
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
}

.arrow-left {
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
}

.arrow-right {
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
}

.replay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #333;
    font-weight: bold;
}

/* Scientific Buttons (Black) */
.btn-black {
    background: #222d38;
    color: #fff;
    height: 24px;
    border-radius: 6px;
    font-size: 9px;
    box-shadow: 0 2px 0 #000;
}

/* Numpad Buttons (Light Grey) */
.btn-gray {
    background: #e0e5ea;
    color: #000;
    height: 28px;
    font-size: 12px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #9ca0a5;
}

/* AC / DEL (Orange) */
.btn-orange {
    background: #d65a31;
    /* Burnt Orange */
    color: #fff;
    height: 28px;
    font-size: 10px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #9e3e1e;
}

.span-2 {
    grid-column: span 2;
}

/* Specific Key Colors & Alignment */
.keys-upper>button:nth-child(1) {
    color: #ffd700;
}

/* SHIFT - Gold */
.keys-upper>button:nth-child(2) {
    color: #ff4444;
    margin-top: 15px;
    /* Push Alpha down */
}

.keys-upper>button:nth-child(4) {
    margin-top: 15px;
    /* Push Mode down */
}

.calculator {
    width: 340px;
    background: #334455;
    /* Slightly adjusted dark blue */
    border-radius: 25px 25px 35px 35px;
    /* Tapered shape */
    padding: 30px 20px 45px 20px;
    box-shadow:
        0 0 0 2px #223344,
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        padding: 40px 10px;
        align-items: center;
        /* keep centered vertically if possible, or top */
    }

    .container {
        flex-direction: column-reverse;
        /* Calculator on top, QR below (or default column to put QR below if it was right) */
        /* Original was row, wrapped. If wrapped, QR is usually last. */
        flex-direction: column;
        gap: 30px;
    }

    .calculator {
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    .qr-section {
        width: 100%;
        max-width: 340px;
    }
}