@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P:wght@400&display=swap');

/* ==============================
   ROOT VARIABLES
============================== */
:root {
  --bg:            #060d06;
  --bg2:           #0a120a;
  --card:          #111911;
  --card2:         #172017;
  --primary:       #4ab030;
  --primary-bright:#7ab845;
  --primary-glow:  #56d364;
  --diamond:       #4ae2e2;
  --gold:          #ffaa00;
  --red:           #e84040;
  --text:          #e8f0e8;
  --muted:         #7a8f7a;
  --border:        #243024;
  --px:            3px;
  --radius:        4px;
  /* Fixed-header height: everything that offsets below the header (hero,
     drawer, cabinet sidebar, anchor scroll) reads this single variable.
     Desktop uses a two-row header; overridden in the responsive blocks. */
  --header-h:      130px;
}

/* ==============================
   RESET
============================== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

/* Anchored sections must not hide under the fixed header on #-navigation */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 21px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: 'VT323', monospace; }

.container {
  width: min(1300px, 95%);
  margin: auto;
  position: relative;
  z-index: 1;
}

/* ==============================
   ANIMATED STARFIELD BACKGROUND
============================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(122,184,69,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(122,184,69,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 10%, rgba(74,226,226,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 40%, rgba(122,184,69,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(74,226,226,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 85%, rgba(122,184,69,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 70%, rgba(122,184,69,.15) 0%, transparent 100%);
  background-size: 600px 600px;
  animation: starfield 60s linear infinite;
}

@keyframes starfield {
  from { background-position: 0 0; }
  to   { background-position: 600px 600px; }
}

/* ==============================
   FALLING BLOCKS (JS-generated)
============================== */
.block-particle {
  position: fixed;
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  animation: blockFall linear infinite;
}

@keyframes blockFall {
  0%   { transform: translateY(-20px) rotate(0deg);  opacity: .7; }
  80%  { opacity: .5; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ==============================
   MINECRAFT PANEL STYLE
============================== */
.mc-panel {
  background: var(--card);
  border: var(--px) solid #080e08;
  box-shadow:
    inset calc(var(--px)*-1) calc(var(--px)*-1) 0 0 #050905,
    inset var(--px) var(--px) 0 0 #1e2e1e;
}

/* ==============================
   MINECRAFT BUTTONS
============================== */
.mc-btn,
.btn-primary,
.buy-btn,
.btn-login,
.btn-register,
form button[type="submit"],
.modal form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #4a7c2f;
  color: #fff;
  border: none;
  padding: 12px 26px;
  font-family: 'VT323', monospace;
  font-size: 22px;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius);
  box-shadow:
    inset -3px -5px 0 0 #2d4e1d,
    inset 3px 3px 0 0 #6aad42,
    0 6px 0 0 #1a2e10,
    0 8px 20px rgba(74,176,48,.25);
  transition: transform .1s, box-shadow .1s, background .1s;
  text-shadow: 2px 2px 0 rgba(0,0,0,.5);
  text-decoration: none;
  white-space: nowrap;
}

.mc-btn:hover,
.btn-primary:hover,
.buy-btn:hover,
.btn-login:hover,
.btn-register:hover,
form button[type="submit"]:hover,
.modal form button:hover {
  background: #5a9038;
  transform: translateY(-2px);
  box-shadow:
    inset -3px -5px 0 0 #3d6427,
    inset 3px 3px 0 0 #7ac050,
    0 8px 0 0 #1a2e10,
    0 10px 28px rgba(122,184,69,.45);
}

.mc-btn:active,
.btn-primary:active,
.buy-btn:active {
  transform: translateY(4px);
  box-shadow:
    inset -2px -2px 0 0 #2d4e1d,
    inset 2px 2px 0 0 #6aad42,
    0 2px 0 0 #1a2e10;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  border: var(--px) solid var(--border);
  padding: 12px 26px;
  font-family: 'VT323', monospace;
  font-size: 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: .2s;
  box-shadow: inset -2px -3px 0 0 rgba(0,0,0,.4);
}

