*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0f14;
  --surface:  #13161f;
  --raised:   #1a1e2b;
  --border:   #252a3a;
  --text:     #e2e6f3;
  --muted:    #5a6180;
  --accent:   #ec3750;   /* Hack Club red */
  --accent-d: #3d0d14;
  --ok:       #33d17a;
  --warn:     #f6b93b;
  --err:      #ec3750;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'Inter', sans-serif;
  --radius:   10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 16px 100px;
}

/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 44px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.logo-flag {
  font-size: 1.6rem;
  line-height: 1;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

header h1 span { color: var(--accent); }

header p {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Layout ── */
.shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* ── Template selector ── */
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;
  padding: 10px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6180' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select:focus { border-color: var(--accent); }

/* ── Drop zone ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-d);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon { font-size: 2rem; margin-bottom: 10px; }

.drop-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.drop-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.file-count {
  display: none;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* ── Submit button ── */
button#check-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}

button#check-btn:hover    { opacity: 0.88; }
button#check-btn:active   { opacity: 0.75; }
button#check-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Result card ── */
#result-card { display: none; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.status-bar.ok   { background: #0d2b1a; color: var(--ok);  border: 1px solid #1a5c35; }
.status-bar.warn { background: #2b1f08; color: var(--warn); border: 1px solid #5c4210; }
.status-bar.err  { background: var(--accent-d); color: var(--err); border: 1px solid #7a1c28; }

.issue-list { margin-bottom: 16px; }

.issue-list h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.issue-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.issue-list li {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--border);
}

.issue-list li.missing   { border-left: 3px solid var(--err); }
.issue-list li.forbidden { border-left: 3px solid var(--warn); }
.issue-list li.minor     { border-left: 3px solid var(--warn); }

/* ── Markdown preview ── */
.md-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

pre#md-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.75;
  overflow-x: auto;
  padding: 18px;
  color: var(--text);
  white-space: pre;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 6px 14px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover   { color: var(--text); border-color: var(--accent); }
.btn-ghost.success { color: var(--ok); border-color: var(--ok); }

/* ── Spinner ── */
.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid var(--accent-d);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  header h1 { font-size: 1.3rem; }
}

/* ── Depth slider ── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.slider-cap {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 16px;
  text-align: center;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* ── Ignore tag input ── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: text;
  transition: border-color 0.15s;
}

.tag-input-wrap:focus-within { border-color: var(--accent); }

#tag-list {
  display: contents;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  color: var(--text);
  white-space: nowrap;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  transition: color 0.1s;
}

.tag-remove:hover { color: var(--err); }

#tag-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  min-width: 160px;
  outline: none;
  padding: 2px 0;
  flex: 1;
}

#tag-input::placeholder { color: var(--muted); }

.tag-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 8px;
}

.lg { width: 50px; height: 50px; }