/* ---------------------------------------------------------
   COLOR VARIABLES (global design system)
--------------------------------------------------------- */
:root {
    --bg-0: #0a0d12;
    --bg-1: #11161f;
    --bg-2: #1c2430;

    --text: #e6edf3;

    --accent: #58a6ff;
    --accent-hover: #79b8ff;

    --success: #3fb950;
    --success-hover: #56d364;

    --danger: #f85149;

    --border: #30363d;

    --font-sm: 0.875rem;
}

/* ---------------------------------------------------------
   GLOBAL PAGE BACKGROUND + TYPOGRAPHY
--------------------------------------------------------- */
body {
    background: radial-gradient(
        circle at center,
        var(--bg-0) 0%,
        var(--bg-1) 35%,
        var(--bg-2) 70%,
        #242e3a 100%
    );
    color: var(--text);
    margin: 0;
    padding: 0;
    text-align: center;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------------------------------------------------------
   FORM FIELD RESTORATION (for make_league and forms)
--------------------------------------------------------- */
input,
select,
textarea {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    padding: 0.5rem;
    font-size: 0.875rem;
}

#leagueForm label,
#leagueForm legend {
    color: #222 !important;
}

#leagueForm h2,
.container h2 {
    color: #222 !important;
}

/* ---------------------------------------------------------
   UNIFIED BUTTON SYSTEM (Primary / Secondary / Danger)
--------------------------------------------------------- */

/* PRIMARY BUTTON — subtle black, soft white outline, gentle hover */
.btn,
button,
input[type="button"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.55rem 1.15rem;
    font-size: 0.95rem;
    font-weight: 600;

    background: rgba(0,0,0,0.65);          /* softer black */
    color: #ffffff;

    border: 1px solid rgba(255,255,255,0.55); /* softer white outline */
    border-radius: 0.45rem;

    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.1s ease;
}

.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    background: rgba(0,0,0,0.78);               /* slightly darker hover */
    border-color: var(--accent-hover);          /* blue hover outline */
}

.btn:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active {
    transform: scale(0.98);
}

.btn:visited {
    color: #ffffff;
}

.button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;   /* was 1.2rem — now slightly more open */
    margin-top: 2rem;
}

/* ---------------------------------------------------------
   SECONDARY BUTTON (gray)
--------------------------------------------------------- */
.btn-secondary {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.20);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
}

/* ---------------------------------------------------------
   DANGER BUTTON (red)
--------------------------------------------------------- */
.btn-danger {
    background: #b91c1c;
    color: #ffffff;
    border: 2px solid #7f1d1d;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #ef4444;
}

.btn-danger:visited {
    color: #ffffff;
}

/* ---------------------------------------------------------
   BUTTON GROUPS
--------------------------------------------------------- */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0rem;
}

/* ---------------------------------------------------------
   INFO MESSAGE (global)
--------------------------------------------------------- */
.info-message {
    text-align: center;
    margin: 1rem auto 1.5rem;
    padding: 0.75rem 1rem;
    max-width: 32rem;

    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;

    color: #f0f0f0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ---------------------------------------------------------
   CONTAINER (global card layout)
--------------------------------------------------------- */
.container {
    margin: 0 auto;
    width: 90%;
    max-width: 700px;
    background: #161b22;
    padding: 20px 25px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ---------------------------------------------------------
   GLOBAL TABLE SYSTEM (Unified)
--------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.625rem;

    background: #0f141a;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.25);
}

th,
td {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}

th {
    text-align: left;
    width: 40%;
    color: #8b949e;
    font-weight: 500;
}

td {
    text-align: right;
    color: var(--text);
}

tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

tr:hover td {
    background: rgba(88,166,255,0.08);
}

/* ---------------------------------------------------------
   STAT TABLE
--------------------------------------------------------- */
.stat-table {
    width: 100%;
    min-width: 260px;
}

/* ---------------------------------------------------------
   TOOLTIP
--------------------------------------------------------- */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 125%;
    transform: translateX(-50%);
    background: #161b22;
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: nowrap;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 1;
    pointer-events: none;
    z-index: 10;
}

.tooltip:hover::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 115%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #161b22 transparent transparent transparent;
}