.btn-secondary:hover {
  border-color: var(--primary-bright);
  background: rgba(122,184,69,.08);
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.4),
    0 0 18px rgba(122,184,69,.2);
}

/* Diamond variant */
.mc-btn-diamond {
  background: #1a6e8a;
  box-shadow:
    inset -3px -5px 0 0 #0d4054,
    inset 3px 3px 0 0 #4ae2e2,
    0 6px 0 0 #0a2030,
    0 8px 20px rgba(74,226,226,.2);
}
.mc-btn-diamond:hover {
  background: #1e85a5;
  box-shadow:
    inset -3px -5px 0 0 #104858,
    inset 3px 3px 0 0 #6af4f4,
    0 8px 0 0 #0a2030,
    0 10px 28px rgba(74,226,226,.4);
}

/* Gold variant */
.mc-btn-gold {
  background: #8a6200;
  box-shadow:
    inset -3px -5px 0 0 #543c00,
    inset 3px 3px 0 0 #ffcc44,
    0 6px 0 0 #302200,
    0 8px 20px rgba(255,170,0,.25);
}
.mc-btn-gold:hover {
  background: #a07400;
  box-shadow:
    inset -3px -5px 0 0 #664800,
    inset 3px 3px 0 0 #ffd856,
    0 8px 0 0 #302200,
    0 10px 28px rgba(255,170,0,.4);
}

/* Telegram variant (Log in with Telegram) */
.btn-telegram {
  background: transparent;
  border: var(--px) solid #2aabee;
  color: #2aabee;
  box-shadow: inset -2px -3px 0 0 rgba(0,0,0,.3);
}
.btn-telegram:hover {
  background: rgba(42,171,238,.12);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.3),
    0 0 18px rgba(42,171,238,.3);
}
.btn-telegram:active {
  transform: translateY(2px);
  box-shadow: inset -1px -2px 0 0 rgba(0,0,0,.3);
}

/* Utility: full-width button (replaces inline style="width:100%") */
.btn-block { width: 100%; }

/* ==============================
   HEADER
============================== */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(4, 10, 4, .92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #1a2a1a;
  box-shadow: 0 2px 0 #0a140a, 0 4px 20px rgba(0,0,0,.5);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 20px;
}

.logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 20px rgba(122,184,69,.4);
  flex-shrink: 0;
}

.logo span { color: var(--primary-glow); }
.logo .logo-sub {
  display: block;
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 4px;
}

nav { display: flex; gap: 4px; }

nav a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: .2s;
  font-size: 20px;
  border: 2px solid transparent;
  white-space: nowrap;
}

nav a:hover {
  color: var(--text);
  background: rgba(122,184,69,.1);
  border-color: rgba(122,184,69,.2);
}

nav a.active {
  color: var(--primary-glow);
  background: rgba(122,184,69,.14);
  border-color: rgba(122,184,69,.3);
}

.auth-buttons { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-drawer { display: contents; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(122,184,69,.08);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform .2s, opacity .2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.lang-switch {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lang-switch a {
  padding: 8px 12px;
  font-size: 17px;
  color: var(--muted);
  transition: .2s;
}
.lang-switch a.active {
  background: rgba(122,184,69,.18);
  color: var(--primary-glow);
}
.lang-switch a:hover { color: var(--text); }

.btn-login {
  background: rgba(122,184,69,.15);
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.4),
    inset 1px 1px 0 0 rgba(122,184,69,.2);
}

/* ==============================
   XP BAR (decoration in header)
============================== */
.xp-bar-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: #0a140a;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #56d364, #7af200);
  width: 73%;
  box-shadow: 0 0 8px #56d364;
  animation: xpPulse 3s ease-in-out infinite;
}

@keyframes xpPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; box-shadow: 0 0 14px #7af200; }
}

