:root {
    color-scheme: dark;
    --bg: #14171c;
    --bg-soft: #1a1f26;
    --panel: #20252d;
    --panel-2: #252b34;
    --line: #313947;
    --line-strong: #3b4556;
    --text: #eef2f7;
    --text-soft: #aeb8c7;
    --accent: #4f8cff;
    --accent-soft: #2e5cb8;
    --success: #2f855a;
    --danger: #b24a4a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.bg-orb {
    display: none;
}

.glass-panel,
.glass-subpanel {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 1.05rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.glass-subpanel {
    background: var(--panel-2);
}

.notice {
    border-radius: 0.75rem;
    border: 1px solid transparent;
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
}

.notice-ok {
    border-color: #3a6f53;
    background: #23362c;
    color: #c6f1dd;
}

.notice-error {
    border-color: #7a3f3f;
    background: #3a2323;
    color: #ffd9d9;
}

.btn,
.chip,
.input,
.btn-icon {
    transition: all 0.16s ease;
}

.btn {
    border: 1px solid var(--line-strong);
    border-radius: 0.8rem;
    padding: 0.7rem 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn svg,
.icon-inline {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}

.btn:focus-visible,
.chip:focus-visible,
.input:focus-visible,
.btn-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-soft);
    border-color: #3f6ec8;
    color: white;
}

.btn-primary:hover {
    background: var(--accent);
    border-color: #5f99ff;
}

.btn-secondary {
    background: #2a3039;
    border-color: #404b5d;
    color: #e6ebf3;
}

.btn-secondary:hover {
    background: #313844;
}

.btn-ghost {
    background: transparent;
    border-color: #3d4656;
    color: #ced5e2;
}

.btn-ghost:hover {
    background: #2a3039;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3d4656;
    background: #2b323d;
    color: #d7deeb;
    border-radius: 999px;
    padding: 0.34rem 0.72rem;
    font-size: 0.77rem;
    font-weight: 600;
    text-decoration: none;
}

.chip:hover {
    border-color: #536179;
    background: #323b48;
}

.section-title {
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
}

.field {
    display: grid;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-soft);
}

.input {
    width: 100%;
    border: 1px solid #3b4554;
    border-radius: 0.75rem;
    background: #161b22;
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.7rem 0.85rem;
}

.input::placeholder {
    color: #7f8a9b;
}

.input:hover {
    border-color: #56637a;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.22);
}

.player-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    border: 1px solid #3f495a;
    background: #2a3039;
    color: #edf2f9;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.72rem;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.btn-icon:hover {
    background: #364050;
}

.mode-option {
    display: block;
}

.mode-card {
    display: grid;
    gap: 0.35rem;
    border-radius: 0.88rem;
    border: 1px solid #394354;
    background: #242a33;
    padding: 0.82rem;
    min-height: 120px;
}

.mode-card strong {
    color: #f2f5fb;
    font-weight: 700;
    font-size: 0.94rem;
}

.mode-card small {
    color: #b7c1d2;
    font-size: 0.8rem;
    line-height: 1.35;
}

.mode-option input:checked + .mode-card {
    border-color: #5e85d6;
    background: #2a3240;
    box-shadow: inset 0 0 0 1px #5e85d6;
}

.category-option {
    display: inline-flex;
}

.category-chip {
    border-radius: 999px;
    border: 1px solid #3a4453;
    background: #252b34;
    color: #d7deeb;
    padding: 0.42rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.category-option input:checked + .category-chip {
    border-color: #5f86d8;
    background: #2c3850;
    color: #f7f9ff;
}

.range {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.info-tile {
    border-radius: 0.85rem;
    border: 1px solid #374152;
    background: #252b35;
    padding: 0.68rem 0.8rem;
}

.tile-title {
    font-size: 0.71rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #99a6bc;
}

.tile-value {
    margin-top: 0.2rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: white;
}

.step-item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.step-item span {
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e9effa;
    background: #344154;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0.72rem;
    border: 1px solid #374152;
    background: #242a33;
    padding: 0.58rem 0.72rem;
    color: #e4ebf7;
    font-size: 0.92rem;
}

.card-enter {
    animation: cardEnter 220ms ease both;
}

.delay-1 {
    animation-delay: 80ms;
}

.card-pop {
    animation: popIn 180ms ease both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.99);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    .btn {
        width: 100%;
        justify-content: center;
    }

    .chip {
        font-size: 0.75rem;
    }
}
