/* src/ui/pixel-skin.css */
:root {
  --buncss-light: ;
  --buncss-dark: initial;
  color-scheme: dark;
  --crt-green: #72f1b8;
  --crt-blue: #36c2ff;
  --crt-pink: #ff64c6;
  --crt-yellow: #ffe66d;
  --dark-bg: #080016;
  --panel-bg: #140022;
  --panel-border: #2f0056;
  --panel-shadow: #04000b;
  --text-primary: #e9fffa;
  --text-muted: #e9fffab3;
  --danger: #ff3c7c;
  background-color: #05010d;
  font-family: "Press Start 2P", system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  color: var(--text-primary);
  background: radial-gradient(circle at top, #1a0040 0, #080016 55%, #03000a 100%);
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem;
}

.scanlines {
  position: fixed;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: .3;
  z-index: 1;
  background-image: repeating-linear-gradient(#0000001a 0 2px, #0000 2px 4px);
  inset: 0;
}

.pubkey-overlay {
  position: fixed;
  display: grid;
  backdrop-filter: blur(4px);
  z-index: 3;
  background: radial-gradient(circle, #380066d9, #080016f2);
  place-items:  center;
  padding: 1.5rem;
  inset: 0;
}

.pubkey-overlay[hidden] {
  display: none;
}

.life-screen {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  display: grid;
  text-align: center;
  position: relative;
  border-radius: 14px;
  gap: 1rem;
  width: min(22rem, 100%);
  max-width: min(22rem, 100%);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 18px #04000ccc, 0 0 35px #ff64c659;
}

.life-screen h2 {
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--crt-yellow);
  text-shadow: 0 0 10px #ffe66d8c;
  margin: 0;
  font-size: 1.1rem;
}

.life-caption {
  color: var(--text-muted);
  margin: 0;
  font-size: .7rem;
  line-height: 1.6;
}

.pubkey-hint {
  color: var(--crt-blue);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0;
  font-size: .6rem;
}

.pubkey-error {
  display: block;
  color: var(--danger);
  letter-spacing: .08em;
  min-height: 1rem;
  margin: 0;
  font-size: .6rem;
}

.wallet-shell {
  position: relative;
  z-index: 2;
  display: flex;
  border: 4px solid var(--panel-border);
  backdrop-filter: blur(6px);
  background: #0a0019d9;
  border-radius: 16px;
  flex-direction: column;
  gap: 2rem;
  width: min(64rem, 100%);
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: 0 0 0 4px #7400ff4d, 0 0 45px #72f1b840;
}

.wallet-header {
  display: grid;
  text-align: center;
  gap: .75rem;
}

.wallet-header h1 {
  letter-spacing: .08em;
  text-shadow: 0 0 6px var(--crt-blue), 0 0 18px #72f1b88c;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.tagline {
  color: var(--text-muted);
  margin: 0;
  font-size: clamp(.65rem, 1.5vw, .8rem);
}

.balance-panel {
  display: inline-flex;
  border: 2px solid var(--panel-border);
  background: linear-gradient(120deg, #24003ccc, #07001ef2);
  border-radius: 12px;
  justify-content: center;
  align-items:  center;
  gap: 1rem;
  padding: .75rem 1.25rem;
  box-shadow: inset 0 -6px #00000059, 0 6px 0 -2px #ff64c64d;
}

.panel-label {
  text-transform: uppercase;
  color: var(--crt-blue);
  letter-spacing: .12em;
  font-size: .6rem;
}

.balance-value {
  color: var(--crt-green);
  font-size: 1rem;
}

.status-line {
  color: var(--text-muted);
  min-height: 1.2rem;
  margin: 0;
  font-size: .6rem;
}

.exit-button {
  justify-self: center;
  margin-top: .25rem;
}

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

@media (width >= 26rem) {
  .exit-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.5rem;
}

.card {
  display: flex;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  box-shadow: 0 8px 0 var(--panel-shadow);
  position: relative;
  border-radius: 12px;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.neon-edge:after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--crt-green), var(--crt-blue), var(--crt-pink));
  mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-composite: exclude;
  z-index: -1;
  opacity: .6;
  border: 2px solid #0000;
  inset: -2px;
}

.card h2 {
  color: var(--crt-yellow);
  text-shadow: 0 0 6px #ffe66d80;
  margin: 0;
  font-size: 1rem;
}

.card p {
  color: var(--text-muted);
  margin: 0;
  font-size: .7rem;
}

.pixel-form {
  display: grid;
  gap: .75rem;
}

.pixel-field {
  display: grid;
  gap: .5rem;
}

.pixel-field[data-required] span:after {
  content: " *";
  color: var(--danger);
}

.pixel-field span {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--crt-blue);
  font-size: .6rem;
}

