:root {
    --bg: #080c14;
    --bg-soft: #0e131c;
    --bg-elevated: #151b26;
    --card: rgba(18, 26, 40, 0.94);
    --card-solid: #121a28;
    --card-border: rgba(255, 255, 255, 0.06);
    --text: #eef2f8;
    --text-secondary: #c5d0e0;
    --muted: #8b9bb8;
    --accent: #64b5f6;
    --accent-hover: #90caf9;
    --accent-soft: rgba(100, 181, 246, 0.14);
    --accent-glow: rgba(100, 181, 246, 0.35);
    --error: #ff6b6b;
    --error-soft: rgba(255, 107, 107, 0.12);
    --ok: #3ddc84;
    --ok-soft: rgba(61, 220, 132, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --input-bg: rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 60px rgba(100, 181, 246, 0.08);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    background-color: #070a10;
    background-image:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(100, 181, 246, 0.08), transparent 52%),
        radial-gradient(ellipse 55% 40% at 100% 100%, rgba(61, 220, 132, 0.035), transparent 42%),
        linear-gradient(180deg, #0a0f18 0%, #070a10 100%);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* ——— Header ——— */

header {
    margin-bottom: 12px;
}

.header-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-title h1 {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.muted {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.55;
}

/* ——— Worker status ——— */

.worker-status-wrap {
    position: relative;
    display: inline-flex;
}

.worker-threads-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 196px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--transition), transform var(--transition);
}

.worker-status-wrap:hover .worker-threads-tooltip:not(.hidden),
.worker-status-wrap:focus-within .worker-threads-tooltip:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.worker-threads-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.worker-thread {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.8125rem;
    color: var(--text);
}

.worker-thread + .worker-thread {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.worker-thread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.worker-thread-idle .worker-thread-dot {
    background: var(--ok);
    box-shadow: 0 0 8px rgba(61, 220, 132, 0.55);
}

.worker-thread-busy .worker-thread-dot {
    background: #ffb347;
    box-shadow: 0 0 8px rgba(255, 179, 71, 0.55);
}

.worker-thread-offline .worker-thread-dot {
    background: var(--muted);
    opacity: 0.45;
    box-shadow: none;
}

.worker-thread-label {
    flex: 0 1 auto;
    min-width: 4.5rem;
}

.worker-thread-meta {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted, #9aa3b2);
    text-align: right;
    white-space: nowrap;
}

.worker-thread-busy .worker-thread-meta {
    color: #ffb347;
}

.worker-thread-idle .worker-thread-meta {
    color: #7ec8a4;
}

.worker-thread-offline .worker-thread-meta {
    opacity: 0.7;
}

.worker-thread-queue {
    margin-left: auto;
    font-size: 0.75rem;
    color: #ffb347;
    white-space: nowrap;
}

.worker-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    transition: border-color var(--transition), background var(--transition);
}

.worker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor;
    animation: worker-pulse 2.5s ease-in-out infinite;
}

@keyframes worker-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.worker-status.worker-online {
    color: var(--ok);
    border-color: rgba(61, 220, 132, 0.3);
    background: var(--ok-soft);
}

.worker-status.worker-busy {
    color: #ffb347;
    border-color: rgba(255, 179, 71, 0.35);
    background: rgba(255, 179, 71, 0.12);
}

.worker-status.worker-offline {
    color: var(--error);
    border-color: rgba(255, 107, 107, 0.3);
    background: var(--error-soft);
}

.worker-status.worker-unknown {
    color: var(--muted);
}

.worker-banner {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--error-soft);
    color: #fecaca;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.worker-banner.worker-banner-busy {
    background: var(--accent-soft);
    color: #d4eaff;
    border-color: rgba(100, 181, 246, 0.22);
}

/* ——— Cards ——— */

.card {
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm), var(--shadow-glow);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
}

.card h2,
.card > h2 {
    margin: 0 0 16px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.card-highlight {
    border-color: rgba(100, 181, 246, 0.28);
    background: linear-gradient(
        165deg,
        rgba(18, 26, 40, 0.98) 0%,
        rgba(12, 18, 28, 0.92) 100%
    );
    box-shadow: var(--shadow), 0 0 0 1px rgba(100, 181, 246, 0.06);
}

.client-notice {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 193, 7, 0.35);
    background: rgba(255, 193, 7, 0.08);
    color: #ffe082;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-line;
}

#client-notice-enter.client-notice {
    margin-bottom: 1rem;
}