/* ==============================
   HERO
============================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--header-h);
}

/* Dark overlay + bg image */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.72)),
    url('/assets/images/mc-bg.jpg') center/cover no-repeat;
  z-index: -2;
  image-rendering: pixelated;
}

/* Pixel grid overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
  pointer-events: none;
}

/* Grass terrain at bottom */
.hero-terrain {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.terrain-row {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
}

.terrain-row .block {
  flex: none;
  width: 40px;
  height: 40px;
  border-right: 1px solid rgba(0,0,0,.3);
}

.block-grass {
  background: linear-gradient(180deg, #5d9e2f 0%, #5d9e2f 20%, #7d4f2a 20%, #7d4f2a 100%);
}

.block-dirt  { background: #7d4f2a; border-bottom: 1px solid rgba(0,0,0,.3); }
.block-stone { background: #888; }

.hero .container { position: relative; z-index: 2; padding-bottom: 100px; }

/* Server badge */
.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(86,211,100,.12);
  border: 2px solid rgba(86,211,100,.25);
  border-radius: var(--radius);
  font-size: 18px;
  color: var(--primary-glow);
  margin-bottom: 28px;
  box-shadow: 0 0 16px rgba(86,211,100,.12);
}

.server-badge::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background: #56d364;
  border-radius: 50%;
  box-shadow: 0 0 6px #56d364;
  animation: pingDot 2s ease-in-out infinite;
}

@keyframes pingDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

.hero h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(24px, 4.5vw, 58px);
  line-height: 1.5;
  max-width: 920px;
  margin: 0 auto 20px;
  text-shadow:
    3px 3px 0 rgba(0,0,0,.6),
    0 0 40px rgba(122,184,69,.2);
}

.hero h1 .accent { color: var(--primary-glow); }

.hero > .container > p {
  max-width: 680px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

/* Hero stats — hotbar style */
.hero-stats {
  display: inline-flex;
  gap: 0;
  border: 3px solid #2a3a2a;
  box-shadow:
    inset -2px -2px 0 0 #0a100a,
    inset 2px 2px 0 0 #3a4a3a,
    0 0 24px rgba(0,0,0,.5);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  padding: 14px 28px;
  border-right: 3px solid #2a3a2a;
  background: rgba(0,0,0,.4);
  text-align: center;
  position: relative;
}

.stat:last-child { border-right: none; }

.stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,.03), transparent);
}

.stat-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: var(--primary-glow);
  text-shadow: 0 0 10px rgba(86,211,100,.4);
  display: block;
}

.stat-label {
  font-size: 16px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

/* ==============================
   GRASS DIVIDER
============================== */
.grass-divider {
  width: 100%;
  height: 48px;
  position: relative;
  overflow: hidden;
  margin: 0;
}

.grass-divider-row {
  display: flex;
  position: absolute;
  bottom: 0; left: -40px; right: -40px;
}

.grass-divider-row .block {
  flex: none;
  width: 40px;
  height: 48px;
}

/* ==============================
   SECTION SHARED
============================== */
section { position: relative; z-index: 1; }

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-size: 16px;
  color: var(--primary-glow);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}

section h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(18px, 3vw, 32px);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 60px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.5);
}

section h2 .accent { color: var(--primary-glow); }

/* ==============================
   FEATURES
============================== */
.features { padding: clamp(64px, 7vw, 100px) 0; background: var(--bg2); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  transition: .25s;
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.4),
    inset 1px 1px 0 0 rgba(255,255,255,.04);
  overflow: hidden;
}

/* Pixel corner accents */
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--border);
  transition: .25s;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(122,184,69,.35);
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.4),
    inset 1px 1px 0 0 rgba(255,255,255,.04),
    0 0 30px rgba(74,176,48,.15),
    0 12px 30px rgba(0,0,0,.4);
}

.feature-card:hover::before { background: var(--primary-bright); }

