@font-face {
  font-family: 'Minecraft Five';
  src: url('/fonts/minecraft-five-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* HotaruMC: тёмный фон + lime-green акцент */
  --bg: #0B0D0A;
  --surface: #14170F;
  --surface-2: #1B2015;
  --line: #262B20;
  --lime-500: #A6FF3C;
  --lime-300: #D4FF8C;
  --lime-glow: rgba(166, 255, 60, 0.35);
  --ink-900: #F3F6EC;
  --ink-600: #9BA48E;
  --white: #FFFFFF;
  --red: #FF5C7A;
  --brand-gradient: linear-gradient(135deg, #C6FF5C 0%, #6EE13A 100%);
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-pixel: 'Minecraft Five', monospace;
  --max-w: 1120px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
:focus-visible { outline: 3px solid var(--lime-500); outline-offset: 3px; border-radius: 4px; }

/* -------------------- stamp -------------------- */
.stamp {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-pixel); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lime-500); background: rgba(166,255,60,0.1);
  border: 1.5px dashed rgba(166,255,60,0.4);
  border-radius: 999px; padding: 8px 14px;
  transform: rotate(-1.5deg);
}
.stamp::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--brand-gradient); flex: none; }
.stamp--surface { color: var(--ink-900); background: var(--surface); border-color: var(--line); }

/* -------------------- header -------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,13,10,0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; flex: none; }
.firefly-mark { width: 30px; height: 30px; position: relative; flex: none; }
.firefly-mark .glow {
  position: absolute; inset: -6px; border-radius: 50%;
  background: var(--lime-500); filter: blur(9px); opacity: 0.65;
}
.firefly-mark .core {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--brand-gradient);
}

.nav { display: flex; gap: 4px; }
.nav a { padding: 9px 15px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-600); transition: color 0.2s ease, background 0.2s ease; }
.nav a:hover, .nav a.active { color: var(--ink-900); background: var(--surface); }

/* -------------------- buttons -------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 800; font-size: 14.5px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-gradient); color: #0B0D0A; box-shadow: 0 10px 26px -10px var(--lime-glow); }
.btn-ghost { background: var(--surface); color: var(--ink-900); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--lime-500); }
.btn-danger { background: rgba(255,92,122,0.12); color: var(--red); border-color: rgba(255,92,122,0.3); }

/* -------------------- hero -------------------- */
.hero { position: relative; padding: 90px 0 80px; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 22px 0 18px; }
.hero h1 em { font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 17.5px; line-height: 1.6; color: var(--ink-600); margin: 0 auto 32px; max-width: 52ch; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.firefly {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--lime-500); box-shadow: 0 0 12px 3px var(--lime-glow);
  animation: firefly-drift 8s ease-in-out infinite;
}
@keyframes firefly-drift {
  0%, 100% { transform: translate(0,0); opacity: 0.4; }
  50% { transform: translate(14px,-22px); opacity: 1; }
}

/* -------------------- search / filters -------------------- */
.catalog-controls {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin: 0 0 28px;
}
.search-input {
  flex: 1; min-width: 220px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 12px 20px;
  color: var(--ink-900); font-family: var(--font-body); font-size: 14.5px;
}
.search-input:focus { outline: none; border-color: var(--lime-500); box-shadow: 0 0 0 4px rgba(166,255,60,0.12); }
.search-input::placeholder { color: var(--ink-600); }

.category-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.category-chip {
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-600);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.15s ease;
}
.category-chip:hover { border-color: var(--lime-500); color: var(--ink-900); }
.category-chip.active { background: var(--brand-gradient); color: #0B0D0A; border-color: transparent; }

.sort-select {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 18px; color: var(--ink-900); font-family: var(--font-body); font-size: 13.5px; font-weight: 700;
}

/* -------------------- sections -------------------- */
section { padding: 72px 0; }
.section-head { max-width: 60ch; margin: 0 0 36px; }
.section-head .stamp { margin-bottom: 14px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin: 0; }

/* -------------------- place cards -------------------- */
.places-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }

.place-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.place-card:hover { transform: translateY(-4px); border-color: var(--lime-500); box-shadow: 0 24px 44px -22px rgba(0,0,0,0.5); }

