/* Сайт «В суете»: ярко, крупно, удобно пальцем. Ширина от 360 px. */
:root {
  --sky: #4fc3ff;
  --sky-2: #c8f0ff;
  --grass: #3fb950;
  --grass-dark: #2a8a3a;
  --sun: #ffd23f;
  --orange: #ff8a1f;
  --berry: #ff4f79;
  --violet: #7b61ff;
  --ink: #1b2a4a;
  --ink-soft: #4a5878;
  --paper: #ffffff;
  --line: #d9e6f5;
  --bg: #eef9ff;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(27, 42, 74, 0.12), 0 12px 28px rgba(27, 42, 74, 0.12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: #0b6bcb; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 7vw, 60px); font-weight: 900; }
h2 { font-size: clamp(28px, 5vw, 40px); font-weight: 900; }
h3 { font-size: 23px; font-weight: 800; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */
.top {
  background: var(--paper);
  box-shadow: 0 3px 0 var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 26px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.logo img { width: 44px; height: 44px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
}
.nav a:hover { background: var(--sky-2); }
.nav a[aria-current="page"] { background: var(--sun); }
.nav a.is-user { background: var(--grass); color: #fff; }
.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #e8fbe9;
  color: var(--grass-dark);
  font-weight: 800;
  font-size: 16px;
}
.online-pill::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--grass);
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.25);
}
@media (max-width: 640px) {
  .top { position: static; }
  .logo { font-size: 22px; }
  .logo img { width: 38px; height: 38px; }
  .nav { width: 100%; }
  .nav a { flex: 1 1 auto; justify-content: center; padding: 0 10px; font-size: 17px; }
  .online-pill { font-size: 15px; }
}

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  font-size: 21px;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  background: var(--sun);
  box-shadow: 0 5px 0 #d9a800;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #d9a800; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.green { background: var(--grass); color: #fff; box-shadow: 0 5px 0 var(--grass-dark); }
.btn.green:active { box-shadow: 0 1px 0 var(--grass-dark); }
.btn.white { background: #fff; box-shadow: 0 5px 0 var(--line); }
.btn.white:active { box-shadow: 0 1px 0 var(--line); }
.btn.small { min-height: 48px; font-size: 18px; padding: 0 20px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 800; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-soft); font-size: 16px; margin-top: 4px; }
input[type="text"], input[type="password"], input[type="search"] {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 3px solid var(--line);
  border-radius: 16px;
  font: inherit;
  font-size: 20px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
input:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(79, 195, 255, 0.25); }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
@media (max-width: 480px) { .card { padding: 20px 16px; } }

.notice {
  border-radius: 18px;
  padding: 16px 20px;
  font-weight: 700;
  margin-bottom: 18px;
}
.notice.error { background: #ffe3ea; color: #a3123a; }
.notice.ok { background: #e3f9e5; color: #1d6b2a; }
.notice.down { background: #fff4d1; color: #7a5600; }

/* ---------- главная ---------- */
.hero {
  position: relative;
  color: #fff;
  background: #2a7fc0 center / cover no-repeat;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 40, 90, 0.82) 0%, rgba(10, 40, 90, 0.55) 55%, rgba(10, 40, 90, 0.1) 100%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 70px; padding-bottom: 80px; }
.hero h1 { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); max-width: 14em; }
.hero .lead { font-size: clamp(20px, 3vw, 25px); font-weight: 700; max-width: 30em; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 640px) {
  .hero .wrap { padding-top: 44px; padding-bottom: 50px; }
  .hero::after { background: rgba(10, 40, 90, 0.68); }
  .hero .actions .btn { flex: 1 1 100%; }
}

.section { padding: 56px 0; }
.section.alt { background: #fff; }
.section > .wrap > p.sub { font-size: 21px; color: var(--ink-soft); max-width: 40em; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 26px;
}
.feature {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.section.alt .feature { background: var(--bg); }
.feature img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--sky-2); }
.feature .body { padding: 18px 20px 22px; }
.feature h3 { display: flex; align-items: center; gap: 10px; }
.feature .tag {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--sun);
}
.feature p { margin: 0; color: var(--ink-soft); font-size: 18px; }

.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 22px; }
.city {
  border-radius: 18px;
  padding: 16px 18px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}
.city b { display: block; font-size: 22px; font-weight: 900; }
.city:nth-child(1) { background: var(--violet); }
.city:nth-child(2) { background: #1a9be0; }
.city:nth-child(3) { background: #8d6e63; }
.city:nth-child(4) { background: var(--orange); }
.city:nth-child(5) { background: var(--grass); }

.jobs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 0; list-style: none; }
.jobs li {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 24px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 18px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; box-shadow: var(--shadow); background: var(--sky-2); }
.gallery figcaption { font-weight: 700; font-size: 17px; padding: 8px 4px 0; color: var(--ink-soft); }

.download {
  background: linear-gradient(135deg, var(--violet), #3aa0ff);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: var(--shadow);
}
.download .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }

.netplay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 800px) { .netplay { grid-template-columns: 1fr; } }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { counter-increment: st; position: relative; padding: 8px 0 8px 58px; font-weight: 700; min-height: 48px; }
.steps li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 4px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--berry);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
}

