:root {
  --grass: #5d9c3f;
  --grass-light: #8bc34a;
  --grass-dark: #3e6e28;
  --dirt: #8d6e4f;
  --plank: #c4a574;
  --paper: #fff8e8;
  --ink: #2d2218;
  --muted: #6b5843;
  --gold: #efc94c;
  --sky: #9fd6ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: Nunito, system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.55), transparent 22%),
    linear-gradient(#9fd6ff 0%, #c8e9ff 40%, #e7f7c9 78%, #bfe38a 100%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.pixel { font-family: "Press Start 2P", monospace; letter-spacing: .02em; }

.mc-border {
  border: 4px solid #3b2a1a;
  box-shadow: inset 4px 4px 0 rgba(255,255,255,.28), inset -4px -4px 0 rgba(0,0,0,.22), 0 8px 0 #2a1c12;
}
.mc-border-sm {
  border: 3px solid #3b2a1a;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.25), inset -3px -3px 0 rgba(0,0,0,.2), 0 4px 0 #2a1c12;
}
.mc-panel { background: linear-gradient(#fff8e8, #f0e2c4); }
.mc-slot {
  background: linear-gradient(#d8c39a, #c4a574);
  border: 3px solid #3b2a1a;
  box-shadow: inset 3px 3px 0 #efe3c8, inset -3px -3px 0 #8d6e4f;
}
.mc-btn, button.mc-btn, input.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.1rem; cursor: pointer;
  background: linear-gradient(#86c44a, #4e8a2c);
  color: #fffdf4; font-weight: 800; font-family: inherit; font-size: 15px;
  text-shadow: 0 2px 0 #2f5a18;
  border: 3px solid #2a1c12;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.28), inset -3px -3px 0 rgba(0,0,0,.22), 0 5px 0 #1c140c;
}
.mc-btn:hover { filter: brightness(1.06); }
.mc-btn-gold { background: linear-gradient(#ffd54a, #e09a12); text-shadow: 0 2px 0 #8a5a00; }
.mc-btn-dirt { background: linear-gradient(#c4a574, #8d6e4f); text-shadow: 0 2px 0 #4a3424; }
.mc-btn-ghost { background: linear-gradient(#fff7e6, #ead9b4); color: #2d2218; text-shadow: none; }
.mc-input, .mc-select, .mc-textarea {
  width: 100%; background: #fffdf6; border: 3px solid #3b2a1a;
  box-shadow: inset 3px 3px 0 #efe6d2; padding: .7rem .85rem; color: #2d2218;
  font: inherit; font-size: 16px;
}
.mc-input:focus, .mc-select:focus, .mc-textarea:focus { outline: 3px solid #8bc34a; }

.site-header { position: sticky; top: 0; z-index: 40; }
.grass-strip {
  height: 8px;
  background: repeating-linear-gradient(90deg, #5d9c3f 0 16px, #68a948 16px 32px, #549138 32px 48px);
  box-shadow: inset 0 -4px 0 #3e6e28;
}
.header-bar {
  background: rgba(255,248,232,.96); border-bottom: 4px solid #3b2a1a; padding: 12px 0;
}
.header-inner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.logo-text { font-size: 12px; }
.logo-block {
  width: 48px; height: 48px; position: relative; overflow: hidden;
}
.logo-block span { position: absolute; inset: 0; }
.logo-block .top { background: #6d9c3f; height: 50%; }
.logo-block .bot { background: #8d6e4f; top: 50%; height: 50%; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; font-weight: 800; }
.nav a:hover { background: #efe3c8; }
.search { margin-left: auto; min-width: 220px; flex: 1; max-width: 340px; position: relative; }
.search input { padding-left: 36px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 10px; color: #6b5843; font-weight: 900; }
.menu-btn { display: none; }
.auth-links { display: flex; align-items: center; gap: 10px; font-weight: 800; white-space: nowrap; }
.auth-links form { display: inline; }
.lang-switch { display: flex; overflow: hidden; font-weight: 900; flex: 0 0 auto; }
.lang-switch a { padding: 7px 10px; }
.lang-switch a.active { background: #8bc34a; color: #fff; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 42px 0 24px; }
.hero h1 { font-size: clamp(22px, 4vw, 36px); line-height: 1.45; margin: 12px 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.muted { color: var(--muted); font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill { display: inline-block; padding: 8px 12px; font-size: 14px; font-weight: 800; background: #fff8e8; }
.pill.active { background: #8bc34a; color: #fff; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
.card { display: flex; flex-direction: column; overflow: hidden; height: 100%; background: linear-gradient(#fff8e8, #f0e2c4); }
.card-cover { aspect-ratio: 16/10; background: #d7f0a3; position: relative; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; }
.badge { background: #ffe082; padding: 4px 8px; font-size: 12px; font-weight: 900; }
.badge.free { background: #c5e1a5; }
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 13px; line-height: 1.5; margin: 6px 0; }
.price { font-size: 22px; font-weight: 900; }
.section { padding: 28px 0; }
.section h2 { margin: 0 0 16px; font-size: 16px; }
.crumbs { font-weight: 800; color: var(--muted); margin: 18px 0 12px; }
.crumbs a:hover { color: var(--ink); }
.page { padding: 18px 0 48px; }
.prose { line-height: 1.7; font-weight: 700; color: #4a3828; overflow-wrap: anywhere; }
.prose h2 { font-family: "Press Start 2P", monospace; font-size: 13px; }
.gallery { overflow: hidden; }
.gallery-main {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  aspect-ratio: 16/10; background: #d7f0a3;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px; background: #fff8e8; padding: 6px 10px;
  font-size: 13px; font-weight: 900;
}
.thumbs { display: flex; gap: 8px; padding: 10px; overflow: auto; }
.thumbs button { width: 96px; height: 64px; padding: 0; border: 3px solid #3b2a1a; background: none; cursor: pointer; flex: 0 0 auto; }
.thumbs button.on { outline: 3px solid #8bc34a; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(20,12,8,.82);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(1100px, 94vw); max-height: 86vh; object-fit: contain; background: #1a120c; box-shadow: 0 8px 0 #3b2a1a; }
.lightbox button {
  position: absolute; cursor: pointer; font-weight: 900; font-size: 28px; line-height: 1;
  background: #fff8e8; border: 3px solid #3b2a1a; width: 48px; height: 48px;
}
.lightbox [data-lb-close] { top: 16px; right: 16px; z-index: 2; }
.lightbox [data-lb-prev], .lightbox [data-lb-next] { top: 50%; transform: translateY(-50%); }
.lightbox [data-lb-prev] { left: 16px; }
.lightbox [data-lb-next] { right: 16px; }
.lightbox.is-single [data-lb-prev], .lightbox.is-single [data-lb-next] { display: none; }
.admin-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.admin-photo { width: 140px; background: #efe3c8; padding: 6px; }
.admin-photo img { width: 100%; height: 96px; object-fit: cover; display: block; }
.admin-cover, .admin-gallery { margin: 8px 0; }
.file-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.file-preview img { width: 120px; height: 80px; object-fit: cover; }
.buybox { position: sticky; top: 92px; padding: 20px; }
.buy-actions .mc-btn { min-width: 180px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flash { padding: 12px 14px; margin: 12px 0; font-weight: 800; }
.flash.ok { background: #c5e1a5; }
.flash.bad { background: #ef9a9a; }
.status { display: inline-block; padding: 4px 10px; font-size: 13px; font-weight: 900; }
.status-NEW { background: #ffe082; }
.status-CONFIRMED { background: #c5e1a5; }
.status-REVISION { background: #ffcc80; }
.status-CANCELLED { background: #ef9a9a; }
.status-COMPLETED { background: #80deea; }

.site-footer { margin-top: 48px; }
.dirt-strip {
  background: repeating-linear-gradient(90deg, #8d6e4f 0 18px, #7a5c40 18px 36px);
  color: #fff8e8; border-top: 4px solid #3b2a1a;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; padding: 36px 0; }
.footer-copy { border-top: 2px solid #5a4330; text-align: center; padding: 12px; font-size: 12px; }
.hero-art { position: relative; height: 320px; }
.block { position: absolute; width: 120px; height: 120px; }
.block.a { left: 20px; top: 10px; background: linear-gradient(#6d9c3f 50%, #8d6e4f 50%); }
.block.b { right: 20px; top: 70px; background: #3ad0d6; width: 96px; height: 96px; }
.block.c { left: 80px; bottom: 20px; background: #c4a574; width: 130px; height: 130px; display: grid; place-items: center; font-size: 42px; }
.achieve { position: absolute; right: 10px; bottom: 8px; background: #fff; padding: 8px 10px; font-size: 10px; }
.admin-bar { background: #fff8e8; border-bottom: 4px solid #3b2a1a; padding: 10px 0; }
.admin-bar nav { display: flex; gap: 10px; flex-wrap: wrap; font-weight: 800; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; text-align: left; border-top: 1px solid #e0d0b0; }
.table th { background: #efe3c8; }
.form-grid { display: grid; gap: 12px; }
label.field { display: block; font-weight: 800; font-size: 14px; }
label.field > * { margin-top: 6px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 800; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pager a { width: 40px; height: 40px; display: grid; place-items: center; background: #fff; font-weight: 900; }
.pager a.on { background: #8bc34a; color: #fff; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha-box { display: grid; gap: 8px; }
.captcha-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.captcha-img { background: #fff8e8; height: 56px; width: 180px; object-fit: contain; }

@media (max-width: 1024px) {
  .hero, .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .buybox { position: static; }
}

@media (max-width: 820px) {
  .wrap { width: min(1120px, calc(100% - 20px)); }
  .menu-btn {
    display: grid; place-items: center; margin-left: auto;
    width: 44px; height: 44px; padding: 0; font-size: 20px; cursor: pointer;
  }
  .nav, .search, .auth-links { display: none; width: 100%; }
  .site-header.is-open .nav,
  .site-header.is-open .search,
  .site-header.is-open .auth-links { display: flex; }
  .site-header.is-open .nav { flex-direction: column; gap: 0; }
  .site-header.is-open .nav a { padding: 12px; border-top: 1px solid #e6d3ad; }
  .site-header.is-open .search { max-width: none; min-width: 0; margin: 0; }
  .site-header.is-open .auth-links { justify-content: flex-start; padding-bottom: 8px; }
  .lang-switch { margin-left: auto; margin-right: 8px; }
  .hero { padding: 22px 0 8px; gap: 16px; }
  .hero h1 { font-size: clamp(16px, 5.2vw, 26px); line-height: 1.55; }
  .hero-art { display: none; }
  .hero-actions { display: grid; }
  .hero-actions .mc-btn,
  .buy-actions .mc-btn,
  .form-grid .mc-btn { width: 100%; }
  .logo-sub { display: none; }
  .pixel { line-height: 1.6; }
  .pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .pill { flex: 0 0 auto; }
  .page { padding: 12px 0 36px; }
  .crumbs { font-size: 13px; }
  .stats { grid-template-columns: 1fr; }
  .card h3 { font-size: 12px; }
  .text-edit { grid-template-columns: 1fr !important; }
  .footer-grid { padding: 24px 0; gap: 16px; }
  .admin-bar nav { font-size: 14px; }
}

@media (max-width: 480px) {
  .logo-block { width: 40px; height: 40px; }
  .logo-text { font-size: 11px; }
  .mc-border {
    border-width: 3px;
    box-shadow: inset 3px 3px 0 rgba(255,255,255,.28), inset -3px -3px 0 rgba(0,0,0,.22), 0 5px 0 #2a1c12;
  }
}
