html {
  box-sizing: border-box;
  font-size: 16px;
  overflow-y: scroll;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #163a8a;
  background: #f3f3f1;
  line-height: 1.4;
}

a {
  color: #0b57b7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- PAGE SHELL --- */

.site-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.site-header {
  max-width: 1120px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 24px;
  align-items: center;
}

.site-logo {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-logo img {
  max-width: 110px;
  height: auto;
  display: block;
}

.site-logo-right {
  justify-self: end;
}

.site-title-block {
  text-align: center;
}

.site-title {
  margin: 0 0 8px;
  font-size: 2.5rem;
  line-height: 1.1;
  color: #1247aa;
  letter-spacing: 1px;
}

.site-subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: #1a4fb3;
}

/* --- TOP NAVIGATION --- */

.top-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;

  display: flex;
  gap: 24px;

  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  background-color: #f8f8f8;
}

.top-nav a {
  color: #1a4fa3;
  font-weight: 500;
  text-decoration: none;
}

.top-nav a.active {
  font-weight: bold;
  border-bottom: 2px solid #1a4fa3;
  padding-bottom: 2px;
}

/* --- SIDEBAR SECTION NAV --- */

.section-nav {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-nav-title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #1247aa;
}

.section-nav-group + .section-nav-group {
  margin-top: 14px;
}

.section-nav-heading {
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #5a6c8c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-nav a {
  display: block;
  margin-bottom: 4px;
  color: #163a8a;
  font-size: 0.9rem;
}

.section-nav a.active {
  font-weight: bold;
  text-decoration: underline;
}

/* --- PAGE HEADER --- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  font-size: 1.6rem;
  color: #1247aa;
}

.last-updated {
  font-size: 0.85rem;
  color: #5a6c8c;
  margin-top: 4px;
}

/* --- TABLES --- */

.fixtures-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.fixtures-table th {
  text-align: left;
  padding: 8px;
  border-bottom: 2px solid #d8e2f2;
  color: #1247aa;
}

.fixtures-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e6ecf5;
}

.fixtures-table tr:nth-child(even) {
  background: #f7f9fc;
}

.fixtures-table td:nth-child(2),
.fixtures-table td:nth-child(3),
.fixtures-table td:nth-child(4) {
  white-space: nowrap;
}

/* --- RESULT STYLING --- */

.result-win {
  color: #1f7a2e;
  font-weight: bold;
}

.result-loss {
  color: #b11f1f;
  font-weight: bold;
}

.result-draw {
  color: #666;
}

.result-pending {
  color: #999;
}

.result-link {
  font-weight: bold;
}

/* --- STATISTICS PANELS --- */

.stats-panel {
  margin-top: 24px;
  padding: 18px 20px 22px;
  border: 2px solid #c8d8f0;
  border-radius: 8px;
  background: #ffffff;
}

.stats-panel:first-of-type {
  margin-top: 0;
}

.stats-panel-title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  color: #1247aa;
}

.stats-subtitle {
  margin: 18px 0 8px;
  font-size: 1.05rem;
  color: #1247aa;
}

.stats-table th,
.stats-table td {
  text-align: right;
  white-space: nowrap;
}

.stats-table th:first-child,
.stats-table td:first-child,
.stats-table td.name {
  text-align: left;
}

.stats-table .text-cell {
  text-align: left;
}

.stats-table .num-cell {
  text-align: right;
  white-space: nowrap;
}

.fielding-grid {
  display: block;
}

.fielding-grid > div {
  margin-top: 18px;
}

.fielding-grid > div:first-child {
  margin-top: 0;
}

/* --- LIFETIME STATISTICS --- */

.lifetime-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.lifetime-tabs a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  color: #1a4fa3;
}

.lifetime-table-panel {
  margin-top: 18px;
}

.lifetime-stats-table {
  table-layout: fixed;
  width: 100%;
}

.lifetime-stats-table th:first-child,
.lifetime-stats-table td:first-child {
  width: 55%;
  text-align: left;
}

.lifetime-stats-table th:not(:first-child),
.lifetime-stats-table td:not(:first-child) {
  width: 15%;
  text-align: right;
}

