/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Colors — Dark sports theme */
    --color-primary: #3B82F6;
    --color-primary-dark: #1E40AF;
    --color-primary-glow: rgba(59, 130, 246, 0.35);
    --color-accent: #F59E0B;
    --color-accent-glow: rgba(245, 158, 11, 0.3);
    --color-bg: #0F172A;
    --color-bg-card: #1E293B;
    --color-bg-card-hover: #253449;
    --color-bg-input: #0F172A;
    --color-bg-elevated: #334155;
    --color-text: #F8FAFC;
    --color-text-muted: #94A3B8;
    --color-text-dim: #64748B;
    --color-border: #334155;
    --color-border-subtle: #1E293B;
    --color-success: #22C55E;
    --color-success-glow: rgba(34, 197, 94, 0.3);
    --color-danger: #EF4444;
    --color-danger-soft: rgba(239, 68, 68, 0.15);
    --color-warning: #F59E0B;
    --color-warning-soft: rgba(245, 158, 11, 0.15);
    --color-gold: #FFD700;
    --color-gold-dark: #B8860B;
    --color-silver: #C0C0C0;
    --color-silver-dark: #808080;
    --color-bronze: #CD7F32;
    --color-bronze-dark: #8B5A2B;
    --color-purple: #8B5CF6;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-primary: 0 0 20px var(--color-primary-glow);
    --shadow-glow-accent: 0 0 20px var(--color-accent-glow);
    --shadow-glow-success: 0 0 20px var(--color-success-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Aliases for wizard CSS compatibility */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --border-color: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --primary: #3B82F6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --success: #22C55E;
    --danger: #EF4444;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global input base — dark theme for all text/number inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--color-text-dim);
}

/* Hide browser number spinners globally */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ============================================
   LEAGUE HEADER
   ============================================ */
.league-header {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-bg-card) 50%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    position: relative;
    overflow: hidden;
}

