*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 1rem;
  transition: background .3s;
}
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 520px;
  width: 100%;
}
.top-bar {
  margin: -2rem -1.5rem 1rem;
  border-radius: 2rem 2rem 0 0;
  overflow: hidden;
}
.lang-switch { display: flex; }
.lang-switch button {
  flex: 1;
  font-size: 0;
  line-height: 1;
  background: none;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,.08);
  cursor: pointer;
  padding: .5rem 0;
  opacity: .35;
  transition: opacity .15s;
  filter: grayscale(.6);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 1.5rem;
}
.lang-switch button.active { opacity: 1; filter: none; }
.lang-switch button:hover { opacity: .7; filter: none; }
.container {
  background: #1a1a2e;
  border-radius: 2rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.8);
  text-align: center;
  width: 100%;
  position: relative;
}
h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #f0f0ff;
  margin-bottom: 1.5rem;
}
h2 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8888aa;
  margin: 1.2rem 0 .6rem;
  text-align: left;
}
.match-block {
  margin-bottom: .5rem;
  position: relative;
  cursor: pointer;
}
.next-block {
  margin-bottom: .5rem;
  position: relative;
  cursor: pointer;
}
.next-match {
  flex: 1;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a1a3e 100%);
  border: 1.5px solid #4f6ef7;
  border-radius: 1.2rem;
  padding: 1.2rem 1.2rem 1.5rem;
}
.next-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #4f6ef7;
  margin-bottom: .4rem;
}
.next-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f0f0ff;
  margin-bottom: .3rem;
}
.next-countdown {
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #6ee7b7;
  text-shadow: 0 0 40px rgba(110,231,183,.2);
  letter-spacing: .03em;
}
.next-time {
  font-size: .75rem;
  color: #8888aa;
  margin-top: .3rem;
}
.match-row {
  display: flex;
  gap: .3rem;
  align-items: stretch;
}
.event-btn {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  row-gap: .25rem;
  padding: .6rem .7rem .85rem;
  font-size: .85rem;
  background: #12121f;
  border: 1.5px solid #2a2a44;
  border-radius: .6rem;
  color: #ddd;
  cursor: default;
  text-align: right;
  transition: border-color .15s;
}
.event-btn:hover { border-color: #4f6ef7; }
.event-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.event-datetime {
  font-size: .75rem;
  color: #6ee7b7;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  text-align: right;
}
.event-datetime .cd { color: #fbbf24; }
.live-badge {
  font-size: .75rem;
  color: #fbbf24;
  background: rgba(251,191,36,.15);
  padding: .15rem .5rem;
  border-radius: .3rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.event-btn::after,
.next-match::after {
  font-size: .85rem;
  color: #555;
  text-align: center;
  transform: rotate(90deg);
  transition: transform .2s, color .2s;
  pointer-events: none;
}
.event-btn::after {
  content: '›';
  flex: 0 0 100%;
}
.next-match::after {
  content: '›';
  display: block;
}
.match-block:has(.broadcasts) .event-btn::after,
.next-block:has(.broadcasts) .next-match::after {
  transform: rotate(-90deg);
  color: #4f6ef7;
}
.match-block:hover .event-btn,
.next-block:hover .next-match {
  border-color: #6b8aff;
}
.broadcasts {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin-top: .2rem;
  padding: .3rem .5rem;
  background: #0d0d18;
  border: 1px solid #2a2a44;
  border-radius: .5rem;
}
.broadcasts a {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  padding: .15rem .3rem;
  color: #999;
  text-decoration: none;
  border-radius: .3rem;
  transition: background .15s;
}
.broadcasts a:hover { background: #1a1a2e; }
.broadcasts .bc-channel { font-weight: 600; color: #ccc; }
.broadcasts .bc-time { color: #6ee7b7; font-variant-numeric: tabular-nums; }
.loading {
  text-align: center;
  color: #666688;
  padding: 2rem;
  font-size: .85rem;
}
.error {
  text-align: center;
  color: #f87171;
  padding: 2rem;
  font-size: .85rem;
}
.empty {
  text-align: center;
  color: #666688;
  padding: 1rem;
  font-size: .8rem;
  font-style: italic;
}
.no-next {
  text-align: center;
  color: #666688;
  padding: 1.5rem;
  font-size: .8rem;
  font-style: italic;
  border: 1.5px dashed #2a2a44;
  border-radius: 1.2rem;
}
.wc-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1a3a1a, #1a1a2e);
  border: 1.5px solid #22c55e;
  border-radius: 1rem;
  color: #fff;
  text-decoration: none;
  transition: all .15s;
  text-align: left;
  line-height: 1.3;
}
.wc-link:hover { background: linear-gradient(135deg, #2a4a2a, #2a2a3e); border-color: #4f6ef7; transform: scale(1.02); }
.wc-link:active { transform: scale(.98); }
.wc-arrow {
  font-size: 1.3rem;
  flex-shrink: 0;
  color: #22c55e;
  transition: transform .15s;
}
.wc-link:hover .wc-arrow { transform: translateX(4px); }
.tz-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-bottom: .75rem;
  font-size: .75rem;
  color: #94a3b8;
}
.tz-current { color: #fbbf24; font-weight: 600; }
.filter-row { display: flex; justify-content: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.filter-btn {
  background: none;
  border: 1.5px solid #2a2a44;
  border-radius: 2rem;
  padding: .25rem .75rem;
  font-size: .75rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.fav-filter { color: #f87171; }
.fav-filter:hover { border-color: #f87171; background: rgba(248,113,113,.08); }
.fav-filter.active { background: rgba(248,113,113,.15); border-color: #f87171; }
.open-filter { color: #6ee7b7; }
.open-filter:hover { border-color: #6ee7b7; background: rgba(110,231,183,.08); }
.open-filter.active { background: rgba(110,231,183,.15); border-color: #6ee7b7; }
.fav-btn {
  position: absolute;
  top: -1.1rem;
  left: -1.1rem;
  width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  font-size: 2.2rem;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 50%;
  color: #f87171;
  cursor: pointer;
  transition: transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn:active { transform: scale(.9); }
.ver-badge {
  position: fixed;
  top: .3rem;
  right: .5rem;
  font-size: .5rem;
  color: #8888aa;
  opacity: .7;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  z-index: 999;
}