#status-card .client-notice {
    margin-bottom: 1.25rem;
}

.card-error {
    border-color: rgba(255, 107, 107, 0.3);
    background: linear-gradient(
        165deg,
        rgba(40, 22, 28, 0.5) 0%,
        rgba(22, 28, 40, 0.92) 100%
    );
}

.card-success {
    border-color: rgba(61, 220, 132, 0.3);
    background: linear-gradient(
        165deg,
        rgba(20, 40, 30, 0.4) 0%,
        rgba(22, 28, 40, 0.92) 100%
    );
}

.card-review {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    border-color: rgba(100, 181, 246, 0.22);
    background: linear-gradient(
        165deg,
        rgba(24, 34, 52, 0.55) 0%,
        rgba(22, 28, 40, 0.92) 100%
    );
}

.result-review-message {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.card-review .btn {
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.card-review .btn:hover {
    text-decoration: none;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-heading h2 {
    margin: 0;
}

.card-heading-result {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-heading-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.card-heading-result .btn-copy-all {
    flex-shrink: 0;
    margin-left: auto;
    padding: 8px 14px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.card-heading-result .launcher-help-trigger {
    margin-top: 0;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

#panel-result .card-heading-result {
    margin-bottom: 0;
}

.panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

.error {
    color: var(--error);
}

.error-body {
    color: #fecaca;
    font-size: 1rem;
    line-height: 1.65;
    margin: 0;
}

.error-hint {
    margin-top: 12px;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.result-expiry-notice {
    margin: 16px 0 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
}

.result-expiry-notice .result-expiry-timer {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ——— Status & progress ——— */

.status-message {
    font-size: 0.9375rem;
    min-height: 1.5em;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.status-message-error {
    color: #fecaca;
}

.info-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.info-heading h2 {
    margin: 0;
}

.info-heading .btn-copy-all {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.8125rem;
    white-space: nowrap;
}

#form-prestart.prestart-completed .prestart-field-body input,
#form-prestart.prestart-completed .prestart-nickname-input-wrap input,
#form-prestart.prestart-completed .prestart-password-input-wrap input {
    cursor: pointer;
}

.prestart-field-body.prestart-field-copied::after {
    content: "Скопировано";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
}

.billing-pause-notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 107, 0.35);
    background: linear-gradient(
        165deg,
        rgba(40, 22, 28, 0.55) 0%,
        rgba(22, 28, 40, 0.92) 100%
    );
}

.billing-pause-title {
    display: block;
    color: #fecaca;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.billing-pause-message {
    margin: 0;
    color: #fca5a5;
    font-size: 0.9rem;
    line-height: 1.45;
}

.input-notice {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 107, 0.35);
    background: rgba(40, 22, 28, 0.45);
}

.input-notice-title {
    display: block;
    margin: 0 0 4px;
    color: #fecaca;
    font-size: 0.9375rem;
    font-weight: 700;
}

.input-notice-text {
    margin: 0;
    color: #fca5a5;
    font-size: 0.875rem;
    line-height: 1.45;
}

.input-notice-warn {
    border-color: rgba(255, 107, 107, 0.35);
    background: rgba(40, 22, 28, 0.45);
}

.queue-info {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    color: var(--accent-hover);
    border: 1px solid rgba(100, 181, 246, 0.18);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
}

.progress {
    margin-top: 18px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

.progress #progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: none;
    border-radius: var(--radius-pill);
    position: relative;
    z-index: 1;
    will-change: width;
    box-shadow: 0 0 12px var(--accent-glow);
}

.progress.progress-connecting #progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 42%;
    height: 100%;
    transform: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    box-shadow: 0 0 14px var(--accent-glow);
    animation: progress-shuttle 2.2s ease-in-out infinite alternate;
}

@keyframes progress-shuttle {
    0% {
        left: -42%;
    }
    100% {
        left: 100%;
    }
}

/* ——— Definition lists ——— */

dl,
.info-fields {
    display: grid;
    grid-template-columns: minmax(130px, 148px) 1fr;
    gap: 12px 20px;
    margin: 0 0 4px;
}

dt {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
}

dd {
    margin: 0;
    word-break: break-word;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9375rem;
}

dd.copyable {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin: -6px -10px;
    transition: background var(--transition), color var(--transition);
}

.result-fields {
    margin: 0 0 4px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.875rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-activation {
    margin-top: 24px;
}

.result-activation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-activation-item {
    display: grid;
    grid-template-columns: minmax(130px, 148px) 1fr;
    gap: 12px 20px;
    align-items: center;
}

.result-activation-game {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding-top: 2px;
}

.result-activation-key {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
}

.result-activation-key:focus {
    outline: none;
    border-color: var(--accent);
}

dd.copyable:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

dd.copyable.copied {
    background: var(--ok-soft);
    color: var(--ok);
}

dd.field-placeholder {
    color: var(--muted);
    font-weight: 400;
    font-style: italic;
}

/* ——— Info / prestart form ——— */

.info-section {
    margin-top: 24px;
}

.info-section > h2 {
    margin: 0 0 16px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.prestart-form {
    display: grid;
    grid-template-columns: minmax(130px, 148px) 1fr;
    gap: 12px 20px;
    margin: 0 0 4px;
    align-items: center;
    --prestart-auto-col: 4.25rem;
    --prestart-auto-gap: 12px;
}

.prestart-field {
    display: contents;
}

.prestart-label {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
}

.prestart-field-body {
    display: block;
    align-self: start;
    min-width: 0;
    width: 100%;
    position: relative;
}

.prestart-field input,
.prestart-field .prestart-static {
    margin: 0;
    font-weight: 500;
    font-size: 0.9375rem;
}

.prestart-field input,
.prestart-field-body input {
    width: 100%;
    box-sizing: border-box;
}

.prestart-field select {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 10px 30px 10px 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa4b2' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: rgba(12, 16, 24, 0.65);
    color: var(--text);
}

.prestart-field select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.prestart-dob-block {
    align-items: start;
}

.prestart-dob-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--prestart-auto-col);
    column-gap: var(--prestart-auto-gap);
    align-items: center;
    min-width: 0;
    width: 100%;
}

.prestart-dob {
    display: grid;
    grid-template-columns: 68px 128px 84px;
    gap: 8px;
    justify-self: start;
    max-width: 100%;
}

# Country select — same arrow padding as DOB fields
.prestart-field #prestart-country {
    padding-right: 30px;
}

.prestart-dob select {
    width: 100%;
    min-width: 0;
    padding: 10px 30px 10px 10px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa4b2' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}

.prestart-dob-random {
    white-space: nowrap;
    justify-self: start;
    margin-top: 0;
}

.prestart-password-block {
    align-items: start;
}

.prestart-nickname-block {
    align-items: start;
}

.prestart-nickname-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--prestart-auto-col);
    column-gap: var(--prestart-auto-gap);
    align-items: start;
    min-width: 0;
    width: 100%;
}

.prestart-nickname-input-wrap {
    min-width: 0;
    width: 100%;
}

.prestart-nickname-input-wrap input {
    width: 100%;
}

.prestart-nickname-auto {
    white-space: nowrap;
    justify-self: start;
    align-self: center;
    margin-top: 0;
}

.prestart-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--prestart-auto-col);
    column-gap: var(--prestart-auto-gap);
    align-items: start;
    min-width: 0;
    width: 100%;
}

