/* ─── BASE ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;  /* prevents width + padding overflow site-wide */
}

html {
    background: black;
}

body {
    font-family: 'Spectral SC', serif;
    background: lemonchiffon;
    margin: 0;
    padding: 10px 0.5rem;
}

/* Default safe image behaviour — individual img classes add sizing on top */
img {
    max-width: 100%;
    height: auto;
}

/* ─── LINKS ─────────────────────────────────────────────────────────────────── */

/* Link colours live in theme.css (kept low-specificity there so pages can
   restyle their own links with a single class). */
a:link {
    text-decoration: none;
}

/* ─── NAVIGATION ────────────────────────────────────────────────────────────── */

nav {
    font-family: 'Lucida Sans', sans-serif;
    font-size: 1.6em;
    color: white;
    display: block;
    padding-bottom: 5px;
}

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

/* ── Desktop nav: horizontal inline-block items ── */
nav li {
    display: inline-block;
    background-color: blanchedalmond;
}

nav li a {
    display: inline-block;
    color: black;
    box-shadow: 5px 1px 20px #888;
    padding: 5px;
    border: 1px solid;
}

nav li a:hover:not(.active) {
    background-color: blue;
}

.active {
    background-color: dodgerblue;
}

nav .dropdown {
    position: relative;
    display: inline-block;
    color: black;
}

.dropdown-content {
    display: none;
    position: absolute;
    z-index: 123;
    width: 175px;
    background-color: skyblue;
    padding: 12px 16px;
    text-align: left;
}

/* Desktop: show dropdown on hover */
nav .dropdown:hover .dropdown-content {
    display: block;
}

/* ─── IMAGES ────────────────────────────────────────────────────────────────── */
/*
 * The global img rule above sets max-width:100% and height:auto.
 * Classes below only need to specify width (and border/margin where they differ).
 */

img.logo {
    width: auto;
    max-width: 500px;
    margin: 5px;
    border: 2px solid black;
}

img.sponsor {
    width: 300px;
    margin: 5px;
    border: 2px solid black;
}

img.sponsor1 {
    width: 400px;
    margin: 5px;
    border: 2px solid black;
}

img.bowlsshow {
    width: 500px;
    margin: 2px;
}

img.winners {
    width: 500px;
    margin: 5px;
    border: 2.5px solid darkblue;
}

img.editorial {
    width: 1500px;
    margin: 5px;
    border: 2.5px solid forestgreen;
}

img.here {
    width: 50px;
    border: 2.5px solid black;
}

img.birthday {
    width: 1000px;
    margin: 5px;
    border: 2.5px solid white;
}

img.clubnews {
    width: 350px;
    margin: 5px;
    border: 2.5px solid black;
}

img.vale {
    width: 150px;
    margin: 15px;
    border: 1px solid;
}

.enlarge:hover {
    transform: scale(3);
    transform-origin: 0 0;
}

/* ─── HEADINGS ──────────────────────────────────────────────────────────────── */
/*
 * Note: h7–h14 are not valid HTML elements. They are retained here for
 * backward compatibility via the companion .h7–.h14 classes. Prefer using
 * the class form (e.g. <div class="h7">) in new markup.
 */

h1 {
    float: left;
    margin: 5px;
    font-family: "Cooper Black", serif;
    font-size: 1.5em;
}

h1.big {
    font-size: 4.5em;
    line-height: 1.2;
    font-family: "Brush Script MT", cursive;
}

h2 {
    background-color: lightgrey;
    padding: 0.5em;
    font-family: 'Anton', sans-serif;
    font-size: 1em;
}

h3 {
    background-color: palevioletred;
    padding: 0.5em;
    font-family: 'Merriweather', serif;
    font-size: 1.2em;
}

h4 {
    font-family: "Franklin Gothic Medium", "ITC Franklin Gothic", Arial, sans-serif;
    color: blueviolet;
    font-size: 1.3em;
    padding-left: 1.2em;
}