.feature-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 8px rgba(122,184,69,.3));
}

.feature-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.feature-card p { color: var(--muted); font-size: 19px; line-height: 1.7; }

/* ==============================
   TARIFFS
============================== */
.tariffs { padding: clamp(64px, 7vw, 100px) 0; }

.tariff-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px);
  justify-content: center;
  gap: 28px;
  align-items: start;
}

.tariff-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  position: relative;
  transition: .25s;
  box-shadow:
    inset -3px -5px 0 0 rgba(0,0,0,.35),
    inset 2px 2px 0 0 rgba(255,255,255,.04);
  overflow: hidden;
}

/* Top accent stripe */
.tariff-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
}

.tariff-card.featured {
  border-color: rgba(122,184,69,.4);
  transform: scale(1.03);
  box-shadow:
    inset -3px -5px 0 0 rgba(0,0,0,.35),
    inset 2px 2px 0 0 rgba(255,255,255,.04),
    0 0 40px rgba(74,176,48,.2);
}

.tariff-card.featured::before { background: var(--primary-glow); height: 5px; }

.rank-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(122,184,69,.3));
}

.tariff-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.tariff-card > p { color: var(--muted); margin-bottom: 20px; font-size: 19px; }

.price {
  font-family: 'Press Start 2P', monospace;
  font-size: 36px;
  color: var(--primary-glow);
  text-shadow: 0 0 20px rgba(86,211,100,.3);
  display: block;
  margin-bottom: 6px;
}

.price-period { color: var(--muted); font-size: 18px; margin-bottom: 24px; display: block; }

.tariff-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.tariff-features li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tariff-features li:last-child { border-bottom: none; }
.tariff-features li::before { content: '▸'; color: var(--primary-glow); flex-shrink: 0; }

.tariff-card:hover {
  transform: translateY(-8px);
  border-color: rgba(122,184,69,.3);
  box-shadow:
    inset -3px -5px 0 0 rgba(0,0,0,.35),
    inset 2px 2px 0 0 rgba(255,255,255,.04),
    0 16px 40px rgba(0,0,0,.5),
    0 0 30px rgba(74,176,48,.12);
}

.tariff-card.featured:hover { transform: scale(1.03) translateY(-8px); }

.buy-btn { width: 100%; font-size: 20px; }

/* Duration tabs (срок подписки) */
.duration-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.duration-tab {
  background: rgba(255,255,255,.03);
  border: 2px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  cursor: pointer;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: .2s;
  font-size: 15px;
}
.duration-tab-days { font-size: 17px; font-weight: 700; }
.duration-tab-price { font-size: 14px; color: var(--muted); }
.duration-tab-price em { color: var(--primary-glow); font-style: normal; }
.duration-tab:hover { border-color: rgba(122,184,69,.4); }
.duration-tab.active {
  border-color: var(--primary-glow);
  background: rgba(122,184,69,.1);
  box-shadow: 0 0 16px rgba(74,176,48,.15);
}
.duration-tab.active .duration-tab-price { color: var(--primary-glow); }

/* Device count selector */
.device-select { margin-bottom: 24px; text-align: left; }
.device-select-label {
  color: var(--muted);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.device-btn {
  background: rgba(255,255,255,.03);
  border: 2px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  color: var(--text);
  cursor: pointer;
  padding: 8px 0;
  font-size: 15px;
  transition: .2s;
}
.device-btn:hover { border-color: rgba(122,184,69,.4); }
.device-btn.active {
  border-color: var(--primary-glow);
  background: rgba(122,184,69,.12);
  color: var(--primary-glow);
}
.device-btn-custom { grid-column: span 2; font-size: 13px; }
.device-custom { margin-top: 8px; }
.device-custom input {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 2px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  color: var(--text);
  padding: 8px 12px;
  font-size: 16px;
}

/* ==============================
   HOW IT WORKS
============================== */
.how-it-works { padding: clamp(64px, 7vw, 100px) 0; background: var(--bg2); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  counter-reset: step;
}

.step-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  position: relative;
  box-shadow: inset -2px -3px 0 0 rgba(0,0,0,.4);
}

