* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #e9eef3;
    color: #1f2937;
    min-height: 100vh;
}

a { color: #1261a0; }

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

.site-header {
    background: white;
    color: #0f3d66;
    padding: 10px 0;
    border-bottom: 1px solid #dce4eb;
}

.header-inner, .main-nav, .hero-actions, .page-heading { display: flex; align-items: center; }
.header-inner, .page-heading { justify-content: space-between; }
.main-nav, .hero-actions { gap: 18px; }
.page-heading-actions { display: flex; align-items: center; gap: 10px; }
.main-nav a, .logo { color: #0f3d66; text-decoration: none; }
.logo { display: block; line-height: 0; }
.logo img { display: block; width: 190px; height: auto; }
.user-label { color: #526b7e; }
.inline-form { display: inline; }
.nav-button { border: 0; border-radius: 7px; background: #8f1d18; color: white; font: inherit; font-weight: 700; cursor: pointer; padding: 9px 16px; }
.nav-button:hover { background: #701611; }

.hero {
    padding: 70px 0;
}

.page { padding: 48px 0 70px; }
.page-heading h1,
.dashboard-heading h1,
.form-card h1 { margin-bottom: 0; }
.page-heading h1 + p,
.dashboard-heading h1 + p,
.form-card h1 + p { margin-top: 0; }
.compact-heading h1 { margin-bottom: 0; }
.compact-heading p { margin-top: 0; }
.auth-page { display: flex; justify-content: center; }
.card { background: white; border-radius: 12px; box-shadow: 0 6px 22px rgba(15, 45, 70, .12); }
.form-card { width: min(100%, 520px); padding: 32px; }
.form-card h1 { margin: 8px 0; }
.muted { color: #687584; }
.form-stack { display: grid; gap: 18px; margin-top: 24px; }
.form-stack label { display: grid; gap: 7px; font-size: 14px; font-weight: 400; }
.form-stack label:has(input[required]),
.form-stack label:has(select[required]),
.form-stack label:has(textarea[required]) { font-weight: 600; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; border: 1px solid #cbd5df; border-radius: 7px; padding: 11px 12px; font-family: inherit; font-size: 16px; font-weight: 400; background: white; }
.form-stack input:focus, .form-stack select:focus { outline: 3px solid #c9e4fa; border-color: #1261a0; }
.form-stack small, td small { display: block; color: #687584; font-weight: normal; margin-top: 4px; }
.checkbox-label { grid-template-columns: auto 1fr !important; align-items: center; }
.checkbox-label input { width: auto; }
.button { display: inline-block; border: 0; border-radius: 7px; background: #1261a0; color: white; padding: 12px 20px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: #0d4c7e; }
.button-small { padding: 8px 13px; }
.main-nav .button { color: white; }
.button-secondary { background: white; color: #1261a0; border: 1px solid #1261a0; }
.button-secondary:hover { background: #1261a0; color: white; }
.form-footer { text-align: center; margin: 24px 0 0; }
.form-footer + .form-footer { margin-top: 12px; }
.back-link { text-decoration: none; }
.flash-wrap { margin-top: 20px; }
.alert { border-radius: 8px; padding: 13px 16px; }
.alert ul { margin: 0; padding-left: 20px; }
.alert-error { background: #fde8e8; color: #9b1c1c; border: 1px solid #f8b4b4; }
.alert-success { background: #def7ec; color: #03543f; border: 1px solid #84e1bc; }
.alert-info { background: #eef8fe; color: #124d73; border: 1px solid #9fd2f0; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid #e5eaf0; text-align: left; white-space: nowrap; }
th { background: #f8fafc; color: #52606d; font-size: 13px; text-transform: uppercase; }
.badge, .status { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 13px; }
.badge { background: #e6f1fa; color: #0f4f82; }
.status-active { background: #def7ec; color: #03543f; }
.status-inactive { background: #eceff2; color: #687584; }
.status-failed { background: #fde8e8; color: #9b1c1c; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.row-actions form { margin: 0; }
.action-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 7px; color: white; font: inherit; font-weight: 800; line-height: 1; text-decoration: none; cursor: pointer; }
.action-edit { background: #b7791f; }
.action-edit:hover { background: #925f16; color: white; }
.action-games { background: #2794d8; }
.action-games:hover { background: #187bb8; color: white; }
.action-ranking { background: #26856a; }
.action-ranking:hover { background: #1d6954; color: white; }
.action-delete { background: #b42318; }
.action-delete:hover { background: #8f1d18; }
.members-count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 999px; background: #e1f2fc; color: #1261a0; font-weight: 800; text-decoration: none; }
.members-count:hover { background: #c6e7fa; }
.prediction-count { color: #1261a0; font-size: 18px; }
.link-danger { padding: 0; border: 0; background: transparent; color: #b42318; font: inherit; text-decoration: underline; cursor: pointer; }
.user-agent { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.championship-draft { background: #eceff2; color: #52606d; }
.championship-open { background: #def7ec; color: #03543f; }
.championship-closed { background: #fde8e8; color: #9b1c1c; }
.score { display: inline-block; min-width: 48px; border-radius: 7px; padding: 5px 9px; background: #0f3d66; color: white; font-weight: 700; text-align: center; }
.dashboard-button { margin-top: 18px; width: fit-content; }
.card-grid, .prediction-list { display: grid; gap: 18px; }
.championship-card, .prediction-card { padding: 24px; }
.championship-card { position: relative; }
.championship-card { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.championship-card h2, .prediction-card h2 { margin: 12px 0 5px; }
.joined-label { position: absolute; top: 22px; right: 24px; color: #1478c9; font-weight: 800; }
.card-actions { display: flex; gap: 10px; align-items: center; }
.card-actions form { margin: 0; }
.button-danger-outline { color: #b42318; background: white; border: 1px solid #b42318; }
.button-danger-outline:hover { background: #b42318; color: white; }
.prediction-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.match-date { color: #1261a0; font-weight: 700; margin: 0; }
.match-info h2 span { color: #8793a1; padding: 0 8px; }
.prediction-form { display: flex; align-items: end; gap: 10px; }
.prediction-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 400; }
.prediction-form label:has(select[required]) { font-weight: 600; }
.prediction-form select { min-width: 190px; min-height: 52px; border: 2px solid #8bc8ed; border-radius: 9px; padding: 10px 38px 10px 14px; font-family: inherit; font-size: 21px; font-weight: 400; text-align: center; text-align-last: center; background: #f7fcff; color: #123b5d; }
.prediction-form select:focus { outline: 3px solid #d5efff; border-color: #2794d8; }
.prediction-notice { margin-bottom: 18px; padding: 16px 20px; border: 1px solid #9fd2f0; border-left: 5px solid #2794d8; border-radius: 10px; background: #eef8fe; color: #124d73; font-size: 16px; }
.prediction-form select:disabled { opacity: .65; cursor: wait; }
.save-feedback { grid-column: 1 / -1; min-height: 20px; font-size: 14px; font-weight: 700; }
.save-feedback-success { color: #047857; }
.save-feedback-error { color: #b42318; }
.closed-prediction { display: grid; gap: 5px; text-align: center; }.closed-prediction strong { font-size: 24px; }
.choice-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.choice-card { padding: 28px; display: flex; align-items: center; gap: 20px; color: inherit; text-decoration: none; transition: transform .15s,box-shadow .15s; }
.choice-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.choice-card h2 { margin: 0 0 8px; }.choice-card p { margin: 0; color: #687584; }
.choice-icon { display: grid; place-items: center; flex: 0 0 52px; height: 52px; border-radius: 50%; background: #1261a0; color: white; font-size: 26px; font-weight: 700; }
.result-card { padding: 24px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.result-summary { display: grid; grid-template-columns: repeat(3,minmax(110px,1fr)); gap: 12px; text-align: center; }
.result-summary div { padding: 12px; border-radius: 8px; background: #f4f6f8; }.result-summary span,.result-summary strong { display: block; }.result-summary span { color: #687584; font-size: 13px; margin-bottom: 6px; }.result-summary strong { font-size: 18px; }.result-summary .points { color: #1261a0; }
.championship-game-card { padding: 24px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.championship-game-result { min-width: 130px; padding: 12px; border-radius: 8px; background: #f4f6f8; text-align: center; }
.championship-game-result span, .championship-game-result strong { display: block; }
.championship-game-result span { color: #687584; font-size: 13px; margin-bottom: 6px; }
.championship-game-result strong { font-size: 18px; }
.leaderboard-table .current-player { background: #eef7ff; }
.rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e8edf2; font-weight: 700; }
.rank-1 { background: #f8d66d; color: #664d03; }.rank-2 { background: #d9e0e7; }.rank-3 { background: #e8b98d; color: #633c1d; }
.leaderboard-points { color: #1261a0; font-size: 22px; }
.empty { text-align: center; color: #687584; padding: 36px; }
.email-form-card { width: min(100%, 720px); }
.email-detail-card { padding: 28px; margin-bottom: 28px; }
.email-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 0 0 28px; }
.email-details div { padding: 15px; border-radius: 8px; background: #f4f6f8; }
.email-details dt { color: #687584; font-size: 13px; margin-bottom: 5px; }
.email-details dd { margin: 0; font-weight: 600; }
.email-body { padding: 20px; border: 1px solid #dce4eb; border-radius: 8px; background: #fff; line-height: 1.6; overflow-wrap: anywhere; }
.email-status-queued, .email-recipient-queued { background: #e6f1fa; color: #0f4f82; }
.email-status-sending, .email-recipient-processing { background: #fef3c7; color: #92400e; }
.email-status-completed, .email-recipient-sent { background: #def7ec; color: #03543f; }
.email-status-completed_with_errors, .email-recipient-failed { background: #fde8e8; color: #9b1c1c; }

.hero h1 {
    margin: 0;
    font-size: 42px;
}

.hero p {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 30px;
}

.status-box {
    background: white;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 6px 22px rgba(15, 45, 70, 0.12);
}

.status-box strong,
.status-box span {
    display: block;
}

.home-section { margin: 0 0 38px; }
.home-section h2, .contact-card h2 { font-size: 28px; margin: 0 0 18px; }
.public-championships { display: grid; gap: 12px; }
.public-championship { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; }
.public-championship h3 { margin: 0 0 5px; font-size: 20px; }
.public-championship p { margin: 0; color: #687584; }
.public-championship > span { color: #52606d; white-space: nowrap; }
.contact-card { padding: 28px; margin-bottom: 55px; border-left: 5px solid #1261a0; }
.contact-card p { margin: 8px 0; font-size: 17px; }
.contact-card a { font-weight: 700; }
.dashboard-heading { padding: 55px 0 32px; }
.dashboard-heading h1 { margin: 0; font-size: 38px; }
.dashboard-heading p { margin: 0; font-size: 18px; }
.championship-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.championship-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.championship-link > span { color: #1261a0; font-weight: 700; }
.championship-link > .championship-enter-button { display: inline-block; padding: 11px 18px; border-radius: 7px; background: #2794d8; color: white; white-space: nowrap; }
.championship-link:hover > .championship-enter-button { background: #187bb8; }
.all-championships-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; margin-bottom: 55px; }
.all-championships-card h2 { margin: 0 0 7px; }.all-championships-card p { margin: 0; color: #687584; }
.admin-management-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.admin-management-card { display: flex; min-height: 180px; padding: 28px; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-management-card h2 { margin: 0 0 8px; }.admin-management-card p { margin: 0; color: #687584; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin: 20px 0 55px; }
.admin-stat-card { padding: 25px; text-align: center; }
.admin-stat-card span { display: block; color: #687584; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.admin-stat-card strong { display: block; margin-top: 8px; color: #1261a0; font-size: 38px; }

.status-box span {
    margin-top: 8px;
    color: #5f6b76;
}

.site-footer {
    padding: 25px 0;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 650px) {
    .container { width: min(100% - 24px, 1100px); }
    .site-header { padding: 13px 0; }
    .logo img { width: 150px; }
    .main-nav { gap: 10px; font-size: 14px; }
    .user-label { display: none; }
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 36px; }
    .form-card { padding: 24px 18px; }
    .public-championship { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; align-items: stretch; }
    .public-championship > span { white-space: normal; }
    .all-championships-card { display: grid; }
    .championship-link > .championship-enter-button,
    .all-championships-card > .button { display: block; width: 100%; text-align: center; box-sizing: border-box; }
    .admin-management-grid, .admin-stats-grid { grid-template-columns: 1fr; }
    .form-columns { grid-template-columns: 1fr; }
    .championship-card, .prediction-card { display: grid; grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: 1fr; }
    .result-card, .championship-game-card { grid-template-columns: 1fr; }.result-summary { grid-template-columns: 1fr; text-align: left; }
    .championship-game-result { text-align: left; }
    .card-actions, .prediction-form { align-items: stretch; flex-direction: column; }
    .card-actions, .card-actions form, .card-actions .button { width: 100%; }
    .card-actions .button { display: block; box-sizing: border-box; text-align: center; }
    .championship-card:has(.joined-label) { padding-top: 62px; }
    .leaderboard-table { table-layout: fixed; }
    .leaderboard-table th, .leaderboard-table td { padding: 12px 6px; }
    .leaderboard-table th { font-size: 11px; }
    .leaderboard-table th:nth-child(1), .leaderboard-table td:nth-child(1) { width: 46px; }
    .leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 48px; text-align: center; }
    .leaderboard-table th:nth-child(4), .leaderboard-table td:nth-child(4) { width: 42px; text-align: center; }
    .leaderboard-table td:nth-child(2) strong { display: block; overflow: hidden; text-overflow: ellipsis; }
    .leaderboard-table .rank { width: 30px; height: 30px; }
    .leaderboard-table .leaderboard-points { font-size: 20px; }
    .email-details { grid-template-columns: 1fr; }
    .page-heading-actions { align-items: stretch; flex-direction: column; }
    .page-heading-actions .button { text-align: center; }
}