.league-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.league-header h1 {
    color: var(--color-text);
    font-size: clamp(1.4rem, 3vw + 0.5rem, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow-wrap: break-word;
    word-break: break-word;
}

.league-header .subtitle {
    color: var(--color-accent);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-config-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.config-action-btn {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.config-action-btn:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.back-to-presets-btn {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.back-to-presets-btn:hover {
    border-color: var(--color-text-muted);
    background: rgba(148, 163, 184, 0.12);
    box-shadow: 0 0 0 1px var(--color-text-muted);
}

/* ============================================
   SECTIONS (Cards)
   ============================================ */
section {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

section:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 12px var(--color-primary-glow);
}

h1 {
    color: var(--color-text);
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    color: var(--color-text);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: var(--color-primary);
    border-radius: 2px;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.section-description {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    text-align: center;
    font-size: 0.95rem;
}

/* ============================================
   TEAM INPUTS
   ============================================ */
.team-inputs-section {
    border-top: 3px solid var(--color-primary);
}

.team-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
}

.team-input-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.team-input-row label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-name-input {
    padding: 0.65rem var(--space-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.team-name-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.team-name-input::placeholder {
    color: var(--color-text-dim);
}

.team-name-input:disabled {
    background: var(--color-bg-elevated);
    color: var(--color-text-dim);
    cursor: not-allowed;
    opacity: 0.6;
}

.team-input-row select {
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-text);
    background-color: var(--color-bg-input);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%233B82F6' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
}

.team-input-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.team-input-row select option {
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

.team-input-row select:disabled {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-dim);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   CONFIRM BUTTONS & ACTIONS
   ============================================ */
.team-input-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-md) auto 0;
    max-width: 400px;
    width: 100%;
}

.team-confirm-button {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    cursor: pointer;
    box-shadow: var(--shadow-md), var(--shadow-glow-primary);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.team-confirm-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 24px var(--color-primary-glow);
}

.team-confirm-button:active {
    transform: translateY(0);
}

.team-confirm-button.locked {
    background: linear-gradient(135deg, var(--color-success) 0%, #16A34A 100%);
    box-shadow: var(--shadow-md), var(--shadow-glow-success);
}

.team-confirm-button.locked:hover {
    box-shadow: var(--shadow-lg), 0 0 24px var(--color-success-glow);
}

.team-confirm-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

.team-confirm-status.locked {
    color: var(--color-success);
    font-weight: 600;
}

/* ============================================
   TABLES (Odds & Pick Ownership)
   ============================================ */
.odds-table-caption {
    margin: 0 0 var(--space-sm) 0;
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.odds-table-container,
.pick-ownership-container {
    width: 100%;
    overflow-x: auto;
    margin: var(--space-md) 0;
}

.odds-table,
.pick-ownership-table {
    width: 100%;
    min-width: 400px; /* prevent collapse below readable width */
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}

.odds-table th,
.pick-ownership-table th {
    padding: 0.85rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    border: none;
    white-space: nowrap;
    min-width: 60px;
}

.odds-table td,
.pick-ownership-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text);
    white-space: nowrap;
}

.odds-table tr:last-child td,
.pick-ownership-table tr:last-child td {
    border-bottom: none;
}

.odds-table tr:nth-child(even),
.pick-ownership-table tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.5);
}

.odds-table tr:nth-child(odd),
.pick-ownership-table tr:nth-child(odd) {
    background-color: var(--color-bg-card);
}

.odds-table tr:hover,
.pick-ownership-table tr:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.odds-table td:first-child,
.odds-table th:first-child {
    text-align: left;
}

.odds-table td:first-child {
    font-weight: 600;
    color: var(--color-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pick-ownership-table select {
    width: 100%;
    min-width: 130px;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background-color: var(--color-bg-input);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}

.pick-ownership-table select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.original-team-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

.round-header {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.round-header td {
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.03em;
}

.pick-ownership-placeholder {
    padding: var(--space-xl);
    text-align: center;
    background-color: rgba(59, 130, 246, 0.05);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================
   PICK OWNERSHIP & DRAFT ORDER SECTIONS
   ============================================ */
.pick-ownership-section,
.draft-order-section {
    border-top: 3px solid var(--color-primary);
}

/* ============================================
   DRAFT ORDER
   ============================================ */
.full-draft-order {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.draft-round {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
}

.draft-round-title {
    color: var(--color-primary);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-primary);
    font-size: 1.1rem;
}

.draft-pick {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
    cursor: pointer;
}

.draft-pick:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.draft-pick-number {
    flex: 0 0 3rem;
    min-width: 3rem;
    font-weight: 700;
    color: var(--color-accent);
    font-family: 'JetBrains Mono', monospace;
}

.draft-pick-team {
    flex: 1;
    min-width: 0; /* required for text-overflow: ellipsis in flex */
    font-weight: 500;
    padding: 0 var(--space-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draft-pick-original {
    flex: 0 1 auto; /* allow shrinking so it doesn't crush team name */
    min-width: 0;
    max-width: 45%;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    font-style: italic;
    padding-left: var(--space-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draft-order-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: var(--space-lg);
    justify-content: center;
    grid-column: 1 / -1;
    width: 100%;
}

/* ============================================
   RESET BUTTON
   ============================================ */
.reset-container {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-xl);
}

.reset-button {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--color-text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all var(--transition-base);
}

.reset-button:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-danger);
    color: var(--color-danger);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.reset-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
   LOTTERY CONTROLS
   ============================================ */
.lottery-section {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid var(--color-primary);
}

.lottery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    margin: var(--space-md) auto;
}

.magic-number-input {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.magic-number-label-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.magic-number-input label {
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    font-size: 0.95rem;
}

.magic-number-help {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    max-width: 240px;
    line-height: 1.4;
}

.magic-number-input input {
    width: 80px;
    padding: 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    text-align: center;
    background-color: var(--color-bg-input);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: textfield;
    -moz-appearance: textfield;
}

.magic-number-input input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.magic-number-input input::-webkit-inner-spin-button,
.magic-number-input input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* ============================================
   LOTTERY BUTTON
   ============================================ */
.lottery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    background: linear-gradient(135deg, var(--color-accent) 0%, #D97706 100%);
    color: #0F172A;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-md), var(--shadow-glow-accent);
    position: relative;
    overflow: hidden;
}

.lottery-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: 0.5s;
}

.lottery-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px var(--color-accent-glow);
}

.lottery-button:hover::before {
    left: 100%;
}

.lottery-button:active {
    transform: translateY(0);
}

.lottery-button:disabled {
    background: var(--color-bg-elevated);
    color: var(--color-text-dim);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.lottery-button:disabled::before {
    display: none;
}

.button-icon {
    font-size: 1.3rem;
}

/* ============================================
   RESULTS
   ============================================ */
.results {
    display: none;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.result-item {
    padding: var(--space-md);
    margin: 0 0 var(--space-sm) 0;
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    width: 100%;
    text-align: center;
    font-weight: 500;
    animation: revealSlide 0.3s ease;
}

.result-item.pick-1st {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-color: var(--color-gold);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.result-item.pick-2nd {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.05) 100%);
    border-color: var(--color-silver);
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.15);
}

.result-item.pick-3rd {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.05) 100%);
    border-color: var(--color-bronze);
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.15);
}

.result-item.pick-auto {
    background-color: var(--color-danger-soft);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================
   FULLSCREEN LOTTERY MODAL
   ============================================ */
.lottery-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lottery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-2xl);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: linear-gradient(180deg, #0F172A 0%, #1A2332 100%);
    position: relative;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all var(--transition-base);
    z-index: 10;
}

.close-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lottery-title {
    font-size: 2.5rem;
    color: var(--color-text);
    margin-bottom: var(--space-2xl);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    text-align: center;
}

.lottery-title .accent {
    color: var(--color-accent);
}

.lottery-animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 500px;
    padding: var(--space-lg);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 85vh;
    gap: var(--space-sm);
    position: relative;
}

/* ============================================
   FULLSCREEN: Quick Iterations
   ============================================ */
.iteration-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
}