.step-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 28px;
  color: var(--primary-glow);
  text-shadow: 0 0 12px rgba(86,211,100,.3);
  display: block;
  margin-bottom: 12px;
}

.step-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  margin-bottom: 12px;
  line-height: 1.7;
}

.step-card p { color: var(--muted); font-size: 18px; line-height: 1.7; }

/* ==============================
   INSTRUCTIONS (accordion, home page)
============================== */
.instructions { padding: clamp(64px, 7vw, 100px) 0; }
.instructions .container { max-width: 860px; }

.instr-item {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.3);
}

.instr-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  line-height: 1.6;
  transition: .2s;
  user-select: none;
  gap: 16px;
}

.instr-question:hover { background: rgba(122,184,69,.06); color: var(--primary-bright); }

.instr-arrow {
  flex-shrink: 0;
  color: var(--primary-glow);
  transition: transform .3s;
  font-size: 16px;
}

.instr-item.open .instr-arrow { transform: rotate(90deg); }

.instr-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
}

.instr-steps {
  list-style: none;
  counter-reset: instr-step;
  padding: 6px 26px 26px;
  margin-top: -1px;
  border-top: 1px solid var(--border);
}

.instr-steps > li {
  counter-increment: instr-step;
  position: relative;
  padding: 14px 0 14px 46px;
  min-height: 28px;
  font-size: 19px;
  line-height: 1.7;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.instr-steps > li:last-child { border-bottom: none; }

.instr-steps > li::before {
  content: counter(instr-step);
  position: absolute;
  left: 0; top: 12px;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122,184,69,.12);
  border: 2px solid rgba(122,184,69,.3);
  border-radius: var(--radius);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--primary-glow);
  flex-shrink: 0;
}

.instr-steps b { color: var(--text); }

.instr-substeps {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instr-substeps li {
  padding-left: 22px;
  position: relative;
  font-size: 18px;
  line-height: 1.6;
}

.instr-substeps li::before { content: '•'; position: absolute; left: 4px; color: var(--primary-glow); }

/* ==============================
   FEEDBACK FORM
============================== */
.feedback { padding: clamp(64px, 7vw, 100px) 0; }

.feedback-inner {
  max-width: 780px;
  margin: auto;
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 50px;
  box-shadow:
    inset -3px -4px 0 0 rgba(0,0,0,.4),
    inset 2px 2px 0 0 rgba(255,255,255,.04);
}

.feedback h2 { text-align: center; margin-bottom: 36px; }

.form-group { display: flex; flex-direction: column; gap: 16px; }

/* ==============================
   INPUTS
============================== */
input, textarea, select {
  width: 100%;
  background: #080e08;
  color: var(--text);
  border: 3px solid #1e2e1e;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 20px;
  outline: none;
  transition: .2s;
  box-shadow: inset 2px 2px 0 0 rgba(0,0,0,.3);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow:
    inset 2px 2px 0 0 rgba(0,0,0,.3),
    0 0 0 2px rgba(74,176,48,.15);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { resize: vertical; min-height: 130px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-msg { text-align: center; font-size: 19px; margin-top: 8px; min-height: 24px; }
.form-msg.success { color: var(--primary-glow); }
.form-msg.error   { color: var(--red); }

/* File upload */
.file-upload-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #080e08;
  border: 3px dashed #243024;
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .2s, color .2s;
  font-size: 20px;
  user-select: none;
}
.file-upload-label:hover { border-color: var(--primary); color: var(--text); }
.file-upload-label input[type="file"] { display: none; }

.file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111911;
  border: 2px solid #243024;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--muted);
  max-width: 100%;
}
.file-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  line-height: 1;
  opacity: .65;
  flex-shrink: 0;
}
.file-chip-remove:hover { opacity: 1; color: var(--red); }

