@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --bg: #f4f6fb;
  --bg-2: #eef2f8;
  --text: #1f2a36;
  --muted: #5d6b7a;
  --primary: #2b77e5;
  --primary-700: #1f5fb8;
  --accent: #1f2a36;
  --card: #ffffff;
  --border: #e3e7ee;
  --shadow: 0 10px 30px rgba(23, 34, 52, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 320px at 10% -5%, rgba(43,119,229,0.10), transparent 60%),
    radial-gradient(700px 260px at 90% -10%, rgba(31,42,54,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

h1, h2, h3 {
  font-family: inherit;
  letter-spacing: 0.2px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }

header {
  background: linear-gradient(120deg, #1f2a36, #2c3e50);
  color: #fff;
  box-shadow: var(--shadow);
}

.page-header {
  padding: 10px;
  min-height: 64px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  max-width: none;
  width: 90%;
  margin: 24px auto;
  padding: 0 16px 80px 16px;
}

.panel, .card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.centered-panel { display:flex; flex-direction:column; justify-content:center; }
.hint-row { margin-top:8px; display:flex; justify-content:space-between; align-items:center; }
.wizard-actions { display:flex; gap:8px; margin-top:12px; }
.section-title { margin-top:0; }
.spacer-16 { margin-top:16px; }
.login-btn { margin-top:12px; width:100%; }
.full-input { width:100%; }

.btn, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff !important;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  min-height: 40px;
}

.btn:hover, .button:hover {
  background: var(--primary-700);
  color: #fff !important;
  text-decoration: none;
}

.button.red { background: #c0392b; }
.button.red:hover { background: #a93226; }

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,119,229,0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: #f2f5fa;
  font-weight: 700;
}

tr:nth-child(even) { background: #fafbfe; }

.hamburger {
  background: #1f2a36;
  color: #fff;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.user-chip {
  background: #1f2a36;
  color: #fff;
  border-radius: 999px;
}

.avatar, .avatar-img {
  border-radius: 999px;
}

.avatar {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2b77e5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.avatar-img {
  width: 20px;
  height: 20px;
  object-fit: cover;
}

.menu-overlay {
  background: #1f2a36;
  box-shadow: var(--shadow);
}

.modal {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-banner {
  box-shadow: var(--shadow);
}

.footer-fixed {
  background: #1f2a36;
}

.page-hamburger {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  color: #fff;
  padding: 80px 20px 20px 20px;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 19;
  pointer-events: none;
}

.menu-overlay.open { transform: translateX(0); pointer-events: auto; }
.menu-overlay a { display: block; color: #fff; text-decoration: none; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.15); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 18;
}

.menu-backdrop.open { opacity: 1; pointer-events: auto; }

.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.footer-links {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  white-space: nowrap;
}
.footer-left {
  visibility: visible;
  display: block;
  opacity: 0.65;
  font-size: 12px;
}
.footer-center {
  text-align: center;
  justify-self: center;
  opacity: 0.85;
}
.footer-center a {
  color: #fff;
  font-weight: 600;
}
.footer-center a:hover { color: #d7e2f1; }
.footer-right {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  justify-self: end;
  justify-content: flex-end;
  text-align: right;
}
.footer-right a {
  color: #fff;
  font-weight: 600;
}
.footer-right a:hover {
  color: #d7e2f1;
}
.footer-links span {
  opacity: 0.85;
}
.wiki-section {
  margin-bottom: 16px;
}
.wiki-section h2 {
  margin: 0 0 6px 0;
}
.wiki-list {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

@media (max-width: 820px) {
  .footer-fixed { padding: 8px 12px; }
  .footer-center { font-size: 12px; }
  .footer-right { gap: 12px; font-size: 12px; }
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-weight: normal;
}

.filter select,
.filter input {
  padding: 4px 6px;
}

.filter-submit {
  display: none;
  margin-left: 8px;
}

.mobile-filter-btn {
  display: none;
}

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  .filter-submit {
    display: inline-block;
  }
  .mobile-filter-btn {
    display: inline-block;
  }
  .filters select,
  .filters label {
    display: none;
  }
}

.mobile-modal {
  width: 92vw;
  max-width: 520px;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 25;
}

.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  width: 420px;
  max-width: 90vw;
  z-index: 26;
  display: none;
}

.modal.open { display: block; }
.modal h2 { margin-top: 0; }
.modal label { display: block; margin: 8px 0 4px; }
.modal input,
.modal select { width: 100%; padding: 8px; box-sizing: border-box; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }

.input-error { border: 2px solid #c0392b; }
.error-text { color: #c0392b; font-size: 12px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.panel-pad, .card-pad {
  padding: 16px;
}

.dashboard-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  min-height: 64px;
}

.dashboard-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.dashboard-title h1 {
  margin: 0;
  font-size: 20px;
}

.comp-title {
  font-size: 16px;
  font-weight: 600;
  color: #d7e2f1;
  text-align: center;
}

.user-menu {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 36px;
  background: #fff;
  color: #1f2a36;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: none;
  min-width: 180px;
  z-index: 30;
}

.user-dropdown.open { display: block; }
.user-dropdown a { display: block; padding: 8px 10px; color: #1f2a36; text-decoration: none; }
.user-dropdown a:hover { background: #f1f3f6; }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 45%) 1fr;
  gap: 24px;
  align-items: start;
}

.sticky {
  position: sticky;
  top: 90px;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.matchday { margin-bottom: 8px; }
.match-card { margin-bottom: 8px; }
.match-card h4 { margin: 0 0 6px 0; }
.set-table { margin-top: 4px; }

.score-win { color: #1f7a1f; font-weight: 600; }
.score-lose { color: #c0392b; font-weight: 600; }
.score-draw { color: #111; font-weight: 600; }
.diff-pos { color: #1f7a1f; font-weight: 600; }
.diff-neg { color: #c0392b; font-weight: 600; }
.diff-zero { color: #111; font-weight: 600; }

.dashboard-hamburger {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  position: relative;
}

.hamburger span:only-child::before,
.hamburger span:only-child::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #fff;
}

.hamburger span:only-child::before { top: -6px; }
.hamburger span:only-child::after { top: 6px; }

.dashboard-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  color: #fff;
  padding: 80px 20px 20px 20px;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 19;
}

.dashboard-menu.open { transform: translateX(0); }
.dashboard-menu a { display: block; color: #fff; text-decoration: none; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.15); }
.menu-separator {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 10px 0;
}
.is-hidden { display: none !important; }
.m-0 { margin: 0 !important; }
.mb-15 { margin-bottom: 15px !important; }
.fw-600 { font-weight: 600 !important; }
.w-180 { width: 180px !important; }
.row-inline-tight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.muted-note {
  margin: 0 0 12px;
  color: #52606d;
}
.mt-0 { margin-top: 0 !important; }
.mt-6 { margin-top: 6px !important; }
.mt-8 { margin-top: 8px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-16 { margin-top: 16px !important; }
.mb-6 { margin-bottom: 6px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-14 { margin-bottom: 14px !important; }
.d-inline { display: inline !important; }
.pad-6-8 { padding: 6px 8px !important; }
.w100-pad6-box {
  width: 100% !important;
  padding: 6px !important;
  box-sizing: border-box !important;
}
.input-full {
  width: 100% !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}
.label-block {
  display: block !important;
  margin: 8px 0 4px !important;
}
.fw600-mb8 {
  font-weight: 600 !important;
  margin-bottom: 8px !important;
}
.flex-gap6 { display: flex; gap: 6px; }
.flex-gap8-center {
  display: flex;
  gap: 8px;
  align-items: center;
}
.flex-gap16-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.form-inline-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.team-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.grid-span-2 { grid-column: 1 / span 2; }
.w-72 { width: 72px !important; }
.w-80 { width: 80px !important; }
.w-90 { width: 90px !important; }
.w-110 { width: 110px !important; }
.w-120 { width: 120px !important; }
.w-130 { width: 130px !important; }
.w-210 { width: 210px !important; }
.w-260 { width: 260px !important; }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 18;
}

.menu-backdrop.open { opacity: 1; pointer-events: auto; }

@media (max-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
}
.table-wrap {
  overflow-x: auto;
}

.league-table th,
.league-table td {
  text-align: center;
  white-space: nowrap;
}

.set-table th,
.set-table td {
  text-align: center;
}

.league-table th,
.league-table td {
  padding: 8px 8px;
}

.league-table th:nth-child(2),
.league-table td:nth-child(2) {
  text-align: left;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-table th:nth-child(1),
.league-table td:nth-child(1),
.league-table th:nth-child(3),
.league-table td:nth-child(3),
.league-table th:nth-child(4),
.league-table td:nth-child(4),
.league-table th:nth-child(5),
.league-table td:nth-child(5),
.league-table th:nth-child(6),
.league-table td:nth-child(6),
.league-table th:nth-child(7),
.league-table td:nth-child(7),
.league-table th:nth-child(8),
.league-table td:nth-child(8),
.league-table th:nth-child(9),
.league-table td:nth-child(9) {
  min-width: 48px;
}

.league-table th:nth-child(7),
.league-table td:nth-child(7),
.league-table th:nth-child(9),
.league-table td:nth-child(9) {
  min-width: 64px;
}

.set-table th,
.set-table td {
  padding: 6px 6px;
}

.set-table th:last-child,
.set-table td:last-child {
  min-width: 52px;
  width: 52px;
}

.set-table th:nth-last-child(2),
.set-table td:nth-last-child(2) {
  min-width: 68px;
  width: 68px;
}
.dashboard-main {
  max-width: none;
  width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}