.quick-iteration-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: var(--space-md) auto;
    padding: var(--space-md);
    height: 140px;
    gap: 6px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
}

.podium-block {
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.podium-team-name {
    font-weight: 700;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    font-size: 0.85rem;
}

.podium-place.first .podium-block {
    height: 100px;
    background: linear-gradient(180deg, #FFD700 0%, #FFC300 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.podium-place.second .podium-block {
    height: 80px;
    background: linear-gradient(180deg, #D4D4D4 0%, #A8A8A8 100%);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.podium-place.third .podium-block {
    height: 60px;
    background: linear-gradient(180deg, #CD7F32 0%, #B8722E 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

/* ============================================
   FULLSCREEN: Picks Reveal
   ============================================ */
.batch-header {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
    text-align: center;
    letter-spacing: -0.01em;
}

.automatic-picks-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: var(--space-xs);
}

.fullscreen-result-item {
    width: 100%;
    max-width: 700px;
    padding: 0.75rem var(--space-md);
    margin: 0.1rem 0;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    font-size: 1.15rem;
    font-weight: 500;
    text-align: center;
    color: var(--color-text);
    animation: slideInFromRight 0.6s var(--spring);
    overflow-wrap: break-word;
    word-break: break-word;
}

.fullscreen-result-item.pick-auto {
    background-color: var(--color-danger-soft);
    border-color: rgba(239, 68, 68, 0.25);
}

.fullscreen-result-item.pick-lottery {
    background-color: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.fullscreen-result-item.has-faller {
    border: 2px solid var(--color-danger);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.chaos-note {
    margin-top: var(--space-sm);
    font-weight: 700;
    color: var(--color-danger);
    font-size: 0.95rem;
    animation: shake 0.4s infinite;
}

/* ============================================
   FULLSCREEN: Calculating Message
   ============================================ */
.fullscreen-calculating {
    font-size: 2.2rem;
    color: var(--color-text);
    font-weight: 800;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    animation: calculatingPulse 2s ease-in-out infinite;
}

/* ============================================
   FULLSCREEN: Drumroll
   ============================================ */
.drumroll-area {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--space-lg) 0 var(--space-2xl) 0;
    position: relative;
}

.fullscreen-drumroll {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    padding: var(--space-lg);
    animation: shake 0.5s infinite;
    width: 100%;
    max-width: 900px;
}

.fullscreen-drumroll.pick-gold { color: var(--color-gold); }
.fullscreen-drumroll.pick-silver { color: var(--color-silver); }
.fullscreen-drumroll.pick-bronze { color: var(--color-bronze); }
.fullscreen-drumroll.pick-fourth { color: var(--color-purple); }

.upset-alert {
    margin-top: 0.75rem;
    font-size: 1.2rem;
    color: var(--color-accent);
    font-weight: 700;
    animation: pulse 0.8s infinite alternate;
}

/* ============================================
   FULLSCREEN: Top 4 Podium
   ============================================ */
.top-four-stage {
    min-height: min(800px, 80vh);
    padding: var(--space-xl);
}

.batch-header-lg {
    font-size: clamp(1.4rem, 4vw, 2.5rem);
}

.reveal-top4-btn {
    margin: var(--space-xl) auto;
    display: block;
}

.top-four-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: min(500px, 55vh);
    margin: 0 auto var(--space-2xl) auto;
    padding: 0;
    width: 100%;
    max-width: 1000px;
    position: relative;
    perspective: 800px;
}

.podium-placeholder {
    flex: 1;
    height: 10px;
    opacity: 0;
}

.podium-placeholder.pos-4 { min-width: 180px; max-width: 180px; order: 0; margin: 0 15px; }
.podium-placeholder.pos-3 { min-width: 200px; max-width: 200px; order: 1; margin: 0 15px; }
.podium-placeholder.pos-1 { min-width: 240px; max-width: 240px; order: 2; margin: 0 15px; }
.podium-placeholder.pos-2 { min-width: 220px; max-width: 220px; order: 3; margin: 0 15px; }

/* Top-N podium places */
.top-podium-place {
    height: var(--podium-height, 200px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-lg) var(--space-md);
    box-shadow: var(--shadow-lg);
    position: absolute;
    bottom: 0;
    box-sizing: border-box;
    animation: revealPodium 0.8s var(--spring);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.top-podium-place:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.top-podium-place.place-1 {
    height: min(380px, 42vh);
    background: linear-gradient(180deg, #FFD700 0%, #E6B800 100%);
    z-index: 40;
}

.top-podium-place.place-2 {
    height: min(300px, 33vh);
    background: linear-gradient(180deg, #D4D4D4 0%, #A8A8A8 100%);
    z-index: 30;
}

.top-podium-place.place-3 {
    height: min(240px, 26vh);
    background: linear-gradient(180deg, #CD7F32 0%, #A8652A 100%);
    z-index: 20;
}

.top-podium-place.place-4 {
    height: min(200px, 22vh);
    background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%);
    z-index: 10;
}

.top-podium-place.has-jumper {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
}

.podium-position-number {
    font-size: 4.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.top-podium-place.place-4 .podium-position-number {
    font-size: 3.5rem;
    margin-bottom: var(--space-xs);
}

.podium-team-label {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.35);
    text-align: center;
    width: 100%;
    padding: 0 var(--space-sm);
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
}

.top-podium-place.place-3 .podium-team-label,
.top-podium-place.place-4 .podium-team-label {
    font-size: 1.3rem;
}

.lucky-leap-badge {
    margin-top: var(--space-md);
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
}

/* ============================================
   FULLSCREEN: Complete Message
   ============================================ */
.fullscreen-complete {
    font-size: 1.8rem;
    color: var(--color-success);
    font-weight: 800;
    margin-top: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--color-success);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.8s ease;
    width: 100%;
    max-width: 700px;
    text-align: center;
    background: rgba(34, 197, 94, 0.08);
}

.redraw-notice {
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-warning);
    background-color: var(--color-warning-soft);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    max-width: 700px;
    margin: var(--space-md) auto;
}

.modal-btn-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: var(--space-lg);
}

/* ============================================
   FULLSCREEN: Pick Timer
   ============================================ */
.pick-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    text-align: center;
    pointer-events: none;
    animation: slideInCorner 0.3s ease-out;
}

.pick-timer-label {
    font-size: 0.85rem;
    margin-bottom: var(--space-xs);
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.pick-timer-display {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.pick-timer-display.urgent {
    color: var(--color-danger);
}

.pick-timer-container.urgent {
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem var(--space-lg);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s var(--spring), toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    max-width: 400px;
    text-align: center;
}

.toast.toast-error {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
}

.toast.toast-warning {
    border-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.12);
    color: #FDE68A;
}

.toast.toast-success {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.12);
    color: #86EFAC;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 20001;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.confirm-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.confirm-message {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.confirm-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.confirm-btn-cancel {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.confirm-btn-cancel:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.confirm-btn-confirm {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: filter var(--transition-fast);
}

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

/* ============================================
   COMPLETE MESSAGE (non-fullscreen results)
   ============================================ */
.complete-message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-success);
    margin-top: var(--space-md);
    padding: var(--space-md);
    border: 2px solid var(--color-success);
    border-radius: var(--radius-md);
    animation: fadeIn 0.8s ease;
    background: rgba(34, 197, 94, 0.08);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes revealSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes goldReveal {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    50% { opacity: 1; transform: scale(1.08) translateY(0); }
    100% { transform: scale(1); }
}

@keyframes silverReveal {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    50% { opacity: 1; transform: scale(1.06) translateY(0); }
    100% { transform: scale(1); }
}

@keyframes bronzeReveal {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    50% { opacity: 1; transform: scale(1.04) translateY(0); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInTop {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes revealPodium {
    0% { transform: translateY(80px); opacity: 0; }
    60% { transform: translateY(-15px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes calculatingPulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.96); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
    100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.96); }
}

@keyframes slideInCorner {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .container {
        padding: var(--space-lg);
    }

    .team-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .lottery-title {
        font-size: 2rem;
    }

    .top-four-podium {
        height: min(400px, 50vh);
    }

    .top-podium-place.place-1 { height: min(300px, 38vh); }
    .top-podium-place.place-2 { height: min(240px, 30vh); }
    .top-podium-place.place-3 { height: min(200px, 25vh); }
    .top-podium-place.place-4 { height: min(170px, 21vh); }

    .podium-placeholder.pos-1,
    .podium-placeholder.pos-2,
    .podium-placeholder.pos-3,
    .podium-placeholder.pos-4 {
        min-width: 140px;
        max-width: 140px;
        margin: 0 8px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .team-inputs {
        grid-template-columns: 1fr;
    }

    .lottery-controls {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .magic-number-input {
        justify-content: center;
        flex-wrap: wrap;
    }

    .magic-number-label-group {
        text-align: center;
        flex: 1 0 100%;
    }

    .lottery-title {
        font-size: 1.5rem;
    }

    .batch-header {
        font-size: 1.4rem;
    }

    .fullscreen-drumroll {
        font-size: 1.4rem;
    }

    .top-four-podium {
        height: min(300px, 40vh);
        flex-wrap: wrap;
    }

    .top-podium-place.place-1 { height: min(220px, 28vh); }
    .top-podium-place.place-2 { height: min(180px, 23vh); }
    .top-podium-place.place-3 { height: min(150px, 19vh); }
    .top-podium-place.place-4 { height: min(130px, 17vh); }

    .podium-placeholder.pos-1,
    .podium-placeholder.pos-2,
    .podium-placeholder.pos-3,
    .podium-placeholder.pos-4 {
        min-width: 100px;
        max-width: 100px;
        margin: 0 4px;
    }

    .podium-team-label {
        font-size: 1rem;
    }

    .podium-position-number {
        font-size: 3rem;
    }

    .top-podium-place.place-4 .podium-position-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .league-header {
        padding: var(--space-lg) var(--space-md);
    }

    section {
        padding: var(--space-md);
    }

    /* Stack magic number label + input vertically on tiny screens */
    .magic-number-input {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
    }

    .magic-number-label-group {
        flex: 1 0 100%;
        text-align: center;
    }

    .magic-number-help {
        max-width: 100%;
    }

    /* Reduce wizard card padding so content has room */
    .wizard-card {
        padding: var(--space-lg);
    }

    /* Scale down podium blocks in the quick-iteration view */
    .podium-block {
        width: 90px;
    }

    .podium-team-name {
        max-width: 80px;
    }

    .pick-timer-container {
        width: 90px;
        height: 90px;
        top: 10px;
        right: 10px;
    }

    .pick-timer-display {
        font-size: 2rem;
    }

    .pick-timer-label {
        font-size: 0.75rem;
    }

    .wizard-structure-row {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .wizard-structure-row label {
        flex: 1 0 100%;
    }

    .wizard-structure-row input {
        width: 100%;
    }

    .lottery-button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   SETUP WIZARD
   ============================================ */

.wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: var(--space-lg);
}

.wizard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--space-2xl);
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

/* ============================================
   QUICK START SCREEN
   ============================================ */

.quickstart-card {
    max-width: 760px;
    text-align: center;
}

.quickstart-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 99px;
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

.quickstart-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.quickstart-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.quickstart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.quickstart-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    color: var(--text-primary);
    text-align: center;
}

.quickstart-preset-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.quickstart-preset-btn:active {
    transform: translateY(0);
}

.quickstart-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.quickstart-preset-btn strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.quickstart-tag {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
    line-height: 1.4;
}

.quickstart-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.quickstart-divider::before,
.quickstart-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.quickstart-custom-btn {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    width: 100%;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.quickstart-custom-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.quickstart-custom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

@media (max-width: 500px) {
    .quickstart-grid {
        grid-template-columns: 1fr;
    }

    .quickstart-title {
        font-size: 1.5rem;
    }
}

.wizard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.wizard-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.wizard-progress {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
}

.wizard-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background var(--transition-base);
}

.wizard-progress-dot.active {
    background: var(--primary);
}

.wizard-progress-dot.completed {
    background: var(--success);
}

.wizard-field {
    margin-bottom: var(--space-lg);
}

.wizard-field label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.wizard-field input[type="text"],
.wizard-field input[type="number"] {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.wizard-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.wizard-field .helper-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.wizard-team-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}

.wizard-team-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.wizard-team-item label {
    min-width: 80px;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.wizard-team-item input {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.wizard-team-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.wizard-combo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-sm);
}

.wizard-combo-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.wizard-combo-item label {
    min-width: 80px;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.wizard-combo-item input {
    width: 80px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    text-align: right;
}

.wizard-combo-total {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
}

.wizard-combo-total.valid {
    color: var(--success);
}

.wizard-combo-total.invalid {
    color: var(--danger);
}

.wizard-auto-btn {
    display: block;
    width: 100%;
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color var(--transition-base), color var(--transition-base);
}

.wizard-auto-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xl);
    gap: var(--space-md);
}

.wizard-nav button {
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
}

.wizard-btn-back {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color) !important;
}

.wizard-btn-back:hover {
    background: var(--border-color);
}

.wizard-btn-next {
    background: var(--primary);
    color: #fff;
}

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

.wizard-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.wizard-format-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.wizard-format-card {
    display: block;
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color var(--transition-base), background var(--transition-base);
    background: var(--bg-secondary);
}

.wizard-format-card:hover {
    border-color: var(--primary);
}

.wizard-format-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.reconfigure-button {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    margin-top: var(--space-sm);
}

.reconfigure-button:hover {
    color: var(--color-text);
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.wizard-structure-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.wizard-structure-row label {
    min-width: 0;
    flex: 1;
    margin-bottom: 0;
}

.wizard-structure-row input {
    width: 80px;
}

.wizard-structure-summary {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   PROGRESS TRACKER
   ============================================ */

.progress-tracker {
    display: flex;
    align-items: center;
    gap: 0;
    margin: var(--space-md) 0 var(--space-xl);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
    min-width: 0;
}

.progress-step.done {
    color: var(--success);
}

.progress-step.active {
    color: var(--primary);
    font-weight: 600;
}

.progress-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.progress-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-primary);
    border: 2px solid currentColor;
    flex-shrink: 0;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    min-width: 24px;
}

.progress-line.done {
    background: var(--success);
}

/* ============================================
   SECTION BADGES
   ============================================ */

.section-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    margin-left: var(--space-sm);
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-pending {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-locked {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   LOTTERY HISTORY
   ============================================ */

.history-section {
    margin-top: var(--space-xl);
}

.history-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.history-entry summary {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.history-entry summary::-webkit-details-marker { display: none; }

.history-entry summary::before {
    content: '▶';
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.history-entry[open] summary::before {
    transform: rotate(90deg);
}

.history-picks {
    margin: 0;
    padding: var(--space-sm) var(--space-md) var(--space-md) calc(var(--space-md) + 1.5rem);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.history-chaos {
    margin: 0 var(--space-md) var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #F59E0B;
    color: #F59E0B;
    font-size: 0.8rem;
    border-radius: 0 6px 6px 0;
}

/* ============================================
   SITE FOOTER
   ============================================ */
.site-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--color-text-dim);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    border-top: 1px solid var(--color-border-subtle);
    margin-top: var(--space-md);
}

.site-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--color-primary);
}

/* ============================================
   PICK OWNERSHIP PRESET BUTTON
   ============================================ */
.pick-ownership-preset-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.pick-ownership-preset-btn:hover {
    border-color: var(--color-success);
    color: var(--color-success);
    background: rgba(34, 197, 94, 0.08);
}

.own-picks-btn {
    display: block;
    width: fit-content;
    margin: 0 auto var(--space-md);
    padding: 0.4rem 1rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--radius-pill);
    color: var(--color-success);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.own-picks-btn:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: var(--color-success);
}

.own-picks-btn:active {
    background: rgba(34, 197, 94, 0.25);
}

.lottery-button {
    min-height: 48px;
}

@media (max-width: 600px) {
    .odds-table-container,
    .pick-ownership-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .odds-table-container::after,
    .pick-ownership-container::after {
        content: '← scroll →';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-secondary);
        padding: var(--space-xs) 0;
    }

    .odds-table th,
    .pick-ownership-table th {
        padding: 0.55rem 0.65rem;
        font-size: 0.72rem;
    }

    .odds-table td,
    .pick-ownership-table td {
        padding: 0.55rem 0.65rem;
        font-size: 0.85rem;
    }

    .progress-tracker {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .progress-line {
        display: none;
    }
}

@media (max-width: 360px) {
    .podium-block {
        width: 72px;
    }

    .podium-team-name {
        max-width: 60px;
        font-size: 0.72rem;
    }

    .quick-iteration-podium {
        gap: 3px;
    }

    .league-header {
        padding: var(--space-md) var(--space-sm);
    }

    .header-config-actions {
        gap: var(--space-xs);
    }

    .config-action-btn,
    .back-to-presets-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
}

