:root{
  --bg:#f6f8fb;           /* page background */
  --card:#ffffff;         /* card surface */
  --muted:#6b7280;        /* secondary text */
  --text:#0b0d10;         /* primary text */
  --accent:#22c55e;       /* green accent */
  --accent-2:#3b82f6;     /* blue accent */
  --danger:#ef4444;

  --line: rgba(0,0,0,.08);
  --ring: 0 0 0 1px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.08);

  --skew-deg: -14deg;
}

*{ box-sizing:border-box }
html,body{ height:100%; background-color:transparent; }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  background-color: transparent;
  padding-top: 35px;
}

.page-bg{
  position: fixed;
  inset: 0;
  z-index: -1;           
  background:
    url("/bg.jpg") center / 50% auto repeat; 
  opacity: 0.1; 
}

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:0;
  min-height:100vh;
}

.backlink{
  opacity:.8;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  cursor:pointer;
  transition:transform .15s ease;
}
.backlink:hover{
  opacity:1;
  transform:scale(1.06);
}
.backlink img{
  width:40px;
  height:40px;
  object-fit:contain;
  filter: invert(1);
  margin-right: 7px;
}

a{ color:inherit; text-decoration:none }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1001;
  background-color: #2b2c2d;
  line-height: 0;
  height: 35px;
  padding: 0;
}
.topbar-inner {padding: 0px;}

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1002;              /* slightly above .topbar */
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #2b2c2d;  /* same color for seamless blend */
  padding: 0;
  line-height: 0;
}

.profile-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 35px;       
  padding: 0 14px;    
  border: 0;
  background: #002244;
  color: #e5e7eb;     
  cursor: pointer;

  overflow: hidden;
  z-index: 0;
}

.profile-btn::before {
  content: "";
  position: absolute;
  inset: 0;

  background: #002244;
  transform-origin: center;

  z-index: -1;
}

.profile-btn img{
  width:25px;
  height:25px;
}
.header-logo {
  display: block;
  height: 35px;
  width: auto;
  margin: 0;
  padding: 0;
}

.hh2 {
  font-size:14px;
  color:#111827;
  margin-bottom: 5px;
}

.navbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;

  background: #2b2c2d;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);

  padding: 0px;
  box-sizing: border-box;
}

.navitem {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0px;
  font-size: 11px;
  color: white;
  transition: color 0.2s ease;
}

.navitem.active {
  color: #69be28;
  font-weight: 600;
}

.navitem.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #002244;
  transform: skewX(var(--skew-deg));
  z-index: -1;
  transition: transform 0.2s ease, background 0.2s ease;
}

.navitem.active:hover::before {
  background: #69be28;
  transform: skewX(var(--skew-deg)) scale(1.03);
}

.grid{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:0;
  background-color: transparent;
}

.card{
  margin-top:0px;
}
.card h2{
  font-size:14px;
  font-weight:600;
  margin:0 0 10px;
  color:#111827;
}
.card .content{
  padding:6px 16px 16px;
}

.matches-title{
  font-size:16px;
  font-weight:800;
  margin:16px 0 10px;
  color:#111827;
}
#dateBadge{
  font-size:.95em;
  font-weight:700;
  white-space:nowrap;
}

.cal-header{
  display:flex;
  align-items:left;
  justify-content:space-between;
  margin-bottom:10px;
}
.cal-title{
  font-weight:700;
  letter-spacing:.3px;
  color:#111827;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  border:1px solid var(--line);
  background:#fff;
  color:#111827;
  border-radius:10px;
  cursor:pointer;
  transition:.15s;
}
.btn:hover{
  border-color:rgba(0,0,0,.18);
  background:#fafafa;
}
.btn[disabled]{
  opacity:.5;
  cursor:not-allowed;
}

.cal-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
}
.dow{
  font-size:11px;
  text-transform:uppercase;
  color:var(--muted);
  padding:4px 0;
  text-align:center;
}
.day{
  position:relative;
  min-height:52px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:6px;
  cursor:pointer;
  transition:.12s;
}
.day:hover{
  border-color:rgba(59,130,246,.35);
}
.day .num{
  font-size:12px;
  color:#111827;
}
.day.selected{
  outline:2px solid rgba(59,130,246,.7);
}
.day.disabled{
  opacity:.45;
  cursor:not-allowed;
  background:#f3f4f6;
}
.pad{ visibility:hidden }

#calGrid .day[data-has="1"]:not(.disabled){
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.40);
}
#calGrid .day[data-has="1"]:not(.disabled) .num{
  color:#065f46;
  font-weight:800;
}
#calGrid .day[data-has="1"]:not(.disabled):hover{
  background: rgba(34,197,94,.16);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.35);
}
#calGrid .day.selected[data-has="1"]{
  background: rgba(34,197,94,.22);
  box-shadow: inset 0 0 0 2px rgba(34,197,94,.45);
  outline:none;
}

