:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #121418;
  --muted: #5f6570;
  --border: #d6dae1;
  --brand: #1366d9;
  --sidebar-bg: #eef2f7;
  --sidebar-hover: #dce5f2;
  --active-link: #0f172a;
  --active-bg: #cfe1ff;
}

html[data-theme="dark"] {
  --bg: #0f131a;
  --surface: #171e27;
  --text: #e8edf6;
  --muted: #9aa9be;
  --border: #2c3542;
  --brand: #7cb2ff;
  --sidebar-bg: #131b25;
  --sidebar-hover: #202c3a;
  --active-link: #f8fbff;
  --active-bg: #31445f;
}

html,
body {
  height: 100%;
}

body.app-shell {
  background: radial-gradient(circle at top right, rgba(19, 102, 217, 0.08), transparent 35%), var(--bg);
  color: var(--text);
  padding-top: 56px;
}

.app-navbar {
  background: rgba(228, 232, 238, 0.62) !important;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border-bottom: 1px solid rgba(95, 101, 112, 0.18);
  transition: background-color 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease;
}

html[data-theme="dark"] .app-navbar {
  background: rgba(33, 40, 51, 0.55) !important;
  border-bottom-color: rgba(154, 169, 190, 0.2);
}

.app-navbar.scrolled {
  background: rgba(127, 134, 145, 0.72) !important;
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .app-navbar.scrolled {
  background: rgba(52, 60, 73, 0.78) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.app-navbar .navbar-brand {
  color: var(--text);
  font-weight: 700;
}

.navbar-brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.navbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}

.navbar-profile-link:hover .navbar-avatar {
  border-color: rgba(255,255,255,0.9);
}

.navbar-profile-name {
  color: var(--text);
}

.navbar-profile-link:hover .navbar-profile-name,
.app-navbar .navbar-brand:hover {
  color: var(--brand);
}

.epl-table {
  font-size: 0.88rem;
}

.epl-pos {
  width: 2.5rem;
  color: var(--muted);
}

.app-main-wrap,
.app-main-row {
  min-height: calc(100vh - 56px);
}

.app-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.sidebar-inner {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 1rem 0.85rem 1.5rem;
}

.sidebar-block {
  margin-bottom: 0.8rem;
}

.sidebar-section-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.8rem 0;
}

.sidebar-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.35rem 0.3rem;
  border-radius: 0.4rem;
  font-weight: 600;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
}

.sidebar-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-list {
  list-style: none;
  padding-left: 0.55rem;
  margin: 0.15rem 0 0.6rem;
}

.sidebar-list.plain {
  padding-left: 0;
}

.sidebar-older-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.1rem 0.4rem 0.4rem 0.5rem;
  text-align: left;
}

.sidebar-older-toggle:hover {
  color: var(--text);
  text-decoration: underline;
}

.sidebar-link {
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.4rem;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.2rem;
}

.sidebar-link-title {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.sidebar-status-orb {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 45%, transparent);
}

.sidebar-status-orb.status-open {
  background: #2ab769;
}

.sidebar-status-orb.status-locked {
  background: #f2a93b;
}

.sidebar-link small {
  color: var(--muted);
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
}

.sidebar-link.active {
  background: var(--active-bg);
  color: var(--active-link);
  font-weight: 700;
}

.sidebar-season-body {
  margin-left: 0.25rem;
  padding-left: 0.45rem;
  border-left: 1px dashed var(--border);
}

.app-content {
  padding: 0 1.2rem 1.5rem;
}

