/* ============ M4OD — стили ============ */
:root {
  --bg: #0a0e1a;
  --bg-2: #0f1628;
  --ink: #eaf0ff;
  --muted: #93a0c0;
  --accent: #4f8cff;
  --accent-2: #9b5cff;
  --gold: #ffcb5c;
  --card: #141b30;
  --line: rgba(120, 150, 220, 0.16);
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,.8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #16224a 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { filter: drop-shadow(0 0 12px rgba(79,140,255,.5)); }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: 1px; }
.brand-tag { color: var(--muted); font-size: 12px; display: none; }
@media (min-width: 720px) { .brand-tag { display: inline; margin-left: 6px; } }

.site-nav { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.site-nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-weight: 600; font-size: 15px; transition: .2s;
}
.site-nav a:hover { color: var(--ink); background: rgba(79,140,255,.1); }
.nav-cta { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 720px) {
  .site-nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 4px;
    background: var(--bg-2); padding: 16px; border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: .3s;
  }
  .nav-open .site-nav { transform: translateY(0); }
  .nav-toggle { display: flex; margin-left: auto; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 10vw, 120px) clamp(16px, 5vw, 64px) clamp(80px, 12vw, 140px);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
  min-height: 80vh;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-cards { display: none; } }

.hero-orb {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,140,255,.35), transparent 70%);
  top: -120px; left: -80px; filter: blur(20px); animation: float 14s ease-in-out infinite;
}
.hero-orb.orb-2 {
  width: 420px; height: 420px; right: -100px; left: auto; top: auto; bottom: -140px;
  background: radial-gradient(circle, rgba(155,92,255,.32), transparent 70%);
  animation-delay: -5s;
}
@keyframes float { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-30px) } }

