:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #edf2f7; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #0f172a; color: #fff; padding: 0.2rem 0.5rem; border-radius: 8px; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--bg); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; }
.brand { font-weight: 800; color: #fff; font-size: 1.15rem; }
.main-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.main-nav a { color: rgba(255,255,255,.92); }
.page { padding: 28px 0 48px; }
.site-footer { padding: 28px 0 40px; color: var(--muted); font-size: .95rem; }
.hero { display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 24px; align-items: stretch; }
.badge { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: rgba(37,99,235,.12); color: var(--primary); font-weight: 700; font-size: .85rem; margin-bottom: 14px; }
h1, h2, h3 { margin: 0 0 14px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.lead { font-size: 1.05rem; line-height: 1.65; color: #334155; max-width: 720px; }
.card { background: var(--panel); border: 1px solid rgba(148, 163, 184, .16); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature-card { background: linear-gradient(180deg, #fff, #f8fbff); }
.grid { display: grid; gap: 24px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-24 { margin-top: 24px; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.actions-row.compact { gap: 8px; }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 12px; padding: 11px 15px; cursor: pointer; font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }
.check-list { margin: 0; padding-left: 18px; line-height: 1.8; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 220px); }
.form-card { width: min(540px, 100%); }
label { display: block; margin-bottom: 16px; font-weight: 600; }
input, select { width: 100%; margin-top: 8px; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; font-size: 1rem; background: #fff; }
input:focus, select:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: var(--primary); }
.field-error { border-color: var(--danger) !important; }
.flash { margin-bottom: 20px; padding: 13px 16px; border-radius: 12px; font-weight: 600; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.dashboard-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.stack-list { display: grid; gap: 12px; }
.list-item { display: flex; gap: 16px; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: .88rem; font-weight: 700; }
.stat-card { display: grid; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); color: var(--text); }
.stat-card strong { font-size: 2rem; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.status-grid div { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: 24px; }
.game-board-wrap { display: flex; justify-content: center; width: 100%; }
.board-shell { width: min(100%, 720px); flex: 0 1 720px; aspect-ratio: 1 / 1; }
.chessboard { width: 100%; height: 100%; display: grid; touch-action: none; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); border-radius: 20px; overflow: hidden; border: 6px solid #0f172a; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16); background: #0f172a; }
.square { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; border: none; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; cursor: pointer; user-select: none; overflow: hidden; -webkit-appearance: none; appearance: none; border-radius: 0; line-height: 0; touch-action: manipulation; }
.square > * { pointer-events: none; }
.square.light { background: #f0d9b5; }
.square.dark { background: #b58863; }
.square.selected { outline: 4px solid rgba(37,99,235,.8); outline-offset: -4px; z-index: 2; }
.square.highlight::after { content: ''; position: absolute; width: 22%; height: 22%; border-radius: 50%; background: rgba(37,99,235,.38); }
.piece { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 2; }
.piece-svg { width: 84%; height: 84%; display: block; filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.18)); }
.axis-label { position: absolute; font-size: .72rem; font-weight: 700; color: rgba(15,23,42,.65); line-height: 1; }
.axis-file { bottom: 4px; right: 6px; }
.axis-rank { top: 4px; left: 6px; }
.game-side-card { height: fit-content; }
.moves-list { max-height: 620px; overflow: auto; }
.moves-grid { display: grid; gap: 8px; }
.move-row { display: grid; grid-template-columns: 48px 1fr 1fr; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-soft); }
.move-no { color: var(--muted); font-weight: 700; }
.game-alert { display: none; margin: 16px 0; padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.game-alert.visible { display: block; }
.game-alert.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.game-alert.warning { background: #fff7ed; color: #b45309; border: 1px solid #fdba74; }
.game-alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.game-alert.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
@media (max-width: 980px) {
  .hero, .two-columns, .three-columns, .game-layout { grid-template-columns: 1fr; }
  .dashboard-head, .section-head { align-items: stretch; flex-direction: column; }
}
@media (max-width: 720px) {
  .container { width: min(100% - 20px, 1180px); }
  .page { padding-top: 18px; }
  .card { padding: 16px; border-radius: 16px; }
  .btn { width: 100%; min-height: 46px; }
  .list-item { flex-direction: column; align-items: stretch; }
  .status-grid { grid-template-columns: 1fr; }
  .board-shell { width: min(100vw - 32px, 620px); }
  .piece-svg { width: 82%; height: 82%; }
  .axis-label { font-size: .62rem; }
}


/* v3.2 board polish */
.game-board-card { overflow: hidden; }
.board-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .9rem; }
.legend-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; margin-right: 7px; }
.legend-last { background: rgba(251, 191, 36, .65); border: 1px solid rgba(180, 83, 9, .5); }
.legend-target { background: rgba(37,99,235,.22); border: 1px solid rgba(37,99,235,.45); }
.legend-capture { background: rgba(220,38,38,.16); border: 1px solid rgba(220,38,38,.4); }
.chessboard { aspect-ratio: 1 / 1; }
.square.last-from::before,
.square.last-to::before { content: ''; position: absolute; inset: 0; }
.square.last-from::before { background: rgba(251, 191, 36, .26); }
.square.last-to::before { background: rgba(251, 191, 36, .46); }
.square.capture-target::after { content: ''; position: absolute; inset: 16%; border-radius: 50%; border: 4px solid rgba(220,38,38,.55); background: rgba(220,38,38,.10); }
.square.highlight:not(.capture-target)::after { content: ''; position: absolute; width: 22%; height: 22%; border-radius: 50%; background: rgba(37,99,235,.38); }
.piece { color: #111827; }
.piece-w { color: #f8fafc; --piece-stroke: #0f172a; }
.piece-b { color: #111827; --piece-stroke: #e5e7eb; }
.piece-arrived .piece-svg { animation: piece-arrive .55s ease-out; }
@keyframes piece-arrive {
  0% { transform: scale(.72); opacity: .4; filter: drop-shadow(0 0 0 rgba(15, 23, 42, 0)); }
  70% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 8px 18px rgba(15, 23, 42, .2)); }
  100% { transform: scale(1); opacity: 1; }
}
.captured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 10px; }
.captured-panel { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.captured-title { font-size: .88rem; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.captured-pieces { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.captured-piece-icon { width: 24px; height: 24px; display: inline-flex; }
.captured-piece-icon .piece-svg { width: 100%; height: 100%; }
.move-row.latest { border-color: rgba(37,99,235,.28); background: linear-gradient(180deg, #f8fbff, #eef5ff); }
#moves-list { padding-right: 4px; }
@media (max-width: 980px) {
  .captured-grid { grid-template-columns: 1fr; }
  .board-legend { gap: 10px 14px; }
}
@media (max-width: 640px) {
  .board-shell { width: min(100%, 92vw); }
  .chessboard { border-width: 4px; border-radius: 16px; }
  .axis-label { font-size: .62rem; }
  .captured-piece-icon { width: 22px; height: 22px; }
}

/* v3.3 interaction upgrades */
.game-help { margin-top: 14px; }
.game-side-card { position: sticky; top: 92px; }
.drag-active { cursor: grabbing; }
.square.drag-origin { box-shadow: inset 0 0 0 3px rgba(37,99,235,.35); }
.square.drag-hover { outline: 3px solid rgba(37,99,235,.55); outline-offset: -3px; z-index: 3; }
.piece-hidden-origin { opacity: .18; transform: scale(.92); }
.drag-ghost { position: fixed; left: 0; top: 0; width: min(88px, 16vw); height: min(88px, 16vw); margin-left: calc(min(88px, 16vw) / -2); margin-top: calc(min(88px, 16vw) / -2); pointer-events: none; z-index: 1200; filter: drop-shadow(0 14px 18px rgba(15,23,42,.28)); }
.drag-ghost .piece,
.drag-ghost .piece-svg { width: 100%; height: 100%; }
.dragging-piece { transform: scale(1.02); }
.modal-overlay[hidden] { display: none !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.52); display: grid; place-items: center; padding: 18px; z-index: 1300; backdrop-filter: blur(3px); }
.modal-card { width: min(540px, 100%); background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 30px 60px rgba(15,23,42,.28); }
.promotion-modal h2 { margin-bottom: 6px; }
.promotion-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 16px; }
.promotion-choice { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 14px 12px; display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; min-height: 74px; }
.promotion-choice:hover,
.promotion-choice:focus-visible { outline: none; border-color: rgba(37,99,235,.45); background: #f8fbff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.promotion-piece { width: 44px; height: 44px; display: inline-flex; }
.promotion-piece .piece-svg { width: 100%; height: 100%; }
@media (max-width: 980px) {
  .game-side-card { position: static; }
}
@media (max-width: 640px) {
  .drag-ghost { width: 68px; height: 68px; margin-left: -34px; margin-top: -34px; }
  .promotion-choices { grid-template-columns: 1fr; }
  .promotion-choice { min-height: 68px; }
}

/* v3.4 gameplay polish */
.legend-check { background: linear-gradient(180deg, rgba(239,68,68,.24), rgba(220,38,38,.44)); border-color: rgba(220,38,38,.35); }
.legend-premove { background: linear-gradient(180deg, rgba(168,85,247,.18), rgba(139,92,246,.34)); border-color: rgba(139,92,246,.34); }
.game-toolbar-secondary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.status-pill { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .92rem; font-weight: 700; background: #f8fafc; color: var(--muted); }
.status-pill.active { color: #5b21b6; background: rgba(245,243,255,.95); border-color: rgba(139,92,246,.34); box-shadow: 0 10px 22px rgba(139,92,246,.12); }
.status-pill.waiting { color: #7c3aed; background: rgba(250,245,255,.96); border-color: rgba(168,85,247,.34); }
.chessboard.is-premove-mode { box-shadow: 0 18px 40px rgba(139,92,246,.12); }
.square.premove-selected { box-shadow: inset 0 0 0 3px rgba(139,92,246,.55); }
.square.premove-target::after,
.square.premove-capture-target::after,
.square.premove-from::after,
.square.premove-to::after,
.square.king-check::after,
.square.last-capture::after { content: ''; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none; }
.square.premove-target::after { background: radial-gradient(circle, rgba(168,85,247,.32) 0 28%, transparent 31%); }
.square.premove-capture-target::after { border: 3px dashed rgba(139,92,246,.55); }
.square.premove-from::after,
.square.premove-to::after { inset: 4px; border: 2px solid rgba(139,92,246,.48); background: rgba(168,85,247,.12); }
.square.king-check::after { inset: 4px; background: radial-gradient(circle, rgba(248,113,113,.28), rgba(220,38,38,.16)); border: 2px solid rgba(220,38,38,.42); box-shadow: 0 0 0 3px rgba(248,113,113,.16); animation: kingCheckPulse 1.2s ease-in-out infinite; }
.square.last-capture::after { inset: 3px; border: 2px solid rgba(234,88,12,.48); background: radial-gradient(circle, rgba(251,191,36,.18), rgba(249,115,22,.08)); animation: captureFlash .7s ease; }
.captured-piece-icon.newly-captured { animation: capturedPop .5s ease both; }
@keyframes kingCheckPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(248,113,113,.16); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(248,113,113,.08); }
}
@keyframes captureFlash {
  0% { transform: scale(.94); opacity: .35; }
  55% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes capturedPop {
  0% { transform: translateY(6px) scale(.84); opacity: 0; }
  60% { transform: translateY(-2px) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@media (max-width: 640px) {
  .game-toolbar-secondary { gap: 8px; }
  .status-pill { width: 100%; justify-content: center; }
}

/* v3.5 clocks and classic pieces */
.clock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}
.clock-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.clock-card.active {
  border-color: rgba(37,99,235,.38);
  box-shadow: 0 16px 32px rgba(37,99,235,.12);
  transform: translateY(-1px);
}
.clock-card.expired {
  border-color: rgba(220,38,38,.45);
  background: linear-gradient(180deg, #fff5f5, #fee2e2);
}
.clock-card.disabled {
  opacity: .78;
}
.clock-side {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.clock-time {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: .03em;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.time-control-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(180, 83, 9, .18);
  background: linear-gradient(180deg, #fffdf7, #fff7ed);
  color: #9a3412;
  font-size: .92rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.piece { color: #1f2937; }
.piece-w {
  color: #fffdf7;
  --piece-stroke: #111827;
}
.piece-b {
  color: #1f2937;
  --piece-stroke: #f8fafc;
}
.piece-svg {
  width: 82%;
  height: 82%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15,23,42,.12)) drop-shadow(0 4px 8px rgba(15,23,42,.10));
}
.captured-piece-icon .piece-svg,
.drag-ghost .piece-svg,
.promotion-piece .piece-svg {
  filter: drop-shadow(0 1px 2px rgba(15,23,42,.12));
}
@media (max-width: 640px) {
  .clock-grid {
    grid-template-columns: 1fr;
  }
  .clock-time {
    font-size: 1.55rem;
  }
}


.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

label.is-disabled {
  opacity: 0.65;
}

/* v3.5.2 commercial homepage refresh */
.brand {
  letter-spacing: -.01em;
  font-size: 1rem;
  max-width: 320px;
  line-height: 1.15;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 24px;
  align-items: stretch;
}
.home-hero-copy,
.home-hero-panel,
.home-cta {
  position: relative;
  overflow: hidden;
}
.home-hero-copy {
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 34%),
    linear-gradient(135deg, #0f172a, #111827 55%, #172554);
  color: #fff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 24px 60px rgba(15,23,42,.18);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  color: #dbeafe;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-kicker-soft {
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.12);
  color: var(--primary);
}
.home-hero-copy h1 {
  color: #fff;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  max-width: 780px;
  margin-bottom: 18px;
}
.lead-hero {
  color: rgba(255,255,255,.82);
  max-width: 760px;
  font-size: 1.08rem;
}
.hero-actions {
  margin-top: 28px;
}
.btn-xl {
  min-height: 50px;
  padding: 13px 18px;
  border-radius: 14px;
}
.home-hero-copy .btn {
  border-color: rgba(255,255,255,.16);
}
.home-hero-copy .btn:not(.btn-primary) {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.home-hero-copy .btn:not(.btn-primary):hover {
  background: rgba(255,255,255,.14);
}
.hero-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.hero-trust-item {
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  display: grid;
  gap: 6px;
}
.hero-trust-item strong {
  font-size: .98rem;
  color: #fff;
}
.hero-trust-item span {
  color: rgba(255,255,255,.72);
  font-size: .92rem;
  line-height: 1.45;
}
.home-hero-panel {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.10), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 26px;
  padding: 26px;
}
.hero-panel-head p {
  color: #475569;
  line-height: 1.65;
  margin-bottom: 0;
}
.hero-panel-badge,
.preview-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.08);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.hero-preview-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.hero-preview-card {
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  padding: 16px;
  box-shadow: 0 12px 24px rgba(15,23,42,.05);
}
.hero-preview-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1rem;
}
.hero-preview-card p,
.home-feature-card p,
.home-cta .lead {
  margin: 0;
  line-height: 1.65;
  color: #475569;
}
.home-section-head {
  margin-bottom: 18px;
}
.home-feature-grid {
  align-items: stretch;
}
.home-feature-card {
  border-radius: 22px;
}
.home-feature-card h3 {
  margin-bottom: 10px;
}
.home-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at bottom left, rgba(37,99,235,.10), transparent 28%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}
.footer-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.footer-admin-link {
  color: #64748b;
  font-size: .9rem;
}
.footer-admin-link:hover {
  color: var(--primary);
}
@media (max-width: 980px) {
  .home-hero,
  .home-cta {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 780px) {
  .home-hero-copy {
    padding: 24px;
    border-radius: 22px;
  }
  .home-hero-panel,
  .home-cta {
    padding: 20px;
    border-radius: 22px;
  }
  .hero-trust-row {
    grid-template-columns: 1fr;
  }
}

/* v3.5.3 premium homepage */
body.home-page {
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 26%),
    radial-gradient(circle at top right, rgba(245,158,11,.08), transparent 22%),
    linear-gradient(180deg, #eef3f9 0%, #f6f8fb 34%, #eef2f7 100%);
}
body.home-page .site-header {
  background: rgba(9, 14, 28, .82);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(15,23,42,.14);
}
body.home-page .page {
  padding-top: 36px;
}
.main-nav {
  align-items: center;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.main-nav a:hover {
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
.main-nav .nav-cta {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}
.brand {
  font-size: 1.02rem;
  max-width: 360px;
}
.premium-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  gap: 24px;
  align-items: stretch;
}
.card-dark {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 38px;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.26), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(251,191,36,.18), transparent 20%),
    linear-gradient(140deg, #081120 0%, #0f172a 48%, #13203b 100%);
  color: #fff;
  box-shadow: 0 30px 80px rgba(15,23,42,.22);
  border: 1px solid rgba(255,255,255,.06);
}
.card-dark::after {
  content: '';
  position: absolute;
  inset: auto -12% -18% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%);
  pointer-events: none;
}
.hero-kicker-gold {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .18);
  color: #fde68a;
}
.premium-hero h1 {
  font-size: clamp(2.35rem, 5vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -.04em;
  margin-bottom: 18px;
  max-width: 860px;
}
.btn-glass {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.14) !important;
  backdrop-filter: blur(10px);
}
.btn-glass:hover {
  background: rgba(255,255,255,.14) !important;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}
.hero-metric {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.hero-metric strong {
  display: block;
  font-size: .98rem;
  margin-bottom: 7px;
}
.hero-metric span {
  display: block;
  color: rgba(255,255,255,.70);
  font-size: .93rem;
  line-height: 1.55;
}
.premium-showcase {
  border-radius: 30px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.95));
}
.showcase-topline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.showcase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.92);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.showcase-pill-soft {
  background: rgba(37,99,235,.08);
  color: var(--primary);
}
.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
}
.showcase-board-wrap {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 18px 36px rgba(15,23,42,.05);
}
.showcase-board-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.showcase-board-header strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 5px;
}
.showcase-board-header p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.showcase-clocks {
  display: grid;
  gap: 8px;
}
.showcase-clocks span {
  display: inline-flex;
  justify-content: center;
  min-width: 82px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.showcase-board {
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15,23,42,.10);
  border: 1px solid rgba(15,23,42,.12);
}
.showcase-square {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}
.showcase-square.light { background: #f4ead6; }
.showcase-square.dark { background: #9f7b57; }
.showcase-square.accent::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  background: rgba(59,130,246,.20);
  border: 2px solid rgba(59,130,246,.34);
}
.showcase-piece {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 72%;
  height: 72%;
}
.showcase-sidebar {
  display: grid;
  gap: 12px;
}
.showcase-card {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 12px 26px rgba(15,23,42,.05);
}
.showcase-card-primary {
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}
.showcase-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.08);
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.showcase-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}
.showcase-card p,
.premium-feature-card p,
.premium-step span,
.premium-strip-card span,
.premium-strip-card strong,
.premium-journey .lead {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}
.premium-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.premium-strip-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 16px 36px rgba(15,23,42,.05);
  backdrop-filter: blur(10px);
}
.premium-strip-card span {
  display: block;
  color: var(--primary);
  font-size: .84rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.premium-strip-card strong {
  display: block;
  font-size: 1rem;
  color: #0f172a;
}
.premium-section {
  margin-top: 28px;
}
.premium-section-head h2,
.premium-journey h2,
.premium-cta h2 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -.03em;
}
.premium-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.premium-feature-card {
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.feature-index {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  margin-bottom: 18px;
}
.premium-journey {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 24px;
  align-items: center;
  border-radius: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.09), transparent 26%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}
.premium-steps {
  display: grid;
  gap: 12px;
}
.premium-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(255,255,255,.85);
}
.premium-step strong {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: var(--primary);
  font-size: 1.05rem;
}
.premium-cta {
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 24%),
    linear-gradient(135deg, #ffffff, #f8fbff 60%, #eef4ff);
}
body.home-page .site-footer {
  padding-top: 26px;
}
body.home-page .footer-inner {
  padding: 18px 0 8px;
  border-top: 1px solid rgba(148,163,184,.18);
}
@media (max-width: 1100px) {
  .premium-hero,
  .premium-journey,
  .premium-feature-grid,
  .premium-strip,
  .showcase-grid {
    grid-template-columns: 1fr;
  }
  .showcase-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .card-dark,
  .premium-showcase,
  .premium-journey,
  .premium-cta {
    padding: 22px;
    border-radius: 24px;
  }
  .hero-metrics,
  .premium-feature-grid,
  .premium-strip,
  .showcase-sidebar {
    grid-template-columns: 1fr;
  }
  .showcase-board-wrap {
    padding: 14px;
  }
}
@media (max-width: 640px) {
  body.home-page .page {
    padding-top: 22px;
  }
  .premium-hero h1 {
    font-size: 2.3rem;
  }
  .card-dark,
  .premium-showcase,
  .premium-journey,
  .premium-cta,
  .premium-strip-card,
  .premium-feature-card {
    border-radius: 22px;
  }
  .showcase-board-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .showcase-clocks {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-metric,
  .premium-step,
  .showcase-card,
  .premium-strip-card {
    padding: 14px;
  }
}


/* v3.5.4 favicon + chess-themed styling */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(15,23,42,.18);
  border: 1px solid rgba(255,255,255,.12);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-text {
  display: grid;
  gap: 2px;
}
.brand-title {
  display: block;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}
.brand-subtitle {
  display: block;
  color: rgba(255,255,255,.60);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
}
body.home-page {
  background:
    linear-gradient(45deg, rgba(15,23,42,.018) 25%, transparent 25%, transparent 75%, rgba(15,23,42,.018) 75%),
    linear-gradient(45deg, rgba(15,23,42,.018) 25%, transparent 25%, transparent 75%, rgba(15,23,42,.018) 75%),
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 26%),
    radial-gradient(circle at top right, rgba(245,158,11,.08), transparent 22%),
    linear-gradient(180deg, #eef3f9 0%, #f6f8fb 34%, #eef2f7 100%);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  background-position: 0 0, 14px 14px, 0 0, 0 0, 0 0;
}
body.home-page .site-header {
  border-bottom: 1px solid rgba(245, 196, 92, .16);
}
.card-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(45deg, rgba(255,255,255,.028) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.028) 75%),
    linear-gradient(45deg, rgba(255,255,255,.028) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.028) 75%);
  background-size: 42px 42px;
  background-position: 0 0, 21px 21px;
  opacity: .95;
}
.hero-kicker::before,
.showcase-label::before,
.premium-strip-card span::before {
  content: '♞';
  display: inline-block;
  margin-right: 8px;
  opacity: .92;
}
.hero-metric::after,
.premium-strip-card::after,
.premium-feature-card::after,
.premium-step::after,
.showcase-card::after {
  content: '';
  position: absolute;
  inset: auto 18px 0 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 196, 92, .55), transparent);
}
.hero-metric,
.premium-strip-card,
.premium-feature-card,
.premium-step,
.showcase-card {
  position: relative;
  overflow: hidden;
}
.hero-metric::before,
.premium-strip-card::before,
.premium-feature-card::before,
.showcase-card::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(245,196,92,.16) 25%, transparent 25%, transparent 75%, rgba(245,196,92,.16) 75%),
    linear-gradient(45deg, rgba(245,196,92,.16) 25%, transparent 25%, transparent 75%, rgba(245,196,92,.16) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  opacity: .40;
  pointer-events: none;
}
.premium-showcase {
  position: relative;
}
.premium-showcase::before {
  content: 'a   b   c   d   e   f   g   h';
  position: absolute;
  right: 24px;
  bottom: 14px;
  color: rgba(100,116,139,.35);
  font-size: .72rem;
  letter-spacing: .52em;
  font-weight: 700;
  pointer-events: none;
}
.showcase-board-wrap {
  position: relative;
}
.showcase-board-wrap::before {
  content: '8 7 6 5 4 3 2 1';
  position: absolute;
  left: -6px;
  top: 70px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: rgba(100,116,139,.32);
  font-size: .68rem;
  letter-spacing: .54em;
  font-weight: 700;
  pointer-events: none;
}
.hero-metric strong,
.showcase-card strong,
.premium-strip-card strong,
.premium-feature-card h3,
.premium-step strong {
  position: relative;
  z-index: 1;
}
.site-footer {
  position: relative;
}
body.home-page .site-footer::before {
  content: '';
  display: block;
  height: 8px;
  margin-bottom: 18px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #0f172a 0 12.5%, #f3e5c6 12.5% 25%, #0f172a 25% 37.5%, #f3e5c6 37.5% 50%, #0f172a 50% 62.5%, #f3e5c6 62.5% 75%, #0f172a 75% 87.5%, #f3e5c6 87.5% 100%);
  opacity: .7;
}
.footer-copy {
  position: relative;
  padding-left: 18px;
}
.footer-copy::before {
  content: '♚';
  position: absolute;
  left: 0;
  top: 0;
  color: #b88929;
}
@media (max-width: 820px) {
  .brand {
    gap: 10px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }
  .brand-title {
    font-size: .92rem;
  }
  .brand-subtitle {
    font-size: .64rem;
    letter-spacing: .12em;
  }
  .premium-showcase::before,
  .showcase-board-wrap::before {
    display: none;
  }
}
@media (max-width: 640px) {
  .brand-subtitle {
    display: none;
  }
  .hero-kicker::before,
  .showcase-label::before,
  .premium-strip-card span::before {
    margin-right: 6px;
  }
}