h5 {
    background-color: palevioletred;
    font-family: "Times New Roman", serif;
    font-size: 2em;
    color: greenyellow;
}

h6 {
    font-size: 2em;
    text-align: left;
    color: saddlebrown;
    font-family: 'Anton', sans-serif;
    margin: auto;
}

/* Custom heading styles */
h7, .h7 {
    display: block;
    font-family: 'Shrikhand', cursive;
    font-size: 1.8em;
    color: saddlebrown;
}

h8, .h8 {
    display: block;
    font-size: 1.5em;
    font-family: 'Salsa', cursive;
}

h9, .h9 {
    display: block;
    font-family: 'Oswald', sans-serif;
    color: mediumvioletred;
    font-size: 1em;
}

h10, .h10 {
    display: block;
    background-color: white;
    font-family: "Cooper Black", serif;
    font-size: 1.8em;
}

h11, .h11 {
    display: block;
    font-family: 'Do Hyeon', sans-serif;
    background-color: greenyellow;
    color: black;
    font-size: 3em;
}

h11a, .h11a {
    display: block;
    font-family: 'Do Hyeon', sans-serif;
    background-color: greenyellow;
    color: black;
    font-size: 1.75em;
}

h12, .h12 {
    display: block;
    font-family: 'Anton', sans-serif;
    color: red;
    font-size: 1.5em;
}

h13, .h13 {
    display: block;
    background-color: palevioletred;
    padding: 0.1em;
    font-family: 'Merriweather', serif;
    font-size: 1.2em;
}

h14, .h14 {
    display: block;
    background-color: palevioletred;
    padding: 0.1em;
    font-family: 'Merriweather', serif;
    font-size: 2em;
}

/* ─── BODY TEXT ─────────────────────────────────────────────────────────────── */

p {
    font-size: 1.2em;
    color: darkblue;
    font-family: Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
    text-indent: 1.5em;
}

u {
    color: black;
}

/* ─── BPL EVENT LISTS ───────────────────────────────────────────────────────── */

ul.bpl-events {
    list-style: none;
    padding: 0;
    margin: 0.5em 0 1em;
    font-family: 'Averia Sans Libre', cursive;
    color: brown;
}

ul.bpl-events li,
ul.bpl-events > li {
    display: block !important;
    background: none;
    padding: 0.2em 0;
    border: none;
    box-shadow: none;
    width: 100%;
}

ul.bpl-events li a {
    display: inline;
    color: crimson;
    box-shadow: none;
    padding: 0;
    border: none;
}

/* ─── PAGE LAYOUT (main content + sponsors sidebar) ─────────────────────────── */
/*
 * On desktop: sponsors float right alongside content (existing .right behaviour).
 * On mobile:  sponsors move below all content via flex order.
 */

.page-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.page-main {
    flex: 1 1 0;
    min-width: 0;          /* prevents flex blowout on wide content */
    order: 1;
}

.page-sponsors {
    flex: 0 0 200px;
    order: 2;
}

/* Cancel the float — flex handles positioning now */
.page-sponsors .right {
    float: none;
    width: 100%;
}

/* ─── LAYOUT ────────────────────────────────────────────────────────────────── */

.right {
    float: right;
    height: 100%;
    width: 20%;
}

.left {
    float: none;
    height: 100%;
    width: 80%;
}

.middle {
    float: left;
    height: 100%;
    width: 20%;
}

.upcoming {
    position: absolute;
    left: 178px;
    top: 250px;
    right: 80%;
    bottom: 0;
}

#sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 90%;
}

/* ─── NEWS / CONTENT BLOCKS ─────────────────────────────────────────────────── */

.news1 {
    border: 2px solid red;
    border-radius: 12px;
    max-width: 58%;
    margin: 5px 0 5px 22%;
    background-color: lemonchiffon;
    padding: 0 0.3rem;
    font-family: 'Lato', sans-serif;
}

