/* ============================================================
   Moravian Championships - Main Stylesheet
   Orange/dark sporty theme for CrossFit competition website
   ============================================================ */

/* ----- CSS Custom Properties ----- */
:root {
    --color-primary: #e87a20;
    --color-primary-light: #f09a4e;
    --color-primary-dark: #c96510;
    --color-bg-dark: #1a1a2e;
    --color-bg-darker: #12122a;
    --color-bg-card: #222240;
    --color-bg-card-hover: #2a2a4a;
    --color-bg-light: #f5f5f5;
    --color-bg-white: #ffffff;
    --color-text-light: #f0f0f5;
    --color-text-dark: #333333;
    --color-text-muted: #9999aa;
    --color-text-muted-dark: #777777;
    --color-success: #2ecc71;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-gold: #ffd700;
    --color-silver: #c0c0c0;
    --color-bronze: #cd7f32;
    --radius: 12px;
    --radius-sm: 6px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* ----- Reset / Base ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text-light);
    background-color: var(--color-bg-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Background variants (apply one class to <body>) --- */

/* Varianta A: Diagonální čáry */
body.bg-lines {
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 40px,
        rgba(255, 255, 255, 0.015) 40px,
        rgba(255, 255, 255, 0.015) 41px
    );
}

/* Varianta B: Tečkovaný rastr */
body.bg-dots {
    background-image: radial-gradient(
        rgba(255, 255, 255, 0.035) 1px,
        transparent 1px
    );
    background-size: 24px 24px;
}

/* Varianta C: SVG vodotisk - abstraktni crossfit pattern */
body.bg-watermark {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 900'%3E%3Cg stroke='white' stroke-opacity='0.055' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='190' cy='180' r='118' stroke-width='2'/%3E%3Ccircle cx='190' cy='180' r='72' stroke-width='1.5'/%3E%3Cpath d='M95 180h190M190 85v190' stroke-width='1.5'/%3E%3Cpath d='M118 108l144 144M262 108L118 252' stroke-width='1' stroke-opacity='0.035'/%3E%3C/g%3E%3Cg stroke='white' stroke-opacity='0.045' fill='none' stroke-linecap='round' stroke-linejoin='round' transform='translate(520 120) rotate(12)'%3E%3Crect x='0' y='40' width='150' height='18' rx='9' stroke-width='1.6'/%3E%3Crect x='-18' y='30' width='18' height='38' rx='5' stroke-width='1.6'/%3E%3Crect x='150' y='30' width='18' height='38' rx='5' stroke-width='1.6'/%3E%3Crect x='-34' y='22' width='12' height='54' rx='4' stroke-width='1.4'/%3E%3Crect x='172' y='22' width='12' height='54' rx='4' stroke-width='1.4'/%3E%3C/g%3E%3Cg stroke='white' stroke-opacity='0.05' fill='none' stroke-linecap='round' transform='translate(115 540) rotate(-8)'%3E%3Cline x1='48' y1='0' x2='48' y2='96' stroke-width='1.4'/%3E%3Cline x1='112' y1='0' x2='112' y2='96' stroke-width='1.4'/%3E%3Ccircle cx='48' cy='132' r='34' stroke-width='2'/%3E%3Ccircle cx='112' cy='132' r='34' stroke-width='2'/%3E%3C/g%3E%3Cg stroke='white' stroke-opacity='0.04' fill='none' stroke-linecap='round' stroke-linejoin='round' transform='translate(560 520)'%3E%3Cpath d='M0 92c56-56 144-56 200 0' stroke-width='1.6'/%3E%3Cpath d='M32 92c38-32 98-32 136 0' stroke-width='1.2'/%3E%3Cline x1='100' y1='14' x2='100' y2='92' stroke-width='1.2'/%3E%3Ccircle cx='100' cy='112' r='78' stroke-width='1.8'/%3E%3Ccircle cx='100' cy='112' r='28' stroke-width='1.2'/%3E%3C/g%3E%3Ccircle cx='438' cy='430' r='150' fill='white' fill-opacity='0.018'/%3E%3Ccircle cx='438' cy='430' r='96' fill='none' stroke='white' stroke-opacity='0.04' stroke-width='1.6'/%3E%3Cpath d='M354 430h168M438 346v168' stroke='white' stroke-opacity='0.03' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 900px 900px;
}

