* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

header {
  margin-bottom: 2rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 2.5rem;
}

p {
  margin: 0;
  color: #cbd5f5;
}

ul {
  color: #cbd5f5;
}

section {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.75);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pow-panel {
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pow-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #cbd5f5;
  font-size: 0.9rem;
}

#pow-challenge {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.pow-progress {
  margin: 0;
  font-size: 0.85rem;
  color: #c4b5fd;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(120deg, #3b82f6, #6366f1);
  color: white;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button.secondary {
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.8);
  padding: 0.45rem 1rem;
  border-radius: 999px;
}

button.secondary:not(:disabled):hover {
  background: rgba(99, 102, 241, 0.2);
}

#kill-form label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.kill-controls {
  display: flex;
  gap: 0.5rem;
}

input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
}

#message {
  min-height: 1.5rem;
  font-weight: 600;
}

#message[data-type='error'] {
  color: #fb7185;
}

#message[data-type='success'] {
  color: #34d399;
}

#instances-table {
  width: 100%;
  border-collapse: collapse;
}

#instances-table th,
#instances-table td {
  padding: 0.75rem;
  text-align: left;
}

#instances-table thead {
  color: #94a3b8;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#instances-table tbody tr {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#instances-table code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
}

.mnemonic {
  max-width: 280px;
  overflow-wrap: anywhere;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
}

.value-with-action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-message {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.status-message[data-state='loading'] {
  color: #fbbf24;
}

.status-message[data-state='solved'] {
  color: #34d399;
  font-weight: 600;
}

.status-message[data-state='error'] {
  color: #fb7185;
}

button.copy-btn {
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

button.copy-btn:hover {
  transform: none;
  background: rgba(99, 102, 241, 0.5);
}

@media (max-width: 640px) {
  .kill-controls {
    flex-direction: column;
  }

  button,
  input {
    width: 100%;
  }

  .pow-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pow-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
