* {
    box-sizing: border-box;
}

:root {
    --background: #f3f6f9;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #647180;
    --border: #d9e0e7;
    --primary: #1456a0;
    --primary-dark: #0c3d76;
    --success: #166534;
    --success-bg: #dcfce7;
    --danger: #991b1b;
    --danger-bg: #fee2e2;
    --shadow: 0 12px 30px rgba(20, 35, 50, 0.08);
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #0d2138;
    color: #ffffff;
    border-bottom: 4px solid var(--primary);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    background: transparent !important;
    box-shadow: none !important;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #b8c7d8;
    font-size: 0.78rem;
}

.main-nav {
    display: flex;
    gap: 18px;
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.page-content {
    padding-top: 36px;
    padding-bottom: 56px;
}

.page-back-link-slot:empty {
    display: none;
}

.page-back-link-slot {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 0 0 14px;
}

.page-top-back-link {
    flex: 0 0 auto;
}

.page-top-back-link:not(.button) {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    font-weight: 700;
    text-decoration: none;
}

.page-top-back-link:not(.button):hover,
.page-top-back-link:not(.button):focus {
    text-decoration: underline;
}

.hero {
    padding: 48px;
    margin-bottom: 28px;
    border-radius: 20px;
    color: #ffffff;
    background:
        linear-gradient(120deg, rgba(13, 33, 56, 0.98), rgba(20, 86, 160, 0.92));
    box-shadow: var(--shadow);
}

.hero h1 {
    max-width: 760px;
    margin: 8px 0 12px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
}

.hero p {
    max-width: 680px;
    margin-bottom: 0;
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.panel,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.auth-card {
    max-width: 620px;
    margin: 30px auto;
    padding: 30px;
}

.panel-heading,
.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.panel-heading h2,
.dashboard-heading h1,
.auth-card h1 {
    margin: 0;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: #e9f1fa;
    color: var(--primary-dark);
}

label {
    display: block;
    margin-bottom: 18px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid #b9c4cf;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(20, 86, 160, 0.17);
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.alert {
    padding: 13px 15px;
    margin-bottom: 20px;
    border-radius: 9px;
    font-weight: 700;
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.card-grid,
.stat-grid {
    display: grid;
    gap: 18px;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stat-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 24px;
}

.tournament-card,
.stat-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #ffffff;
}

.tournament-card h3 {
    margin-top: 0;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    color: var(--primary-dark);
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e7eef7;
    color: #243d59;
    font-size: 0.78rem;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: #3f4d5b;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.empty-state {
    color: var(--muted);
}

.site-footer {
    padding: 24px 0;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .header-inner,
    .panel-heading,
    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding: 30px 24px;
    }

    .form-row,
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Keep all desktop and admin button text readable on hover/focus. */
.button:hover,
.button:focus,
.button:focus-visible,
button.button:hover,
button.button:focus,
button.button:focus-visible,
input[type="submit"].button:hover,
input[type="submit"].button:focus,
input[type="button"].button:hover,
input[type="button"].button:focus,
input[type="reset"].button:hover,
input[type="reset"].button:focus,
.button-secondary:hover,
.button-secondary:focus,
.button-secondary:focus-visible {
    color: #ffffff !important;
}



/* Section 1 transparent header logo override */
.brand-logo,
.brand img.brand-logo {
    width: 64px !important;
    height: 64px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media (max-width: 640px) {
    .brand-logo,
    .brand img.brand-logo {
        width: 52px !important;
        height: 52px !important;
    }
}