.card,
.table,
.form-control,
.form-select {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.table {
  --bs-table-bg: var(--surface);
  --bs-table-striped-bg: color-mix(in srgb, var(--surface) 86%, var(--border));
  --bs-table-color: var(--text);
}

.text-muted,
.form-text {
  color: var(--muted) !important;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  opacity: 1;
  background-color: color-mix(in srgb, var(--surface) 88%, var(--border));
}

.admin-readonly-field {
  font-weight: 600;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
}

@media (max-width: 991.98px) {
  .app-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-inner {
    position: static;
    height: auto;
    max-height: 50vh;
  }
}

.predictions-table .prediction-col {
  min-width: 42px;
}

.predictions-table td,
.predictions-table th {
  vertical-align: middle;
  border: 1px solid #d8d8d8 !important;
  padding: 0.35rem 0.45rem !important;
  white-space: nowrap;
}

.predictions-table .actual-col {
  width: 34px;
}

.predictions-table .kickoff-col {
  width: 30px;
}

.kickoff-tooltip {
  color: #9aa3af;
  font-size: 0.92rem;
  cursor: help;
}

.predictions-table tbody tr,
.predictions-table tbody tr:nth-of-type(odd),
.predictions-table tbody tr:nth-of-type(even) {
  --bs-table-accent-bg: transparent;
  background-color: transparent !important;
}

.player-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.player-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.player-header {
  border-left: 2px solid rgba(0, 0, 0, 0.15) !important;
  background: linear-gradient(180deg, #f8f9fa, #e9ecef);
  color: #1f2933 !important;
}

.player-head span {
  color: inherit;
}

.prediction-wrong {
  background: #ea9999 !important;
  color: #1d2027 !important;
}

.prediction-outcome {
  background: #ffe599 !important;
  color: #1d2027 !important;
}

.prediction-exact {
  background: #b6d7a8 !important;
  color: #1d2027 !important;
}

.prediction-pending {
  background: #cccccc !important;
}

.prediction-value {
  display: inline-block;
  min-width: 0.8rem;
}

.prediction-hidden-cell {
  position: relative;
}

.prediction-blurred {
  filter: blur(4px);
  opacity: 0.65;
  user-select: none;
  pointer-events: none;
}

.my-col,
.my-col-header {
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.75);
}

.pred-cell {
  color: #000 !important;
}

.player-divider {
  border-left: 2px solid rgba(0, 0, 0, 0.2) !important;
}

.weekly-image {
  max-height: 360px;
  width: 100%;
  object-fit: contain;
}

.blog-text {
  white-space: pre-line;
}

.blog-image-frame {
  border: 1px solid var(--border);
}

.bonus-star {
  color: #f1c40f;
  font-size: 1.05rem;
  margin-right: 4px;
}

.winner-block {
  min-width: 280px;
}

.winner-label {
  font-size: 1.95rem;
  line-height: 1;
}

.winner-points-line {
  font-size: 1.08rem;
}

.winner-avatar-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.winner-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e6bf3f;
  background: #fff;
  margin-left: -10px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.winner-avatar:first-child {
  margin-left: 0;
}

.winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.winner-avatar-small {
  width: 66px;
  height: 66px;
}

.winner-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: none;
  background: linear-gradient(135deg, #fff7d1, #ffe4b5);
  color: #1d2027;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  padding-top: 0.25rem;
}

.winner-card-previous {
  background: linear-gradient(135deg, #f7f7f7, #ededed);
}

.winner-card .text-muted,
.winner-card .small {
  color: #5d6571 !important;
}

.winner-plaque {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.winner-plaque.comp-multiplier-plaque {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 0;
  width: max-content;
  max-width: calc(100% - 1.5rem);
}

.winner-plaque-muted {
  color: #2c2c2c;
}

.winner-plaque.winner-plaque-muted.comp-multiplier-plaque {
  border-color: rgba(90, 90, 90, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 46%),
    linear-gradient(135deg, #f0f0f0 0%, #d5d5d5 52%, #b5b5b5 100%);
  color: #2f2f2f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 -1px 0 rgba(80, 80, 80, 0.2);
}

.winner-plaque.winner-plaque-muted .comp-multiplier-star {
  background: linear-gradient(180deg, #ffffff 0%, #d4d4d4 100%);
  color: #4a4a4a;
}

.comp-multiplier-plaque {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 220px;
  min-height: 44px;
  padding: 0.58rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(168, 113, 0, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 46%),
    linear-gradient(135deg, #ffe28a 0%, #f4c449 48%, #dca019 100%);
  color: #3f2b00;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 251, 223, 0.9), 0 -1px 0 rgba(107, 68, 0, 0.25);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(112, 74, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.2);
}

.comp-multiplier-text {
  line-height: 1;
}

.comp-multiplier-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff6cf 0%, #efc24a 100%);
  color: #6f4300;
  font-size: 0.82rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 3px rgba(0, 0, 0, 0.18);
}

.comp-multiplier-plaque::before {
  content: "";
  position: absolute;
  inset: 6px 10px auto;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

html[data-theme="dark"] .comp-multiplier-plaque {
  border-color: rgba(214, 156, 35, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 0 rgba(92, 60, 0, 0.26),
    0 8px 20px rgba(0, 0, 0, 0.35);
}

.winner-coin {
  position: absolute;
  right: -4px;
  bottom: -2px;
  font-size: 1rem;
}

.winner-names {
  min-width: 180px;
}

.stats-hero {
  width: min(240px, 32vw);
}

.leaderboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.leaderboard-header {
  padding: 0.9rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table {
  --bs-table-bg: var(--surface);
  --bs-table-accent-bg: transparent;
  --bs-table-striped-bg: transparent;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.95rem 1rem !important;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent) !important;
}

.leaderboard-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.winner-fireworks-canvas {
  position: absolute;
  inset: -8px;
  pointer-events: none;
  z-index: 4;
}

.comment-list .comment-item {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-bottom: 0.9rem;
}

.comment-list .comment-item:last-child {
  border-bottom: 0;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.comment-body {
  white-space: pre-line;
}

.reaction-count {
  display: inline-block;
  background: color-mix(in srgb, var(--surface) 85%, var(--border));
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.3rem;
  font-size: 0.86rem;
}

.reaction-icon {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 1rem;
}

.reaction-icon:hover {
  color: var(--text);
}

.emoji-picker {
  position: absolute;
  z-index: 20;
  top: 26px;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  padding: 0.3rem;
  white-space: nowrap;
}

.emoji-option {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  padding: 0.2rem;
  border-radius: 6px;
}

.emoji-option:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--border));
}

/* Predictions page */
.predictions-page {
  max-width: 1320px;
}

.predict-hero {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at right top, rgba(19, 102, 217, 0.12), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 95%, #d6e6ff), var(--surface));
}

.predict-hero-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.predict-hero-meta {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 600;
}

.predict-card {
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(18, 20, 24, 0.08);
}

.predict-card-header {
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
}

.predict-entry-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.predict-entry-table tbody td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.predict-date,
.predict-time {
  white-space: nowrap;
  font-weight: 600;
}

.predict-score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.predict-score-input {
  width: 5.25rem;
  font-weight: 700;
}

.predict-dash {
  color: var(--muted);
  font-weight: 700;
}

.predict-actual-badge {
  min-width: 4.75rem;
  font-size: 0.84rem;
}

.predict-lock-alert {
  border-radius: 0.75rem;
}

@media (max-width: 991.98px) {
  .predict-entry-table {
    min-width: 950px;
  }
}
