*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0D0E13;
  --bg2:       #111318;
  --bg3:       #181B26;
  --card:      #161921;
  --card2:     #1C1F2C;
  --accent:    #5B7BFE;
  --accent2:   #7C9AFF;
  --accentdim: rgba(91,123,254,.12);
  --green:     #3DBA6F;
  --greendim:  rgba(61,186,111,.12);
  --text:      #DDE0F5;
  --text2:     #7A80A4;
  --text3:     #5A6080;
  --border:    rgba(255,255,255,.06);
  --border2:   rgba(255,255,255,.10);
  --yellow:    #FFBD3E;
  --red:       #E05555;
  --reddim:    rgba(220,60,60,.12);
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,14,19,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

.nav-links { display: flex; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: color .14s;
  border: none;
  background: none;
  font-family: inherit;
}
.nav-link i { font-size: 18px; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }

.ip-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .14s, transform .14s;
}
.ip-badge:hover { border-color: rgba(91,123,254,.4); }
.ip-dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: var(--green); 
  animation: pulse-dot 2s cubic-bezier(.4,0,.6,1) infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.85); }
}

.ip-text { color: var(--text3); font-weight: 500; }
.ip-val { color: var(--text); font-weight: 700; }

/* ── SECTIONS ── */
.section { display: none; padding: 48px 32px; max-width: 1100px; margin: 0 auto; }
.section.visible { display: block; }

/* ── HERO ── */
.hero { text-align: center; padding: 72px 32px 56px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--greendim);
  border: 1px solid rgba(61,186,111,.2);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 28px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 18px;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.stats-row {
  display: flex;
  justify-content: center;
  margin-top: 52px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}
.stat { flex: 1; padding: 22px 24px; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.stat-lbl { font-size: 13px; color: var(--text3); margin-top: 4px; font-weight: 500; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .14s;
  border: none;
  font-family: inherit;
}
.btn i { font-size: 18px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { background: var(--accent); }

.btn-ghost {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: rgba(91,123,254,.35); color: var(--accent); }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 32px; }
.page-header h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.page-header p { font-size: 16px; color: var(--text2); line-height: 1.6; }

/* ── SEARCH ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 24px;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  flex: 1;
}
.search-bar input::placeholder { color: var(--text3); }

/* ── CRAFT CARDS ── */
.crafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.craft-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.craft-card:hover { 
  border-color: var(--border2); 
  transform: translateY(-3px); 
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.craft-img {
  width: 100%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100px;
}
.craft-img img { width: 100%; height: auto; display: block; }

.craft-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text3);
  font-size: 14px;
  padding: 32px;
}
.craft-img-placeholder i { font-size: 40px; opacity: .4; }

.craft-info { padding: 16px 18px; }
.craft-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.craft-desc { font-size: 14px; color: var(--text2); line-height: 1.6; }
.craft-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accentdim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── INFO ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.info-card-icon.blue { background: var(--accentdim); }
.info-card-icon.green { background: var(--greendim); }

.info-card h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.info-card .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.info-card .val.green { color: var(--green); }
.info-card .sub { font-size: 13px; color: var(--text3); margin-top: 4px; font-weight: 500; }

.copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.copy-row code { flex: 1; font-family: monospace; font-size: 17px; color: var(--accent); font-weight: 700; }
.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accentdim);
  color: var(--accent);
  border: 1px solid rgba(91,123,254,.2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .14s;
  font-family: inherit;
}
.copy-btn:hover { background: var(--accent); color: #fff; }

/* ── RULES ── */
.rules-category {
  margin-bottom: 24px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
  padding: 0 4px;
}
.category-header i { font-size: 18px; color: var(--accent); }

.rules-category.danger .category-header i { color: var(--red); }
.rules-category.danger .category-header { color: var(--red); }

.rules-list { display: flex; flex-direction: column; gap: 12px; }

.rule-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color .15s, transform .15s;
}
.rule-item:hover { border-color: var(--border2); transform: translateX(2px); }

.rule-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accentdim);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rule-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.rule-text { font-size: 15px; color: var(--text2); line-height: 1.65; }

.rule-item.danger { border-color: rgba(220,60,60,.15); }

/* Status colors */
.val.offline { color: var(--red); }
.info-card-icon.offline { background: var(--reddim); }
.info-card-icon.offline i { color: var(--red) !important; }
.rule-item.danger:hover { border-color: rgba(220,60,60,.3); }
.rule-item.danger .rule-num { background: var(--reddim); color: var(--red); }
.rule-item.danger .rule-title { color: var(--red); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
}
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal .modal-sub { font-size: 15px; color: var(--text2); margin-bottom: 20px; }

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text2);
}
.modal-close:hover { color: var(--text); }

.modal input[type="text"] {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  width: 100%;
  transition: border-color .14s;
}
.modal input[type="text"]:focus { border-color: rgba(91,123,254,.5); }
.modal input[type="text"]::placeholder { color: var(--text3); }

/* ── PHOTO UPLOAD ── */
.craft-photo {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  cursor: pointer;
  border: 1.5px dashed var(--border2);
  transition: border-color .14s;
  overflow: hidden;
  color: var(--text3);
}
.craft-photo:hover { border-color: rgba(91,123,254,.4); color: var(--accent); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(61,186,111,.35); color: var(--green); }

/* ── SCROLL TO TOP ── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  transition: all .25s;
  pointer-events: none;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.scroll-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 0 16px; height: 58px; justify-content: space-between; }
  .nav-links .nav-link span { display: none; }
  .nav-link { padding: 8px 12px; }
  .nav-link i { font-size: 20px; }
  .section { padding: 28px 16px; }
  .hero { padding: 48px 16px 36px; }
  .hero h1 { font-size: clamp(36px, 10vw, 52px); }
  .hero p { font-size: 16px; }
  .stats-row { flex-direction: column; border-radius: 12px; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); padding: 18px 20px; }
  .stat:last-child { border-bottom: none; }
  .stat-num { font-size: 22px; }
  .info-grid { grid-template-columns: 1fr; }
  .crafts-grid { grid-template-columns: 1fr; }
  .page-header h2 { font-size: 24px; }
  .rule-item { padding: 16px 18px; }
  .rule-text { font-size: 14px; }
}

@media (max-width: 480px) {
  .ip-badge .ip-text, .ip-badge .ip-val { display: none; }
  .ip-badge { padding: 8px; }
  .hero-btns { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}