/* nftGlitch — pixel-art theme. No border-radius anywhere (rounded corners read as
   non-pixel), hard offset shadows instead of soft/blurred ones, a pixel display
   font for headings/buttons only (real pixel fonts are unreadable at paragraph
   size), monospace for body/data. */

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

:root {
  --bg: #0d0d1a;
  --bg-panel: #16162b;
  --bg-panel-alt: #1e1e38;
  --bg-input: #0a0a14;
  --border: #000;
  --cyan: #4dd8ff;
  --magenta: #ff4dd8;
  --lime: #b6ff4d;
  --red: #ff4d6a;
  --text: #e8e8ff;
  --text-dim: #8f8fb3;
  --shadow-size: 4px;
}

* {
  box-sizing: border-box;
}

html {
  /* iOS: keep tap highlight from flashing the whole hard-shadow box on every tap */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0px, transparent 2px, transparent 4px);
  color: var(--text);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.5;
  /* long unbroken strings (addresses, keys) must never force horizontal page scroll */
  overflow-x: hidden;
}

h1, h2, h3, .pixel-font {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 22px;
  margin: 0;
  color: var(--cyan);
  text-shadow: 2px 0 var(--magenta), -2px 0 var(--cyan);
}

h2 {
  font-size: 14px;
  color: var(--cyan);
  margin: 0 0 16px;
}

h3 {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 0 10px;
}

a {
  color: var(--cyan);
}

/* ---- layout ------------------------------------------------------------- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px;
  background: var(--bg-panel);
  border-bottom: var(--shadow-size) solid var(--border);
}

nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  padding: 6px 2px; /* wider tap target than the text alone */
}

main {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: var(--bg-panel);
  border: var(--shadow-size) solid var(--border);
  box-shadow: var(--shadow-size) var(--shadow-size) 0 0 var(--border);
  padding: 20px;
  margin-bottom: 24px;
}

.panel + .panel {
  margin-top: 24px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.row > * {
  flex: 1 1 200px;
}

.stat {
  background: var(--bg-panel-alt);
  border: 3px solid var(--border);
  padding: 12px;
}

.stat .label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat .value {
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  color: var(--lime);
  margin-top: 6px;
  word-break: break-all;
}

/* ---- form controls -------------------------------------------------------- */

label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: var(--bg-input);
  border: 3px solid var(--border);
  color: var(--text);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  padding: 10px;
}

input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.field {
  margin-bottom: 16px;
}

.btn {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  background: var(--cyan);
  color: #061019;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-size) var(--shadow-size) 0 0 var(--border);
  padding: 12px 16px;
  cursor: pointer;
  transition: none;
}

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

.btn:active,
.btn.pressed {
  box-shadow: none;
  transform: translate(var(--shadow-size), var(--shadow-size));
}

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6) brightness(0.7);
}

.btn.secondary {
  background: var(--bg-panel-alt);
  color: var(--text);
}

.btn.danger {
  background: var(--red);
  color: #1a0006;
}

.btn.small {
  font-size: 9px;
  padding: 8px 10px;
}

/* ---- misc UI -------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 10px;
  padding: 4px 8px;
  border: 2px solid var(--border);
}

.badge.ok {
  background: var(--lime);
  color: #06210a;
}

.badge.off {
  background: var(--bg-panel-alt);
  color: var(--text-dim);
}

.warning {
  background: #2b1900;
  border: 3px solid var(--red);
  color: #ffcf99;
  padding: 12px;
  font-size: 12px;
  margin-bottom: 16px;
}

.error-message {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}

.success-message {
  color: var(--lime);
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}

.muted {
  color: var(--text-dim);
  font-size: 12px;
}

.table-scroll {
  /* the escape hatch for anything that can't reflow (tables): scrolls its own
     box instead of ever pushing the page itself wider than the viewport */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  border-bottom: 2px solid var(--bg-panel-alt);
  text-align: left;
  padding: 8px 6px;
}

th {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
}

td.address, code {
  font-family: "Consolas", "Courier New", monospace;
  word-break: break-all;
}

.log-output {
  background: var(--bg-input);
  border: 3px solid var(--border);
  color: var(--text-dim);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.4;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.empty-state {
  color: var(--text-dim);
  font-size: 12px;
  padding: 12px 0;
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  padding: 30px 0;
}

.addr-short {
  cursor: pointer;
  border-bottom: 1px dotted var(--text-dim);
}

/* ---- responsive: phones and small tablets ---------------------------------
   Goal: no horizontal scroll on the page itself, buttons stay >=44px tall
   (Apple/Google's minimum comfortable tap target), the pixel headings shrink
   instead of wrapping mid-word, and stat/panel spacing tightens up. */

@media (max-width: 600px) {
  header {
    padding: 12px 16px;
  }

  h1 {
    font-size: 16px;
  }

  main {
    margin: 20px auto;
    padding: 0 14px 40px;
  }

  .panel {
    padding: 14px;
    margin-bottom: 18px;
  }

  .row {
    gap: 10px;
  }

  .row > * {
    flex-basis: 100%;
  }

  .btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .btn.small {
    width: auto;
    min-height: 38px;
  }

  table {
    min-width: 340px;
    font-size: 12px;
  }
}