.news2 {
    max-width: 58%;
    margin: 5px 0 5px 22%;
    background-color: palegreen;
    padding: 0 0.3rem;
    font-family: 'Lato', sans-serif;
}

.pinned {
    border: 2px solid black;
    border-radius: 1px;
    max-width: 58%;
    margin: 5px 5px 5px 22%;
    background-color: whitesmoke;
    padding: 0 0.3rem;
    font-size: 1.2em;
    color: black;
}

.pinned1 {
    border: 2px solid black;
    border-radius: 1px;
    max-width: 58%;
    margin: 5px 5px 5px 22%;
    background-color: paleturquoise;
    padding: 0 0.3rem;
    font-size: 1.2em;
    color: black;
}

.pinned2 {
    border: 2px solid black;
    border-radius: 1px;
    max-width: 75%;
    background-color: slateblue;
    padding: 0 0.3rem;
    font-size: 1.3em;
    color: black;
}

.marquee {
    border: 5px solid black;
    border-radius: 1px;
    max-width: 58%;
    margin: 5px 0 10px 22%;
    background-color: lightcyan;
    padding: 0 0.3rem;
    font-family: 'Lato', sans-serif;
    font-size: 1.3em;
    color: black;
}

/* ─── EDITORIAL ─────────────────────────────────────────────────────────────── */

.editorial {
    border: 2px solid slateblue;
    border-radius: 12px;
    width: 65%;
    margin: 5px 0 5px 11%;
    background-color: whitesmoke;
    padding: 0 0.3rem;
    font-size: 1.1em;
}

/* ─── RUMOURS ───────────────────────────────────────────────────────────────── */
/* .rumour / .fact / .false share layout; only background-color differs */

.rumour,
.fact,
.false {
    font-family: 'Balsamiq Sans', cursive;
    border: 2px solid black;
    max-width: 75%;
    padding-left: 0.3rem;
    font-size: 1em;
    color: black;
}

.rumour { background-color: orange; }
.fact   { background-color: lightgreen; }
.false  { background-color: red; }

/* ─── CALENDAR ──────────────────────────────────────────────────────────────── */

.calendar {
    font-family: 'Mukta', sans-serif;
}

.carnivals {
    font-size: 1em;
    color: black;
    background-color: darkturquoise;
}

.winterweeklies {
    font-size: 1em;
    color: black;
    background-color: yellowgreen;
}

/* ─── CLASSIFIEDS ───────────────────────────────────────────────────────────── */

.classifieds {
    border: 2px solid black;
    width: 68%;
    margin: 5px 0 5px 11%;
    background-color: whitesmoke;
}

/* ─── PANELS ────────────────────────────────────────────────────────────────── */

.panel {
    padding: 0.1em 16px;
    margin: 16px 0;
    color: yellow;
    background-color: purple;
    font-size: 1.3em;
}

.panel1 {
    background-color: yellow;
}

.panelyoutube {
    padding: 0.1em 0.3rem;
    margin: 16px 0;
    color: yellow;
    background-color: forestgreen;
}

.panelred {
    padding: 0.01em 16px;
    margin: 16px 0;
    color: black;
    background-color: red;
}

.panelwhite {
    padding: 0.01em 16px;
    color: black;
    background-color: white;
    border: 1px solid;
}

.panelblue {
    padding: 0.01em 16px;
    margin: 16px 0;
    color: black;
    background-color: blue;
}

.panelgreen {
    padding: 0.01em 16px;
    margin: 16px 0;
    color: black;
    background-color: green;
}

.panelyellow {
    padding: 0.01em 16px;
    margin: 16px 0;
    color: black;
    background-color: yellow;
}

.paneleditorial {
    padding: 0.01em 16px;
    color: black;
    background-color: slateblue;
    border: 1px solid;
}

.panel1-title {
    padding: 0.01em 16px;
    background-color: black;
    font-size: 2em;
}

