* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #080808; color: #ffffff; font-family: 'Teko', sans-serif; overflow-x: hidden; }

.webgl { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%); }
.main-logo { position: fixed; top: 30px; left: 5%; width: 120px; height: auto; z-index: 10; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
.content-wrapper { position: relative; z-index: 2; }
.scene { min-height: 100vh; display: flex; align-items: center; padding: 0 10%; position: relative; }
.text-content { max-width: 700px; z-index: 2; }
.right-align { margin-left: auto; text-align: right; }

h1 { font-family: 'Oswald', sans-serif; font-size: 9rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; line-height: 0.9; text-shadow: 0 10px 30px rgba(0,0,0,0.5); }
h2 { font-family: 'Oswald', sans-serif; font-size: 5rem; font-weight: 800; color: #ffae00; margin-bottom: 20px; text-transform: uppercase; line-height: 1; }
p { font-size: 2.2rem; line-height: 1.3; margin-bottom: 15px; color: #cccccc; font-weight: 300; }
strong { color: #ffffff; font-weight: 600; }

.stats-grid { display: flex; gap: 60px; margin-top: 30px; justify-content: flex-end; }
.stats-grid h3 { font-size: 6rem; margin: 0; color: #ffae00; line-height: 1; }
.stats-grid span { font-size: 1.8rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }

/* Rulebook Styling (Fixes the white text issue) */
.rules-scene { align-items: center; justify-content: center; padding-top: 5vh; padding-bottom: 5vh; }
.rules-container { width: 100%; max-width: 1200px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; margin-top: 2rem; position: relative; z-index: 2; }
.rule-card { background: rgba(40, 40, 40, 0.4); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 2.5rem; transition: transform 0.3s ease; }
.rule-card:hover { transform: translateY(-5px); background: rgba(50, 50, 50, 0.6); }
.rule-card h3 { font-family: 'Oswald', sans-serif; font-size: 2.2rem; color: #ffae00; margin-bottom: 1.5rem; letter-spacing: 1px; }
.rule-card ul { list-style: none; padding: 0; }
.rule-card li { font-size: 1.8rem; line-height: 1.4; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #ccc; }
.scoring-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 1.8rem; }
.scoring-table th { text-align: left; padding: 10px; border-bottom: 2px solid rgba(255, 255, 255, 0.2); color: #fff; }
.scoring-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #ccc; }
.win { color: #4caf50; font-weight: 600; }
.win-trump { color: #ffae00; font-weight: 600; }
.loss { color: #f44336; font-weight: 600; }
.trump-card { border: 1px solid rgba(255, 174, 0, 0.3); box-shadow: 0 0 20px rgba(255, 174, 0, 0.05); }
.trump-note { font-size: 1.4rem; color: #aaa; margin-top: 15px; }

/* Teams Styling */
.teams-scene { flex-direction: column; align-items: flex-start; justify-content: center; padding: 0; min-height: 100vh; }
.teams-container { width: 100%; padding-top: 10vh; padding-bottom: 10vh; }
.section-header { padding: 0 10%; margin-bottom: 2rem; }
.section-header p { color: #888; text-transform: uppercase; letter-spacing: 2px; font-size: 1.5rem; }
.team-track { display: flex; gap: 2rem; padding: 2rem 10%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none; }
.team-track::-webkit-scrollbar { display: none; }
.team-card { min-width: 350px; background: rgba(40, 40, 40, 0.4); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px; padding: 3rem 2rem; display: flex; flex-direction: column; align-items: center; scroll-snap-align: center; transition: transform 0.3s ease; }
.team-logo { width: 160px; height: 160px; object-fit: contain; margin-bottom: 2rem; filter: drop-shadow(0px 10px 20px rgba(0,0,0,0.7)); }
.roster { list-style: none; width: 100%; text-align: center; }
.roster li { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 1.4rem; color: #ccc; }
.roster .captain { color: #ffae00; font-weight: 600; font-size: 1.6rem; text-transform: uppercase; border-bottom: 2px solid rgba(255, 174, 0, 0.4); margin-bottom: 8px; padding-bottom: 12px;}

/* =========================================
   FIXTURES PAGE STYLING
========================================= */

.fixtures-page {
    background: radial-gradient(circle at top center, #1a1005 0%, #050505 100%);
    min-height: 100vh;
}

.fixtures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 174, 0, 0.2);
}

.back-btn {
    color: #ffae00;
    text-decoration: none;
    font-size: 1.8rem;
    font-family: 'Oswald', sans-serif;
    border: 1px solid #ffae00;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #ffae00;
    color: #000;
}

.fixtures-logo {
    height: 60px;
}

.fixtures-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.center-text { text-align: center; margin-bottom: 40px; }

/* Tables Setup */
.tables-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 60px;
}

.group-table-card {
    flex: 1;
    min-width: 320px;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.group-table-card h3 {
    font-family: 'Oswald', sans-serif;
    color: #ffae00;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.8rem;
    text-align: center;
}

.group-table th { color: #fff; border-bottom: 2px solid #ffae00; padding: 10px; }
.group-table td { color: #ccc; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 10px; }
.group-table td:first-child { text-align: left; }
.pts-col { color: #ffae00; font-weight: bold; font-size: 2rem; }

/* Subtle Fire Animation Keyframes */
@keyframes subtleFire {
    0% { box-shadow: 0 0 4px rgba(255, 174, 0, 0.3), inset 0 0 6px rgba(255, 50, 0, 0.1); border-color: rgba(255, 174, 0, 0.3); }
    50% { box-shadow: 0 0 12px rgba(255, 174, 0, 0.6), inset 0 0 10px rgba(255, 0, 0, 0.2); border-color: rgba(255, 174, 0, 0.8); }
    100% { box-shadow: 0 0 4px rgba(255, 174, 0, 0.3), inset 0 0 6px rgba(255, 50, 0, 0.1); border-color: rgba(255, 174, 0, 0.3); }
}

/* Fixtures Schedule Grid */
.schedule-title {
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    color: #ffae00;
    text-align: center;
    margin-bottom: 30px;
}

.fixtures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

/* The Animated Card */
.fire-card {
    background: #111;
    border-radius: 12px;
    border: 1px solid #ffae00;
    cursor: pointer;
    overflow: hidden;
    animation: subtleFire 3s infinite alternate;
    transition: transform 0.3s ease;
}

.fire-card:hover {
    transform: scale(1.02);
}

.card-summary {
    padding: 20px;
    text-align: center;
}

.match-date { color: #aaa; font-size: 1.6rem; letter-spacing: 1px; }
.match-teams { font-family: 'Oswald', sans-serif; font-size: 2.2rem; margin: 10px 0; color: #fff; }
.vs { color: #ffae00; font-size: 1.8rem; margin: 0 10px; }
.expand-hint { color: #888; font-size: 1.4rem; }

/* Expandable Details Area */
.card-details {
    max-height: 0;
    opacity: 0;
    background: #0a0a0a;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-in, padding 0.3s ease;
}

.fire-card.open .card-details {
    max-height: 500px;
    opacity: 1;
    padding: 20px;
    border-top: 1px solid rgba(255, 174, 0, 0.3);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 15px;
}

.details-table th { color: #ffae00; padding-bottom: 8px; border-bottom: 1px dotted #555; font-weight: 400; }
.details-table td { padding: 8px 5px; color: #ddd; border-bottom: 1px solid rgba(255,255,255,0.05); }
.trump { color: #ffae00 !important; }

.match-footer {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: #aaa;
    margin-top: 15px;
}
.match-footer span { color: #fff; }

/* =========================================
   RULES PAGE STYLING
========================================= */

.rules-page-bg {
    background: radial-gradient(circle at top right, #1a1510 0%, #050505 100%);
    min-height: 100vh;
}

.rules-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.rules-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.rule-detail-card {
    background: rgba(25, 25, 25, 0.7);
    border: 1px solid rgba(255, 174, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.rule-detail-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 174, 0, 0.6);
}

.rule-detail-card h3 {
    font-family: 'Oswald', sans-serif;
    color: #ffae00;
    font-size: 2.4rem;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.rule-list {
    list-style: none;
    padding: 0;
}

.rule-list li {
    font-size: 1.8rem;
    color: #ddd;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.3;
}

.rule-list li::before {
    content: "▸";
    color: #ffae00;
    position: absolute;
    left: 0;
    top: 0;
}

.rule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.8rem;
    text-align: left;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
}

.rule-table th {
    background: rgba(255, 174, 0, 0.1);
    color: #ffae00;
    padding: 10px 15px;
    font-weight: 400;
}

.rule-table td {
    padding: 10px 15px;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-note {
    font-size: 1.6rem;
    color: #aaa;
    line-height: 1.4;
}

.groups-split {
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.groups-split p {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.5;
}

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

/* Fix for disappearing footer and mobile alignment */
.table-wrapper {
    width: 100%;
    overflow-x: auto; /* Allows horizontal swipe on small screens */
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}
.details-table {
    min-width: 450px; /* Ensures table doesn't squish too much */
}
.fire-card.open .card-details {
    max-height: none; /* Changed from fixed 500px to allow content to breathe */
    opacity: 1;
    padding: 15px; /* Slightly tighter for mobile */
    display: flex;
    flex-direction: column;
}
/* Responsive adjustments for the grid */
@media (max-width: 600px) {
    .fixtures-grid {
        grid-template-columns: 1fr; /* Single column on phones */
        gap: 15px;
    }
    .match-teams {
        font-size: 1.8rem; /* Slightly smaller text for fit */
    }
    .fixtures-wrapper {
        padding: 20px 10px;
    }
}
