:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #7a869a;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 20px rgba(16, 24, 40, .06);

  --blue: #1f66ff;
  /* верхняя панель как на макете */
  --blue-2: #0f56f0;
  --green: #18c964;
  --red: #ff3b30;

  --radius: 14px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  padding-bottom: 86px;
  /* место под нижнее меню */
}

/* top bar */
.topbar {
  background: var(--blue);
  color: #fff;
  padding: 18px 18px 16px;
}
.topbar__left{
  position: relative;
}
.topbar__left .hello {
  font-size: 14px;
  opacity: .9;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.icon-btn {
  border: 0;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  height: 32px;
  width: 32px;
  border-radius: 10px;
  cursor: pointer;
}

.topbar__right {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  font-weight: 700;
}

.pill__icon {
  opacity: .95;
}

.shop-btn {
  height: 38px;
  width: 38px;
  border-radius: 999px;
  border: 0;
  background: var(--green);
  color: #0b1220;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 8px 16px rgba(24, 201, 100, .25);
}

/* content */
.content {
  padding: 18px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.icon-btn--light{
  background: rgba(0,0,0,.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

/* buttons */
.btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.btn--ghost {
  background: #fff;
}

.btn--primary {
  background: var(--green);
  border-color: transparent;
  color: #07130c;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* views */
.view {
  display: none;
}

.view--active {
  display: block;
}

/* match list */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match__left {
  min-width: 0;
}

.match__league {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.match__teams {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.vs {
  color: var(--muted);
  font-weight: 800;
}

.match__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.live {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 59, 48, .12);
  border: 1px solid rgba(255, 59, 48, .25);
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.time {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.chev {
  opacity: .55;
  font-size: 18px;
}

/* panel (leaders etc) */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel__title {
  font-size: 18px;
  font-weight: 900;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.emoji {
  font-size: 18px;
}

.leaders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leader {
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f6f9ff;
}

.leader:nth-child(2n) {
  background: #fff;
}

.leader__left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.medal {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border);
}

.leader__name {
  font-weight: 900;
}

.leader__sub {
  font-size: 12px;
  color: var(--muted);
}

.leader__score {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 900;
  color: var(--blue-2);
}

/* tasks */
.task {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.task__title {
  font-weight: 900;
  font-size: 16px;
}

.task__desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.task__progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.task__bar {
  height: 8px;
  border-radius: 999px;
  background: #e6ebf3;
  flex: 1;
  overflow: hidden;
}

.task__barFill {
  height: 100%;
  background: var(--blue);
  width: 0%;
}

.task__meta {
  color: var(--muted);
  font-size: 12px;
  min-width: 44px;
  text-align: right;
}

.task__reward {
  color: #f18a00;
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 10px;
}

.placeholder {
  color: var(--muted);
  padding: 12px;
}

/* bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 10px env(safe-area-inset-bottom);
  z-index: 50;
}

.nav-item {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 14px;
}

.nav-item--active {
  color: var(--blue);
  background: rgba(31, 102, 255, .10);
  border: 1px solid rgba(31, 102, 255, .18);
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 12px;
}


/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal--hidden {
  display: none;
}

.modal__sheet {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  overflow: hidden;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}

.modal__back {
  height: 34px;
  width: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.modal__title {
  font-weight: 900;
}

.modal__body {
  padding: 16px;
}

.modal__league {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.modal__teams {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 6px;
}

.modal__time {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.lock {
  background: rgba(255, 59, 48, .12);
  border: 1px solid rgba(255, 59, 48, .25);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  margin-bottom: 12px;
}

.lock--hidden {
  display: none;
}

.score {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #f6f9ff;
  margin-bottom: 12px;
}

.score__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}

.score__row+.score__row {
  border-top: 1px solid rgba(15, 23, 42, .08);
}

.score__team {
  font-weight: 900;
}

.score__input {
  width: 72px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .14);
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.btn--full {
  width: 100%;
}


/* контейнер табов */
.lb-tabs {
  display: inline-flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 4px;
  margin: 10px 0 14px;
}

/* кнопка */
.lb-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: #555;
  transition: background 0.15s ease, color 0.15s ease;
}

/* активная */
.lb-tab--active {
  background: #ffffff;
  color: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* hover */
.lb-tab:not(.lb-tab--active):hover {
  background: rgba(255, 255, 255, 0.5);
}


.leader__name {
  font-weight: 600;
}


.group-title{
  margin: 14px 2px 8px;
  font-weight: 900;
  font-size: 14px;
  color: var(--text);
}

.subgroup-title{
  margin: 10px 2px 8px;
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}

/* одинаковые размеры для команд и времени */
.match__teams--same .team,
.time--same{
  font-size: 14px;
  font-weight: 800;
}
.time--same{
  color: var(--text);
  opacity: .85;
}


/* ===== User menu ===== */

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.user-menu-btn:hover {
  background: rgba(255,255,255,0.15);
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 999;
}

.user-menu--hidden {
  display: none;
}

.user-menu__item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #111;
}

.user-menu__item:hover {
  background: #f2f4f7;
}

.user-menu__item--disabled {
  color: #999;
  cursor: default;
}

.user-menu__item--danger {
  color: #d92d20;
}

.user-menu__sep {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}

.user-menu-btn{
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 10px;
}
.user-menu-btn:hover{
  background: rgba(255,255,255,0.20);
}

.match__hint{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

.user-menu__profile{
  padding: 6px 8px;
}

.user-menu__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f7f9;
  margin-bottom: 6px;
}

.user-menu__label{
  font-size: 12px;
  color: #666;
}

.user-menu__value{
  font-size: 13px;
  font-weight: 700;
  color: #111;
}
.shop-item{
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  background:#fff;
  box-shadow: var(--shadow);
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.shop-item__title{ font-weight:900; }
.shop-item__desc{ color:var(--muted); font-size:12px; margin-top:4px; }
.shop-item__right{ text-align:right; }
.shop-item__price{ font-weight:900; color: var(--blue-2); }

.powerups{
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.03);
}

.powerups__title{
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}

.powerups__row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.chip{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.chip:disabled{
  opacity: .5;
  cursor: default;
}

.chip--active{
  border-color: var(--blue-2);
  box-shadow: 0 0 0 2px rgba(47,128,237,0.12);
}

.chip--shield.chip--active{
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22,163,74,0.12);
}

.match__powerups{
  margin-top: 6px;
  font-size: 12px;
  opacity: .8;
}