@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0b0e11;
  --surface: #12161b;
  --surface-2: #171c22;
  --border: #232a32;
  --text: #e7e9ea;
  --muted: #7c8791;
  --white: #f7f7f8;
  --silver: #a9afb8;
  --red: #ff4d4d;
  --radius: 3px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

a { color: inherit; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------- Boot screen ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.5s ease;
}

.boot-screen.boot-out { opacity: 0; pointer-events: none; }

.boot-window {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.03);
}

.boot-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.boot-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.boot-path {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.boot-body {
  padding: 20px 18px;
  min-height: 160px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
}

.boot-line { color: var(--text); white-space: pre; }
.boot-prompt { color: var(--silver); margin-right: 8px; }
.boot-ok { color: var(--white); text-shadow: 0 0 10px rgba(247, 247, 248, 0.5); }

.boot-line:last-child::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 4px;
  background: var(--white);
  vertical-align: -2px;
  animation: cursorBlink 1s steps(1) infinite;
}

.boot-screen.no-motion .boot-line:last-child::after {
  animation: none;
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- App shell reveal ---------- */

#appShell {
  animation: shellIn 0.6s ease;
}

#gateMain {
  opacity: 0;
}

#gateMain.shell-in {
  animation: shellIn 0.6s ease forwards;
}

@keyframes shellIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #appShell, #gateMain { opacity: 1; animation: none; }
}

/* ---------- Login gate ---------- */

.gate-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 700px 500px at 50% -10%, rgba(255, 255, 255, 0.07), transparent),
    linear-gradient(180deg, #0b0e11, #08090b);
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  animation: gateIn 0.5s ease;
}

@keyframes gateIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .gate-card { animation: none; }
}

.gate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--white), transparent);
  background-size: 200% 100%;
  animation: shimmer 3.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-card::before { animation: none; background: var(--white); }
}

.gate-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--white);
  text-shadow: 0 0 12px rgba(247, 247, 248, 0.45);
  transform: rotate(-2deg);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
}

.gate-card h1 {
  font-size: 22px;
  margin: 0 0 12px;
  font-weight: 600;
}

.gate-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 28px;
}

.gate-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.35);
  color: #ff9d9d;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  text-align: left;
}

.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #5865f2;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.15s ease;
}

.btn-discord:hover { filter: brightness(1.1); }

.gate-foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.gate-foot code { color: var(--silver); }

/* ---------- Tabs ---------- */

.tabbar {
  display: flex;
  gap: 4px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 28px 0;
}

.tab-btn {
  background: none;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 10px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.tab-btn:hover { color: var(--text); }
.tab-btn:active { transform: scale(0.97); }

.tab-btn.active {
  color: var(--white);
  background: var(--surface);
  border-color: var(--border);
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--white);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabIn 0.35s ease; }

@keyframes tabIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  min-width: 280px;
}

.search-input:focus { outline: none; border-color: var(--white); }

.log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Panel shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }
.logout {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius);
}
.logout:hover { color: var(--red); border-color: var(--red); }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 28px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.2s ease;
}

.panel-card.wide { grid-column: 1 / -1; }

.card-head { margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 17px; font-weight: 600; }

form { display: flex; flex-direction: column; gap: 14px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }

input, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13.5px;
  resize: vertical;
  transition: border-color 0.15s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--white);
}

.btn-primary, .btn-secondary {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }

.btn-primary { background: var(--white); color: #0b0e11; }
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary { background: transparent; border-color: var(--silver); color: var(--silver); }
.btn-secondary:hover { background: rgba(79, 209, 197, 0.08); }

.form-msg { font-size: 12.5px; margin: 0; min-height: 16px; font-family: var(--mono); }
.form-msg.ok { color: var(--silver); }
.form-msg.err { color: var(--red); }

/* ---------- Lookup result ---------- */

.lookup-result {
  margin-top: 18px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  animation: resultIn 0.4s ease;
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }

.score-gauge {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  border: 3px solid var(--border);
  flex-shrink: 0;
}

.score-gauge.low { border-color: var(--silver); color: var(--silver); }
.score-gauge.mid { border-color: var(--white); color: var(--white); }
.score-gauge.high { border-color: var(--red); color: var(--red); animation: pulseHigh 1.6s ease-in-out infinite; }

@keyframes pulseHigh {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
}

.score-meta { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.score-meta strong { color: var(--text); }

.hit-list { display: flex; flex-direction: column; gap: 8px; }

.hit-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
}

.hit-item strong { display: block; margin-bottom: 2px; }
.hit-item span { color: var(--muted); font-family: var(--mono); font-size: 11px; }

.clean-flag {
  color: var(--silver);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ---------- Ban list / case log ---------- */

.ban-list { display: flex; flex-direction: column; gap: 10px; }

.empty-state { color: var(--muted); font-size: 13px; font-family: var(--mono); }

.case-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  animation: caseIn 0.35s ease backwards;
  transition: border-color 0.15s ease;
}

.case-entry:hover { border-color: var(--muted); }

@keyframes caseIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .case-entry { animation: none; }
}

.case-stamp {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  padding: 3px 8px;
  transform: rotate(-3deg);
  white-space: nowrap;
  height: fit-content;
}

.case-body { min-width: 0; }
.case-id { font-family: var(--mono); font-size: 12px; color: var(--silver); margin: 0 0 4px; }
.case-reason { font-size: 13.5px; margin: 0 0 6px; line-height: 1.5; }
.case-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.case-meta a { color: var(--white); }

.case-del {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--mono);
}
.case-del:hover { color: var(--red); border-color: var(--red); }

/* ---------- Changelog ---------- */

.changelog-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  animation: caseIn 0.35s ease backwards;
  transition: border-color 0.15s ease;
}

.changelog-entry:hover { border-color: var(--muted); border-left-color: var(--white); }

.changelog-title { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.changelog-msg { font-size: 13px; color: var(--text); margin: 0 0 8px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .changelog-entry { animation: none; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .case-entry { grid-template-columns: 1fr; }
  .case-del { justify-self: start; }
}
