:root {
  --bg-deep: #050a14;
  --cyan: #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.3);
  --text-primary: #f4f8ff;
  --text-muted: #8aa4c4;
  --card-bg: rgba(8, 20, 44, 0.78);
  --card-border: rgba(0, 190, 255, 0.22);
  --green: #34ad00;
  --yellow: #ffd800;
  --closeBtn: #f50000;
  --btnActive: #00ba7c;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", var(--font);
  min-height: 100vh;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 12% -5%, rgba(0, 110, 210, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 88% 105%, rgba(0, 180, 255, 0.07) 0%, transparent 45%);
  color: var(--text-primary);
  overflow-x: hidden;
}

.grid-overlay {
  position: fixed; inset: 0;
  background:
    linear-gradient(rgba(0, 150, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 150, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  z-index: 0; pointer-events: none;
}

.glow-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 1; pointer-events: none;
}

.app {
  position: relative;
  z-index: 2;
  width: min(96%, 1100px);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo-section { display: flex; align-items: center; gap: 14px; }
.logo-section img {
  width: 52px; height: 52px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--card-border);
  background: rgba(4, 12, 28, 0.85);
}
.logo-section h1 {
  font-family: "Rajdhani", sans-serif;
  font-size: 28px; font-weight: 700; line-height: 1.1;
}
.logo-section p { font-size: 12px; color: var(--text-muted); letter-spacing: 0.4px; }
.logo-section p strong { color: var(--cyan); font-weight: 600; }

.readme-pill, .version-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Rajdhani", sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.4px; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; transition: 0.2s ease; white-space: nowrap;
}

a.readme-pill, a.version-pill { text-decoration: none; }
.readme-pill {
  position: relative;
  border: 1px solid rgba(0, 186, 124, 0.35);
  background: rgba(0, 186, 124, 0.08);
  color: var(--btnActive);
  animation: readmeFlash 1.1s ease-in-out infinite;
}
.readme-pill::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(0, 186, 124, 0.85);
  animation: readmePing 1.1s ease-out infinite;
  pointer-events: none;
}
.readme-pill.seen,
.readme-pill.seen::after {
  animation: none;
}
.readme-pill.seen::after { opacity: 0; }
.readme-pill:hover,
.readme-pill.seen {
  background: rgba(0, 186, 124, 0.16);
  box-shadow: 0 0 16px rgba(0, 186, 124, 0.35);
}
@keyframes readmeFlash {
  0%, 100% {
    background: rgba(0, 186, 124, 0.12);
    border-color: rgba(0, 186, 124, 0.45);
    box-shadow: 0 0 0 rgba(0, 186, 124, 0);
    color: var(--btnActive);
  }
  50% {
    background: #00ba7c;
    border-color: #7dffc3;
    box-shadow: 0 0 22px rgba(0, 186, 124, 0.95);
    color: #041018;
  }
}
@keyframes readmePing {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .readme-pill,
  .readme-pill::after { animation: none; }
}

.version-pill {
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.08);
  color: var(--cyan);
}
.version-pill:hover { background: rgba(0, 212, 255, 0.16); box-shadow: 0 0 16px var(--cyan-glow); }

.hero { text-align: center; margin-bottom: 28px; padding: 0 8px; }
.hero h2 {
  font-family: "Rajdhani", sans-serif;
  font-size: 28px; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 12px;
}
.hero-lead {
  font-size: 16px; line-height: 1.55; color: rgba(232, 244, 255, 0.92);
  max-width: 720px; margin: 0 auto 10px;
}
.hero-sub {
  font-size: 13px; line-height: 1.6; color: var(--text-muted);
  max-width: 640px; margin: 0 auto;
}