/* Varianta D: technictejsi blueprint s osou a kotouci */
body.bg-watermark-tech {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 960'%3E%3Cg fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke-opacity='0.04' transform='translate(130 150)'%3E%3Ccircle cx='110' cy='110' r='92' stroke-width='1.6'/%3E%3Ccircle cx='110' cy='110' r='58' stroke-width='1.2'/%3E%3Ccircle cx='110' cy='110' r='16' stroke-width='1'/%3E%3Cpath d='M18 110h184M110 18v184' stroke-width='1.2'/%3E%3C/g%3E%3Cg stroke-opacity='0.05' transform='translate(500 180) rotate(-10)'%3E%3Cline x1='0' y1='56' x2='220' y2='56' stroke-width='2'/%3E%3Crect x='16' y='42' width='18' height='28' rx='4' stroke-width='1.4'/%3E%3Crect x='42' y='36' width='12' height='40' rx='4' stroke-width='1.2'/%3E%3Crect x='166' y='42' width='18' height='28' rx='4' stroke-width='1.4'/%3E%3Crect x='188' y='36' width='12' height='40' rx='4' stroke-width='1.2'/%3E%3C/g%3E%3Cg stroke-opacity='0.038' transform='translate(140 560)'%3E%3Cpath d='M0 90h220' stroke-width='1'/%3E%3Cpath d='M110 0v180' stroke-width='1'/%3E%3Ccircle cx='110' cy='90' r='130' stroke-width='1.4'/%3E%3Ccircle cx='110' cy='90' r='78' stroke-width='1.1'/%3E%3C/g%3E%3Cg stroke-opacity='0.042' transform='translate(610 560)'%3E%3Cline x1='34' y1='0' x2='34' y2='82' stroke-width='1.2'/%3E%3Cline x1='98' y1='0' x2='98' y2='82' stroke-width='1.2'/%3E%3Ccircle cx='34' cy='116' r='28' stroke-width='1.8'/%3E%3Ccircle cx='98' cy='116' r='28' stroke-width='1.8'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 960px 960px;
}

/* Varianta E: sportovnejsi, s naznaky pohybu a kruhu */
body.bg-watermark-strong {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 880 880'%3E%3Cg fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke-opacity='0.048' transform='translate(90 110) rotate(-6)'%3E%3Cpath d='M0 110c48-58 132-72 220-34' stroke-width='1.6'/%3E%3Cpath d='M24 148c54-34 126-40 186-12' stroke-width='1.2'/%3E%3Ccircle cx='162' cy='152' r='86' stroke-width='1.8'/%3E%3Ccircle cx='162' cy='152' r='30' stroke-width='1.2'/%3E%3C/g%3E%3Cg stroke-opacity='0.042' transform='translate(520 120) rotate(14)'%3E%3Crect x='0' y='38' width='144' height='16' rx='8' stroke-width='1.4'/%3E%3Crect x='-14' y='28' width='14' height='36' rx='4' stroke-width='1.2'/%3E%3Crect x='144' y='28' width='14' height='36' rx='4' stroke-width='1.2'/%3E%3Crect x='-26' y='22' width='8' height='48' rx='3' stroke-width='1'/%3E%3Crect x='162' y='22' width='8' height='48' rx='3' stroke-width='1'/%3E%3C/g%3E%3Cg stroke-opacity='0.05' transform='translate(170 500)'%3E%3Cline x1='40' y1='0' x2='40' y2='88' stroke-width='1.2'/%3E%3Cline x1='100' y1='0' x2='100' y2='88' stroke-width='1.2'/%3E%3Ccircle cx='40' cy='120' r='32' stroke-width='1.8'/%3E%3Ccircle cx='100' cy='120' r='32' stroke-width='1.8'/%3E%3C/g%3E%3Cg stroke-opacity='0.03' transform='translate(470 500)'%3E%3Ccircle cx='120' cy='120' r='144' stroke-width='1.4'/%3E%3Cpath d='M20 120h200M120 20v200' stroke-width='1.1'/%3E%3C/g%3E%3C/g%3E%3Ccircle cx='438' cy='430' r='120' fill='white' fill-opacity='0.012'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 880px 880px;
}