.attach-hint { opacity: .55; font-size: 16px; }

.feedback-submit { min-width: 200px; }

/* ==============================
   FAQ
============================== */
.faq { padding: clamp(64px, 7vw, 100px) 0; background: var(--bg2); }
.faq .container { max-width: 860px; }

.faq-item {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.3);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  line-height: 1.6;
  transition: .2s;
  user-select: none;
  gap: 16px;
}

.faq-question:hover { background: rgba(122,184,69,.06); color: var(--primary-bright); }

.faq-arrow {
  flex-shrink: 0;
  color: var(--primary-glow);
  transition: transform .3s;
  font-size: 16px;
}

.faq-item.open .faq-arrow { transform: rotate(90deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.faq-item.open .faq-answer { max-height: 300px; }

.faq-answer p {
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.faq-instr-link {
  display: block;
  margin: -4px 24px 20px;
  color: var(--primary-glow);
  font-size: 18px;
  border-bottom: 1px dashed transparent;
  width: fit-content;
}
.faq-instr-link:hover { color: var(--primary-bright); border-bottom-color: currentColor; }

/* ==============================
   FOOTER
============================== */
footer {
  background: #050c05;
  border-top: 3px solid #1a2a1a;
  box-shadow: inset 0 3px 0 0 #0a140a;
  padding: 70px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 50px;
  margin-bottom: 50px;
}

.footer-brand .logo { display: block; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); font-size: 19px; line-height: 1.8; }

.footer-channel-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 18px;
  border: 2px solid rgba(74,226,226,.35);
  border-radius: var(--radius);
  background: rgba(74,226,226,.06);
  color: var(--diamond);
  font-size: 18px;
  transition: .2s;
}
.footer-channel-link:hover {
  border-color: var(--diamond);
  background: rgba(74,226,226,.14);
  color: #fff;
  transform: translateY(-2px);
}

.footer-note { margin-top: 12px; }

.footer-col h4 {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  margin-bottom: 18px;
  color: var(--primary-glow);
}

.footer-col a, .footer-col p {
  display: block;
  color: var(--muted);
  font-size: 19px;
  margin-bottom: 8px;
  transition: .2s;
}

.footer-col a:hover { color: var(--text); }

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-glow);
  font-size: 19px;
}

.footer-status::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-glow);
  box-shadow: 0 0 6px var(--primary-glow);
  animation: pingDot 2s ease-in-out infinite;
}

.footer-bottom {
  border-top: 1px solid #1a2a1a;
  padding-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
}

/* ==============================
   MODALS
============================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

.modal.active { display: flex; }

.modal-content {
  width: min(480px, 95%);
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow:
    inset -3px -4px 0 0 rgba(0,0,0,.5),
    inset 2px 2px 0 0 rgba(255,255,255,.04),
    0 30px 80px rgba(0,0,0,.7);
  animation: modalSlide .25s ease;
}

@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes modalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  line-height: 1.5;
}

.close-modal {
  width: 38px; height: 38px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  box-shadow: inset -1px -2px 0 0 rgba(0,0,0,.3);
}

.close-modal:hover { background: rgba(255,0,0,.15); color: #ff6b6b; border-color: rgba(255,0,0,.3); }

.modal form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
}

.modal-footer a { color: var(--primary-glow); cursor: pointer; }
.modal-footer a:hover { text-decoration: underline; }
.modal-footer-right { text-align: right; }

.tg-login-status {
  margin-top: 10px;
  text-align: center;
  font-size: 17px;
  color: var(--muted);
  min-height: 22px;
}

.modal form > #loginMessage,
.modal form > #registerMessage {
  text-align: center;
  min-height: 22px;
  font-size: 18px;
}

.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
}
.agreement-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary-bright);
  flex-shrink: 0;
  cursor: pointer;
}
.agreement-check a { color: var(--primary-glow); }
.agreement-check a:hover { text-decoration: underline; }

/* ==============================
   USER MENU (logged in)
============================== */
.user-menu {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-menu a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: .2s;
  font-size: 20px;
}

