/* ============================================================
   БАЗА
   ============================================================ */
:root{
  --wood-dark:#2b1c12;
  --wood-mid:#4a3018;
  --wood-light:#6b4423;
  --paper:#e9d8ae;
  --paper-dark:#d3bd88;
  --ink:#2a1c10;
  --emerald:#1fae5c;
  --emerald-dark:#127a3f;
  --blood:#7a1d1d;
  --gold:#d4af37;
}
*{box-sizing:border-box;}
html{height:100%;}
body{
  height:100%;
  margin:0;
  font-family:'VT323', monospace;
  background:
    repeating-linear-gradient(90deg, var(--wood-dark) 0 22px, var(--wood-mid) 22px 24px),
    var(--wood-dark);
  color:var(--ink);
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:28px 14px 60px;
}
h1,h2,h3,.pixel{font-family:'Press Start 2P', monospace;}

/* ============================================================
   ПЛАКАТ
   ============================================================ */
.poster{
  width:100%;
  max-width:640px;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    repeating-linear-gradient(135deg, #00000012 0 4px, transparent 4px 9px);
  border:6px solid var(--wood-light);
  outline:3px solid #1a1108;
  box-shadow:0 14px 34px rgba(0,0,0,.55), inset 0 0 0 3px var(--paper-dark);
  padding:22px 18px 30px;
  position:relative;
}
.poster::before{
  content:"";
  position:absolute;
  inset:8px;
  border:2px dashed #8a6a3a88;
  pointer-events:none;
}
.badge-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin-bottom:10px;
  flex-wrap:wrap;
}
.pillager-icon{
  width:58px;height:58px;flex:0 0 auto;
  image-rendering:pixelated;
}
h1.title{
  font-size:clamp(15px, 4vw, 22px);
  text-align:center;
  color:var(--blood);
  text-shadow:2px 2px 0 #00000022;
  margin:6px 0 4px;
  letter-spacing:1px;
}
.subtitle{
  text-align:center;
  font-size:22px;
  margin-bottom:14px;
  color:#4a2f14;
}

/* ============================================================
   НАВИГАЦИЯ
   ============================================================ */