/* Varianta F: minimalisticka, skoro jen struktura a obrysy */
body.bg-watermark-minimal {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 960'%3E%3Cg fill='none' stroke='white' stroke-linecap='round'%3E%3Cg stroke-opacity='0.028' transform='translate(120 120)'%3E%3Ccircle cx='120' cy='120' r='124' stroke-width='1.4'/%3E%3Ccircle cx='120' cy='120' r='72' stroke-width='1'/%3E%3Cpath d='M24 120h192M120 24v192' stroke-width='0.9'/%3E%3C/g%3E%3Cg stroke-opacity='0.026' transform='translate(580 170) rotate(10)'%3E%3Cline x1='0' y1='40' x2='150' y2='40' stroke-width='1.4'/%3E%3Crect x='16' y='30' width='12' height='20' rx='3' stroke-width='1'/%3E%3Crect x='122' y='30' width='12' height='20' rx='3' stroke-width='1'/%3E%3C/g%3E%3Cg stroke-opacity='0.028' transform='translate(210 610)'%3E%3Cline x1='28' y1='0' x2='28' y2='72' stroke-width='0.9'/%3E%3Cline x1='84' y1='0' x2='84' y2='72' stroke-width='0.9'/%3E%3Ccircle cx='28' cy='98' r='24' stroke-width='1.4'/%3E%3Ccircle cx='84' cy='98' r='24' stroke-width='1.4'/%3E%3C/g%3E%3Cg stroke-opacity='0.022' transform='translate(590 540)'%3E%3Ccircle cx='110' cy='110' r='138' stroke-width='1.1'/%3E%3Cpath d='M24 110h172M110 24v172' stroke-width='0.8'/%3E%3C/g%3E%3C/g%3E%3Ccircle cx='480' cy='480' r='170' fill='white' fill-opacity='0.008'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 960px 960px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    /* margin-top: 1.5em; */
    margin-bottom: 0.75em;
}

h1 + *, h2 + *, h3 + * {
    margin-top: 0;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-white  { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }

.section-title {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ----- Layout ----- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    max-width: 800px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.row > * {
    padding: 0 0.75rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6  { flex: 0 0 50%;  max-width: 50%; }
.col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3  { flex: 0 0 25%;  max-width: 25%; }

.d-flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.py-6 { padding-top: 4rem; padding-bottom: 4rem; }

/* ----- Navigation ----- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-bg-darker);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(18, 18, 42, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}

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

.navbar-brand img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background: rgba(232, 122, 32, 0.08);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--color-text-light);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ----- Hero Section ----- */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    background: url('/img/header2.jpg') center/cover no-repeat
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(18, 18, 42, 0.92) 0%,
        rgba(26, 26, 46, 0.8) 50%,
        rgba(18, 18, 42, 0.92) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem 1.5rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1rem;
    color: var(--color-text-light);
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

.hero-title span {
    color: var(--color-primary);
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.hero-date {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(232, 122, 32, 0.12);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(232, 122, 32, 0.25);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 122, 32, 0.35);
}

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-text-light);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.35);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

.btn-success:hover {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2.4rem;
    font-size: 1.1rem;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ----- Sections ----- */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--color-bg-card);
}

/* ----- Card grid ----- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

/* ----- Cards ----- */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: var(--transition);
    margin-top: 1.5rem;
}

