:root {
    --bg-top: #eef2f5;
    --bg-bottom: #d8e0e8;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --surface-dark: #0f2237;
    --text-main: #152434;
    --text-soft: #5a6a7c;
    --line: rgba(21, 36, 52, 0.12);
    --accent: #0057b8;
    --accent-deep: #00366d;
    --success: #2f7d4a;
    --warning: #9d5a16;
    --danger: #8d1f2d;
    --shadow: 0 24px 70px rgba(15, 34, 55, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-display: "Avenir Next", "Segoe UI", sans-serif;
    --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(0, 87, 184, 0.18), transparent 28%),
        radial-gradient(circle at right 20%, rgba(255, 184, 0, 0.16), transparent 22%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(21, 36, 52, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 36, 52, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 72px;
}

.site-header {
    display: grid;
    gap: 18px;
    margin-bottom: 20px;
}

.brand-lockup h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.eyebrow,
.card-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent-deep);
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-chip {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(21, 36, 52, 0.08);
}

.nav-chip.active {
    color: #fff;
    background: linear-gradient(135deg, #00366d, #0057b8);
    box-shadow: 0 10px 24px rgba(0, 87, 184, 0.24);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 22px;
    padding: 40px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 245, 251, 0.86));
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -90px;
    bottom: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 87, 184, 0.18), transparent 68%);
}

.hero-copy-block,
.hero-panel {
    position: relative;
    z-index: 1;
}

.hero h2,
.card h2 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.05;
}

.hero h2 {
    max-width: 12ch;
    font-size: clamp(2.3rem, 5vw, 4.4rem);
}

.hero-copy {
    max-width: 60ch;
    margin: 18px 0 0;
    font-size: 1.03rem;
    line-height: 1.72;
    color: var(--text-soft);
}

.hero-panel {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(15, 34, 55, 0.96), rgba(0, 57, 116, 0.95));
    color: #edf4ff;
    align-self: start;
}

.hero-panel-label {
    margin: 0 0 12px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: rgba(237, 244, 255, 0.72);
}

.hero-panel-note {
    margin: 14px 0 0;
    color: rgba(237, 244, 255, 0.78);
    line-height: 1.6;
}

.hero-actions,
.row,
.card-head {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.hero-actions {
    margin-top: 18px;
    justify-content: flex-start;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.card {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.card-accent {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 251, 0.95));
}

.card-dark {
    background: linear-gradient(160deg, rgba(15, 34, 55, 0.98), rgba(10, 24, 39, 0.98));
    color: #edf4ff;
}

.card-dark .card-label,
.card-dark h2 {
    color: #edf4ff;
}

.stack {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.field span {
    font-size: 0.95rem;
}

.field input,
.field select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    font: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    font: inherit;
    resize: vertical;
    min-height: 140px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(0, 87, 184, 0.6);
    box-shadow: 0 0 0 4px rgba(0, 87, 184, 0.12);
    transform: translateY(-1px);
}

.field-checkbox {
    align-content: end;
}

.field-checkbox input {
    width: 20px;
    height: 20px;
    margin-top: 12px;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #1674da);
    box-shadow: 0 10px 24px rgba(0, 87, 184, 0.24);
}

.secondary-button,
.ghost-button {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(21, 36, 52, 0.08);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.18);
    color: #edf4ff;
    border-color: rgba(237, 244, 255, 0.18);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.badge-muted {
    color: var(--text-soft);
    background: rgba(21, 36, 52, 0.08);
}

.badge-success {
    color: #fff;
    background: var(--success);
}

.badge-warning {
    color: #fff;
    background: var(--warning);
}

.status-text {
    margin: 18px 0 0;
    min-height: 24px;
    color: var(--text-soft);
}

.output-panel {
    margin: 18px 0 0;
    min-height: 194px;
    padding: 18px;
    overflow: auto;
    border-radius: var(--radius-md);
    background: rgba(21, 36, 52, 0.05);
    border: 1px solid rgba(21, 36, 52, 0.08);
    color: var(--text-main);
    font-family: "SFMono-Regular", "Menlo", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.next-list {
    margin: 18px 0 0;
    padding-left: 20px;
    line-height: 1.8;
    color: rgba(237, 244, 255, 0.84);
}

.player-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.player-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(21, 36, 52, 0.04);
    border: 1px solid rgba(21, 36, 52, 0.08);
}

.player-meta {
    display: grid;
    gap: 4px;
}

.player-row.is-selected {
    border-color: rgba(0, 87, 184, 0.4);
    box-shadow: 0 0 0 4px rgba(0, 87, 184, 0.08);
}

.player-name {
    font-size: 1rem;
    font-weight: 700;
}

.player-details {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.danger-button {
    color: #fff;
    background: linear-gradient(135deg, #bb2f3d, var(--danger));
}

.empty-state {
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(21, 36, 52, 0.04);
    color: var(--text-soft);
}

.notes-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.note-card {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(21, 36, 52, 0.04);
    border: 1px solid rgba(21, 36, 52, 0.08);
}

.note-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.86rem;
    color: var(--text-soft);
}

.note-text {
    margin: 10px 0 0;
    line-height: 1.7;
}

.hidden {
    display: none;
}

@media (max-width: 880px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 20px;
    }

    .hero,
    .card {
        padding: 20px;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .view-grid {
        grid-template-columns: 1fr;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        max-width: 100%;
    }

    .row button,
    .hero-actions button,
    .top-nav button,
    .card-head button {
        width: 100%;
    }

    .player-row {
        flex-direction: column;
        align-items: stretch;
    }
}