.panel1-body {
    background-color: palegoldenrod;
    color: black;
    text-align: left;
}

/* ─── TABLES ────────────────────────────────────────────────────────────────── */

td, th {
    padding: 5px 15px;
    border: 2px solid black;
    text-align: left;
}

tr:nth-child(even) {
    background-color: #ddd;
}

thead {
    background-color: grey;
}

/* ─── PENNANTS ──────────────────────────────────────────────────────────────── */
/* .teams17/18/19 share font, size, and text colour; only background differs */

.teams17,
.teams18,
.teams19 {
    font-family: 'Baloo Bhaina 2', cursive;
    font-size: 2em;
    color: black;
}

.teams17 { background-color: paleturquoise; }
.teams18 { background-color: darkseagreen; }
.teams19 { background-color: palevioletred; }

.preview {
    font-family: 'Alike Angular', serif;
    color: darkred;
    font-size: 1.2em;
}

.preview1 {
    font-family: 'Chango', cursive;
    background-color: yellow;
    font-size: 1.6em;
    color: black;
}

/* ─── CONTENT CLASSES ───────────────────────────────────────────────────────── */

.agm {
    font-family: 'Roboto', sans-serif;
    color: cadetblue;
    font-size: 2em;
}

.new {
    color: aqua;
    font-family: 'Bangers', cursive;
    font-size: 2em;
}

.winners {
    font-family: 'Bangers', cursive;
}

.galadays {
    color: hotpink;
    font-family: 'Lato', sans-serif;
}

.tips {
    font-family: 'Ruluko', sans-serif;
    color: #2e67d1;
    font-size: 1.2em;
}

.clubnews {
    font-family: 'Varela Round', sans-serif;
    color: #37474f;
    text-indent: 1.5em;
}

.rankings {
    font-family: 'Baloo Bhaina 2', cursive;
}

.myresponse {
    font-family: 'Risque', cursive;
}

.rankings2 {
    font-family: 'Averia Sans Libre', cursive;
    color: brown;
}

.rankings3 {
    font-family: 'Rammetto One', cursive;
    color: blue;
}

.country {
    font-family: 'Della Respira', serif;
}

.bpl {
    font-family: 'Black Han Sans', sans-serif;
    color: teal;
}

.bpl1 {
    font-family: 'Black Han Sans', sans-serif;
    color: darkblue;
    font-size: 2em;
}

.marketodds {
    font-family: 'Pangolin', cursive;
    font-size: 1.1em;
    color: purple;
    text-align: left;
    margin: 0 1em;
}

.polls {
    font-family: 'Nova Round', cursive;
    font-size: 1.5em;
}

.bachelor {
    font-family: 'Otomanopee One', sans-serif;
    font-size: 1.5em;
    padding-left: 2rem;
}

/* ─── JOKES ─────────────────────────────────────────────────────────────────── */
/* .jokes/.jokes1/.jokes2 share layout; only font, border style, and bg differ */

.jokes,
.jokes1,
.jokes2 {
    width: 65%;
    margin: 5px 0 5px 11%;
    padding: 0 0.3rem;
    font-size: 1.2em;
    color: black;
}

.jokes {
    font-family: 'Merienda One', cursive;
    border: 2.5px solid purple;
    background-color: floralwhite;
}

.jokes1 {
    font-family: 'Modern Antiqua', cursive;
    border: 2.5px dashed darkgreen;
    background-color: palegreen;
}

.jokes2 {
    font-family: 'News Cycle', sans-serif;
    border: 4.5px outset black;
    background-color: lightskyblue;
}

/* ─── QUIZ & TIPPING ────────────────────────────────────────────────────────── */

.quiz {
    font-family: 'Just Another Hand', cursive;
    font-size: 2.4em;
    background-color: plum;
    color: black;
}

.tipping {
    font-family: 'Merriweather', serif;
    font-size: 4em;
    color: darkgoldenrod;
}

