:root {
    --color-bg: #0b0d12;
    --color-card-bg: rgba(255, 255, 255, 0.045);
    --color-card-border: rgba(255, 255, 255, 0.09);
    --color-border: rgba(255, 255, 255, 0.12);
    --color-text: #f2f1ec;
    --color-text-muted: #9a9dab;
    --color-accent: #ffb020;
    --color-accent-light: #ffd479;
    --color-accent-dark: #1a1300;
    --color-field-bg: rgba(0, 0, 0, 0.35);
    --shadow-card: 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 176, 32, 0.16), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(255, 176, 32, 0.06), transparent 45%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 26px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 26px);
    background-attachment: fixed;
    color: var(--color-text);
    font-family: "Quicksand", Helvetica, Arial, sans-serif;
}

.page {
    width: 100%;
    max-width: 420px;
    padding: 16px 20px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    margin-bottom: 16px;
}

.logo {
    width: 68px;
    height: 68px;
    filter: drop-shadow(0 8px 18px rgba(255, 176, 32, 0.35));
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0;
    background: linear-gradient(180deg, #ffffff, var(--color-accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

.output-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
}

#output {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 2.1em;
    max-height: 180px;
    field-sizing: content;
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: "Courier New", monospace;
    font-size: 1.25rem;
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding: 16px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-field-bg);
    color: var(--color-text);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

#output:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.25);
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s ease, filter 0.15s ease;
}

.btn:hover {
    filter: brightness(1.1);
}

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

.btn-secondary {
    flex: 1;
    background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
    color: var(--color-accent-dark);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.2rem;
    line-height: 1;
    padding: 10px 16px;
}

.type-toggle {
    display: flex;
    gap: 6px;
    margin: 10px 0;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
}

.radio {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--color-text-muted);
}

.radio:has(input:checked) {
    background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
    color: var(--color-accent-dark);
}

.radio input,
.checkbox input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.radio,
.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    position: relative;
}

.checkbox {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-card-border);
    color: var(--color-text-muted);
    font-size: 0.88rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.checkbox:has(input:checked) {
    background: rgba(255, 176, 32, 0.14);
    border-color: rgba(255, 176, 32, 0.4);
    color: var(--color-accent-light);
}

.controls {
    margin-top: 2px;
    padding: 0 4px;
}

.controls .type-toggle {
    margin: 4px 0 8px;
}

.field-label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.field-label span {
    color: var(--color-accent-light);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--color-accent);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 6px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.separator-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.separator-group label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.separator-input {
    width: 26px;
    text-align: center;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-field-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.88rem;
}

.separator-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.25);
}