/* --- HOME PAGE --- */

.home-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.home-card {
  display: block;
  padding: 16px 18px;
  border: 2px solid #c8d8f0;
  border-radius: 8px;
  background: #f7f9fc;
  color: #163a8a;
}

.home-card:hover {
  background: #eef3fb;
  text-decoration: none;
}

.home-card h4 {
  margin: 0 0 8px;
  color: #1247aa;
}

.home-card p {
  margin: 0;
}

/* --- RESPONSIVE --- */

@media (max-width: 900px) {
  .site-shell {
    padding: 16px 12px 32px;
  }

  .site-header {
    grid-template-columns: 90px 1fr 90px;
    gap: 12px;
  }

  .site-logo {
    width: 90px;
    height: 90px;
  }

  .site-logo img {
    max-width: 82px;
  }

  .site-title {
    font-size: 1.8rem;
  }

  .site-subtitle {
    font-size: 0.95rem;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 12px;
  }

  .home-link-grid {
    grid-template-columns: 1fr;
  }
}

.page-content {
  max-width: 900px;
  margin: 0 auto;
}

.sidebar {
  font-size: 0.95rem;
}

/* --- SIDEBAR + CONTENT LAYOUT --- */

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;

  max-width: 1120px;
  margin: 0 auto;
}

/* Sidebar (de-emphasised, aligned with content) */
.layout-with-sidebar .sidebar {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 12px;

  /* controls vertical alignment with page title */
  padding: 8px 0 0;
}

/* Remove inner panel styling so it blends with page */
.layout-with-sidebar .section-nav {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* Main content panel */
.layout-with-sidebar .page-content {
  margin: 0;
}

/* --- FULL-WIDTH CONTENT (no sidebar pages) --- */

.layout-full {
  max-width: 1120px;
  margin: 0 auto;
}

/* --- LIFETIME / SEASON TABS (final tuning) --- */

.lifetime-tabs {
  display: flex;
  gap: 16px;
  margin: 12px 0 20px;
}

.lifetime-tabs a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  color: #1a4fa3;
}

.lifetime-tabs a.active {
  background-color: #e6eefc;
  font-weight: bold;
  border-bottom: 2px solid #1a4fa3;
}

/* --- FINAL LAYOUT WIDTH OVERRIDES --- */

.layout-full .page-content {
  max-width: none;
  margin: 0;
}

.layout-with-sidebar .page-content {
  max-width: none;
  margin: 0;
}

/* --- ALIGN FIRST PANEL WITH PANEL SPACING SYSTEM --- */

.layout-full .stats-panel:first-of-type {
  margin-top: 24px;
}

/* --- HOME SUMMARY BLOCKS --- */

.home-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.home-compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-compact-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e6ecf5;
}

.home-item-date,
.home-item-main,
.home-item-detail {
  display: block;
}

.home-item-date {
  font-size: 0.85rem;
  color: #5a6c8c;
}

.home-item-main {
  font-weight: bold;
  color: #1247aa;
}

.home-item-detail {
  color: #163a8a;
}

@media (max-width: 900px) {
  .home-summary-grid {
    grid-template-columns: 1fr;
  }
}
/* --- HOME PAGE TARGET LAYOUT --- */

.home-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.home-left-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-side-panel {
  align-self: stretch;
}

.home-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-match-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e6ecf5;
}

.home-match-line1,
.home-match-line2 {
  display: block;
}

.home-match-line1 {
  font-weight: bold;
  color: #1247aa;
}

.home-panel-link {
  margin: 16px 0 0;
  font-weight: bold;
}

.home-directory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.home-directory-heading {
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.home-directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-directory-list li {
  margin-bottom: 8px;
}

.home-directory-list a {
  font-weight: bold;
}

@media (max-width: 900px) {
  .home-hero-grid,
  .home-directory-grid {
    grid-template-columns: 1fr;
  }
}

.home-match-line1 {
  font-size: 0.9rem;
  line-height: 1.25;
}

.home-match-line2 {
  margin-top: 2px;
  font-size: 0.95rem;
  color: #163a8a;
}
