* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #0b0f14;
    color: #f1f5f9;
    min-height: 100vh;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.github-link {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 20px;
}

.github-link a {
    width: 48px;
    height: 48px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #111720;
    border: 1px solid #27313d;
    border-radius: 50%;

    color: #8b98a8;

    transition:
        color 0.2s,
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.github-link a:hover {
    color: #ffffff;
    background: #181f29;
    border-color: #3b4857;
    transform: translateY(-2px);
}

.github-link svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.language-switcher {
    position: fixed;
    right: 20px;
    top: 80px;

    display: flex;
    flex-direction: column;

    padding: 4px;

    background: #111720;
    border: 1px solid #27313d;
    border-radius: 10px;

    z-index: 1000;
}

.language-button {
    width: 42px;
    height: 34px;

    border: none;
    border-radius: 7px;

    background: transparent;
    color: #6f7c8b;

    font-size: 12px;
    font-weight: 700;
    cursor: pointer;

    transition:
        background 0.2s,
        color 0.2s;
}

.language-button:hover {
    color: #f1f5f9;
}

.language-button.active {
    background: #f1f5f9;
    color: #0b0f14;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 55px 0 30px;
}

.header h1 {
    font-size: 42px;
    letter-spacing: -1px;
}

.header p {
    color: #8b98a8;
    margin-top: 8px;
    font-size: 17px;
}

.battery-icon {
    width: 60px;
    height: 60px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 16px;

    background: #161d26;
    border: 1px solid #27313d;

    font-size: 27px;
}

.mode-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 5px;

    padding: 5px;

    margin-bottom: 24px;

    background: #111720;
    border: 1px solid #222c37;
    border-radius: 12px;
}

.mode-button {
    padding: 13px 18px;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #718092;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s,
        color 0.2s;
}

.mode-button:hover {
    color: #f1f5f9;
}

.mode-button.active {
    background: #f1f5f9;
    color: #0b0f14;
}

section {
    background: #111720;
    border: 1px solid #222c37;
    border-radius: 18px;

    padding: 30px;
    margin-bottom: 24px;
}

section h2 {
    font-size: 23px;
    margin-bottom: 25px;
}

.inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.input-group label {
    display: flex;
    justify-content: space-between;

    margin-bottom: 9px;

    font-size: 14px;
    color: #c4ccd6;
}

.input-group label > span:last-child {
    color: #6f7c8b;
}

.input-group input,
.input-group select {
    width: 100%;

    padding: 14px 15px;

    background: #0c1117;
    border: 1px solid #2a3542;
    border-radius: 10px;

    color: white;
    font-size: 16px;

    outline: none;

    transition:
        border-color 0.2s,
        background 0.2s;
}

.input-group select {
    appearance: auto;
    cursor: pointer;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #6f7c8b;
    background: #0f151c;
}

.input-group small {
    display: block;

    margin-top: 7px;

    color: #687584;
    font-size: 12px;
}

#calculate,
#design {
    width: 100%;

    margin-top: 25px;

    padding: 15px;

    border: none;
    border-radius: 10px;

    background: #f1f5f9;
    color: #0b0f14;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s,
        opacity 0.15s;
}

#calculate:hover,
#design:hover {
    opacity: 0.9;
}

#calculate:active,
#design:active {
    transform: scale(0.99);
}

.error {
    min-height: 20px;

    margin-top: 14px;

    color: #ff7b7b;
    font-size: 14px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.result-card {
    min-height: 145px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 23px;

    background: #0c1117;
    border: 1px solid #222c37;
    border-radius: 14px;
}

.result-card.highlight {
    background: #151d26;
    border-color: #34414f;
}

.result-label {
    color: #8491a0;
    font-size: 14px;
    margin-bottom: 10px;
}

.result-card strong {
    font-size: 30px;
    letter-spacing: -0.5px;
}

.result-unit {
    margin-top: 4px;

    color: #697686;
    font-size: 13px;
}

.designer-description {
    margin-bottom: 25px;

    color: #8794a3;
    font-size: 14px;
    line-height: 1.6;
}

.configuration-result {
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 5px 0 25px;
    padding: 25px;

    background: #151d26;
    border: 1px solid #34414f;
    border-radius: 14px;

    text-align: center;
}

.configuration-result strong {
    font-size: 38px;
    letter-spacing: -1px;
}

.designer-results h3 {
    margin-bottom: 10px;

    color: #c4ccd6;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.designer-note {
    margin-top: 18px;
    padding: 15px;

    background: #0c1117;
    border-radius: 10px;

    color: #7d8997;
    font-size: 13px;
    line-height: 1.6;
}

.formula {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px 0;

    border-bottom: 1px solid #202934;
}

.formula:last-of-type {
    border-bottom: none;
}

.formula span {
    color: #aab5c2;
}

.formula code {
    padding: 7px 11px;

    background: #0a0f14;
    border-radius: 7px;

    color: #d9e1e8;
    font-family: Consolas, monospace;
}

.warning {
    margin-top: 20px;
    padding: 15px;

    background: #0c1117;
    border-radius: 10px;

    color: #7d8997;
    font-size: 13px;
    line-height: 1.6;
}

footer {
    padding: 25px 0 40px;

    color: #596574;
    text-align: center;

    font-size: 13px;
}

@media (max-width: 800px) {

    .header {
        padding-top: 35px;
    }

    .header h1 {
        font-size: 32px;
    }

    .inputs,
    .result-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 22px;
    }

    .result-card {
        min-height: 120px;
    }
}