.card.calendar-collapsed{ cursor:pointer }
.card.calendar-collapsed .cal-header{ margin-bottom:0 }
.card.calendar-collapsed .cal-header .btn{ display:none }
.card.calendar-collapsed .cal-grid,
.card.calendar-collapsed .muted{ display:none }

.cal-compact--tight .cal-header{
  padding:6px 10px;
  gap:6px;
  min-height:30px;
}
.cal-compact--tight #monthLabel{
  font-size:13px;
  font-weight:800;
}
.cal-compact--tight #prevMonth,
.cal-compact--tight #nextMonth{
  width:26px;
  height:26px;
  padding:0;
  border-radius:6px;
  line-height:26px;
}
.cal-compact--tight #calGrid{
  gap:6px;
  padding:0 10px;
}
.cal-compact--tight #calGrid .dow{
  height:16px;
  line-height:16px;
  font-size:11px;
  letter-spacing:.2px;
  color:var(--muted);
  text-transform:uppercase;
  text-align:center;
  padding:0;
}
.cal-compact--tight #calGrid .pad,
.cal-compact--tight #calGrid .day{
  height:34px;
  min-height:34px;
}
.cal-compact--tight #calGrid .day{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
}
.cal-compact--tight #calGrid .day .num{
  font-size:12px;
  font-weight:800;
  line-height:1;
  padding:0 2px;
}
.cal-compact--tight #calGrid .day.selected{
  outline:2px solid rgba(244,204,69,.55);
  outline-offset:-2px;
  border-color:rgba(244,204,69,.55);
}
.cal-compact--tight #calGrid .day[data-has="1"]:not(.disabled){
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.40);
}
.cal-compact--tight #calGrid .day.selected[data-has="1"]{
  background: rgba(34,197,94,.22);
  box-shadow: inset 0 0 0 2px rgba(34,197,94,.45);
  outline:none;
}

.tabrow{
  position:relative;
  display:grid;
  grid-template-columns:36px 1fr 36px;
  align-items:center;
  gap:6px;
  margin-bottom:10px;
  padding-left: 0px;
}

.tabrow.no-left{ grid-template-columns:1fr 36px }
.tabrow.no-left .tabrow-arrow.left{ display:none }
.tabrow.no-right{ grid-template-columns:36px 1fr }
.tabrow.no-right .tabrow-arrow.right{ display:none }
.tabrow.no-left.no-right{ grid-template-columns:1fr }

.tabrow-arrow{
  height:30px;
  width:36px;
  background:transparent;
  color:#4b5563;
  border:0;
  cursor:pointer;
  display:grid;
  place-items:center;
  opacity:.55;
  transition:opacity .15s ease;
}
.tabrow-arrow[disabled]{
  opacity:.3;
  cursor:not-allowed;
}

.filter-bar{
  position:relative;
  display:flex;
  margin-left: 0px;
  gap:16px;
  white-space:nowrap;
  padding-left: 7px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
  width:100%;
  max-width:100%;
  flex:1;
}

.filter-bar .underline{
  display:none !important;
}

.filter-bar .pill-highlight{
  position:absolute;
  top:4px;
  bottom:6px;
  background:#22c55e;
  transform:skewX(var(--skew-deg));
  z-index:0;
  opacity:0;
  pointer-events:none;
  transition:
    left .23s ease,
    width .23s ease,
    opacity .18s ease;
}

.filter-bar::-webkit-scrollbar{ display:none }

.pill{
  position:relative;
  z-index:1;
  padding:8px 12px;
  background:none;
  border:none;
  color:#111827;
  font-weight:600;
  cursor:pointer;
  border-radius:6px;
}

.pill:focus-visible{
  outline:2px solid rgba(59,130,246,.35);
  outline-offset:2px;
}

.pill.active{
  color:white;
}

.pill::before{
  content:"";
  position:absolute;
  inset:0;
  background:#002244;
  transform:skewX(var(--skew-deg)) scale(0.98);
  z-index:-1;
  opacity:0;
  transition:
    opacity .18s ease,
    transform .18s ease,
    background .18s ease;
}

.pill.active::before{
  opacity:1;
  transform:skewX(var(--skew-deg)) scale(1.03);
}

.tools{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
  flex-wrap:wrap;
  margin-left: 10px;
  margin-right: 10px;
}
input[type="search"]{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  color:#111827;
}
.list{
  display:grid;
  gap:12px;
  margin-left: 10px;
  margin-right: 10px;
  padding-bottom: 80px;
}

.match{
  border-radius:10px;
  background:#ffffff;
  border:1px solid var(--line);
  padding:10px 12px;
  transition: box-shadow .2s ease, transform .05s ease, border-color .2s ease;
  color:inherit;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
}
.match:hover{
  border-color:rgba(0,0,0,.16);
}
.meta{
  font-size:12px;
  color:var(--muted);
}
.empty{
  padding:30px;
  text-align:center;
  color:var(--muted);
}