/* v3.5.5 premium public auth screens */
body.auth-page {
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 24%),
    radial-gradient(circle at top right, rgba(245,158,11,.10), transparent 20%),
    linear-gradient(180deg, #eef2f8 0%, #f7f8fb 42%, #eff3f8 100%);
}
body.auth-page .site-header {
  background: rgba(9, 14, 28, .86);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(15,23,42,.14);
}
body.auth-page .page {
  padding-top: 38px;
}
.auth-premium-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, .88fr);
  gap: 24px;
  align-items: stretch;
}
.auth-premium-layout-narrow {
  grid-template-columns: minmax(0, .98fr) minmax(340px, .82fr);
}
.auth-premium-copy {
  min-height: 100%;
}
.auth-premium-copy h1 {
  font-size: clamp(2.15rem, 4.2vw, 3.55rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  margin-bottom: 18px;
  max-width: 720px;
}
.auth-premium-copy p.lead {
  max-width: 680px;
}
.auth-copy-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.auth-copy-metrics-wide {
  grid-template-columns: 1fr;
}
.auth-copy-metric {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.auth-copy-metric strong {
  display: block;
  color: #fff;
  font-size: .98rem;
  margin-bottom: 8px;
}
.auth-copy-metric span {
  display: block;
  color: rgba(255,255,255,.74);
  line-height: 1.6;
  font-size: .93rem;
}
.auth-copy-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.auth-copy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-copy-badge-soft {
  color: #dbeafe;
}
.auth-panel {
  border-radius: 28px;
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}
.auth-panel-compact {
  align-self: center;
}
.auth-panel-head {
  margin-bottom: 18px;
}
.auth-panel-head h2 {
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  margin-bottom: 10px;
}
.auth-panel-head p {
  margin: 0;
  color: #475569;
  line-height: 1.68;
}
.auth-form-card {
  width: 100%;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.auth-form-card label {
  font-size: .95rem;
}
.auth-form-card input {
  min-height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.96);
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-form-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: .94rem;
}
.auth-form-links a {
  font-weight: 700;
}
.auth-form-note {
  margin: 14px 0 0;
  color: #64748b;
  line-height: 1.6;
  text-align: center;
}
.auth-divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(100,116,139,.55);
}
.auth-copy-login {
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.28), transparent 26%),
    radial-gradient(circle at 90% 14%, rgba(251,191,36,.18), transparent 20%),
    linear-gradient(140deg, #07111f 0%, #0f172a 46%, #132544 100%);
}
.auth-copy-register {
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.26), transparent 26%),
    radial-gradient(circle at 92% 12%, rgba(245,158,11,.16), transparent 20%),
    linear-gradient(140deg, #0a1322 0%, #101b31 42%, #162b4d 100%);
}
.auth-copy-forgot,
.auth-copy-reset {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.24), transparent 28%),
    radial-gradient(circle at 90% 14%, rgba(250,204,21,.15), transparent 20%),
    linear-gradient(140deg, #0b1220 0%, #101828 44%, #172554 100%);
}
@media (max-width: 980px) {
  .auth-premium-layout,
  .auth-premium-layout-narrow {
    grid-template-columns: 1fr;
  }
  .auth-copy-metrics {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  body.auth-page .page {
    padding-top: 24px;
  }
  .auth-panel,
  .auth-premium-copy {
    border-radius: 24px;
    padding: 22px;
  }
  .auth-premium-copy h1 {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
  }
  .auth-form-links {
    justify-content: flex-start;
  }
}








/* ===== Android / smartphone adaptive fixes ===== */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Важный фикс для flex/grid на мобильных */
.header-inner,
.brand,
.brand-text,
.main-nav,
.premium-hero,
.premium-hero-copy,
.premium-showcase,
.showcase-grid,
.showcase-board-wrap,
.showcase-sidebar,
.premium-strip,
.premium-feature-grid,
.premium-journey,
.premium-journey-copy,
.home-cta {
  min-width: 0;
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 0;
  }

  .brand {
    width: 100%;
    max-width: none;
    gap: 10px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-title {
    font-size: 0.95rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .brand-subtitle {
    letter-spacing: 0.08em;
  }

  .main-nav {
    width: 100%;
    gap: 8px;
  }

  .main-nav a {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
  }

  .card-dark,
  .premium-showcase,
  .premium-journey,
  .premium-cta {
    padding: 18px;
    border-radius: 20px;
  }

  .premium-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }

  .lead,
  .lead-hero {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .showcase-board-wrap {
    padding: 12px;
  }

  .showcase-board {
    border-radius: 16px;
  }

  .showcase-piece {
    width: 68%;
    height: 68%;
  }

  .showcase-clocks span {
    min-width: 0;
  }

  /* Для Android часто полезно убрать blur в шапке */
  body.home-page .site-header,
  body.auth-page .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 16px);
  }

  body.home-page .page,
  body.auth-page .page {
    padding-top: 16px;
  }

  .card-dark,
  .premium-showcase,
  .premium-journey,
  .premium-cta,
  .premium-strip-card,
  .premium-feature-card {
    padding: 16px;
    border-radius: 18px;
  }

  .main-nav a {
    flex: 1 1 100%;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-title {
    font-size: 0.9rem;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-kicker {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .premium-hero h1 {
    font-size: clamp(1.5rem, 8vw, 1.9rem);
  }

  .hero-metric,
  .premium-step,
  .showcase-card,
  .premium-strip-card,
  .premium-feature-card {
    padding: 12px;
  }

  .premium-step {
    grid-template-columns: 44px 1fr;
    gap: 12px;
  }

  .premium-step strong {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  .showcase-board-header p,
  .showcase-card p,
  .premium-feature-card p,
  .premium-strip-card strong,
  .premium-step span {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .showcase-clocks span {
    font-size: 0.9rem;
    padding: 7px 8px;
  }
}