@media (max-width: 500px) {

    .container {
        width: 94%;
    }

    .header {
        align-items: flex-start;
    }

    .battery-icon {
        width: 50px;
        height: 50px;
    }

    .header h1 {
        font-size: 27px;
    }

    .header p {
        font-size: 14px;
    }

    .language-switcher {
        right: 10px;
        top: 20px;
    }

    .language-button {
        width: 38px;
        height: 31px;
    }

    .mode-switcher {
        grid-template-columns: 1fr;
    }

    .mode-button {
        padding: 12px;
    }

    .configuration-result strong {
        font-size: 30px;
    }

    .formula {
        gap: 15px;
        align-items: flex-start;
        flex-direction: column;
    }
}

body {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 20% 10%, rgba(76, 111, 145, 0.08), transparent 28%),
        radial-gradient(circle at 80% 80%, rgba(94, 76, 145, 0.07), transparent 30%),
        #0b0f14;
}

.ambient-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-circle {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.18;
    will-change: transform;
}

.circle-1 {
    width: 420px;
    height: 420px;
    left: -120px;
    top: 8%;
    background: radial-gradient(
        circle,
        rgba(90, 120, 155, 0.24) 0%,
        rgba(90, 120, 155, 0.08) 45%,
        transparent 72%
    );
    animation: ambientFloat1 18s ease-in-out infinite alternate;
}

.circle-2 {
    width: 330px;
    height: 330px;
    right: -90px;
    top: 22%;
    background: radial-gradient(
        circle,
        rgba(125, 92, 155, 0.22) 0%,
        rgba(125, 92, 155, 0.07) 48%,
        transparent 72%
    );
    animation: ambientFloat2 23s ease-in-out infinite alternate;
}

.circle-3 {
    width: 260px;
    height: 260px;
    left: 28%;
    bottom: -100px;
    background: radial-gradient(
        circle,
        rgba(70, 130, 125, 0.20) 0%,
        rgba(70, 130, 125, 0.06) 48%,
        transparent 72%
    );
    animation: ambientFloat3 20s ease-in-out infinite alternate;
}

.circle-4 {
    width: 190px;
    height: 190px;
    right: 28%;
    top: 8%;
    background: radial-gradient(
        circle,
        rgba(180, 145, 90, 0.13) 0%,
        transparent 70%
    );
    animation: ambientFloat4 16s ease-in-out infinite alternate;
}

.circle-5 {
    width: 500px;
    height: 500px;
    right: 8%;
    bottom: -300px;
    background: radial-gradient(
        circle,
        rgba(65, 95, 130, 0.12) 0%,
        transparent 70%
    );
    animation: ambientFloat5 27s ease-in-out infinite alternate;
}

.container {
    position: relative;
    z-index: 1;
}

@keyframes ambientFloat1 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(100px, 60px, 0) scale(1.12);
    }
}

@keyframes ambientFloat2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(-90px, 80px, 0) scale(0.9);
    }
}

@keyframes ambientFloat3 {
    0% {
        transform: translate3d(0, 0, 0) scale(0.95);
    }

    100% {
        transform: translate3d(-80px, -100px, 0) scale(1.15);
    }
}

@keyframes ambientFloat4 {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(70px, 110px, 0);
    }
}

@keyframes ambientFloat5 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(-120px, -80px, 0) scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-circle {
        animation: none;
    }
}

@media (max-width: 600px) {
    .circle-1 {
        width: 280px;
        height: 280px;
    }

    .circle-2 {
        width: 220px;
        height: 220px;
    }

    .circle-3 {
        width: 180px;
        height: 180px;
    }

    .circle-5 {
        width: 320px;
        height: 320px;
    }
}