.tipping1 {
    font-family: 'McLaren', cursive;
    background-color: indianred;
    font-size: 1.2em;
    color: white;
}

.tipping2 {
    font-family: 'Bree Serif', serif;
    font-size: 1.4em;
    color: darkmagenta;
    background-color: bisque;
}

.tipping3 {
    font-family: 'Gloria Hallelujah', cursive;
    color: black;
    background-color: lightcyan;
    font-size: 1.2em;
}

/* ─── UTILITIES ─────────────────────────────────────────────────────────────── */

.rotateimg90 {
    transform: rotate(90deg);
}

/* ─── VALE ───────────────────────────────────────────────────────────────────── */
/*
 * img.vale sizing is defined above under IMAGES.
 * All other vale page styles are here.
 */

/* ── Hero banner ── */
.vale-hero {
    background-color: #0f3d24;
    color: #e8c96a;
    text-align: center;
    padding: 1.2em 1em 1em;
    font-family: var(--font-head);
    margin-bottom: 1em;
}

.vale-hero h2 {             /* override: global h2 has lightgrey bg + Anton font */
    font-size: 2em;
    font-weight: 400;
    letter-spacing: 0.06em;
    margin: 0 0 0.2em;
    background: none;
    color: #e8c96a;
    padding: 0;
}

.vale-hero p {              /* override: global p has text-indent */
    font-size: 0.95em;
    color: rgba(232,201,106,0.8);
    text-indent: 0;
}

/* ── Submission form ── */
.vale-form-wrap {
    max-width: 660px;
    margin: 1.5em auto;
}

.vale-form-wrap h3 {        /* override: global h3 has palevioletred bg */
    font-family: var(--font-head);
    font-size: 1em;
    background-color: lightgrey;
    padding: 0.5em;
    margin-bottom: 0.75em;
}

.vale-form-inner {
    border: 2px solid #0f3d24;
    border-radius: 8px;
    background-color: #fff;
    padding: 1em 1.2em;
}

.vale-form-inner p {        /* override: global p has text-indent */
    font-size: 1em;
    color: #444;
    text-indent: 0;
    margin-bottom: 0.8em;
}

.vale-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    margin-bottom: 0.8em;
}

.vale-form-row:last-child { margin-bottom: 0; }

.vale-form-row label {
    font-family: var(--font-body);
    font-size: 0.9em;
    color: #555;
}

.vale-form-row input[type="text"],
.vale-form-row input[type="email"],
.vale-form-row textarea {
    width: 100%;
    padding: 0.45em 0.7em;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-family: var(--font-head);
    font-size: 0.95em;
    background: #fffef8;
}

.vale-form-row textarea { min-height: 80px; resize: vertical; }