.panel {
  background: rgba(4, 12, 28, 0.82);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 18px 20px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 {
  font-family: "Rajdhani", sans-serif;
  font-size: 20px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
}

.count {
  font-family: "Rajdhani", sans-serif;
  font-size: 13px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(0, 212, 255, 0.12); color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.35);
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.panel input[type="text"],
textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  outline: none;
  background: rgba(4, 12, 28, 0.85);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.panel input[type="text"]:focus,
textarea:focus,
.cell-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.category-pill {
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(4, 12, 28, 0.85);
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
}

.category-pill:hover { color: var(--text-primary); border-color: rgba(0, 212, 255, 0.3); }

.category-pill.active {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.type-tag {
  display: inline-block;
  font-family: "Rajdhani", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.btn {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  transition: 0.2s;
}

.btn-primary {
  border: 1px solid var(--cyan);
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
}
.btn-primary:hover { background: var(--cyan); color: #041018; box-shadow: 0 0 18px var(--cyan-glow); }

.btn-file {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 186, 124, 0.45);
  background: rgba(0, 186, 124, 0.1);
  color: var(--btnActive);
  margin-bottom: 0;
}
.btn-file:hover { background: var(--btnActive); color: #041018; }
.btn-file input { display: none; }

.btn-danger {
  border: 1px solid rgba(245, 0, 0, 0.45);
  background: rgba(245, 0, 0, 0.12);
  color: #ff8a8a;
  padding: 8px 12px;
}
.btn-danger:hover { background: var(--closeBtn); color: #fff; border-color: var(--closeBtn); }

.hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.file-name {
  margin-top: 10px;
  font-size: 13px;
  color: var(--cyan);
}

code {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--cyan);
}

.table-wrap { overflow-x: auto; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; min-width: 680px; }

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 190, 255, 0.12);
  text-align: left;
  vertical-align: middle;
}

th {
  font-family: "Rajdhani", sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
}

.hash-cell {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: var(--cyan);
  white-space: nowrap;
}

.cell-input {
  width: 100%;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}
.cell-input:hover { border-color: var(--card-border); }

.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 4px;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  background: rgba(0, 212, 255, 0.18); color: var(--cyan);
  cursor: help; text-transform: none; letter-spacing: 0;
}

.empty { margin-top: 12px; color: var(--text-muted); font-size: 14px; }

textarea {
  height: 260px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  color: #7dffe1;
  line-height: 1.45;
}

.footer {
  margin-top: 32px; text-align: center; font-size: 13px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.footer-social {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.footer-social-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.footer-social-link i { font-size: 18px; transition: transform 0.25s ease; }
.footer-social-link span { color: rgba(255, 255, 255, 0.85); }
.footer-social-link:hover { transform: translateY(-3px); }
.footer-social-link:hover i { transform: scale(1.15); }
.footer-social-link--discord { border-color: rgba(88, 101, 242, 0.45); color: #5865f2; }
.footer-social-link--discord:hover { background: rgba(88, 101, 242, 0.18); box-shadow: 0 6px 28px rgba(88, 101, 242, 0.35); }
.footer-social-link--email { border-color: rgba(0, 212, 255, 0.4); color: var(--cyan); }
.footer-social-link--email:hover { background: rgba(0, 212, 255, 0.12); box-shadow: 0 6px 28px rgba(0, 212, 255, 0.3); }
.footer-social-link--web { border-color: rgba(167, 139, 250, 0.4); color: #a78bfa; }
.footer-social-link--web:hover { background: rgba(167, 139, 250, 0.14); box-shadow: 0 6px 28px rgba(167, 139, 250, 0.32); }
.footer-copy { margin: 0; }
.footer a { color: var(--cyan); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92);
  display: none; justify-content: center; align-items: flex-start;
  z-index: 9999; overflow-y: auto; padding: 40px 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: linear-gradient(165deg, rgba(6, 22, 48, 0.97) 0%, rgba(5, 10, 20, 0.99) 100%);
  border: 1px solid var(--card-border);
  color: #fff; width: 680px; max-width: 95%;
  padding: 0; border-radius: 16px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.08);
}
.changelog-box { max-width: 560px; }

.help-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(0, 80, 160, 0.25), transparent);
}
.help-header h2 { font-family: "Rajdhani", sans-serif; font-size: 26px; margin-bottom: 6px; }
.help-header p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.help-ver { font-size: 14px; color: var(--cyan); font-weight: 600; }
.help-body { padding: 20px 24px 28px; }

.instruction-item { padding: 14px 16px; margin: 8px 0; border-radius: 10px; }
.instruction-item h3 { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.instruction-item p { font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, 0.82); }
.green { border-left: 3px solid var(--green); background: rgba(52, 173, 0, 0.1); }
.blue { border-left: 3px solid var(--cyan); background: rgba(0, 212, 255, 0.07); }
.yellow { border-left: 3px solid var(--yellow); background: rgba(255, 216, 0, 0.08); }

.closeModal {
  position: absolute; top: 18px; right: 22px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06); font-size: 16px;
  cursor: pointer; color: rgba(255, 255, 255, 0.7); z-index: 2;
}
.closeModal:hover { color: #fff; background: rgba(245, 0, 0, 0.25); border-color: var(--closeBtn); }

.changelog-list { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 28px; }
.changelog-entry {
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(4, 12, 28, 0.5);
}
.changelog-entry.current { border-color: rgba(0, 212, 255, 0.45); background: rgba(0, 212, 255, 0.06); }
.changelog-ver { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ver-tag {
  font-family: "Rajdhani", sans-serif; font-size: 13px; font-weight: 700;
  padding: 2px 10px; border-radius: 6px; background: var(--cyan); color: #041018;
}
.changelog-entry:not(.current) .ver-tag { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
.ver-date { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.changelog-entry h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.changelog-entry ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.changelog-entry li { margin-bottom: 4px; }
.changelog-entry li strong { color: var(--text-primary); font-weight: 600; }

body::-webkit-scrollbar, .modal-box::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-thumb, .modal-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), rgba(0, 0, 0, 0.5));
  border-radius: 10px;
}

@media (max-width: 640px) {
  .logo-section h1 { font-size: 24px; }
  .hero h2 { font-size: 24px; }
}