.card:hover {
    background: var(--color-bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-body {
    padding: 1.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.card-light {
    background: var(--color-bg-white);
    border: 1px solid #e0e0e0;
    color: var(--color-text-dark);
}

.card-light:hover {
    background: var(--color-bg-white);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-light .card-header {
    border-bottom-color: #e0e0e0;
    color: var(--color-text-dark);
}

.card-light .card-footer {
    border-top-color: #e0e0e0;
}

.card-light p {
    color: var(--color-text-muted-dark);
}

/* ----- Results Tables ----- */
.results-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0;
}

.results-tab {
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -2px;
}

.results-tab:hover {
    color: var(--color-text-light);
}

.results-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Results category tabs */
.results-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.results-tab-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: var(--transition);
}

.results-tab-btn:hover {
    color: var(--color-text-light);
}

.results-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.results-category-panel {
    display: none;
}

.results-category-panel.active {
    display: block;
}

/* Admin light variant */
.admin-layout .results-tabs {
    border-bottom-color: #e0e0e0;
}

.admin-layout .results-tab-btn {
    color: var(--color-text-muted-dark);
}

.admin-layout .results-tab-btn:hover {
    color: var(--color-text-dark);
}

.admin-layout .results-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.results-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.results-table thead th {
    background: var(--color-primary);
    color: #fff;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
}

.results-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.results-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.results-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.results-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.results-table tbody tr:hover {
    background: rgba(232, 122, 32, 0.08);
}

.results-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    vertical-align: middle;
}

.results-table .team-name {
    font-weight: 700;
    color: var(--color-text-light);
    font-size: 1rem;
}

.results-table .score-cell {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
}

.results-table .total-cell {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--color-primary);
}

.results-category {
    display: none;
}

.results-category.active {
    display: block;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
    background: var(--color-bg-card);
}