.hero-inner { position: relative; z-index: 2; }
.hero-kicker {
  display: inline-block; color: var(--gold); font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; font-size: 13px; margin-bottom: 18px;
  padding: 6px 14px; border: 1px solid rgba(255,203,92,.3); border-radius: 999px;
}
.hero-title {
  font-size: clamp(38px, 7vw, 76px); line-height: 1.02; font-weight: 900;
  letter-spacing: -1.5px; margin-bottom: 22px;
}
.hero-sub { color: var(--muted); font-size: clamp(16px, 2vw, 20px); max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 16px;
  cursor: pointer; border: 0; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 12px 30px -10px rgba(79,140,255,.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(79,140,255,.9); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.hero-stats { display: flex; gap: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 30px; font-weight: 900; }
.hero-stats span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

/* 3D веер карт */
.hero-cards { position: relative; height: 420px; perspective: 1400px; z-index: 1; }
.heroc {
  position: absolute; width: 160px; height: 230px; border-radius: 16px;
  background: linear-gradient(160deg, #1a2440, #0d1428);
  border: 1px solid rgba(120,160,255,.3);
  box-shadow: var(--shadow), inset 0 0 40px rgba(79,140,255,.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  left: 50%; top: 50%; transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.heroc .r { font-size: 42px; font-weight: 900; }
.heroc .s { font-size: 56px; }
.héroc-1 { transform: translate(-50%,-50%) rotate(-24deg) translateX(-150px) rotateY(10deg); color: var(--ink); }
.héroc-2 { transform: translate(-50%,-50%) rotate(-8deg) translateX(-60px); color: #ff7b8a; }
.héroc-3 { transform: translate(-50%,-50%) rotate(8deg) translateX(60px); color: var(--gold); }
.héroc-4 { transform: translate(-50%,-50%) rotate(24deg) translateX(150px) rotateY(-10deg); color: #7be0ff; }
.hero-cards:hover .héroc-1 { transform: translate(-50%,-50%) rotate(-30deg) translateX(-190px) translateZ(40px); }
.hero-cards:hover .héroc-4 { transform: translate(-50%,-50%) rotate(30deg) translateX(190px) translateZ(40px); }
.hero-cards:hover .héroc-2,
.hero-cards:hover .héroc-3 { transform: translate(-50%,-50%) translateZ(-20px); opacity: .85; }

/* ---------- SECTIONS ---------- */
.section { padding: clamp(56px, 8vw, 110px) clamp(16px, 5vw, 64px); max-width: 1280px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 4vw, 46px); font-weight: 900; letter-spacing: -1px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 auto; }

/* ---------- GAMES ---------- */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px;
}
.game-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, var(--card), #0c1222);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s; transform-style: preserve-3d;
  cursor: pointer;
}
.game-card:hover { transform: translateY(-8px) scale(1.02) rotateX(3deg); box-shadow: 0 30px 60px -20px rgba(79,140,255,.5); }
.game-art {
  height: 190px; display: flex; align-items: center; justify-content: center;
  font-size: 78px; position: relative; overflow: hidden;
}
.game-art::after { content:''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.15), transparent 60%); }
.gc-1 .game-art { background: linear-gradient(135deg,#0e3b6e,#0a1a3a); }
.gc-2 .game-art { background: linear-gradient(135deg,#6e0e3b,#2a0a1a); }
.gc-3 .game-art { background: linear-gradient(135deg,#0e6e4a,#0a2a1a); }
.gc-4 .game-art { background: linear-gradient(135deg,#5a0e6e,#1a0a2a); }
.game-body { padding: 20px 22px 24px; }
.game-body h3 { font-size: 22px; margin-bottom: 6px; }
.game-body p { color: var(--muted); font-size: 15px; margin-bottom: 16px; min-height: 44px; }
.game-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(79,140,255,.14); color: #9cc0ff; border: 1px solid rgba(79,140,255,.25); }
.game-links { display: flex; gap: 8px; flex-wrap: wrap; }
.game-links a, .game-links button {
  font-size: 13px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--ink); cursor: pointer; transition: .2s; font-weight: 600;
}
.game-links a:hover, .game-links button:hover { background: rgba(79,140,255,.2); border-color: var(--accent); }

/* ---------- DEMO ---------- */
.section-demo { }
.demo-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
  background: linear-gradient(160deg, rgba(20,27,48,.9), rgba(10,16,32,.9));
  border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
}
@media (max-width: 820px) { .demo-card { grid-template-columns: 1fr; } }
.demo-left h3 { font-size: 26px; margin-bottom: 12px; }
.demo-desc { color: var(--muted); margin-bottom: 18px; }
.demo-tries { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.demo-tries strong { color: var(--gold); font-size: 20px; }

.demo-history { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 14px; }
.hist-card { font-weight: 800; padding: 4px 10px; border-radius: 8px; background: #fff; color: #111; min-width: 54px; text-align: center; }
.hist-hints { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.hint.rank-up { background: rgba(255,203,92,.18); color: var(--gold); }
.hint.rank-down { background: rgba(79,140,255,.18); color: #9cc0ff; }
.hint.rank-ok { background: rgba(80,200,120,.2); color: #6be59a; }
.hint.suit-ok { background: rgba(80,200,120,.2); color: #6be59a; }
.hint.suit-no { background: rgba(255,90,90,.16); color: #ff8686; }

/* picker */
.picker { display: flex; flex-direction: column; gap: 16px; }
.picker-row label { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.ranks { display: flex; flex-wrap: wrap; gap: 6px; }
.ranks button {
  width: 46px; height: 56px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--ink); font-weight: 800; font-size: 16px; cursor: pointer; transition: .15s;
}
.ranks button:hover { background: rgba(79,140,255,.2); }
.ranks button.active { background: linear-gradient(135deg,var(--accent),var(--accent-2)); border-color: transparent; transform: scale(1.05); }
.suits { display: flex; gap: 10px; }
.suits button {
  width: 58px; height: 58px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); font-size: 28px; cursor: pointer; transition: .15s;
}
.suits button:hover { background: rgba(79,140,255,.2); }
.suits button.active { background: linear-gradient(135deg,var(--accent),var(--accent-2)); border-color: transparent; transform: scale(1.05); }
.suits button[data-suit="♥"], .suits button[data-suit="♦"] { color: #ff7b8a; }
.pick-btn { margin-top: 8px; }
.pick-btn:disabled { opacity: .4; cursor: not-allowed; }
.guess-preview { text-align: center; color: var(--muted); font-size: 15px; min-height: 20px; }

/* result */
.result { text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.result-card {
  width: 140px; height: 200px; border-radius: 16px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 900; font-size: 40px; box-shadow: var(--shadow); position: relative;
  animation: pop .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { 0%{ transform: scale(.4) rotate(-15deg); opacity:0 } 100%{ transform: scale(1); opacity:1 } }
.result-name { display: flex; gap: 10px; align-items: center; width: 100%; justify-content: center; }
.result-name input { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--ink); font-size: 16px; }
.hidden { display: none !important; }

/* ---------- ABOUT ---------- */
.about { text-align: center; }

/* ---------- DOWNLOAD ---------- */
.download { text-align: center; }
.download h2 { font-size: clamp(28px, 4vw, 46px); font-weight: 900; margin-bottom: 12px; }
.download > p { color: var(--muted); margin-bottom: 32px; }
.store-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.store img { height: 56px; width: auto; transition: transform .2s; }
.store:hover img { transform: translateY(-3px); }
.store-apk {
  display: inline-flex; align-items: center; padding: 0 24px; height: 56px; border-radius: 12px;
  background: linear-gradient(135deg, #1f8f4e, #146b39); color: #fff; font-weight: 700; font-size: 15px;
  border: 1px solid rgba(120,255,170,.3);
}
.download-note { color: var(--muted); font-size: 13px; margin-top: 20px; }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(6,10,20,.8); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px,5vw,64px);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--ink); }

/* виджет «Угадай карту» */
.guess-widget {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  border: 0; box-shadow: 0 10px 26px -10px rgba(79,140,255,.8); transition: transform .2s;
  animation: pulse 2.6s ease-in-out infinite;
}
.guess-widget:hover { transform: translateY(-2px) scale(1.04); }
@keyframes pulse { 0%,100%{ box-shadow: 0 10px 26px -10px rgba(79,140,255,.8) } 50%{ box-shadow: 0 10px 40px -6px rgba(155,92,255,.9) } }
.gw-face { font-size: 20px; }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,7,15,.8); backdrop-filter: blur(6px); }
.modal-box {
  position: relative; z-index: 2; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(160deg, #16203a, #0b1224);
  border: 1px solid rgba(120,160,255,.25); border-radius: 24px; padding: 28px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9);
  animation: pop .35s cubic-bezier(.2,1.2,.4,1);
}
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal-box h3 { font-size: 24px; margin-bottom: 8px; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
#modalGame .picker { margin-bottom: 18px; }

.result-name { flex-direction: column; }
.result-name input { width: 100%; max-width: 280px; }

.rating { margin-top: 22px; }
.rating h4 { font-size: 18px; margin-bottom: 12px; }
.rating ol { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rating li { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 15px; }
.rating li .place { color: var(--gold); font-weight: 800; margin-right: 10px; }

/* иконки магазинов как текст-заглушки, если нет svg */
.store img[onerror] { display:none; }
