:root {
  --bg: #050505;
  --panel: rgba(15, 15, 15, 0.85);
  --panel-hover: rgba(30, 30, 30, 0.95);
  --text: #e0e0e0;
  --muted: #888888;
  --white: #ffffff;
  --border: rgba(255, 255, 255, 0.15);
  --font-display: "Yeseva One", Georgia, serif;
  --font-body: "Literata", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image: url('grimoire.jpg'); /* Фоновая картинка */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
/* Затемнение и ЧБ-фильтр для фона, чтобы текст читался */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: rgba(0, 0, 0, 0.85); backdrop-filter: grayscale(100%) blur(2px);
}

h1, h2, h3 { font-family: var(--font-display); color: var(--white); font-weight: normal; margin-bottom: 0.5em; }
a { color: var(--white); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--muted); text-decoration: underline; }
p { max-width: 68ch; margin-bottom: 1rem; color: var(--muted); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }

/* ШАПКА */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 5, 5, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); display: flex; align-items: center; gap: 10px; }
.logo svg { width: 30px; fill: var(--white); }
nav ul { display: flex; gap: 20px; list-style: none; }
nav a { color: var(--text); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }
nav a:hover, nav a.active { color: var(--white); text-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* КНОПКИ */
.btn {
  display: inline-block; padding: 12px 24px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 1px; border: 1px solid var(--border); background: rgba(255,255,255,0.05);
  color: var(--white); cursor: pointer; transition: 0.3s; text-align: center; font-family: var(--font-body);
}
.btn:hover { background: rgba(255,255,255,0.15); border-color: var(--white); box-shadow: 0 0 15px rgba(255,255,255,0.2); text-decoration: none; }
.btn-primary { background: var(--white); color: var(--bg); border-color: var(--white); }
.btn-primary:hover { background: #cccccc; color: var(--bg); box-shadow: 0 0 25px rgba(255,255,255,0.4); }

/* HERO */
.hero { padding: 120px 0 80px; text-align: center; }
.hero h1 { font-size: 4rem; margin-bottom: 20px; text-shadow: 0 0 20px rgba(255,255,255,0.2); }
.hero p { margin: 0 auto 30px; font-size: 1.2rem; color: var(--muted); }
.ip-box {
  display: inline-flex; align-items: center; gap: 15px; background: var(--panel);
  border: 1px solid var(--border); padding: 10px 20px; margin-bottom: 30px;
}
.ip-box code { font-size: 1.2rem; color: var(--white); font-family: monospace; }
.hero-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* СЕКЦИИ И КАРТОЧКИ */
.panel {
  background: var(--panel); border: 1px solid var(--border); padding: 40px;
  backdrop-filter: blur(5px);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); padding: 30px; position: relative;
  transition: 0.3s;
}
.card:hover { border-color: rgba(255,255,255,0.4); background: var(--panel-hover); box-shadow: 0 0 20px rgba(255,255,255,0.05); }
.card h3 { margin-bottom: 15px; font-size: 1.5rem; color: var(--white); }
.card .price { font-size: 2rem; color: var(--white); margin-bottom: 20px; font-weight: bold; }
.card ul { list-style: none; margin-bottom: 25px; color: var(--muted); }
.card ul li::before { content: "✦"; color: var(--white); margin-right: 10px; }

/* ГРИМУАРЫ */
.books-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.book {
  perspective: 1000px; cursor: pointer; height: 400px; position: relative;
}
.book-inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.6s;
  transform-style: preserve-3d;
}
.book.is-open .book-inner { transform: rotateY(180deg); }
.book-front, .book-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: #111; border: 1px solid #333; display: flex; flex-direction: column;
  padding: 20px; border-radius: 5px; box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.book-front { align-items: center; justify-content: center; text-align: center; }
.book-front svg { width: 100px; height: 100px; fill: var(--white); margin-bottom: 20px; }
.book-back { transform: rotateY(180deg); overflow-y: auto; justify-content: flex-start; }
.book-back h4 { color: var(--white); margin-bottom: 10px; }
.book-back ul { margin-left: 20px; color: var(--muted); font-size: 0.9rem; margin-bottom: 15px; }
.book-rarity { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); border: 1px solid #333; padding: 3px 10px; border-radius: 20px; margin-bottom: 15px; }

/* АТРИБУТЫ */
.attrs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.attr { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--panel); border: 1px solid var(--border); }
.attr svg { width: 30px; height: 30px; stroke: var(--white); fill: none; stroke-width: 1.5; }
.attr h4 { margin: 0; font-size: 1rem; color: var(--white); }
.attr p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* FAQ */
.faq-item { border: 1px solid var(--border); margin-bottom: 10px; background: var(--panel); }
.faq-btn { width: 100%; text-align: left; padding: 20px; background: none; border: none; color: var(--white); font-size: 1rem; font-family: var(--font-body); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-btn:hover { background: rgba(255,255,255,0.05); }
.faq-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; padding: 0 20px; }
.faq-panel p { padding-bottom: 20px; margin: 0; }

/* АДМИНКА */
.admin-login { max-width: 400px; margin: 100px auto; padding: 30px; background: var(--panel); border: 1px solid var(--border); }
input[type="text"], input[type="password"] { width: 100%; padding: 12px; margin-bottom: 15px; background: #000; border: 1px solid #333; color: var(--white); outline: none; }
input:focus { border-color: #fff; }
footer { text-align: center; padding: 30px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; margin-top: 50px; }