:root {
  --navy: #041e42;
  --orange: #D36711;
  --white: #f4f4f4;

  --muted: #c7c7c7;
  --border: rgba(255, 255, 255, 0.12);
}

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 75vmin;
  height: 75vmin;
  background-size: 60vmin;
  background-size: 60vmin;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-position: center center;
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;

  /* Default: Tessman branding */
  background-image: url("Tessman Consulting Logo_white.png");
}

/* branding for Oilers pages */
body.page-scores::before,
body.page-bracket::before {
  background-image: url("https://assets.nhle.com/logos/nhl/svg/EDM_light.svg");
  background-size: 80vmin;
}

body.modal-open {
  overflow: hidden;
}

.filter-spacer {
  height: 96px;
  /* height of the fixed filter block */
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
}

.filter-title-fixed {
  position: fixed;
  width:100%;

  background: rgba(4, 30, 66, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.filter-title-fixed .wrap {
  padding-top: 8px;
  padding-bottom: 12px;
}

.filter-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  margin: 0;  /* important: no margins for header */
}

.filter-spacer {
  height: 96px;
  /* height of the fixed filter block */
}

header {
  position: sticky;
  top: 0;
  background: rgba(4, 30, 66, 0.92);
  border-bottom: 2px solid var(--orange);
  z-index: 30;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.title {
  font-weight: 900;
  color: var(--orange);
  font-size: 1.5rem;
  /* ~50% larger */
}

.subtitle {
  font-size: 1.1rem;
  /* ~50% larger */
  color: var(--muted);
}

/* Hamburger */
.hamburger {
  font-size: 32px;
  background: transparent;
  border: none;
  color: var(--orange);
  cursor: pointer;
}

/* Side Menu */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background: rgba(4, 30, 66, 0.98);
  border-left: 2px solid var(--orange);
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 500;
}

.side-menu.open {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.menu-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
}

.menu-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--orange);
  cursor: pointer;
}

.menu-separator {
  border: none;
  border-top: 1px solid var(--orange);
  margin: 14px 0;
  opacity: 0.5;
}

.nav-item {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--orange);
  cursor: pointer;
  font-size: 15px;
}

.nav-item:hover {
  background: var(--orange);
  color: var(--navy);
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

.filter {
  margin-top: 6px;
  margin-bottom: 8px;
}

.filter-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.filter-line input[type=number] {
  width: 56px;
}

/* @media (max-width: 420px) {
  .filter-line input {
    width: 48px;
  }
} */

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

input[type=number] {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--orange);
  background: transparent;
  color: var(--orange);
  cursor: pointer;
}

button:hover {
  background: var(--orange);
  color: var(--navy);
}

/* Cards */
.grid {
  display: grid;
  gap: 12px;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opp-logo {
  width: 32px;
  height: 32px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score {
  font-weight: 700;
  color: var(--orange);
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.chip.final {
  background: rgba(255, 255, 255, 0.18);
  color: var(--orange);
}

.chip.live {
  background: var(--orange);
  color: var(--navy);
}

.chip.scheduled {
  background: rgba(255, 255, 255, 0.10);
  color: var(--white);
}

/* Win/Loss chips */
.result {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.result-W {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.result-L {
  background: rgba(248, 113, 113, 0.20);
  color: #fecaca;
}

.result-OTL {
  background: rgba(255, 224, 102, 0.30);
  border: 1px solid rgba(255, 224, 102, 0.45);
  color: #fff7c2;
}

.result-T {
  background: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

.status-text {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* DETAILS DIALOG */
.details-dialog {
  border: 2px solid var(--orange);
  background: rgba(4, 30, 66, 0.96);
  border-radius: 12px;

  position: fixed;
  inset: 10% auto auto 50%;
  transform: translateX(-50%);

  width: min(640px, calc(100vw - 24px));
  max-height: 80vh;

  padding: 0;
  overflow: hidden;
}

.dlg-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--orange);
  font-weight: 800;
}

.dlg-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  max-height: calc(80vh - 56px);  /* header height */
}

/* make the main details area scrollable */
.details-scroll {
  overflow-y: auto;
  max-height: 35vh;
  min-height: 120px;
}

/* TABLE */
.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.details-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.details-table td:first-child {
  width: 160px;
  font-weight: 600;
  color: var(--orange);
}

/* JSON PANEL */
.json-section {
  width: 100%;
  display: block;
  margin-top: 10px;
}

.json-toggle {
  float: right;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--orange);
  cursor: pointer;
  margin-bottom: 6px;
}

#detailsPre {
  clear: both;

  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  /* IMPORTANT */

  background: rgba(255, 255, 255, 0.07);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);

  font-size: 11px;
  color: var(--white);

  white-space: pre-wrap;  /* allow wrapping */
  word-break: break-all;  /* force-break long tokens */
  overflow-wrap: anywhere;  /* last-resort wrap */
}

.json-expanded {
  display: block;
}

.json-collapsed {
  display: none;
}

.ticket-link {
  color: var(--orange);
  font-weight: 700;
}

.ticket-link:hover {
  color: var(--white);
}
