/* Мячом: стили. Минимализм: почти белый фон, тёмно-серый текст, акцент #FF6B00. */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #2a2a2a;
  --muted: #6e6e6e;
  --line: rgba(0, 0, 0, .09);
  --line-strong: rgba(0, 0, 0, .16);
  --accent: #ff6b00;
  --accent-hover: #ff7d1f;
  --accent-ink: #1a1a1a;      /* тёмный текст на оранжевом: контраст около 6:1 */
  --accent-soft: #fff1e6;
  --accent-text: #b84a00;     /* оранжевый текст на светлом фоне: контраст не ниже 4,5:1 */
  --ok: #1e6b3a;
  --ok-bg: #eaf6ee;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
svg { display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 249, .72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 19px; letter-spacing: -.02em; text-decoration: none;
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-size: 15px; font-weight: 500;
}
.nav-links a:hover { background: rgba(0, 0, 0, .05); color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .nav-links { display: none; } }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(0, 0, 0, .05); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--text);
}
.user-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: 46px; min-width: 230px; padding: 6px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.user-menu[hidden] { display: none; }
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0;
  background: transparent; border-radius: 8px; font: inherit; color: inherit;
  text-decoration: none; cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: #f3f3f2; }
.menu-head { padding: 10px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.menu-head strong { display: block; color: var(--text); font-size: 15px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.btn:hover { background: #f3f3f2; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.is-busy { opacity: .65; pointer-events: none; }
.link-btn {
  background: none; border: 0; padding: 6px 0; margin-right: 18px; color: var(--muted);
  font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.link-btn:disabled { text-decoration: none; cursor: default; }

/* ---------- Главная: заголовок и фильтры ---------- */
.hero { padding: 34px 0 18px; }
.hero h1 { font-size: clamp(32px, 6.4vw, 50px); letter-spacing: -.03em; font-weight: 700; }
.lead { color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); margin: 12px 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.pill-select {
  appearance: none; -webkit-appearance: none; width: auto;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236e6e6e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center;
  border: 1px solid var(--line-strong); border-radius: 999px; min-height: 38px;
  padding: 0 34px 0 14px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer;
}
.day-title { font-size: 14px; font-weight: 650; color: var(--muted); margin: 26px 0 10px; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.game-card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 6px 16px;
  padding: 16px 18px; margin-bottom: 12px; text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.game-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 10px 28px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.gc-time strong { display: block; font-size: 20px; letter-spacing: -.02em; }
.gc-time span { color: var(--muted); font-size: 14px; }
.gc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.gc-main h3 { font-size: 17px; font-weight: 650; margin: 8px 0 2px; }
.gc-main p { margin: 0; font-size: 14px; }
.gc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price { font-weight: 650; }
.seats {
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); white-space: nowrap;
}
.seats-full { background: #efefee; color: var(--muted); }
.tag { display: inline-block; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: #2a2a2a; color: #fff; }
.tag-quiet { background: #efefee; color: var(--text); font-weight: 600; }
@media (max-width: 560px) {
  .game-card { grid-template-columns: 56px 1fr; }
  .gc-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}

.skeleton {
  height: 96px; border-radius: var(--radius); margin-bottom: 12px;
  background: linear-gradient(90deg, #efefee 25%, #f6f6f5 37%, #efefee 63%);
  background-size: 400% 100%; animation: sk 1.3s infinite;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.empty .btn { margin-top: 8px; }

.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15; box-shadow: 0 8px 24px rgba(255, 107, 0, .35); }
.fab:active { transform: translateX(-50%) scale(.98); }
@media (min-width: 641px) { .fab { display: none; } }

/* ---------- Страница игры ---------- */
.back { display: inline-block; margin: 20px 0 6px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.game h1 { font-size: clamp(26px, 5vw, 34px); letter-spacing: -.02em; margin: 12px 0 4px; }
.facts { margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.fact { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fact dt { color: var(--muted); font-size: 14px; }
.fact dd { margin: 0; font-weight: 500; }
.about h2 { font-size: 16px; margin: 20px 0 6px; }
.about p { white-space: pre-line; }
.banner { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin: 14px 0; }
.banner-off { background: #f0f0ef; color: var(--muted); }
.banner-ok { background: var(--ok-bg); color: var(--ok); }
.banner-wait { background: var(--accent-soft); color: var(--accent-text); }
.action-box {
  margin: 20px 0 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, .82); display: flex; flex-direction: column; gap: 12px;
}
.action-box:empty { display: none; }
.ab-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-box { background: var(--ok-bg); border-radius: 12px; padding: 12px 14px; }
.contact-box a { color: var(--ok); font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.game-links { margin-top: 8px; }
@media (max-width: 720px) {
  .action-box { position: sticky; bottom: 12px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
}
@media (max-width: 480px) { .fact { grid-template-columns: 92px 1fr; } }

/* ---------- Формы ---------- */
.page-title { font-size: 28px; letter-spacing: -.02em; margin: 26px 0 6px; }
.form { padding: 22px; margin: 18px 0 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; font-weight: 600; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 0, .18); }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.row-date { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 560px) {
  .row-date { grid-template-columns: 1fr 1fr; }
  .row-date > :first-child { grid-column: 1 / -1; }
}
.form-error { color: var(--danger); font-size: 14px; margin: 0 0 10px; }
.form-error:empty { display: none; }

/* ---------- Окна ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 20, .28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 20px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.modal h2 { font-size: 21px; margin: 0 28px 6px 0; }
.modal form { margin-top: 14px; }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%;
}
.modal-x:hover { background: rgba(0, 0, 0, .05); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.auth-links { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: #2a2a2a; color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Кабинет и уведомления ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #efefee; border-radius: 999px; width: fit-content; margin: 14px 0 18px; }
.tab { padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.list-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 10px; text-decoration: none; }
.status { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-wait { background: var(--accent-soft); color: var(--accent-text); }
.status-off { background: #efefee; color: var(--muted); }
.org-card { padding: 16px 18px; margin-bottom: 14px; }
.org-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.org-head a { font-weight: 650; font-size: 17px; text-decoration: none; }
.req-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.req-row + .req-row { margin-top: 0; }
.req-info { min-width: 0; }
.req-info p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.req-actions { display: flex; gap: 8px; }
.org-foot { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.notif-list { overflow: hidden; }
.notif { display: block; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; }
.notif:first-child { border-top: 0; }
.notif.unread { background: var(--accent-soft); }
.notif small { display: block; margin-top: 2px; color: var(--muted); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

footer { margin-top: 48px; padding-bottom: 96px; color: var(--muted); font-size: 13px; }
