/* Reset / base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: #f3f4f6;
    color: #111827;
}

a {
    color: #0f766e;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header / brand */
.site-header {
    background: #111827;
    color: #f9fafb;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner,
.site-footer-inner,
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.site-logo {
    height: 50px;
    width: auto;
    margin-right: 0.75rem;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.site-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.main-nav a {
    color: #e5e7eb;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.main-nav a:hover {
    border-color: #f97316;
    color: #f97316;
    text-decoration: none;
}

.nav-user {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* Layout */
.container {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
}

.card h2,
.card h3,
.card h4 {
    margin-top: 0;
    color: #111827;
}

.status-row {
    font-size: 0.85rem;
    color: #4b5563;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: #f3f4f6;
}

th,
td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

/* Forms */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    font: inherit;
    padding: 0.45rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #f97316;
    border-color: #ea580c;
    color: #111827;
    font-weight: 600;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-secondary {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111827;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #b91c1c;
    border-color: #991b1b;
    color: #f9fafb;
}

.btn-danger:hover {
    background: #991b1b;
}

/* Special ENTER NOW button */
.btn-enter {
    background: #111827;
    border-color: #111827;
    color: #f9fafb;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.9rem;
}

.btn-enter:hover {
    background: #020617;
    border-color: #020617;
}

/* Badges / statuses */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft {
    background: #e5e7eb;
    color: #374151;
}

.badge-submitted {
    background: #0f766e;
    color: #ecfdf5;
}

.badge-judging {
    background: #4b5563;
    color: #f9fafb;
}

/* Range slider */
.slider {
    width: 100%;
}

/* Details / summary */
details summary {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

details[open] summary {
    margin-bottom: 0.75rem;
}

/* Track cards and category mini-cards */
.track-card {
    padding-top: 1rem;
    padding-bottom: 1.1rem;
}

.track-card-header h3 {
    margin-bottom: 0.1rem;
}

.category-mini-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0.5rem -0.5rem -0.5rem -0.5rem;
}

.category-mini {
    background: #f9fafb;
    border-radius: 0.65rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0.5rem;
    width: 100%;
}

/* ≥ 700px: two mini cards per row */
@media (min-width: 700px) {
    .category-mini {
        width: calc(50% - 1rem);
    }
}

/* ≥ 1100px: three mini cards per row */
@media (min-width: 1100px) {
    .category-mini {
        width: calc(33.333% - 1rem);
    }
}

.category-mini-body h4 {
    font-size: 0.95rem;
    margin: 0 0 0.3rem 0;
}

.category-mini-body p {
    font-size: 0.82rem;
    margin: 0 0 0.25rem 0;
}

.category-mini-footer {
    margin-top: 0.35rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 1.25rem 0 1.75rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.site-footer-inner p {
    margin: 0.1rem 0;
}

.site-footer a {
    color: #0f766e;
}

/* Responsive tweaks */
@media (max-width: 700px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    .nav-user {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}