.user-menu a:hover {
  color: var(--text);
  border-color: rgba(122,184,69,.25);
  background: rgba(122,184,69,.08);
}

/* ==============================
   TABLES (shared)
============================== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.05); }
th { text-align: left; color: var(--muted); font-family: 'Press Start 2P', monospace; font-size: 11px; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tr:last-child td { border-bottom: none; }

/* ==============================
   SCROLL TO TOP
============================== */
.scroll-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 48px; height: 48px;
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 900;
  transition: .2s;
  box-shadow: inset -2px -3px 0 0 rgba(0,0,0,.4);
}

.scroll-top.visible { display: flex; }
.scroll-top:hover { border-color: var(--primary); color: var(--primary-glow); transform: translateY(-3px); }

/* ==============================
   TOAST NOTIFICATIONS
============================== */
.toast-container {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 480px;
}

.toast {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 19px;
  box-shadow:
    inset -2px -3px 0 0 rgba(0,0,0,.4),
    0 8px 24px rgba(0,0,0,.5);
  animation: toastIn .3s ease;
  text-align: center;
  max-width: 100%;
}

.toast.success { border-color: rgba(86,211,100,.4); color: var(--primary-glow); }
.toast.error   { border-color: rgba(232,64,64,.4);  color: #ff8080; }

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(20px); opacity: 0; }
}