.prestart-nickname-row.prestart-row--no-toggle,
.prestart-password-row.prestart-row--no-toggle {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
}

.prestart-password-input-wrap {
    min-width: 0;
    width: 100%;
}

.prestart-password-input-wrap input {
    width: 100%;
}

.prestart-password-auto {
    white-space: nowrap;
    justify-self: start;
    align-self: center;
    margin-top: 0;
}

.prestart-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 400;
    user-select: none;
}

.prestart-checkbox input {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.prestart-newsletter.prestart-field {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 2px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 400;
    user-select: none;
    line-height: 1.35;
}

.prestart-newsletter input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex-shrink: 0;
    margin: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: rgba(12, 16, 24, 0.65);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.prestart-newsletter input[type="checkbox"]:hover:not(:disabled):not(:checked) {
    border-color: rgba(100, 181, 246, 0.5);
    background: rgba(12, 16, 24, 0.85);
}

.prestart-newsletter input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.prestart-newsletter input[type="checkbox"]:checked:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.prestart-newsletter input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #0a0e14;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.prestart-newsletter input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.prestart-newsletter input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prestart-newsletter span {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 400;
    color: var(--muted);
}

.prestart-newsletter {
    margin-top: 2px;
    align-items: flex-start;
    line-height: 1.4;
}

.prestart-newsletter span {
    font-weight: 400;
    color: var(--muted);
}

.prestart-newsletter {
    margin-top: 2px;
    align-items: flex-start;
    line-height: 1.4;
}

