:root {
    --bg: #1a1c2c;
    --fg: #41a6f6;
    --fg-hover: #ffcd75;
    --fg-muted: rgba(65, 166, 246, 0.35);
    --fg-focus: #7ec27e;
    --fg-error: #ff6e6e;
    --border: #5a6988;
    --border-hover: #ffcd75;
    --font: 'Press Start 2P', monospace;
    --notation-size: 42px;
    --input-size: 32px;
    --row-height: 56px;
    --panel-padding: 1.75rem 1.5rem 1.5rem;
    --panel-border: 4px solid var(--fg);
    --panel-shadow:
        4px 4px 0 0 #0f1020,
        inset -4px -4px 0 0 #0f1020,
        inset 4px 4px 0 0 #5a6988;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background-image: linear-gradient(rgba(0, 0, 0, 0.12) 50%, transparent 50%);
    background-size: 100% 4px;
    opacity: 0.45;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 4px 4px;
}

#bounds {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    text-align: center;
    gap: 0;
}

.error-slot {
    width: min(90vw, 32rem);
    top: 50%;
    left: 50%;
    transform: translate(110%, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.central {
    color: var(--fg);
    font-family: var(--font);
    padding: var(--panel-padding);
    border: var(--panel-border);
    box-shadow: var(--panel-shadow);
}

.result-slot {
    width: min(90vw, 32rem);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-slot {
    min-height: 5.5rem;
}

.error-slot {
    min-height: 5.5rem;
}

input {
    background: transparent;
    border: none;
    color: var(--fg);
    text-align: center;
    outline: none;
    font-family: inherit;
}

#minBoundary,
#maxBoundary {
    display: flex;
    align-items: flex-end;
}

#bounds .box {
    width: 5ch;
    min-width: 5ch;
    max-width: 15ch;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-bottom: 3px dashed var(--border);
    border-radius: 0;
    font-family: var(--font);
    font-size: var(--input-size);
    line-height: var(--row-height);
    color: var(--fg);
    caret-color: var(--fg);
    -moz-appearance: textfield;
    appearance: textfield;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#bounds .box:hover {
    color: var(--fg-hover);
}

#bounds .box:focus {
    color: var(--fg-hover);
    border-bottom-color: var(--fg-focus);
    border-bottom-style: solid;
}

#bounds .box::-webkit-outer-spin-button,
#bounds .box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#bounds .box::placeholder {
    color: var(--fg-muted);
}

.parenthesis {
    flex-shrink: 0;
    width: auto;
    min-width: 0.6em;
    height: var(--row-height);
    background-color: transparent;
    font-family: var(--font);
    font-size: var(--notation-size);
    line-height: var(--row-height);
    text-align: center;
    user-select: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.parenthesis:hover {
    color: var(--fg-hover);
}

.parenthesis:active {
    transform: translateY(2px);
}

h1 {
    font-size: 200px;
}

.slabel {
    font-family: var(--font);
}

#ynDec {
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 6em;
    height: var(--row-height);
    margin: 1rem auto 0;
    padding: 0.5rem;
    text-align: center;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    border: 3px solid var(--border);
    box-shadow: 3px 3px 0 0 #0f1020;
    transition: color 0.15s ease;
}

#ynDec:hover {
    color: var(--fg-hover);
}

#comma {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: var(--row-height);
    width: auto;
    min-width: 0.4em;
    padding: 0 0.05em;
    font-family: var(--font);
    font-size: var(--notation-size);
    line-height: var(--row-height);
}

.getResult {
    display: flex;
    justify-content: center;
    align-items: center;
}

#submission {
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--fg);
    background: transparent;
    border: 4px solid var(--border);
    border-radius: 0;
    cursor: pointer;
    box-shadow: 4px 4px 0 0 #0f1020;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

#submission:hover {
    color: var(--bg);
    background: var(--fg-hover);
    border-color: var(--fg-hover);
}

#submission:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 0 #0f1020;
}

#submission:focus {
    color: var(--fg-hover);
    border-color: var(--border-hover);
}

#resultant,
#error {
    margin: 0;
    padding: 0.75rem;
    width: 100%;
    text-align: center;
    word-break: break-word;
    border: 3px solid transparent;
    background: transparent;
    box-shadow: none;
    visibility: hidden;
    opacity: 0;
}

#resultant.is-visible {
    visibility: visible;
    opacity: 1;
    color: var(--fg);
    border-color: var(--fg-focus);
    background: rgba(15, 16, 32, 0.6);
    box-shadow: 3px 3px 0 0 #0f1020;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.8;
}

#error.is-visible {
    visibility: visible;
    opacity: 1;
    color: var(--fg-error);
    border-color: var(--fg-error);
    background: rgba(15, 16, 32, 0.6);
    box-shadow: 3px 3px 0 0 #0f1020;
    font-family: var(--font);
    font-size: 0.75rem;
    line-height: 1.9;
}