.sb-tabbar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:9997;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  align-items:center;
  gap:0;
  height:64px;
  padding-bottom:env(safe-area-inset-bottom);
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(10px);
  border-top:1px solid var(--line);
}
.sb-tab{
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  color:#4b5563;
  text-decoration:none;
}
.sb-tab svg{
  width:26px;
  height:26px;
  opacity:.95;
}
.sb-tab.active{
  color:#111827;
  font-weight:600;
}
.sb-tab:active{
  transform:translateY(1px);
}

#loadingOverlay{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  z-index:9998;
  opacity:0;
  pointer-events:none;
  transition:opacity .32s ease;
  background:
    radial-gradient(120% 80% at 50% 20%, rgba(34,197,94,.10), rgba(34,197,94,0) 45%),
    rgba(255,255,255,.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.loader{
  width:64px;
  aspect-ratio:1;
  position:relative;
  border-radius:50%;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.85), rgba(255,255,255,0) 40%),
    linear-gradient(135deg, rgba(34,197,94,.55), rgba(34,197,94,.28));
  border:1px solid rgba(0,0,0,.08);
  box-shadow:
    inset 0 2px 14px rgba(255,255,255,.6),
    0 10px 30px rgba(34,197,94,.25),
    0 0 0 1px rgba(0,0,0,.06);
  animation: blob-morph 3s linear infinite, blob-float 2.8s ease-in-out infinite alternate;
}
.loader::before,
.loader::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
}
.loader::before{
  inset:6%;
  background: radial-gradient(80% 80% at 30% 20%, rgba(255,255,255,.75), rgba(255,255,255,0) 55%);
  mix-blend-mode: screen;
  filter: blur(2px);
}
.loader::after{
  background: conic-gradient(from 200deg at 70% 25%, rgba(0,0,0,.15), rgba(0,0,0,0) 60%);
  opacity:.35;
  filter: blur(4px);
}
@keyframes blob-morph{
  12.5% {border-radius: 37% 63% 70% 30% / 30% 62% 38% 70%}
  25%   {border-radius: 50% 50% 70% 30% / 52% 62% 38% 48%}
  37.5% {border-radius: 33% 67% 18% 82% / 52% 75% 25% 48%}
  50%   {border-radius: 73% 27% 18% 82% / 52% 32% 68% 48%}
  62.5% {border-radius: 73% 27% 74% 26% / 64% 32% 68% 36%}
  75%   {border-radius: 84% 16% 15% 85% / 55% 79% 21% 45%}
  87.5% {border-radius: 12% 88% 69% 31% / 10% 66% 34% 90%}
}
@keyframes blob-float{
  from{ transform: translateY(-4px) }
  to{   transform: translateY(6px)  }
}

.sr-only{
  position:absolute!important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

@media (max-width:980px){
  .grid{ grid-template-columns:1fr }
}
@media (prefers-reduced-motion: reduce){
  .loader{ animation:none }
  #loadingOverlay{ transition:none }
}


#dateRail::-webkit-scrollbar{ display:none; }

.date-rail{
  position: relative;
  display: block;
  left: 50%;
  width: 100dvw;
  margin-left: -50dvw;
  margin-right: -50dvw;
  right: auto;
  padding-left: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  border-radius: 0;
}
#dateRail{
  display:flex;
  gap:8px;
  overflow-x:auto; 
  overflow-y:hidden;
  padding:8px 10px;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;
  scrollbar-width:none;
}
#dateRail::-webkit-scrollbar{ display:none; }

.dr-day{
  flex:0 0 auto;
  width:64px;
  padding:8px 6px;
  border-radius:10px;
  background:#ffffff;
  border:1px solid var(--line);
  text-align:center;
  scroll-snap-align:start;
  cursor:pointer;
}

.dr-weekday{
  font-size:11px;
  color:var(--muted);
}
.dr-daynum{
  font-weight:800;
  font-size:14px;
  line-height:1.1;
  color:#111827;
}
.dr-dot{
  width:6px;
  height:6px;
  margin:6px auto 0;
  border-radius:50%;
  background:transparent;
}
.dr-day[data-has="1"] .dr-dot{
  background:var(--accent);
}

.dr-day[aria-selected="true"]{
  outline:2px solid rgba(59,130,246,.35);
  outline-offset:-2px;
  border-color:rgba(59,130,246,.45);
  background:#f3f8ff;
}

.card.calendar-collapsed #dateRailWrap{ display:block }

.grid > *,
.card,
.card .content{
  margin-left: 0px;
  margin-right: 0px;
  padding-bottom: 0px;
  min-width:0;
}

#categoryBar{
  width:100%;
  max-width:100%;
  margin-left: 0px;
  margin-right: 5px;
  flex:1;
  justify-content:space-between;
}

#categoryBar .pill{
  flex:1 1 0;
  min-width:0;
  text-align:center;
}

.card:not(.calendar-collapsed) #dateRailWrap {
  display: none !important;
}

#popupOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#popupOverlay.open {
  display: flex;
}

.popup-shell {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  width: min(480px, 94vw);
  max-height: 90vh;

  overflow: hidden;
}

.popup-body {
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.no-scroll {
  overflow: hidden !important;
  height: 100%;
  touch-action: none;
}
