* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: white;
}

.md-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0; /* remove side/top padding */
}

/* Header styling */
header {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.header-title {
  font-family: "Roboto", sans-serif;
  font-size: 2rem;
  font-weight: bold;
}

.header-description {
  font-size: 1rem;
  color: #6a737d;
}

/* Styling the countdown timer button */
.countdown-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.countdown-timer {
  width: 200px;
  padding: 10px;
  font-size: 1.5rem;
  border: none;
  border-radius: 8px;
  background-color: #007bff;
  color: white;
  cursor: default;
}

/* Split page */
.split-container {
  display: flex;
  flex: 1;
  padding: 0; /* no side padding */
  margin: 0; /* flush to edges */
}

.split {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.icon {
  font-size: 5rem;
}

/* Style the EPL club logos */
.club-logo {
  width: 200px;  /* Make logos twice as big */
  height: 200px;
  margin-bottom: 10px;
  margin-top: 40px;
}

/* Keep the rest of the design mobile-friendly */
.split {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
}

.clickable-area {
  font-size: 12rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.save-button {
  width: auto;
  height: 50px;
  padding: 10px;
  font-size: 1.2rem;
  border: solid;
  border-radius: 8px;
  background-color: white;
  color: black;
  margin-top: 10px;
  margin-right: 10px;
  cursor: pointer;
}

.save-button:hover {
  border-color: black;
  background-color: black;
  color: white;
}

    /* Overlay styling */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
}

/* Overlay content adjustments */
.overlay-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  width: 300px;
}

/* Style the comment */
.overlay-comment {
  font-size: 0.9rem;
  color: #6a737d;
  margin-bottom: 10px;
}

/* Confirm button styling */
.confirm-button {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: solid;
  border-radius: 8px;
  background-color: white;
  color: black;
  margin-top: 10px;
  cursor: pointer;
}

.confirm-button:hover {
  background-color: black;
  color: white;
}

/* Cancel button styling */
.cancel-button {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: solid;
  border-radius: 8px;
  background-color: white;
  color: black;
  margin-top: 10px;
  cursor: pointer;
}

.mode-input.error { background-color: #ef4444 !important; color: #ffffff; border-color: #ef4444 !important; box-shadow: none; }

.cancel-button:hover {
  background-color: LightGray;
}

/* Split page */
.save-container {
  justify-content: center;
  display: flex;
  flex: 1;
  padding: 20px;
}

/* Footer Styling */
footer {
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 40px 0 40px 0; /* bottom-only padding, increased */
  color: red;
}

.home {
  color: red;
  font-weight: bold;
}
.home a {
  color: inherit;
  text-decoration: none;
}
.home a:hover {
  color: inherit; 
  text-decoration: none;
}

.londonisred {
  font-family: 'Bebas Neue', sans-serif;
  text-transform: uppercase;
  color: red;
  font-size: 2rem; /* Adjust size as needed */
  text-align: center;
  font-weight: 700;
  }
  /* Hover week styling */
.londonisred:hover {
  color: red; /* Change text color to black when hovered */
}

/* Style the links inside the week-number div */
.londonisred a {
  color: red; /* Change text color to black when hovered */
  text-decoration: none;
}

/* Hover effect on links */
.londonisred a:hover {
  color: red; /* Change text color to black when hovered */
  text-decoration: none;
}

/* Autosave toast */
.autosave-toast {
  position: fixed;
  right: 16px;
  top: 16px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 22px; /* match .drawer-toggle */
  padding: 10px 14px;  /* match .drawer-toggle */
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.autosave-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.autosave-toast .material-icons {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.autosave-toast .toast-label { margin-left: 6px; font-weight: 600; }
.autosave-toast.error { background: #b91c1c; color: #fff; }

/* Right-side stats drawer */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-height: 55vh;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-100%);
  transition: transform 250ms ease;
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
}
.drawer.open {
  transform: translateY(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.drawer-title {
  font-weight: 700;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
/* Stats widgets */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr; /* one per row */
  gap: 12px;
}
.stat-card {
  background: #f7f7f8;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.stat-card.full { grid-column: 1 / -1; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
}
.stat-icon .material-icons {
  font-size: 28px;
  line-height: 1;
}
.stat-body {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Stacked percentage bar for W/D/L */
.pct-bar {
  width: 100%;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  background: #eee;
}
.segment { height: 100%; }
.pct-win { background: #16a34a; }  /* green */
.pct-draw { background: #2563eb; } /* blue */
.pct-loss { background: #ef4444; } /* red */

.pct-legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.legend-item.win::before { content: ""; width: 10px; height: 10px; background: #16a34a; border-radius: 2px; display: inline-block; }
.legend-item.draw::before { content: ""; width: 10px; height: 10px; background: #2563eb; border-radius: 2px; display: inline-block; }
.legend-item.loss::before { content: ""; width: 10px; height: 10px; background: #ef4444; border-radius: 2px; display: inline-block; }

/* Compact breakdown list */
.bd-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.bd-item { display:flex; align-items:center; }
.bd-item .bd-label { font-weight:600; margin-left:8px; flex:1; text-align:left; }
.bd-item .bd-value { font-weight:700; margin-left:12px; text-align:right; min-width:6ch; }
.bd-item .bd-dot { width:12px; height:12px; border-radius:3px; margin-right:8px; display:inline-block; }
.bd-item.win .bd-dot { background:#16a34a; }
.bd-item.draw .bd-dot { background:#2563eb; }
.bd-item.loss .bd-dot { background:#ef4444; }
.drawer-toggle {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.drawer-toggle:focus { outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.locked .drawer-toggle:focus { outline: none !important; box-shadow: none !important; }
.drawer-toggle:hover {
  opacity: 0.9;
}

/* Top centered controls container */
.top-controls {
  position: fixed;
  top: 16px;
  left: 16px;
  transform: none;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-controls .drawer-toggle,
.top-controls .drawer-toggle-ladder {
  position: static;
}

/* Right-side ladder drawer */
.drawer-right {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -2px 0 10px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 250ms ease;
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
}
.drawer-right.open { transform: translateX(0); }
.drawer-right .drawer-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }
.drawer-right .drawer-title { font-weight:700; }
.drawer-right .drawer-close { background:none; border:none; font-size:1.2rem; cursor:pointer; }

.drawer-toggle-ladder {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.drawer-toggle-ladder:hover { opacity: 0.9; }

/* Leaderboard list */
.leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f7f8;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}
.lb-left { display:flex; align-items:center; gap:10px; }
.lb-rank {
  width: 28px; height: 28px; border-radius: 8px; background:#111; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700;
}
.lb-user { font-weight:600; }
.lb-points { font-weight:700; }
.lb-entries { color:#6b7280; font-size:0.85rem; margin-left: 6px; }

/* Mode switch (Anonymous vs Reddit) */
.user-switch-wrapper { position: relative; }
.mode-switch {
  position: absolute;
  top: 0;
  left: calc(100% + 8px); /* right of button */
  transform: none;
  background: #000;
  border: 0px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 0;
}
.mode-avatar { margin-right: 8px; color:#6b7280; font-size: 22px; }
.hide[aria-hidden="true"][inert] { display:none !important; }
.mode-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #111827;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
}
.mode-btn#btnReddit { border-radius: 20px; }
.mode-btn.active { background: #111827; color: #ffffff; }
.mode-input { height: 34px; padding: 6px 10px; border: 0px solid #e5e7eb; border-radius: 8px; }
.hide { display: none !important; }

/* Reddit login button */
.reddit-login img { height: 28px; display:block; }
.reddit-login { display:inline-flex; align-items:center; justify-content:center; padding:4px 8px; background:#fff; border-radius:10px; }
.reddit-login:hover { opacity: .9; }

/* User profile button with inline username */
.user-btn { display:inline-flex; align-items:center; gap:8px; }
.user-btn .material-icons { line-height:1; display:inline-flex; align-items:center; }
.user-btn .user-name { line-height:1; display:inline-block; }
.user-btn .user-reddit { height: 22px; display:block; }
.logout-icon { margin-left: 6px; color:#fff; opacity: .85; display:inline-flex; align-items:center; }
.logout-icon .material-icons { font-size: 18px; }
.logout-icon:hover { opacity: 1; }

/* Make anonymous user button the same size as other circular buttons */
/* ensure anonymous user button stays compact like others */
.user-btn .user-reddit { height: 22px; }

/* -------- Responsive: mobile-first adjustments -------- */
@media (max-width: 768px) {
  /* Keep horizontal split on small devices */
  .split-container { flex-direction: row; }
  .club-logo {
    width: 150px;
    height: 150px;
    margin-top: 24px;
  }
  .clickable-area {
    font-size: 9rem;
    line-height: 1;
  }
  .drawer-right {
    width: 100%;
    max-width: 100%;
  }
  footer {
    padding: 24px 0 24px 0;
  }
  .top-controls {
    top: 12px;
    left: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .club-logo {
    width: 110px;
    height: 110px;
    margin-top: 16px;
  }
  .clickable-area {
    font-size: 7rem;
  }
  .drawer-title { font-size: 1rem; }
  .stat-value { font-size: 1.2rem; }
}