.place-cover {
  position: relative; aspect-ratio: 16/10;
  background: var(--surface-2) linear-gradient(135deg, rgba(166,255,60,0.18), rgba(110,225,58,0.05));
  background-size: cover; background-position: center;
}
.place-cover .stamp { position: absolute; top: 12px; left: 12px; transform: rotate(-1.5deg); }
.place-status-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-pixel); font-size: 10px; padding: 6px 10px; border-radius: 999px;
}
.place-status-badge.pending { background: rgba(255,196,0,0.15); color: #FFC400; }
.place-status-badge.rejected { background: rgba(255,92,122,0.15); color: var(--red); }
.place-status-badge.draft { background: rgba(155,164,142,0.15); color: var(--ink-600); }

.place-body { padding: 18px 20px 20px; }
.place-body h3 { font-size: 16.5px; font-weight: 800; margin: 0 0 6px; }
.place-body p { font-size: 13.5px; color: var(--ink-600); line-height: 1.5; margin: 0 0 12px; min-height: 20px; }

.place-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.place-creator { font-size: 12.5px; color: var(--ink-600); font-weight: 700; }
.place-favs { display: flex; align-items: center; gap: 5px; font-family: var(--font-pixel); font-size: 11px; color: var(--lime-500); }

.empty-state {
  text-align: center; padding: 70px 30px;
  border: 2px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.empty-state h3 { font-size: 20px; font-weight: 800; margin: 16px 0 10px; }
.empty-state p { color: var(--ink-600); max-width: 42ch; margin: 0 auto 22px; }

/* -------------------- place detail page -------------------- */
.place-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; font-size: 14px; font-weight: 700; color: var(--ink-600); margin-bottom: 18px; }
.back-link:hover { color: var(--lime-500); }

.place-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.place-hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 10px; }
.place-hero .tagline { color: var(--ink-600); font-size: 16px; margin: 0 0 20px; }

.place-creator-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.creator-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-gradient); flex: none; overflow: hidden; }
.creator-avatar img { width: 100%; height: 100%; object-fit: cover; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 28px 0; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: pointer; }

.place-description { font-size: 15.5px; line-height: 1.7; color: var(--ink-900); white-space: pre-wrap; max-width: 72ch; }

.play-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; position: sticky; top: 96px;
}
.play-panel .server-line { font-family: var(--font-pixel); font-size: 13px; color: var(--lime-500); margin: 14px 0; word-break: break-all; }
.play-panel .warp-line { font-size: 13.5px; color: var(--ink-600); margin: 0 0 20px; }

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } .play-panel { position: static; } }

.review-note-box {
  background: rgba(255,92,122,0.08); border: 1px solid rgba(255,92,122,0.25);
  border-radius: var(--radius-md); padding: 18px 20px; margin: 20px 0;
}
.review-note-box.approved { background: rgba(166,255,60,0.08); border-color: rgba(166,255,60,0.25); }
.review-note-box strong { display: block; margin-bottom: 6px; font-size: 13px; }

/* -------------------- forms -------------------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 800; font-size: 13.5px; margin-bottom: 8px; color: var(--ink-900); }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 12px 16px; font-family: var(--font-body); font-size: 14.5px;
  color: var(--ink-900); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--lime-500); box-shadow: 0 0 0 4px rgba(166,255,60,0.12);
}
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 12.5px; color: var(--ink-600); margin-top: 6px; }

.form-msg { margin-top: 14px; font-weight: 700; font-size: 13.5px; display: none; }
.form-msg.show { display: block; }
.form-msg.ok { color: var(--lime-500); }
.form-msg.err { color: var(--red); }

/* -------------------- editor -------------------- */
.editor-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } }

.status-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 20px; margin-bottom: 28px; flex-wrap: wrap;
}

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.image-slot {
  position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
}
.image-slot img { width: 100%; height: 100%; object-fit: cover; }
.image-slot .remove-btn {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(11,13,10,0.75); color: var(--white); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.upload-slot {
  aspect-ratio: 1/1; border-radius: 12px; border: 1.5px dashed var(--line);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink-600); font-size: 26px; transition: border-color 0.15s ease, color 0.15s ease;
}
.upload-slot:hover { border-color: var(--lime-500); color: var(--lime-500); }

/* -------------------- moderation -------------------- */
.moderation-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px 24px; margin-bottom: 16px;
}
.moderation-item-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.moderation-item h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.moderation-item .meta { font-size: 13px; color: var(--ink-600); }
.moderation-item .desc { font-size: 14px; color: var(--ink-900); line-height: 1.6; margin: 12px 0; white-space: pre-wrap; }
.moderation-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.moderation-thumbs img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.moderation-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.moderation-actions textarea { flex: 1; min-width: 200px; }

/* -------------------- account -------------------- */
.account-tabs { display: flex; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; }
.account-tab {
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-600); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.account-tab.active { background: var(--brand-gradient); color: #0B0D0A; border-color: transparent; }

.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-gradient); overflow: hidden; flex: none; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------- footer -------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-name { font-weight: 800; color: var(--ink-900); display: flex; align-items: center; gap: 8px; }
.footer-meta { font-family: var(--font-pixel); font-size: 10px; color: var(--ink-600); letter-spacing: 0.04em; }

/* -------------------- login / lightbox / misc -------------------- */
.login-card { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; text-align: center; }
.btn-telegram { width: 100%; background: #229ED9; color: var(--white); }
.btn-telegram:hover { background: #1c8bc2; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); padding: 30px; visibility: hidden; opacity: 0; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.open { visibility: visible; opacity: 1; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; }

.muted { color: var(--ink-600); font-size: 14.5px; }

@media (max-width: 640px) {
  .nav { display: none; }
  section { padding: 52px 0; }
  .hero { padding: 60px 0 56px; }
}

.profile-menu-item:hover { background: var(--surface-2); }
