:root {
  --bg: #17181c;
  --panel: #212329;
  --panel-2: #2a2d34;
  --edge: #0d0e10;
  --text: #e6e6e6;
  --muted: #9a9ca3;
  --green: #4caf3a;
  --green-dark: #2f7a22;
  --gold: #f2c230;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 Rubik, Arial, sans-serif; }
a { color: #7fc6ff; }
h1, h2, h3 { font-family: "Pixelify Sans", Rubik, sans-serif; font-weight: 700; letter-spacing: .5px; margin: 0 0 10px; }
.px { image-rendering: pixelated; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- banner ---------- */
.banner {
  background:
    linear-gradient(rgba(10, 10, 12, .35), rgba(10, 10, 12, .65)),
    url(img/grass_side.png) top left / 64px 64px repeat-x,
    url(img/dirt.png) 0 64px / 64px 64px repeat;
  image-rendering: pixelated;
  border-bottom: 4px solid var(--edge);
}
.banner-inner { max-width: 1180px; margin: 0 auto; padding: 34px 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.logo img { display: block; width: 420px; max-width: 100%; image-rendering: auto; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.6)); }
.infobox {
  justify-self: start; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(0,0,0,.55); border: 2px solid var(--edge); color: var(--text); text-decoration: none;
  font: inherit; cursor: pointer; text-align: left;
}
.infobox:hover { background: rgba(0,0,0,.7); }
.infobox img { width: 32px; height: 32px; }
.infobox span { display: flex; flex-direction: column; line-height: 1.25; }
.infobox b { font-size: 16px; letter-spacing: .5px; }
.infobox small { color: var(--muted); }
.infobox.right { justify-self: end; text-align: right; color: #aab4ff; }
.infobox.right b { color: var(--text); }

/* ---------- menu ---------- */
.menu { background: var(--panel); border-bottom: 2px solid var(--edge); position: sticky; top: 0; z-index: 10; }
.menu-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: stretch; overflow-x: auto; }
.menu a { padding: 14px 14px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.menu a:hover { color: var(--text); }
.menu a.on { color: var(--text); border-bottom-color: var(--green); }
.basket-link { margin-left: auto; background: none; border: 0; color: var(--gold); font: 500 15px Rubik, sans-serif; cursor: pointer; white-space: nowrap; padding: 0 4px 0 16px; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 24px auto; padding: 0 16px; display: grid; grid-template-columns: 1fr 290px; gap: 20px; align-items: start; }
.box { background: var(--panel); border: 2px solid var(--edge); padding: 16px; margin-bottom: 16px; }
.box h3 { font-size: 18px; border-bottom: 2px solid var(--panel-2); padding-bottom: 8px; }
.login { display: flex; gap: 8px; margin-top: 10px; }
.login img { image-rendering: pixelated; border: 2px solid var(--edge); }
input { flex: 1; min-width: 0; background: var(--bg); border: 2px solid var(--edge); color: var(--text); padding: 6px 10px; font: inherit; }
input:focus { outline: 2px solid var(--green); }

/* ---------- posts ---------- */
.post { background: var(--panel); border: 2px solid var(--edge); padding: 20px 22px; margin-bottom: 16px; }
.post-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.post-meta img { image-rendering: pixelated; }
.post h2 { font-size: 24px; margin-bottom: 4px; }
.post p { margin: 0 0 12px; }
.post ul { margin: 0 0 12px; padding-left: 20px; }

/* ---------- packages ---------- */
.cat-head { margin-bottom: 16px; }
.cat-head h1 { font-size: 30px; margin-bottom: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pkg { background: var(--panel); border: 2px solid var(--edge); padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pkg img { width: 64px; height: 64px; image-rendering: pixelated; margin: 4px 0 6px; }
.pkg h3 { font-size: 19px; margin: 0; }
.pkg .price { color: var(--gold); font-weight: 700; }
.pkg .price s { color: var(--muted); font-weight: 400; margin-right: 4px; }
.pkg .sale { font-size: 12px; color: #ff7b6b; font-weight: 700; }

.btn {
  font: 700 15px Rubik, sans-serif; color: #fff; cursor: pointer; padding: 8px 18px; margin-top: 6px;
  background: #6b6e75; border: 2px solid var(--edge); box-shadow: inset -2px -3px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.18);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { box-shadow: inset 2px 3px 0 rgba(0,0,0,.35); }
.btn.green { background: var(--green); }
.btn.wide { width: 100%; padding: 12px; font-size: 16px; }

/* ---------- table / rules ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
th, td { border: 2px solid var(--edge); padding: 8px 10px; text-align: center; background: var(--panel); }
th { font-family: "Pixelify Sans", sans-serif; font-size: 16px; background: var(--panel-2); }
td:first-child { text-align: left; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.rules li { margin-bottom: 8px; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border: 2px solid var(--edge); width: min(460px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px; position: relative; }
.x { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.modal-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.modal-top img { width: 64px; height: 64px; image-rendering: pixelated; }
.modal-top h2 { margin: 0; }
.modal-card ul { padding-left: 20px; margin: 0 0 12px; }
.basket-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 2px solid var(--panel-2); }
.basket-row img { width: 32px; height: 32px; image-rendering: pixelated; }
.basket-row .n { flex: 1; }
.basket-row button { background: var(--panel-2); color: var(--text); border: 2px solid var(--edge); width: 28px; height: 28px; cursor: pointer; }
.basket-foot { display: flex; justify-content: space-between; padding: 12px 0; font-size: 17px; }
.basket-foot b { color: var(--gold); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 100px); background: var(--panel); border: 2px solid var(--green);
  padding: 10px 18px; transition: transform .2s; z-index: 60; }
.toast.show { transform: translate(-50%, 0); }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; border-top: 2px solid var(--edge); background: #131417; }
footer p { margin: 4px 0; }

@media (max-width: 860px) {
  .wrap { grid-template-columns: 1fr; }
  .banner-inner { grid-template-columns: 1fr; justify-items: center; padding: 22px 16px; }
  .banner-inner .logo { order: -1; }
  .infobox, .infobox.right { justify-self: center; }
  .logo img { width: 300px; }
}