.vale-form-row input:focus,
.vale-form-row textarea:focus { outline: 2px solid #0f3d24; border-color: #0f3d24; }

.btn-vale-submit {
    background-color: #0f3d24;
    color: #e8c96a;
    border: none;
    padding: 0.5em 1.4em;
    font-family: var(--font-head);
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 0.5em;
}

.btn-vale-submit:hover { background-color: #1c6b3c; }

/* ── Search bar ── */
.vale-search-wrap {
    max-width: 860px;
    margin: 1em auto 0.5em;
}

.vale-search-wrap input {
    width: 100%;
    padding: 0.5em 1em;
    border: 2px solid #0f3d24;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 1em;
    background: #fff;
    color: #333;
}

.vale-search-wrap input:focus { outline: none; border-color: #1c6b3c; }

#vale-count {
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.82em;
    color: #888;
    margin: 0.4em 0 0;
    text-indent: 0;             /* override: global p adds text-indent */
}

/* ── Accordion entries ── */
.vale-list {
    max-width: 860px;
    margin: 1em auto 2.5em;
}

details.vale-item {
    border: 1px solid #c9dccb;
    border-radius: 6px;
    margin-bottom: 0.5em;
    background-color: #fffef8;
    overflow: hidden;
}

details.vale-item[open] { border-color: #0f3d24; }

summary.vale-trigger {
    display: flex;
    align-items: center;
    gap: 0.8em;
    padding: 0.7em 1em;
    cursor: pointer;
    list-style: none;
    background-color: #eef6ef;
}

summary.vale-trigger::-webkit-details-marker { display: none; }

details.vale-item[open] summary.vale-trigger {
    background-color: #0f3d24;
    color: #e8c96a;
}

.vale-entry-name {
    flex: 1;
    font-family: var(--font-head);
    font-size: 1.05em;
    color: inherit;
}

/* Clubs and date share the same base style */
.vale-entry-clubs,
.vale-entry-date {
    font-family: var(--font-body);
    font-size: 0.8em;
    color: #888;
}

.vale-entry-date { white-space: nowrap; }

details.vale-item[open] .vale-entry-clubs,
details.vale-item[open] .vale-entry-date { color: rgba(232,201,106,0.75); }

.vale-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s;
}

details.vale-item[open] .vale-chevron { transform: rotate(180deg); color: #e8c96a; }

/* ── Entry body ── */
.vale-body {
    padding: 1em 1.2em 1.2em;
    border-top: 1px solid #ddd;
}

.vale-inner {
    display: flex;
    gap: 1.2em;
    align-items: flex-start;
}

.vale-inner img.vale { flex-shrink: 0; }

.vale-text {
    flex: 1;
    font-family: var(--font-body);
    font-size: 1em;
    color: #1d2a22;
    line-height: 1.75;
}

.vale-text .myresponse {
    display: block;
    margin-top: 0.5em;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
    .vale-inner { flex-direction: column; }
    .vale-search-wrap,
    .vale-list,
    .vale-form-wrap { margin-left: 0.3em; margin-right: 0.3em; }
}

/* ─── RESPONSIVE / MOBILE ───────────────────────────────────────────────────── */

@media (max-width: 700px) {

    body {
        padding: 4px;
    }

    /* Sponsors: stack vertically on mobile, sponsors go below main content */
    .page-layout {
        flex-direction: column;
    }

    .page-main {
        order: 1;
        width: 100%;
    }

    .page-sponsors {
        order: 2;
        width: 100%;
    }

    /* Stack sponsors below content instead of floating alongside */
    .right {
        float: none;
        width: 100%;
        clear: both;
    }

    /* .middle is the float:left sponsor sidebar — full width on mobile */
    .middle {
        float: none;
        width: 100%;
        clear: both;
    }

    .left {
        width: 100%;
    }

    /* Shrink sponsor images so they don't overflow */
    img.sponsor {
        width: 100%;
        max-width: 300px;
    }

    img.sponsor1 {
        width: 100%;
        max-width: 380px;
    }

    /* Shrink other large images */
    img.bowlsshow,
    img.winners,
    img.birthday,
    img.editorial,
    img.clubnews {
        width: 100%;
        max-width: 100%;
    }

    /* News/content blocks: remove the fixed 22% left-margin indent */
    .news1, .news2, .pinned, .pinned1, .pinned2, .marquee,
    .editorial, .classifieds, .rumour, .fact, .false {
        max-width: 100%;
        width: auto;
        margin-left: 2px;
        margin-right: 2px;
    }

    /* ── NAV: vertical stack with tap-to-open dropdowns ── */
    nav {
        font-size: 1em;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    /* Override the desktop inline-block on nav li */
    nav li {
        display: block;
        width: 100%;
        border-bottom: 1px solid #bbb;
        background-color: blanchedalmond;
    }

    nav li > a,
    nav li .dropdown > a {
        display: block;
        padding: 10px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Override the desktop inline-block on .dropdown */
    nav .dropdown {
        display: block;
        position: static;
        width: 100%;
    }

    /* Dropdowns hidden by default on mobile; JS adds .open to reveal */
    .dropdown-content {
        display: none;
        position: static;
        width: 100%;
        background-color: #d0e8f8;
        padding: 0;
    }

    /* Disable the desktop hover rule on mobile */
    nav .dropdown:hover .dropdown-content {
        display: none;
    }

    /* Only show when JS adds .open */
    nav .dropdown.open .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        display: block;
        padding: 9px 24px;
        border-top: 1px solid #b0cfe0;
    }
}

/* ─── FOOTER ────────────────────────────────────────────────────────────────── */

footer {
    background-color: darkblue;
    font-size: 1em;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1em;
    text-align: right;
}

/* ─── STATS PAGES (skipstats.php, statevents.php) ───────────────────────────── */

.page-wrap {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 10px;
}

/* Search box */
.search-box {
    background: #fff;
    border: 1px solid #ccc;
    padding: 18px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.search-box label {
    font-weight: bold;
    color: #1c6b3c;
    display: block;
    margin-bottom: 6px;
}
.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.search-row input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 14px;
    font-family: var(--font-body, Arial, sans-serif);
}
.search-row select {
    padding: 8px 10px;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    font-family: var(--font-body, Arial, sans-serif);
}
.btn-search {
    background: #1c6b3c;
    color: #fff;
    border: none;
    padding: 8px 22px;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    font-family: var(--font-body, Arial, sans-serif);
}
.btn-search:hover { background: #0f3d24; }
.btn-clear {
    background: #888;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-body, Arial, sans-serif);
}
.btn-clear:hover { background: #666; }

/* Results area */
.results-area {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 18px 20px;
}
.results-info {
    color: #555;
    margin-bottom: 12px;
    font-style: italic;
    font-family: var(--font-body, Arial, sans-serif);
    font-size: 13px;
    text-indent: 0;
}
.table-wrap { overflow-x: auto; }

/* Stats tables */
.stats-table, .stats-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
    font-family: var(--font-body, Arial, sans-serif);
}
.stats-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
    font-family: var(--font-body, Arial, sans-serif);
}
.stats-page thead tr { background: #1c6b3c; color: #fff; }
.stats-page thead th {
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.stats-page thead th:first-child { text-align: left; }
.stats-page thead th:hover { background: #0f3d24; }
.stats-page thead th .sort-arrow { margin-left: 4px; opacity: 0.6; font-size: 10px; }
.stats-page tbody tr:nth-child(even) { background: #f4f8f4; }
.stats-page tbody tr:hover { background: #e2efe4; }
.stats-page tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    white-space: nowrap;
    font-family: var(--font-body, Arial, sans-serif);
    font-size: 13px;
}
.stats-page tbody td:first-child { text-align: left; font-weight: bold; color: #1c6b3c; }

/* Fours table */
.fours-table { font-size: 11px; min-width: 1100px; }
.fours-table thead th, .fours-table tbody td { padding: 6px 6px; white-space: nowrap; }

/* Stat colours */
.stat-positive { color: #007700; font-weight: bold; }
.stat-negative { color: #cc0000; font-weight: bold; }
.stat-neutral  { color: #555; }
.winner-cell   { color: #1c6b3c; font-weight: bold; }
.loser-cell    { color: #888; }
.score-win     { color: #007700; font-weight: bold; }
.score-loss    { color: #cc0000; }
.round-gf      { background: #ffd700 !important; font-weight: bold; color: #333; }
.round-sf      { background: #e8e8e8 !important; }

/* Name highlight */
.name-highlight {
    background: #ffe066 !important;
    color: #333 !important;
    font-weight: bold;
    border-radius: 3px;
    padding: 2px 6px;
}

/* Expand button */
.btn-expand {
    background: #1c6b3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    margin-right: 6px;
    display: inline-block;
    font-weight: bold;
    flex-shrink: 0;
}
.btn-expand:hover { background: #0f3d24; }

/* Season/detail expand rows */
.season-row, .detail-row { display: none; }
.season-row.open, .detail-row.open { display: table-row; }
.season-detail, .detail-cell {
    background: #eef6ef !important;
    padding: 0 !important;
}
.season-table-wrap, .detail-table-wrap {
    padding: 8px 16px 12px 40px;
    overflow-x: auto;
}
.season-table, .detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 500px;
    font-family: var(--font-body, Arial, sans-serif);
}
.season-table thead tr, .detail-table thead tr { background: #2f8f87; }
.season-table thead th, .detail-table thead th {
    padding: 5px 8px;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    font-size: 11px;
}
.season-table thead th:first-child,
.detail-table thead th:first-child { text-align: left; }
.season-table tbody td, .detail-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #d5e3d7;
    text-align: center;
    white-space: nowrap;
    font-family: var(--font-body, Arial, sans-serif);
}
.season-table tbody td:first-child { text-align: left; font-weight: bold; }
.season-table tbody tr:nth-child(even),
.detail-table tbody tr:nth-child(even) { background: #e2efe4; }

/* Page tabs (skipstats) */
.page-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-tab-btn {
    background: #ccc;
    color: #333;
    border: none;
    padding: 9px 22px;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body, Arial, sans-serif);
}
.page-tab-btn:hover { background: #aaa; }
.page-tab-btn.active { background: #1c6b3c; color: #fff; }
.page-panel { display: none; }
.page-panel.active { display: block; }

/* Event tabs (statevents) */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tab-btn {
    background: #ccc;
    color: #333;
    border: none;
    padding: 9px 20px;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body, Arial, sans-serif);
}
.tab-btn:hover { background: #aaa; }
.tab-btn.active { background: #1c6b3c; color: #fff; }

/* Search mode tabs (statevents) */
.mode-bar {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}
.mode-btn {
    background: #ddd;
    color: #555;
    border: 1px solid #ccc;
    border-bottom: none;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-family: var(--font-body, Arial, sans-serif);
}
.mode-btn.active { background: #fff; color: #1c6b3c; border-color: #ccc; }
.mode-btn:hover:not(.active) { background: #ccc; }
.search-panel { display: none; }
.search-panel.active { display: block; }

/* Head to head */
.h2h-box {
    background: #fff;
    border: 1px solid #ccc;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.h2h-box label { font-weight: bold; color: #1c6b3c; display: block; margin-bottom: 6px; font-family: var(--font-body, Arial, sans-serif); }
.h2h-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #1c6b3c;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    text-align: center;
}
.h2h-team { font-size: 18px; font-weight: bold; flex: 1; min-width: 120px; font-family: var(--font-body, Arial, sans-serif); }
.h2h-score { font-size: 40px; font-weight: bold; color: #ffe066; min-width: 80px; }
.h2h-vs { font-size: 16px; opacity: 0.7; }
.h2h-sub { font-size: 12px; opacity: 0.8; margin-top: 4px; }

/* Loading states */
.state-msg {
    text-align: center;
    padding: 30px 0;
    color: #777;
    font-style: italic;
    font-family: var(--font-body, Arial, sans-serif);
    text-indent: 0;
}
.state-msg.error { color: #cc0000; }
.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #ccc;
    border-top-color: #1c6b3c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note {
    margin-top: 14px;
    font-size: 12px;
    color: #888;
    text-align: right;
    font-family: var(--font-body, Arial, sans-serif);
    text-indent: 0;
}

/* Stats pages mobile */
@media (max-width: 600px) {
    .search-row { flex-direction: column; }
    .search-row input[type="text"],
    .search-row select,
    .btn-search, .btn-clear { width: 100%; min-width: unset; text-align: center; }
    .stats-page table { font-size: 11px; }
    .stats-page thead th, .stats-page tbody td { padding: 5px 6px; }
    .season-table-wrap, .detail-table-wrap { padding: 6px 8px; }
}