.rank-1 {
    background: linear-gradient(135deg, var(--color-gold), #e6c200);
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, var(--color-silver), #a8a8a8);
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(192, 192, 192, 0.4);
}

.rank-3 {
    background: linear-gradient(135deg, var(--color-bronze), #b06a28);
    color: #fff;
    box-shadow: 0 2px 10px rgba(205, 127, 50, 0.4);
}

/* ----- Forms ----- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(232, 122, 32, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239999aa' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
}

.form-input.is-invalid,
.form-textarea.is-invalid,
.form-select.is-invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--color-danger);
    margin-top: 0.3rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Light form variant (for admin) */
.form-light .form-label {
    color: var(--color-text-dark);
}

.form-light .form-input,
.form-light .form-textarea,
.form-light .form-select {
    color: var(--color-text-dark);
    background: var(--color-bg-white);
    border-color: #d0d0d0;
}

.form-light .form-input:focus,
.form-light .form-textarea:focus,
.form-light .form-select:focus {
    border-color: var(--color-primary);
    background: var(--color-bg-white);
}

.form-light .form-select option {
    background: var(--color-bg-white);
    color: var(--color-text-dark);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--color-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ----- Gallery ----- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        transparent 50%
    );
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-caption {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.lightbox.open {
    display: flex;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ----- Competition detail ----- */
.competition-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.competition-date,
.competition-location {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.competition-header {
    margin-bottom: 2rem;
}

.competition-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.competition-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.competition-tab:hover {
    color: var(--color-text-light);
}

.competition-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.competition-description {
    max-width: 800px;
    margin-bottom: 2.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-primary);
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ----- WOD cards ----- */
.wod-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.wod-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.wod-description {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.wod-description p {
    margin-bottom: 0.5rem;
}

.wod-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.wod-video-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.competition-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.competition-description-html {
    max-width: 800px;
    margin-bottom: 2rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.competition-description-html p {
    margin-bottom: 0.75rem;
}

.info-card-content {
    color: var(--color-text-muted);
    line-height: 1.6;
}

.info-card-content p {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .wod-videos {
        grid-template-columns: 1fr;
    }
}

/* ----- Qualification page (legacy) ----- */
.qual-intro {
    max-width: 800px;
    margin-bottom: 2rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

.qual-section {
    margin-bottom: 3rem;
}

.qual-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 2rem;
}

.qual-video-item h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.qual-wod-image {
    max-width: 500px;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.qual-wod-image img {
    width: 100%;
    height: auto;
}

.qual-wod-rules {
    max-width: 800px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.qual-wod-rules p {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.qual-rules-box {
    max-width: 800px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--color-primary);
}

.qual-rules-box p {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .qual-videos {
        grid-template-columns: 1fr;
    }

    .qual-wod-image {
        max-width: 100%;
    }
}

/* ----- Info page ----- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.info-highlight {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-notes {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-primary);
}

.info-notes h3 {
    margin-top: 0;
    color: var(--color-primary);
}

.info-notes p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.info-notes p:last-child {
    margin-bottom: 0;
}

.categories-table-wrapper {
    margin-bottom: 2rem;
}

/* ----- Footer ----- */
.footer {
    background: var(--color-bg-darker);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer-brand-text strong {
    font-size: 1.05rem;
    color: var(--color-text-light);
    letter-spacing: 0.02em;
}

.footer-brand-text span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-links,
.footer-contact,
.footer-social-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-links h4,
.footer-contact h4,
.footer-social-wrap h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.footer-links a,
.footer-contact a,
.footer-contact span {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--color-primary);
}

.footer-social {
    display: flex;
    gap: 0.6rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 0;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .footer-top {
        grid-template-columns: 1fr;
    }
}

/* ----- Alerts / Flash Messages ----- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
    position: relative;
}

.alert-success {
    background: rgba(46, 204, 113, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.12);
    color: var(--color-warning);
    border: 1px solid rgba(243, 156, 18, 0.25);
}

.alert-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
    padding: 0.25rem;
}

.alert-close:hover {
    opacity: 1;
}

.flash-container {
    position: fixed;
    top: 80px;
    right: 2.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 450px;
    min-width: 280px;
}

.flash-container .flash-alert {
    position: relative;
    padding: 1rem 2.5rem 1rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.flash-container .flash-alert.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-container .flash-alert.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-container .flash-alert.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(232, 122, 32, 0.15);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--color-success);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--color-danger);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: var(--color-warning);
}

/* ----- Pagination ----- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.page-link:hover {
    background: var(--color-bg-card-hover);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.page-link.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----- Admin Layout ----- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg-light);
    color: var(--color-text-dark);
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: var(--color-bg-darker);
    color: var(--color-text-light);
    overflow-y: auto;
    z-index: 900;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar-brand:hover {
    color: var(--color-primary);
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
}

.admin-nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav-link:hover {
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav-link.active {
    color: var(--color-primary);
    background: rgba(232, 122, 32, 0.06);
    border-left-color: var(--color-primary);
}

.admin-nav-link i,
.admin-nav-link svg {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.admin-nav-link.active i,
.admin-nav-link.active svg {
    opacity: 1;
}

/* ----- Admin Content Area ----- */
.admin-content {
    margin-left: 220px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: var(--color-bg-white);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.admin-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-body {
    flex: 1;
    padding: 2rem;
}

.admin-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ----- Stats Cards ----- */
.stat-card {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-icon {
    float: right;
    font-size: 2rem;
    opacity: 0.15;
    color: var(--color-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ----- Data Tables (Admin) ----- */
.data-table {
    width: 100%;
    overflow-x: auto;
    background: var(--color-bg-white);
    border-radius: var(--radius);
    border: 1px solid #e0e0e0;
}

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

.data-table thead th {
    background: var(--color-bg-light);
    color: var(--color-text-dark);
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(232, 122, 32, 0.04);
}

.data-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--color-text-dark);
    vertical-align: middle;
}

.data-table .actions {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
}

/* ----- Modal ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
    color: var(--color-text-dark);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3,
.modal-header h4 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--color-text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--color-text-muted-dark);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Dark modal variant */
.modal-dark {
    background: var(--color-bg-card);
    color: var(--color-text-light);
}

.modal-dark .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.modal-dark .modal-header h3,
.modal-dark .modal-header h4 {
    color: var(--color-text-light);
}

.modal-dark .modal-close {
    color: var(--color-text-muted);
}

.modal-dark .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* ----- Loading Spinner ----- */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(232, 122, 32, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
}

/* ----- Miscellaneous ----- */
.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 1.5rem 0;
}

.divider-light {
    border-top-color: #e0e0e0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Score input grid for admin */
.score-grid {
    display: grid;
    grid-template-columns: 2fr repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    align-items: center;
}

.score-grid .form-input {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.score-grid-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: var(--color-text-muted-dark);
    padding: 0.5rem;
}

/* ----- Admin Results Table ----- */
.admin-content {
    overflow-x: hidden;
    min-width: 0;
}

.results-scroll-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    max-width: calc(100vw - 310px);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
}

@media (max-width: 992px) {
    .results-scroll-wrapper {
        max-width: calc(100vw - 2rem);
    }
}

.results-scroll-wrapper .table {
    margin: 0;
    width: max-content;
    min-width: 100%;
}

.table-compact th,
.table-compact td {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.table-compact thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-bg-light);
}

.col-sticky {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--color-bg-white);
}

.col-rank.col-sticky {
    min-width: auto;
    max-width: 40px;
    width: 30px;
    text-align: center;
    padding-left: 0.4rem;
    padding-right: 0.2rem;
}

.col-team-name {
    min-width: 120px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

thead .col-sticky {
    z-index: 3;
}

.col-score {
    text-align: center;
}

.score-input-sm {
    width: 60px;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
    text-align: center;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-family: inherit;
    background: var(--color-bg-white);
    color: var(--color-text-dark);
}

.score-input-sm:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(232, 122, 32, 0.15);
}

.score-pts {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--color-text-muted-dark);
    margin-left: 1px;
    min-width: 14px;
}

.col-total,
.col-rank {
    text-align: center;
    font-size: 0.8rem;
}

/* ----- Admin Competition Tabs ----- */
.admin-comp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.admin-comp-header h2 {
    margin: 0;
    color: var(--color-text-dark);
}

.admin-comp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.admin-comp-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted-dark);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.admin-comp-tab:hover {
    color: var(--color-text-dark);
}

.admin-comp-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ----- Admin Theme Overrides ----- */
/* Reset colors for light admin context */
.admin-layout {
    background: var(--color-bg-light);
    color: var(--color-text-dark);
}

.admin-main {
    padding: 2rem;
}

.admin-page-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-brand:hover {
    color: var(--color-primary);
}

.admin-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-nav-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0.75rem 1.5rem;
}

/* Admin cards — light background instead of dark */
.admin-layout .card {
    background: var(--color-bg-white);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.admin-layout .card:hover {
    background: var(--color-bg-white);
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-layout .card-body {
    padding: 1.5rem;
}

/* Admin headings */
.admin-layout h2,
.admin-layout h3 {
    color: var(--color-text-dark);
    margin-top: 0;
    margin-bottom: 1rem;
}

.admin-layout h2 {
    font-size: 1.4rem;
}

.admin-layout h3 {
    font-size: 1.15rem;
}

.admin-layout .card-body h2:first-child,
.admin-layout .card-body h3:first-child {
    margin-top: 0;
}

/* Admin text */
.admin-layout p {
    color: var(--color-text-dark);
}

.admin-layout .text-muted {
    color: var(--color-text-muted-dark);
}

/* Stats grid — fix class name mismatch */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.admin-layout .stat-card {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.admin-layout .stat-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* .form-control — used in admin forms */
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text-dark);
    background: var(--color-bg-white);
    border: 2px solid #d0d0d0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(232, 122, 32, 0.15);
}

.form-control::placeholder {
    color: var(--color-text-muted-dark);
    opacity: 0.6;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-control-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}

/* Admin form labels */
.admin-layout label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-layout .form-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text-dark);
    cursor: pointer;
}

.admin-layout input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Admin form layout */
.admin-layout .form-group {
    margin-bottom: 1.25rem;
}

.admin-layout .form-group-half {
    flex: 1;
}

/* Admin tables */
.admin-layout .table-responsive {
    overflow-x: auto;
}

.admin-layout .table {
    width: 100%;
    border-collapse: collapse;
}

.admin-layout .table thead th {
    background: var(--color-bg-light);
    color: var(--color-text-dark);
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.admin-layout .table tbody tr {
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.admin-layout .table tbody tr:hover {
    background: rgba(232, 122, 32, 0.04);
}

.admin-layout .table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--color-text-dark);
    vertical-align: middle;
}

/* Admin content blocks */
.admin-layout .content-block-edit {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.admin-layout .content-block-edit h3 {
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.admin-layout hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1.5rem 0;
}

/* Admin badges */
.admin-layout .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(46, 204, 113, 0.12);
    color: #1a9e55;
}

.badge-info {
    background: rgba(52, 152, 219, 0.12);
    color: #2980b9;
}

.badge-warning {
    background: rgba(243, 156, 18, 0.12);
    color: #c67c08;
}

.badge-muted {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-muted-dark);
}

/* Admin alerts */
.admin-layout .alert {
    margin: 0 2rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: #1a9e55;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #c67c08;
    border: 1px solid rgba(243, 156, 18, 0.2);
}

/* Admin toolbar */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Admin gallery grid */
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-admin-card .gallery-admin-cover {
    height: 180px;
    overflow: hidden;
    background: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-admin-card .gallery-admin-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-album-placeholder {
    color: var(--color-text-muted-dark);
    font-size: 0.9rem;
}

/* Admin gallery photo management */
.gallery-admin-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-admin-photo {
    background: var(--color-bg-white);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-admin-photo img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.gallery-admin-photo-actions {
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* Extra small button */
.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ----- Responsive ----- */
@media (max-width: 992px) {
    .col-4 { flex: 0 0 50%; max-width: 50%; }
    .col-3 { flex: 0 0 50%; max-width: 50%; }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-sidebar-toggle,
    .admin-menu-toggle {
        display: block;
    }

    .admin-sidebar-close {
        display: block;
    }

    .admin-main {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.4rem; }

    .hero {
        min-height: 70vh;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    /* Mobile navigation */
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: var(--color-bg-darker);
        padding: 1.5rem;
        gap: 0.25rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .nav-auth {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        width: 100%;
        flex-direction: column;
    }

    .nav-auth .btn {
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    /* Grid */
    .col-6,
    .col-4,
    .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .row {
        margin: 0;
    }

    .row > * {
        padding: 0;
    }

    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Tables */
    .results-table {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        border-radius: 0;
        width: calc(100% + 3rem);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }

    /* Admin */
    .admin-main {
        padding: 1rem;
    }

    .admin-header {
        padding: 0 1rem;
    }

    .stats-grid,
    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Modal */
    .modal {
        max-width: 100%;
        max-height: 90vh;
    }

    /* Lightbox nav */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .results-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .results-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        text-align: left;
    }

    .results-tab.active {
        border-bottom: none;
        border-left-color: var(--color-primary);
        background: rgba(232, 122, 32, 0.06);
    }
}

/* ----- Print Styles ----- */
@media print {
    .navbar,
    .nav-toggle,
    .footer,
    .admin-sidebar,
    .admin-header,
    .btn,
    .lightbox,
    .modal-overlay,
    .flash-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    .admin-content {
        margin-left: 0;
    }

    .results-table table {
        min-width: auto;
    }

    .results-table thead th {
        background: #333;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