/* ==============================
   ANIMATIONS
============================== */
@keyframes bgFloat {
  from { background-position: 0 0, 40px 40px; }
  to   { background-position: 80px 80px, 120px 120px; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes glow {
  0%, 100% { text-shadow: 2px 2px 0 rgba(0,0,0,.6), 0 0 20px rgba(122,184,69,.2); }
  50%       { text-shadow: 2px 2px 0 rgba(0,0,0,.6), 0 0 40px rgba(122,184,69,.5); }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-glow  { animation: glow 3s ease-in-out infinite; }

/* ==============================
   ENCHANT SHIMMER (featured card)
============================== */
.featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(122,184,69,.06) 50%,
    transparent 60%
  );
  background-size: 200% 200%;
  animation: enchantShimmer 3s linear infinite;
  pointer-events: none;
}

@keyframes enchantShimmer {
  0%   { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

/* ==============================
   RESPONSIVE
============================== */
/* Desktop (>=1200px): two-row header. 8 nav links + logo + lang switch +
   auth buttons need ~1500px in a single row — more than the 1300px container —
   so the row was overflowing and wrapping ("кривое меню"). Row 1 carries the
   logo and auth cluster, row 2 centers the full nav; both fit at any width. */
@media (min-width: 1200px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    gap: 0 20px;
  }
  .navbar > .nav-drawer > nav {
    order: 5;
    flex-basis: 100%;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    border-top: 2px solid rgba(255,255,255,.05);
    padding: 5px 0;
  }
  /* Header-row buttons one step slimmer than page CTAs, so row 1 stays lean */
  .navbar .mc-btn { padding: 9px 20px; font-size: 20px; }
  .navbar .btn-secondary { padding: 6px 18px; font-size: 20px; }
  /* Long display names must not push the header apart — truncate instead */
  .user-menu a:first-child {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Hamburger + drawer for everything below the full-nav threshold */
@media (max-width: 1199px) {
  :root { --header-h: 76px; }
  .hamburger { display: flex; }

  .nav-drawer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: rgba(4,10,4,.98);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid #1a2a1a;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-drawer.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-drawer nav { flex-direction: column; gap: 4px; }
  .nav-drawer nav a {
    font-size: 18px;
    padding: 13px 14px;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
  }

  .auth-buttons { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .user-menu { flex-wrap: wrap; justify-content: center; }
  .auth-buttons .mc-btn,
  .auth-buttons .btn-secondary { flex: 1 1 auto; min-height: 44px; }
}

@media (max-width: 900px) {
  .hero h1 { font-size: 26px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr; }
  .tariff-card.featured { transform: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .navbar { height: 64px; gap: 10px; position: relative; }
  .logo { font-size: 13px; }
  .logo .logo-sub { display: none; }

  /* Sections: keep air, but tighter than desktop's 100px */
  .features, .tariffs, .how-it-works, .instructions, .feedback, .faq {
    padding: 64px 0;
  }
  .section-header { margin-bottom: 40px; }
  section h2 { font-size: 16px; margin-bottom: 40px; }

  /* Hero */
  .hero { padding-top: 90px; }
  .hero h1 { font-size: 20px; }
  .hero > .container > p { font-size: 19px; }
  .hero-buttons .mc-btn,
  .hero-buttons .btn-secondary { min-height: 44px; }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    gap: 0;
  }
  .stat { border-right: 3px solid #2a3a2a; border-bottom: 3px solid #2a3a2a; padding: 14px 10px; }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(n+3) { border-bottom: none; }

  /* Tariff card */
  .tariff-card { padding: 28px 20px; }
  .duration-tabs { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
  .duration-tab { padding: 10px 4px; min-height: 44px; justify-content: center; }
  .device-btn { min-height: 44px; padding: 10px 0; font-size: 16px; }
  .device-custom input { min-height: 44px; padding: 12px; }
  .buy-btn { min-height: 48px; }

  /* Inputs / forms: ≥16px avoids iOS auto-zoom, ≥44px is a comfortable tap target */
  input, textarea, select {
    font-size: 16px;
    min-height: 44px;
  }
  .mc-btn, .btn-primary, .buy-btn, .btn-login, .btn-register,
  .btn-secondary, form button[type="submit"], .modal form button {
    min-height: 44px;
  }
  .file-upload-label { min-height: 44px; font-size: 18px; }

  .feedback-inner { padding: 30px 20px; }
  .feedback-submit { width: 100%; min-width: 0; }

  /* Instructions accordion */
  .instr-question { font-size: 12px; padding: 18px 20px; }
  .instr-steps { padding: 4px 20px 22px; }
  .instr-steps > li { font-size: 18px; padding-left: 42px; }

  /* FAQ */
  .faq-question { font-size: 11px; padding: 18px 20px; }
  .faq-answer p { font-size: 18px; }

  .footer-grid { grid-template-columns: 1fr; }

  /* Toasts: keep clear of bottom CTAs / on-screen keyboard, show under header instead */
  .toast-container {
    bottom: auto;
    top: calc(var(--header-h) + 12px);
    width: calc(100% - 24px);
  }

  /* Modals: near full-screen bottom sheet, scrollable, big close target */
  .modal { align-items: flex-end; }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    animation: modalSlideUp .25s ease;
  }
  .close-modal { width: 44px; height: 44px; font-size: 22px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 16px; }
  .price { font-size: 28px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .mc-btn,
  .hero-buttons .btn-secondary { width: 100%; max-width: 280px; }

  .features, .tariffs, .how-it-works, .instructions, .feedback, .faq {
    padding: 48px 0;
  }
  .section-header { margin-bottom: 30px; }
  section h2 { margin-bottom: 30px; }

  .feedback-inner { padding: 24px 16px; }
  .tariff-card { padding: 24px 16px; }

  /* 5 duration tabs never fit comfortably in one row below ~420px — force 3/row */
  .duration-tabs { grid-template-columns: repeat(3, 1fr); }

  /* Device grid: 5 columns keeps tap targets big; "11+" spans a full row */
  .device-grid { grid-template-columns: repeat(5, 1fr); }
  .device-btn-custom { grid-column: span 5; }

  .modal-content { padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
}