.poster-nav{
  display:flex;
  justify-content:center;
  gap:12px;
  margin:14px 0 18px;
  flex-wrap:wrap;
}
.poster-nav a{
  font-family:'Press Start 2P', monospace;
  font-size:11px;
  color:#2a1c10;
  background:#d3bd88;
  border:3px solid var(--wood-light);
  padding:10px 14px;
  text-decoration:none;
  transition:transform .08s ease, background .15s ease;
}
.poster-nav a:hover{background:#f0e0b0;}
.poster-nav a:active{transform:translateY(2px);}

/* ============================================================
   ГЕРОЙ-КАРТИНКА
   ============================================================ */
.hero-frame{
  margin:6px auto 16px;
  max-width:420px;
  border:4px solid var(--wood-light);
  background:#1a2a1e;
  padding:6px;
  box-shadow: inset 0 0 0 2px #000000aa;
}
.hero-frame svg,
.hero-frame img{
  display:block;
  width:100%;
  height:auto;
  image-rendering:pixelated;
}

/* ============================================================
   БАННЕР
   ============================================================ */
.banner{
  text-align:center;
  font-size:clamp(26px, 7vw, 40px);
  color:#fdfaf0;
  background:var(--blood);
  padding:10px 6px 4px;
  margin:6px 0 2px;
  border:3px solid #1a1108;
  letter-spacing:2px;
  text-shadow:2px 2px 0 #00000055;
}
.banner small{display:block;font-size:.42em;letter-spacing:4px;margin-top:2px;opacity:.9;}
.fineprint{
  text-align:center;
  font-size:15px;
  color:#5a4326;
  margin:4px 0 20px;
  font-style:italic;
}
.divider{
  height:3px;
  background:repeating-linear-gradient(90deg, var(--wood-light) 0 10px, transparent 10px 16px);
  margin:18px 0;
}

/* ============================================================
   ФОРМА / ЛИЧНОЕ ДЕЛО
   ============================================================ */
.dossier h2{
  font-size:13px;
  color:#4a2f14;
  text-align:center;
  margin-bottom:14px;
  line-height:1.6;
}
.dossier h2 span{display:block;font-size:.7em;color:var(--emerald-dark);margin-top:6px;}
form{display:grid;gap:12px;}
label{
  font-size:18px;
  color:#3a2712;
  display:block;
  margin-bottom:3px;
}
input, textarea, select{
  width:100%;
  font-family:'VT323', monospace;
  font-size:19px;
  padding:8px 10px;
  background:#f4ecd2;
  border:2px solid var(--wood-light);
  outline:none;
  color:var(--ink);
}
input:focus, textarea:focus, select:focus{
  border-color:var(--emerald-dark);
  background:#fffdf3;
}
textarea{resize:vertical;min-height:70px;}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
@media (max-width:420px){.row2{grid-template-columns:1fr;}}

.submit-btn{
  margin-top:8px;
  font-family:'Press Start 2P', monospace;
  font-size:13px;
  padding:14px 10px;
  background:var(--emerald);
  color:#08210f;
  border:3px solid var(--emerald-dark);
  cursor:pointer;
  letter-spacing:1px;
  transition:transform .08s ease, background .15s ease;
}
.submit-btn:hover{background:#2bd074;}
.submit-btn:active{transform:translateY(2px);}

.disclaimer{
  font-size:14px;
  color:#6b5636;
  text-align:center;
  margin-top:10px;
  line-height:1.5;
}

/* ============================================================
   АРХИВ
   ============================================================ */
.archive{
  margin-top:26px;
  background:#1e140c;
  border:3px solid var(--wood-light);
  padding:14px 12px 16px;
}
.archive h3{
  color:var(--gold);
  font-size:12px;
  margin:0 0 10px;
  text-align:center;
}
.archive-note{
  color:#c9b98a;
  font-size:15px;
  text-align:center;
  margin-bottom:10px;
  line-height:1.5;
}
.archive-note b{color:#9fe6b5;}

/* Поиск */
.search-form{
  margin:14px 0;
  display:grid;
  gap:8px;
}
.search-form label{
  color:var(--gold);
  font-size:16px;
}
.search-row{
  display:flex;
  gap:8px;
  align-items:stretch;
}
.search-row input{
  flex:1;
  background:#0f0a06;
  border:2px solid var(--wood-light);
  color:#e9d8ae;
  font-size:18px;
  padding:8px 10px;
  font-family:'VT323', monospace;
}
.search-row input:focus{
  border-color:var(--gold);
  background:#15100a;
  color:#fff;
}
.search-row .submit-btn{
  margin-top:0;
  padding:0 16px;
  font-size:11px;
  white-space:nowrap;
}
.search-info{
  color:#c9b98a;
  font-size:15px;
  margin-top:4px;
}
.search-info code{
  background:#00000060;
  color:#9fe6b5;
  padding:1px 6px;
  border-radius:3px;
}
.clear-link{
  color:var(--gold);
  text-decoration:none;
  border-bottom:1px dotted var(--gold);
}
.clear-link:hover{color:#fff;border-bottom-color:#fff;}

/* Список файлов */
.file-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:6px;
  max-height:340px;
  overflow-y:auto;
}
.file-list li{
  font-size:16px;
  background:#00000040;
  color:#e9d8ae;
  padding:10px 12px;
  border-left:4px solid var(--gold);
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:space-between;
}
.file-list li .fname{color:#9fe6b5;flex:1 1 auto;}
.file-list li .fmeta{color:#a89568;font-size:.85em;white-space:nowrap;}
.file-list li .fnote{
  flex:1 1 100%;
  color:#8a7550;
  font-size:.9em;
  font-style:italic;
  margin-top:2px;
}
.file-list li.empty{
  color:#7a6248;
  font-style:italic;
  border-left-color:#5a4326;
  justify-content:center;
}

.archive-footer{
  text-align:center;
  color:#a89568;
  font-size:15px;
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed #4a3a2a;
}
.archive-footer b{color:#9fe6b5;}

/* Ошибка SQL */
.error-box{
  background:#2a0e0e;
  border:2px solid var(--blood);
  color:#ffb0b0;
  padding:10px 12px;
  margin:10px 0;
  font-size:15px;
  border-radius:3px;
}
.error-box b{color:#ff7070;}
.error-box pre{
  margin:6px 0 0;
  white-space:pre-wrap;
  word-break:break-word;
  color:#ffd0d0;
  font-family:'Courier New', monospace;
  font-size:13px;
}

/* ============================================================
   ФУТЕР
   ============================================================ */
footer{
  margin-top:22px;
  color:#9c8562;
  font-size:14px;
  text-align:center;
  max-width:640px;
}