.prestart-newsletter span {
    font-weight: 400;
    color: var(--muted);
}

.prestart-field input.prestart-readonly-input {
    opacity: 0.9;
    cursor: default;
    background: rgba(12, 16, 24, 0.65);
    color: var(--muted);
    font-family: inherit;
    letter-spacing: 0.01em;
    font-style: italic;
}

.prestart-field input.prestart-readonly-input.prestart-password-revealed {
    color: var(--muted);
    font-family: var(--font-mono);
    font-style: normal;
    letter-spacing: 0.04em;
}

.prestart-readonly {
    align-items: center;
}

.prestart-static {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.9375rem;
}

#form-prestart .field-error {
    margin: 0;
    grid-column: 1 / -1;
    padding-top: 4px;
}

#form-prestart .prestart-field-error {
    margin: 4px 0 0;
    padding-top: 0;
    line-height: 1.35;
}

#form-prestart .prestart-field-body input[type="text"],
#form-prestart .prestart-field-body input[type="email"],
#form-prestart .prestart-nickname-input-wrap input,
#form-prestart .prestart-password-input-wrap input {
    flex: none;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
}

.start-action,
.registration-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.registration-actions .btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.start-action .btn,
.registration-actions .btn {
    min-width: 260px;
    padding: 10px 32px;
    font-size: 0.9375rem;
}

.start-cooldown-hint {
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.task-meta {
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* ——— Loading ——— */

.order-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 220px;
    padding: 40px 28px;
    text-align: center;
}

.order-loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2.5px solid rgba(100, 181, 246, 0.15);
    border-top-color: var(--accent);
    border-right-color: var(--accent-hover);
    animation: order-loading-spin 0.9s linear infinite;
}

.order-loading-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

@keyframes order-loading-spin {
    to { transform: rotate(360deg); }
}

/* ——— Enter code ——— */

.enter-code-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.enter-code-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.enter-code-label {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.enter-code-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.enter-code-row input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
}

.enter-code-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 12px 22px;
}

#form-enter-code .field-error {
    margin: 0;
}

/* ——— Forms & inputs ——— */

form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    flex: 1 1 200px;
    min-width: 0;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.35;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(139, 155, 179, 0.55);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
    background: var(--bg-soft);
}

input.input-invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-soft);
}

.field-error {
    margin: 8px 0 0;
    color: var(--error);
    font-size: 0.875rem;
    line-height: 1.4;
    width: 100%;
}

.captcha-block {
    margin: 12px 0;
    min-height: 78px;
}

.nickname-rules {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

#form-code.form-code {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#form-code .code-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

#form-code .code-input-row input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

#form-code .code-input-row .btn {
    flex: 0 0 auto;
    align-self: stretch;
    white-space: nowrap;
}

#form-code .field-error {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

#form-nickname.form-nickname {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#form-nickname .nickname-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

#form-nickname .nickname-input-row input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-family: var(--font-mono);
}

#form-nickname .nickname-input-row .btn {
    flex: 0 0 auto;
    align-self: stretch;
}

#form-nickname .field-error {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.copy-hint {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* ——— Buttons ——— */

.btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: transform 0.12s ease, filter var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    color: #0a1628;
    border: 1px solid rgba(100, 181, 246, 0.4);
    box-shadow: 0 2px 12px rgba(100, 181, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn.primary:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 4px 20px rgba(100, 181, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.secondary {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.secondary:hover:not(:disabled) {
    background: var(--bg-soft);
    border-color: var(--accent);
}

/* ——— Timers ——— */

.input-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid rgba(100, 181, 246, 0.2);
    box-sizing: border-box;
}

.input-timer-row .input-timer {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.input-timer-attempts {
    margin: 0;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent-hover);
    white-space: nowrap;
}

.input-timer {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--accent-soft);
    color: var(--accent-hover);
    border: 1px solid rgba(100, 181, 246, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.input-timer-row.input-timer-urgent {
    background: var(--error-soft);
    border-color: rgba(255, 107, 107, 0.22);
}

.input-timer-row.input-timer-urgent .input-timer,
.input-timer-row.input-timer-urgent .input-timer-attempts {
    color: #fecaca;
}

.input-timer.input-timer-urgent {
    background: var(--error-soft);
    color: #fecaca;
    border-color: rgba(255, 107, 107, 0.22);
}

code {
    background: var(--bg-soft);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    color: var(--accent-hover);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}