* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-deep: #07111f;
    --bg-mid: #10253d;
    --glass: rgba(173, 220, 255, 0.12);
    --glass-strong: rgba(227, 243, 255, 0.18);
    --line: rgba(255, 255, 255, 0.2);
    --text-main: #f4fbff;
    --text-soft: rgba(244, 251, 255, 0.66);
    --button-base: rgba(255, 255, 255, 0.09);
    --button-hover: rgba(255, 255, 255, 0.18);
    --operator: linear-gradient(135deg, rgba(48, 171, 255, 0.6), rgba(102, 233, 255, 0.2));
    --action: linear-gradient(135deg, #9b5cff, #ff6b9a, #ff9a4d);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(83, 184, 255, 0.22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 125, 184, 0.18), transparent 28%),
        linear-gradient(145deg, var(--bg-deep), var(--bg-mid) 52%, #0a1525);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
}

body::before {
    top: -7rem;
    right: -6rem;
    background: rgba(85, 194, 255, 0.34);
}

body::after {
    bottom: -8rem;
    left: -5rem;
    background: rgba(255, 95, 160, 0.24);
}

.appShell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.launchScreen {
    position: relative;
    width: min(100%, 460px);
    display: grid;
    place-items: center;
}

.launchGlow {
    position: absolute;
    border-radius: 50%;
    filter: blur(24px);
    pointer-events: none;
}

.launchGlowOne {
    width: 220px;
    height: 220px;
    top: 10%;
    left: 5%;
    background: rgba(108, 204, 255, 0.22);
}

.launchGlowTwo {
    width: 180px;
    height: 180px;
    right: 4%;
    bottom: 10%;
    background: rgba(255, 129, 177, 0.18);
}

.launchButton {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 28px 26px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
    cursor: pointer;
}

.launchButton:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 30px 95px rgba(0, 0, 0, 0.44);
    border-color: rgba(255, 255, 255, 0.38);
}

.launchButton:active {
    transform: translateY(-2px) scale(0.995);
}

.img {
    width: min(72vw, 210px);
    display: block;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.34));
}

.launchLabel {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.launchHint {
    color: var(--text-soft);
    text-align: center;
    line-height: 1.5;
    font-size: 0.96rem;
}

.dialog {
    width: min(92vw, 430px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(203, 234, 255, 0.16), rgba(122, 178, 215, 0.08));
    box-shadow: var(--shadow);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    color: var(--text-main);
    overflow: hidden;
}

.dialog::backdrop {
    background: rgba(2, 8, 18, 0.58);
    backdrop-filter: blur(8px);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 6px 12px;
}

.title {
    width: 136px;
    max-width: 100%;
}

.closeDialog {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.closeDialog:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.03);
}

.closeDialog:active {
    transform: scale(0.98);
}

.closeDialog img {
    width: 18px;
    display: block;
}

.displayPanel {
    padding: 8px 10px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.inpPerResult,
.display {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    text-align: right;
}

.inpPerResult {
    min-height: 28px;
    color: var(--text-soft);
    font-size: 1rem;
}

.display {
    min-height: 56px;
    color: var(--text-main);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
}

.display::placeholder {
    color: rgba(255, 255, 255, 0.88);
}

.divMain {
    margin-top: 12px;
    padding: 14px 12px 12px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.04));
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 6px;
}

.time {
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}

.btnDelete {
    width: 24px;
    opacity: 0.85;
    transition: transform 180ms ease, opacity 180ms ease;
    cursor: pointer;
}

.btnDelete:hover {
    opacity: 1;
    transform: scale(1.08);
}

.btnDelete:active {
    transform: scale(0.96);
}

.rowButtons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

button {
    min-height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: var(--text-main);
    background: var(--button-base);
    font-size: 1.35rem;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

button:hover {
    background: var(--button-hover);
    border-color: rgba(255, 255, 255, 0.16);
    cursor: pointer;
}

button:active {
    transform: scale(0.97);
}

#btnGray {
    background: rgba(255, 255, 255, 0.14);
}

#btnBlue {
    background: var(--operator);
}

.btnResult {
    background: var(--action);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 520px) {
    .appShell {
        padding: 18px;
    }

    .launchButton {
        border-radius: 26px;
        padding: 24px 20px 22px;
    }

    .dialog {
        width: min(96vw, 420px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        padding: 14px;
        border-radius: 26px;
    }

    .divMain {
        padding: 12px 10px 10px;
    }

    .rowButtons {
        gap: 8px;
    }

    button {
        min-height: 52px;
        font-size: 1.2rem;
        border-radius: 18px;
    }
}
