:root {
    --primary: #0077cc;
    --dark: #15151e;
    --light: #f3f3f3;
    --medium: #dddddd;
    --white: #ffffff;
    --error: #ff3b30;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--medium);
    color: var(--dark);
    line-height: 1.6;
}

/* Navbar Styling */
.navbar {
    background-color: var(--dark);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

/* Content Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Wrapper */
.form-wrapper {
    display: flex;
    flex-direction: column;
    /* Stack H1 and Form vertically */
    align-items: center;
    /* Center them horizontally */
    justify-content: center;
    /* Center them vertically */
    min-height: 70vh;
    /* Use more vertical space */
    width: 100%;
    margin: 0 auto;
}

.form-wrapper h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form Card Styling */
form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 450px;
    /* Slightly wider for better balance */
    border: 2px solid #eeeeee;

    /* Ensure the form itself doesn't have alignment-breaking margins */
    margin-left: auto;
    margin-right: auto;
}

/* Adjusting the Bet form to be wider than Login/Register */
form[action="/bet"] {
    max-width: 550px;
}

h1 {
    text-align: center;
    color: var(--dark);
}

/* Form Elements */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #eeeeee;
    border-radius: 8px;
    font-size: 1.2rem;
    background-color: #fafafa;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background-color: #005fa3;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.error {
    background-color: #ffe5e5;
    color: var(--error);
    border: 1px solid var(--error);
}

.info {
    background-color: #e5f4ff;
    color: #007aff;
    border: 1px solid #007aff;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .navbar-inner {
        flex-direction: column;
        gap: 10px;
    }
}

/* Hero section */
.hero {
    text-align: center;
    padding: 0rem 1rem 2rem;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: #555;
}

/* Card (reusable, lighter than container) */
.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.card h2 {
    margin-bottom: 0.75rem;
}

/* Call-to-action button */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    background: #0077cc;
    color: #ffffff;
}

.btn:hover {
    background: #005fa3;
}

/* Event metadata */
.event-meta {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Leaderboard preview */
.leaderboard {
    margin-top: 2rem;
}

.leaderboard ol {
    margin-left: 1.2rem;
}

.leaderboard li {
    margin: 0.3rem 0;
}

.event-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.event-info p {
    margin: 0.3rem 0;
}

.event-actions {
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e7f2ff;
    color: #004a99;
    margin-bottom: 0.5rem;
}

.event-category {
    font-size: 1.1rem;
}

.event-name {
    font-size: 1.3rem;
    font-weight: 600;
}

.table-wrapper {
    margin-top: 1.5rem;
    overflow-x: auto;
}

.bets-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.95rem;
}

.bets-table thead {
    background: #f5f5f5;
}

.bets-table th,
.bets-table td {
    padding: 0.75rem 0.9rem;
    text-align: center;
    white-space: nowrap;
}

.bets-table th {
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.bets-table tbody tr {
    border-bottom: 1px solid #eee;
}

.bets-table tbody tr:last-child {
    border-bottom: none;
}

.bets-table tbody tr:hover {
    background: #fafafa;
}

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

.muted {
    color: #666;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.bets-table th:not(:first-child),
.bets-table td:not(:first-child) {
    font-family: monospace;
}