
:root {
  --bg: #090604;
  --panel: rgba(26, 18, 10, 0.92);
  --panel2: rgba(39, 27, 14, 0.94);
  --gold: #d7b56d;
  --gold2: #8f6f32;
  --text: #f3e7cc;
  --muted: #b8a98c;
  --danger: #7f2b24;
  --green: #4f8f42;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% -10%, rgba(155,104,37,.35), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(77,48,105,.24), transparent 30rem),
    linear-gradient(180deg, #160d07 0%, #090604 38%, #050302 100%);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, #000, transparent 85%);
}
a { color: #ffd17a; text-decoration: none; }
a:hover { color: #fff2ba; text-shadow: 0 0 8px rgba(255,210,122,.45); }
.hero {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(9,6,4,.96), rgba(9,6,4,.78));
  border-bottom: 1px solid rgba(215,181,109,.35);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
.hero-inner {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 16px;
  position: relative;
}
.hero-actions {
  position: absolute;
  top: 18px;
  right: 0;
  display: flex;
  gap: 8px;
}
.hero-actions a, .button-link {
  border: 1px solid rgba(215,181,109,.36);
  border-radius: 999px;
  padding: 8px 12px;
  color: #ffe3a0;
  background: rgba(18,12,7,.68);
  font-size: 13px;
}
h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: .02em;
  color: #ffe3a0;
  text-shadow: 0 0 18px rgba(215,181,109,.24), 0 3px 0 #000;
}
.subtitle { color: var(--muted); line-height: 1.45; max-width: 1000px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat {
  background: linear-gradient(180deg, rgba(44,31,17,.94), rgba(19,12,7,.94));
  border: 1px solid rgba(215,181,109,.33);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: inset 0 0 28px rgba(255,202,103,.04), 0 8px 22px rgba(0,0,0,.25);
}
.stat strong { display:block; font-size: 24px; color:#ffe3a0; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing:.08em; }
.controls {
  width: min(1500px, calc(100vw - 32px));
  margin: 18px auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 260px auto auto;
  gap: 12px;
  align-items: center;
}
.control, select, button, input[type="text"], input[type="password"], input[type="date"], input[type="file"], textarea {
  border: 1px solid rgba(215,181,109,.36);
  border-radius: 14px;
  background: rgba(18,12,7,.92);
  color: var(--text);
  min-height: 44px;
  padding: 0 14px;
  box-shadow: inset 0 0 18px rgba(0,0,0,.24);
  font: inherit;
}
textarea { min-height: 86px; padding-top: 10px; resize: vertical; }
input[type="file"] { padding-top: 10px; }
.control::placeholder, input::placeholder, textarea::placeholder { color: #84755f; }
button { cursor:pointer; color:#ffe3a0; }
button:hover { border-color:#ffd17a; transform: translateY(-1px); }
.toggle {
  display:flex;
  gap: 8px;
  align-items:center;
  background: rgba(18,12,7,.92);
  border: 1px solid rgba(215,181,109,.36);
  border-radius: 14px;
  padding: 0 12px;
  min-height:44px;
  color: var(--muted);
}
.toggle input { transform: scale(1.2); accent-color: #c49a4b; }
main.cards {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 16px;
}
.char-card {
  background: linear-gradient(180deg, rgba(35,24,13,.96), rgba(13,9,5,.96));
  border: 1px solid rgba(215,181,109,.34);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.04);
}
.char-card.hidden { display:none; }
.char-head {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid rgba(215,181,109,.22);
  background:
    radial-gradient(circle at 40px 18px, color-mix(in srgb, var(--class-color), transparent 55%), transparent 14rem),
    linear-gradient(180deg, rgba(255,255,255,.045), transparent);
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 2px solid var(--gold);
  object-fit: cover;
  background: #110b06;
  box-shadow: 0 0 18px color-mix(in srgb, var(--class-color), transparent 60%);
}
.char-title h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #fff0c1;
  font-size: 24px;
}
.char-title h2 span { color: var(--muted); font-size: 15px; font-family: inherit; }
.char-sub { display:flex; gap: 10px; align-items:center; margin-top: 5px; }
.class-badge {
  border: 1px solid color-mix(in srgb, var(--class-color), #fff 20%);
  color: color-mix(in srgb, var(--class-color), #fff 22%);
  background: color-mix(in srgb, var(--class-color), transparent 86%);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing:.08em;
}
.char-counts { text-align:right; color:var(--muted); min-width:72px; }
.char-counts strong { display:block; color:#ffe3a0; font-size: 30px; line-height: 1; }
.char-counts span { display:block; text-transform: uppercase; font-size: 11px; letter-spacing:.08em; }
.char-counts small { display:block; margin-top:4px; color:#907f65; }
.items { list-style: none; margin:0; padding:0; }
.item-row {
  display: grid;
  grid-template-columns: 92px minmax(0,1fr) 154px;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(215,181,109,.13);
  transition: background .15s ease;
}
.item-row:hover { background: rgba(255,210,122,.055); }
.item-row:last-child { border-bottom: 0; }
.item-row.hide-by-filter { display:none; }
.item-row.is-excluded {
  opacity: .55;
  background: rgba(127,43,36,.08);
}
.item-date { color:#ecd19a; font-size: 13px; }
.item-date small { display:block; color:#8f826a; margin-top:3px; }
.item-main { min-width:0; }
.item-title { font-size: 15px; line-height: 1.4; }
.item-link { font-weight: 700; }
.note { color:#ffdfa0; font-style: italic; }
.item-meta { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.muted { color:#8e8069; }
.merge-badge {
  display:inline-block;
  color:#d9c084;
  border:1px solid rgba(217,192,132,.28);
  border-radius:999px;
  padding:1px 7px;
  background:rgba(217,192,132,.08);
}
.item-string { margin-top: 5px; color:#897a62; font-size: 11px; }
.item-string summary { cursor:pointer; }
code {
  display:block;
  white-space: normal;
  word-break: break-all;
  background: rgba(0,0,0,.28);
  padding: 6px;
  border-radius: 8px;
  margin-top: 4px;
}
.item-responses { display:flex; flex-wrap:wrap; gap:6px; align-content:flex-start; justify-content:flex-end; }
.pill {
  border-radius:999px;
  padding: 4px 8px;
  font-size:11px;
  line-height:1.1;
  border: 1px solid rgba(255,255,255,.12);
  color:#f7e8c0;
  background: rgba(255,255,255,.07);
  max-width: 150px;
}
.resp-bis { background:rgba(163,48,201,.24); border-color:rgba(220,130,255,.35); }
.resp-big { background:rgba(72,139,67,.24); border-color:rgba(117,217,109,.35); }
.resp-small { background:rgba(0,112,221,.21); border-color:rgba(76,160,255,.35); }
.resp-good { background:rgba(255,244,104,.16); border-color:rgba(255,244,104,.35); }
.resp-off { background:rgba(196,154,75,.18); border-color:rgba(196,154,75,.35); }
.resp-twink { background:rgba(135,136,238,.17); border-color:rgba(135,136,238,.35); }
.resp-style { background:rgba(244,140,186,.16); border-color:rgba(244,140,186,.35); }
.resp-pl { background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.20); }
.resp-bonus { background:rgba(255,209,122,.18); border-color:rgba(255,209,122,.40); }
.resp-pass, .resp-wait { background:rgba(127,43,36,.22); border-color:rgba(177,78,69,.35); }
.top-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.top-chip {
  border: 1px solid rgba(215,181,109,.28);
  background:rgba(18,12,7,.54);
  border-radius:999px;
  padding:5px 9px;
  color:#d2c1a2;
  font-size:12px;
}
.top-chip b { color:#ffe3a0; margin-left:6px; }
footer {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto 40px;
  color:#8d7d63;
  font-size:12px;
  line-height:1.5;
}

/* Admin */
.admin-main {
  width: min(1100px, calc(100vw - 32px));
  margin: 22px auto 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-panel, .login-panel {
  background: linear-gradient(180deg, rgba(35,24,13,.96), rgba(13,9,5,.96));
  border: 1px solid rgba(215,181,109,.34);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.04);
}
.admin-panel h2, .login-panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: #ffe3a0;
  margin: 0 0 12px;
}
.form-grid { display:grid; gap: 12px; }
.form-grid label { display:grid; gap: 6px; color: var(--muted); }
.form-grid span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color:#d2c1a2; }
.form-actions { display:flex; gap: 10px; flex-wrap:wrap; margin-top: 4px; }
.notice {
  border:1px solid rgba(215,181,109,.24);
  background:rgba(18,12,7,.55);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.45;
}
.flash-wrap {
  width:min(1100px, calc(100vw - 32px));
  margin: 16px auto 0;
  display:grid;
  gap:8px;
}
.flash {
  border:1px solid rgba(215,181,109,.32);
  border-radius: 14px;
  padding: 10px 12px;
  background:rgba(18,12,7,.86);
}
.flash.success { border-color: rgba(117,217,109,.35); color:#d7ffd1; }
.flash.error { border-color: rgba(177,78,69,.55); color:#ffd2cc; }
.login-shell {
  width: min(460px, calc(100vw - 32px));
  margin: 36px auto 60px;
}
.admin-table {
  width:100%;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 14px;
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid rgba(215,181,109,.16);
  padding: 8px 6px;
  text-align:left;
}
.admin-table th { color:#ffe3a0; }
@media (max-width: 900px) {
  .hero-actions { position: static; margin-bottom: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: 1fr; }
  main.cards { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr; }
  .item-responses { justify-content:flex-start; }
  .char-head { grid-template-columns: 58px 1fr; }
  .avatar { width:56px; height:56px; border-radius:12px; }
  .char-counts { grid-column: 1 / -1; text-align:left; display:flex; gap:10px; align-items:baseline; }
  .char-counts strong, .char-counts span, .char-counts small { display:inline; }
  .admin-main { grid-template-columns: 1fr; }
}
