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

:root {
  --bg-base: #0a0f16;
  --bg-surface: #111923;
  --bg-elevated: #182030;
  --bg-input: #0d1219;

  --border-faint: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-green: rgba(74, 222, 128, 0.3);

  --text-bright: #f1f5f9;
  --text-primary: #cbd5e1;
  --text-secondary: #8896a8;
  --text-dim: #56657a;
  --text-muted: #3d4b5e;

  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-glow: rgba(74, 222, 128, 0.08);
  --green-glow-strong: rgba(74, 222, 128, 0.15);

  --amber-400: #fbbf24;
  --amber-glow: rgba(251, 191, 36, 0.1);

  --red-400: #f87171;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
}

html { font-size: 16px; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.header h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: 0.06em;
  color: var(--text-bright);
  line-height: 1.15;
  text-transform: uppercase;
}

.header h1 .frog {
  display: block;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.4rem;
  position: relative;
  animation: float 4s ease-in-out infinite;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.header h1 .frog::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.header-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle) 20%, var(--border-green) 50%, var(--border-subtle) 80%, transparent);
  margin-top: 1.5rem;
}

/* ── MODE SWITCH ── */
.mode-switch {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3px;
  gap: 2px;
  margin-bottom: 2rem;
}

.mode-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.45rem 1.3rem;
  background: none;
  border: none;
  border-radius: calc(var(--radius-lg) - 3px);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-btn.active {
  background: var(--green-500);
  color: var(--bg-base);
  font-weight: 600;
}

.mode-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

/* ── INPUT SECTION ── */
.input-section {
  margin-bottom: 1rem;
}

.input-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-label::before {
  content: '>';
  color: var(--green-500);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.input-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.input-top .input-label {
  margin-bottom: 0;
}

.titlecase-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.titlecase-toggle:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.titlecase-toggle.active {
  background: var(--green-glow-strong);
  border-color: var(--border-green);
  color: var(--green-400);
}

.titlecase-icon {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.9rem 2.75rem 0.9rem 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-bright);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.input-field::placeholder {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 400;
}

.input-field:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12), inset 0 0 30px rgba(74, 222, 128, 0.02);
}

.input-corner { display: none; }

.input-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.input-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.input-clear:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

/* ── HASH OUTPUT ── */
.hash-output {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.875rem 1.1rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.hash-output.matched {
  border-color: var(--border-green);
  background: linear-gradient(135deg, var(--bg-surface), rgba(74, 222, 128, 0.04));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.05);
}

.hash-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--bg-base);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.hash-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: right;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  letter-spacing: 0.02em;
}

.hash-value.matched {
  color: var(--green-400);
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}

.hash-value.pending {
  color: var(--text-muted);
  font-style: italic;
}

/* ── VERSION BLOCKS ── */
.version-block {
  margin-bottom: 1.75rem;
}

.version-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.version-tag {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-base);
  background: var(--green-400);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.version-tag.archived {
  background: var(--text-dim);
}

.version-name {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-bright);
  letter-spacing: 0.03em;
}

/* ── SECTION BLOCKS ── */
.section-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.section-title {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-base);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

.section-chevron {
  font-size: 0.6rem;
  color: var(--text-dim);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: auto;
  padding-left: 0.75rem;
  line-height: 1;
}

.section-chevron.open {
  transform: rotate(180deg);
}

.section-body {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.section-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.section-body.expanded {
  opacity: 1;
}

.section-divider {
  height: 1px;
  background: var(--border-faint);
  margin: 0 1rem;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── HASH ROWS ── */
.hash-row {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-faint);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  align-items: stretch;
  cursor: pointer;
}

.hash-row:last-child { border-bottom: none; }

.hash-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.hash-row.matched {
  background: var(--green-glow);
  box-shadow: inset 3px 0 0 var(--green-400);
}

.hash-row-abbr {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--amber-400);
  letter-spacing: 0.04em;
  background: var(--amber-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hash-row.matched .hash-row-abbr {
  color: var(--green-400);
  background: var(--green-glow-strong);
}

.hash-row-details {
  min-width: 0;
}

.hash-row-hash {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}

.hash-row.matched .hash-row-hash {
  color: var(--green-400);
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

.hash-row-answer {
  margin-top: 0.35rem;
}

.spoiler-text {
  font-family: 'Barlow', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-block;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  background: var(--bg-base);
  color: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
}

.spoiler-text:hover {
  border-color: var(--border-default);
  background: var(--bg-elevated);
  color: var(--bg-elevated);
}

.spoiler-text.revealed {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  cursor: default;
}

.hash-row.matched .spoiler-text {
  color: var(--green-400);
  background: transparent;
  border-color: transparent;
  cursor: default;
}

/* ── FOOTER ── */
.footer {
  margin-top: 2.5rem;
  text-align: center;
}

.footer-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle) 30%, var(--border-subtle) 70%, transparent);
  margin-bottom: 1.25rem;
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ── SHA NOTICE ── */
.sha-notice {
  display: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.sha-notice.visible {
  display: block;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  html { font-size: 15px; }
  .page-wrapper { padding: 1.5rem 1rem 2.5rem; }
  .header h1 { font-size: 1.75rem; }
  .header h1 .frog { font-size: 2.5rem; }
  .hash-row { grid-template-columns: 3.25rem 1fr; gap: 0.5rem; }
  .hash-row-hash { font-size: 0.8125rem; }
  .hash-value { font-size: 0.8125rem; }
  .mode-btn { padding: 0.4rem 1rem; font-size: 0.75rem; }
}

@media (max-width: 380px) {
  html { font-size: 14px; }
  .header h1 { font-size: 1.5rem; }
  .hash-row-hash { font-size: 0.75rem; }
}

/* ── THIS IS FINE ── */
.thisisfine-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.thisisfine-popup.visible {
  opacity: 1;
}

.thisisfine-popup img {
  max-width: min(700px, 90vw);
  max-height: 80vh;
  object-fit: contain;
  transform: scale(0.7);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.thisisfine-popup.visible img {
  transform: scale(1);
}

/* ── SELECTION ── */
::selection {
  background: rgba(74, 222, 128, 0.2);
  color: var(--text-bright);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}
