:root {
  color-scheme: dark;
  --bg: #090817;
  --panel: rgba(15, 20, 39, 0.86);
  --card: rgba(20, 29, 53, 0.9);
  --card-hover: rgba(29, 42, 73, 0.96);
  --text: #f6f8ff;
  --muted: #c7d7ec;
  --cyan: #31c6ff;
  --violet: #ad45ff;
  --pink: #f058e8;
  --gold: #ffd35a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(26, 116, 255, 0.28), transparent 32%),
    radial-gradient(circle at 82% 24%, rgba(174, 39, 255, 0.28), transparent 30%),
    var(--bg);
}

button, a { font: inherit; }

button:focus-visible, a:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.home-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(480px, 0.95fr);
  overflow: hidden;
}

.artwork {
  position: relative;
  min-height: 100%;
  background: #111126 url("../assets/app-home-bg.png") center center / cover no-repeat;
  box-shadow: 28px 0 80px rgba(0, 0, 0, 0.5);
}

.artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 72%, var(--bg));
  pointer-events: none;
}

.artwork-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(1, 3, 16, 0.02), rgba(1, 3, 16, 0.18));
}

.web-badge {
  position: absolute;
  z-index: 1;
  left: 28px;
  bottom: 24px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(98, 232, 255, 0.45);
  border-radius: 11px;
  background: rgba(4, 11, 27, 0.76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.web-badge span, .menu-header h1 span { color: var(--cyan); }

.menu-panel {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(680px, 100%);
  padding: clamp(28px, 5vw, 72px);
}

.menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.menu-header h1 {
  margin: 0;
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.welcome {
  max-width: 420px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.settings-button {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: white;
  background: rgba(11, 17, 34, 0.72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-size: 1.3rem;
  transition: transform 160ms ease, background 160ms ease;
}

.settings-button:hover { transform: rotate(25deg); background: rgba(33, 44, 74, 0.92); }

.main-menu { display: grid; gap: 14px; }

.menu-card {
  min-height: 92px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 19px;
  color: var(--text);
  background: var(--card);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.22);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.menu-card:hover {
  transform: translateX(-5px);
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--card-hover);
}

.menu-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #3bd5ff, #1698ff);
  box-shadow: 0 10px 20px rgba(18, 160, 255, 0.22);
  font-size: 2rem;
  font-weight: 900;
}

.violet .menu-icon { background: linear-gradient(145deg, #c241ff, #793cff); }
.news-icon { font-size: 1.75rem; }
.shop-icon { font-size: 1.55rem; }
.players-icon { font-size: 2.1rem; }

.menu-copy { min-width: 0; }
.menu-copy strong { display: block; font-size: 1.22rem; }
.menu-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 0.82rem; }

.chevron {
  color: var(--cyan);
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1;
}

.violet .chevron { color: #cd8aff; }
.gold-arrow .chevron { color: var(--gold); }

.status-message {
  min-height: 20px;
  margin: 18px 0 0;
  color: #a8ebff;
  text-align: center;
  font-size: 0.8rem;
}

.settings-popover {
  position: absolute;
  top: 118px;
  right: 42px;
  z-index: 5;
  width: 240px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(10, 15, 31, 0.97);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.settings-popover p { margin: 0 0 10px; font-weight: 850; }
.settings-popover button, .settings-popover a {
  width: 100%;
  padding: 11px 10px;
  display: block;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.settings-popover button:hover, .settings-popover a:hover { color: white; background: rgba(255, 255, 255, 0.08); }

.ios-notifications-dialog,
.notification-settings-dialog {
  width: min(calc(100% - 32px), 430px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 26px 22px 22px;
  overflow: auto;
  border: 1px solid rgba(82, 217, 255, 0.48);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(155deg, #17132b 0%, #0b1020 68%, #091827 100%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 38px rgba(60, 202, 255, 0.13);
  text-align: center;
}

.ios-notifications-dialog::backdrop,
.notification-settings-dialog::backdrop {
  background: rgba(3, 5, 14, 0.82);
  backdrop-filter: blur(8px);
}

.ios-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: white;
  background: rgba(13, 18, 34, 0.88);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.ios-dialog-brand {
  position: relative;
  width: 104px;
  margin: 0 auto 14px;
}

.ios-dialog-brand img {
  width: 88px;
  height: 88px;
  display: block;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.ios-dialog-brand span {
  position: absolute;
  right: 0;
  bottom: -4px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 2px solid #0d1322;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cyan), #8e4cff);
  font-size: 1.15rem;
}

.ios-notifications-dialog h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.ios-dialog-intro {
  margin: 9px auto 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.ios-notification-steps {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
  text-align: left;
}

.ios-notification-steps li {
  min-height: 60px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.ios-notification-steps li > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #061019;
  background: var(--cyan);
  font-weight: 900;
}

.ios-notification-steps p { margin: 0; color: #e8eef8; font-size: 0.88rem; line-height: 1.35; }
.ios-dialog-note { margin: 14px 4px 18px; color: #9fdff2; font-size: 0.78rem; line-height: 1.4; }

.ios-dialog-actions { display: block; }
.ios-dialog-actions button { min-height: 48px; padding: 10px; border-radius: 13px; font-weight: 850; cursor: pointer; }
.ios-primary-button { width: 100%; border: 1px solid var(--cyan); color: #061019; background: linear-gradient(135deg, var(--cyan), #8e6bff); }

.android-install-banner {
  position: fixed;
  z-index: 90;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  width: min(560px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 42px 12px 12px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(82, 217, 255, 0.58);
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(24, 26, 48, 0.98), rgba(7, 17, 31, 0.98));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62), 0 0 30px rgba(82, 217, 255, 0.12);
  backdrop-filter: blur(18px);
}
.android-install-banner[hidden] { display: none; }
.android-banner-logo { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; }
.android-banner-copy { min-width: 0; text-align: left; }
.android-banner-copy span { display: block; color: var(--cyan); font-size: 0.58rem; font-weight: 900; letter-spacing: 0.13em; }
.android-banner-copy strong { display: block; margin-top: 2px; font-size: 0.94rem; line-height: 1.12; }
.android-banner-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.68rem; line-height: 1.25; }
.android-store-button {
  min-height: 40px;
  padding: 8px 13px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 217, 255, 0.72);
  border-radius: 14px;
  color: #061019;
  background: linear-gradient(135deg, var(--cyan), #8e6bff);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}
.android-store-button:hover { filter: brightness(1.08); }
.android-store-button:focus-visible { outline: 3px solid rgba(82, 217, 255, 0.42); outline-offset: 3px; }
.android-banner-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #d9e3f1;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.android-banner-close:hover { color: white; background: rgba(255, 255, 255, 0.13); }

.notification-settings-dialog {
  text-align: left;
}

.notification-dialog-heading {
  padding-right: 42px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.notification-dialog-heading .kicker {
  margin: 0 0 3px;
  color: var(--cyan);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.notification-dialog-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.notification-bell {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 217, 255, 0.4);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(57, 213, 255, 0.22), rgba(142, 76, 255, 0.24));
  font-size: 1.45rem;
}

.notification-dialog-intro {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.notification-options {
  display: grid;
  gap: 10px;
}

.notification-option {
  min-height: 76px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.notification-option > span { flex: 1; min-width: 0; }
.notification-option strong { display: block; color: var(--text); font-size: 0.95rem; }
.notification-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }

.notification-option input {
  width: 48px;
  height: 27px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  background: #252b3d;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.notification-option input::before {
  content: "";
  width: 21px;
  height: 21px;
  display: block;
  margin: 2px;
  border-radius: 50%;
  background: #dce3ef;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease;
}

.notification-option input:checked {
  border-color: var(--cyan);
  background: linear-gradient(135deg, #28cdea, #8068ff);
}

.notification-option input:checked::before { transform: translateX(21px); background: white; }
.notification-option input:disabled { cursor: wait; opacity: 0.65; }

.notification-state {
  min-height: 20px;
  margin: 13px 2px;
  color: #9fdff2;
  font-size: 0.78rem;
  line-height: 1.4;
}

.notification-done {
  min-height: 48px;
  border-radius: 13px;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 900px) {
  .home-shell { display: block; position: relative; }
  .artwork { position: fixed; inset: 0; background-position: center top; }
  .artwork::after { background: linear-gradient(180deg, rgba(4, 7, 20, 0.03) 22%, rgba(4, 7, 20, 0.34) 44%, rgba(4, 7, 20, 0.74) 100%); }
  .web-badge { top: max(18px, env(safe-area-inset-top)); bottom: auto; }
  .menu-panel {
    min-height: 100vh;
    min-height: 100dvh;
    width: min(620px, 100%);
    margin: 0 auto;
    padding: clamp(220px, 32vh, 340px) 24px max(28px, env(safe-area-inset-bottom));
  }
  .menu-header { margin-bottom: 18px; }
  .menu-header h1, .menu-header .kicker, .menu-header .welcome { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .settings-button { position: fixed; top: max(18px, env(safe-area-inset-top)); right: 18px; z-index: 4; }
  .settings-popover { position: fixed; top: 78px; right: 18px; }
}

@media (min-width: 700px) and (max-width: 900px) {
  .menu-panel {
    width: min(820px, 100%);
    padding: clamp(260px, 34vh, 360px) 34px 34px;
  }
  .main-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .menu-card {
    min-height: 108px;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding: 16px;
  }
  .menu-card:hover { transform: translateY(-3px); }
}

@media (min-width: 901px) and (max-height: 720px) {
  .menu-panel { padding-top: 26px; padding-bottom: 26px; }
  .menu-header { margin-bottom: 16px; }
  .welcome { display: none; }
  .main-menu { gap: 10px; }
  .menu-card { min-height: 76px; padding-top: 10px; padding-bottom: 10px; }
  .menu-icon { width: 52px; height: 52px; }
}

@media (max-width: 520px) {
  .menu-panel { padding-left: 18px; padding-right: 18px; }
  .menu-card { min-height: 82px; padding: 12px 14px; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 13px; border-radius: 17px; }
  .menu-icon { width: 54px; height: 54px; border-radius: 15px; }
  .menu-copy strong { font-size: 1.08rem; }
  .menu-copy small { font-size: 0.75rem; line-height: 1.3; }
  .ios-notifications-dialog, .notification-settings-dialog { padding: 22px 16px 16px; border-radius: 21px; }
  .android-install-banner { bottom: max(9px, env(safe-area-inset-bottom)); width: calc(100% - 18px); padding-left: 9px; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 9px; border-radius: 16px; }
  .android-banner-logo { width: 48px; height: 48px; border-radius: 12px; }
  .android-banner-copy strong { font-size: 0.86rem; }
  .android-banner-copy small { font-size: 0.62rem; }
  .android-store-button { min-height: 38px; padding: 7px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