.pixel-field input, .pixel-field textarea {
  border: 2px solid var(--panel-border);
  color: var(--text-primary);
  background: #040010e6;
  border-radius: 10px;
  width: 100%;
  padding: .85rem .9rem;
  transition: border .1s, box-shadow .2s;
  font-family: inherit;
  font-size: .75rem;
  box-shadow: inset 0 -4px #00000059;
}

.pixel-field input:focus, .pixel-field textarea:focus {
  outline: none;
  border-color: var(--crt-blue);
  box-shadow: 0 0 0 3px #36c2ff59;
}

.more-toggle {
  color: var(--crt-pink);
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  background: none;
  border: none;
  justify-self: start;
  padding: 0;
  font-family: inherit;
  font-size: .6rem;
}

.more-fields {
  display: grid;
  animation: flipDown .16s ease;
  gap: .75rem;
}

[hidden] {
  display: none !important;
}

@keyframes flipDown {
  from {
    opacity: 0;
    transform: perspective(400px)rotateX(-20deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.pixel-button {
  color: #120010;
  text-transform: uppercase;
  letter-spacing: .16em;
  cursor: pointer;
  background: linear-gradient(135deg, #ff64c6e6, #72f1b8d9);
  border: 0;
  border-radius: 10px;
  padding: .85rem 1rem;
  transition: transform .1s, box-shadow .1s;
  font-size: .7rem;
  box-shadow: 0 6px #0009;
}

.pixel-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px #0009;
}

.pixel-button-ghost {
  border: 2px solid var(--crt-blue);
  color: var(--crt-blue);
  box-shadow: none;
  background: none;
}

.pixel-button-ghost:active {
  transform: translateY(2px);
}

.invoice-output {
  display: grid;
  box-sizing: border-box;
  background: #04001099;
  border: 1px dashed #ffe66d59;
  border-radius: 12px;
  justify-items: center;
  gap: .75rem;
  width: 100%;
  padding: 1rem;
}

.invoice-qr {
  display: block;
  image-rendering: pixelated;
  width: 100%;
  max-width: 11rem;
  height: auto;
  margin: 0 auto;
}

.invoice-string {
  display: block;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: var(--crt-green);
  background: #000000a6;
  border-radius: 10px;
  width: 100%;
  margin-top: .5rem;
  padding: .75rem;
  font-size: .55rem;
}

.token-panel {
  display: grid;
  background: #04001073;
  border: 1px dashed #36c2ff59;
  border-radius: 12px;
  gap: .75rem;
  margin-top: .75rem;
  padding: .75rem;
}

.token-actions {
  display: flex;
  justify-content: flex-end;
}

.scanner-panel {
  display: grid;
  background: #04001099;
  border: 1px solid #36c2ff59;
  border-radius: 12px;
  gap: .75rem;
  margin-top: 1rem;
  padding: 1rem;
}

.scanner-panel h3 {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--crt-blue);
  margin: 0;
  font-size: .75rem;
}

.scanner-view {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0006;
  border-radius: 10px;
  width: 100%;
}

.scanner-actions {
  display: flex;
  justify-content: flex-end;
}

.action-output {
  color: var(--crt-green);
  display: block;
  min-height: 1.5rem;
  font-size: .6rem;
}

.toast {
  position: fixed;
  border: 2px solid var(--crt-blue);
  color: var(--crt-blue);
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: toastPop .16s ease-out;
  z-index: 3;
  background: #140022f2;
  border-radius: 12px;
  padding: .9rem 1.2rem;
  font-size: .6rem;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translateX(-50%)translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.toast.fade-out {
  animation: toastFade .2s ease-in forwards;
}

@keyframes toastFade {
  to {
    opacity: 0;
    transform: translateX(-50%)translateY(12px);
  }
}

@media (width <= 720px) {
  body {
    padding: 1rem;
  }

  .wallet-shell {
    padding: 1.25rem;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1rem;
  }

  .balance-panel {
    flex-direction: column;
    gap: .5rem;
  }
}