/* ---------- формы входа ---------- */
.auth { max-width: 520px; margin: 40px auto; }
.auth .switch { text-align: center; margin-top: 18px; font-weight: 700; }
.auth .btn { width: 100%; }

/* ---------- профиль ---------- */
.profile { display: grid; grid-template-columns: 300px 1fr; gap: 24px; margin: 32px 0 50px; align-items: start; }
@media (max-width: 860px) { .profile { grid-template-columns: 1fr; } }
.avatar-card { text-align: center; }
.figure { width: 150px; height: 240px; margin: 0 auto 10px; display: block; }
.avatar-card .name { font-size: 28px; font-weight: 900; word-break: break-word; }
.avatar-card .login { color: var(--ink-soft); font-weight: 700; }
.stat { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 2px solid var(--line); font-weight: 700; text-align: left; }
.stat b { font-weight: 900; }
.profile .card + .card { margin-top: 24px; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 6px; }
.swatch {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--line);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--ink); }
.swatch.custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  position: relative;
  overflow: hidden;
}
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  border: 3px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}
.choice button[aria-pressed="true"] { border-color: var(--ink); background: var(--sun); }
.group { margin-bottom: 22px; }
.group > .label { font-weight: 800; margin-bottom: 4px; }

/* ---------- сетевые игры ---------- */
.games-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; justify-content: space-between; margin: 32px 0 18px; }
.games-head h1 { margin: 0; }
.totals { display: flex; flex-wrap: wrap; gap: 10px; }
.totals span { background: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 800; box-shadow: 0 3px 0 var(--line); }
.search { position: relative; margin-bottom: 18px; }
.search input { padding-left: 54px; }
.search::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5878' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='7'/%3E%3Cpath d='M15.5 15.5 22 22'/%3E%3C/svg%3E");
}
.rooms { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.room {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: 0 4px 0 var(--line);
  text-decoration: none;
  color: var(--ink);
  min-height: 76px;
}
.room:hover { box-shadow: 0 4px 0 var(--sky); }
.room.main { background: linear-gradient(90deg, #fff6cf, #fff); box-shadow: 0 4px 0 #f2cf55; }
.room .icon {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--sky-2);
}
.room.main .icon { background: var(--sun); }
.room .info { flex: 1; min-width: 0; }
.room .title { display: block; font-weight: 900; font-size: 21px; overflow-wrap: anywhere; }
.room .meta { display: block; color: var(--ink-soft); font-size: 16px; font-weight: 700; }
.room .count { flex: none; text-align: right; font-weight: 900; font-size: 22px; white-space: nowrap; }
.room .count small { display: block; font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.room .lock { font-size: 22px; flex: none; }
.empty { text-align: center; padding: 40px 10px; font-weight: 700; color: var(--ink-soft); }
.updated { color: var(--ink-soft); font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 40px; }
.players { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.players li { background: var(--bg); border-radius: 18px; padding: 10px; text-align: center; font-weight: 800; overflow-wrap: anywhere; }
.players .figure { width: 70px; height: 112px; margin-bottom: 4px; }

/* ---------- подвал ---------- */
.foot {
  background: var(--ink);
  color: #c9d6ef;
  padding: 26px 0 calc(26px + env(safe-area-inset-bottom));
  font-size: 16px;
}
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.foot a { color: #fff; font-weight: 700; }
