@font-face {
  font-display: swap;
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/vt323-v18-latin-regular.woff2') format('woff2');
}

/* ── Panel tab bar (Queue / Store) inside .queue-list ── */
#sp-panel-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 3px double #00ffcc;
}

body.dark-mode #sp-panel-tabs {
  border-bottom-color: #ffcc00;
}

.sp-panel-tab {
  flex: 1;
  padding: 8px 10px;
  background: #000044;
  color: #00ffcc;
  border: none;
  border-right: 2px solid #00ffcc;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sp-panel-tab:last-child {
  border-right: none;
}

.sp-panel-tab.active {
  background: #00ffcc;
  color: #000;
  font-weight: bold;
}

.sp-panel-tab:hover:not(.active) {
  background: rgba(0, 255, 204, 0.15);
}

body.dark-mode .sp-panel-tab {
  background: #222211;
  color: #ffcc00;
  border-color: #ffcc00;
}

body.dark-mode .sp-panel-tab.active,
body.dark-mode #sp-panel-tabs .sp-panel-tab.active {
  background: #ffcc00 !important;
  color: #000 !important;
  font-weight: bold;
}

body.dark-mode .sp-panel-tab:hover:not(.active) {
  background: rgba(255, 204, 0, 0.12);
}

/* ── Terminal shell ── */
#sp-terminal {
  font-family: 'VT323', monospace;
  background: #d7d7d7;
  border: 1px solid #222;
  border-radius: 2px;
  box-shadow: 1px 1px #222, inset 1px 1px #fff;
  text-shadow: 0 1px #ededed;
  position: relative;
  padding-bottom: 10px;
}

/* Corner gems */
#sp-terminal::before,
#sp-terminal::after {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #b1b1b1, #d7d7d7);
  border: 1px solid #222;
  box-shadow: inset 1px 1px #fff, 1px 1px #fff;
  content: '';
}
#sp-terminal::before { left: 6px; }
#sp-terminal::after  { right: 6px; }

/* ── Terminal header bar ── */
#sp-header {
  color: #222;
  text-align: center;
  line-height: 28px;
  font-size: 18px;
  font-family: 'VT323', monospace;
  text-shadow: 0 1px #ededed;
}

/* ── Terminal dark window ── */
#sp-window {
  margin: 4px 8px 0;
  padding: 10px 14px 14px;
  background: #464646;
  box-shadow: -1px -1px #b4b4b5, 1px 1px #fff;
  font-size: 18px;
  color: #5fbb46;
  text-shadow: none;
  overflow-y: auto;
  max-height: 75vh;
}

#sp-window::-webkit-scrollbar        { width: 6px; }
#sp-window::-webkit-scrollbar-track  { background: #333; }
#sp-window::-webkit-scrollbar-thumb  { background: #5fbb46; }

/* ── Typography helpers ── */
.sp-bright  { color: #88ff66; }
.sp-dim     { color: #7a9970; }
.sp-warn    { color: #ff8844; font-size: 16px; margin: 4px 0; }
.sp-hidden  { display: none !important; }
.sp-blink   { animation: sp-blink 1.2s step-end infinite; }

@keyframes sp-blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }

.sp-cursor { animation: sp-blink 1s step-end infinite; }

/* ── Rules ── */
.sp-rule {
  border: none;
  border-top: 1px solid #3a5a32;
  margin: 8px 0;
}

/* ── Section headings ── */
.sp-section-head {
  font-size: 18px;
  margin-bottom: 6px;
  color: #88ff66;
}

/* ── Mix track rows ── */
.sp-mix-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid #333;
  font-size: 17px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.sp-mix-num   { flex-shrink: 0; font-size: 15px; }
.sp-mix-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #88ff66; }
.sp-mix-dur   { flex-shrink: 0; font-size: 14px; white-space: nowrap; }
.sp-mix-price { flex-shrink: 0; font-size: 14px; white-space: nowrap; }

.sp-remove-btn {
  flex-shrink: 0;
  font-family: 'VT323', monospace;
  font-size: 15px;
  color: #cc3333;
  background: none;
  border: 1px solid #cc3333;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1.3;
  text-shadow: none;
}
.sp-remove-btn:hover { background: #cc3333; color: #111; }

/* ── Duration bar ── */
#sp-dur-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
}

#sp-dur-bar-wrap {
  flex: 1;
  height: 6px;
  background: #333;
  border: 1px solid #5fbb46;
}

#sp-dur-bar {
  height: 100%;
  width: 0%;
  background: #5fbb46;
  transition: width 0.3s ease, background 0.3s ease;
}

/* ── Buttons ── */
.sp-btn {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #5fbb46;
  background: #2a2a2a;
  border: 1px solid #5fbb46;
  padding: 1px 10px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: none;
  line-height: 1.4;
  text-decoration: none;
  display: inline-block;
}
.sp-btn:hover    { background: #5fbb46; color: #2a2a2a; }
.sp-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.sp-full-btn {
  display: block;
  width: 100%;
  font-size: 19px;
  padding: 5px 10px;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-align: left;
}

.sp-dim-btn {
  color: #7a9970;
  border-color: #7a9970;
}
.sp-dim-btn:hover { background: #7a9970; color: #2a2a2a; }

/* ── Format buttons ── */
.sp-format-btn {
  margin-top: 5px;
}

.sp-format-active {
  background: #5fbb46 !important;
  color: #111 !important;
  border-color: #88ff66 !important;
}
.sp-format-active:hover {
  background: #88ff66 !important;
}

/* ── Shipping fields ── */
.sp-field-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.sp-field-row label {
  color: #7a9970;
  font-size: 16px;
  white-space: pre;  /* preserve spacing for alignment */
  flex-shrink: 0;
  font-family: 'VT323', monospace;
}

.sp-field-row input {
  flex: 1;
  min-width: 110px;
  font-family: 'VT323', monospace;
  font-size: 17px;
  background: #2a2a2a;
  border: 1px solid #5fbb46;
  color: #88ff66;
  padding: 2px 6px;
  outline: none;
}
.sp-field-row input::placeholder { color: #3a5a32; }
.sp-field-row input:focus         { border-color: #88ff66; }

/* ── Pricing rows ── */
.sp-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  padding: 2px 0;
}

.sp-total-row {
  border-top: 1px solid #3a5a32;
  padding-top: 4px;
  margin-top: 2px;
  font-size: 20px;
}

/* ── Wallet row ── */
#sp-wallet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 17px;
}

#sp-pay-status {
  font-size: 16px;
  min-height: 20px;
  margin-top: 2px;
}

/* ── Confirmation ── */
#sp-congrats {
  font-size: 18px;
  color: #fff;
  font-family: 'VT323', monospace;
  animation: sp-clunky 0.8s infinite alternate;
  line-height: 1.3;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

@keyframes sp-clunky {
  0%   { text-shadow: 0 0 1px #000, 2px 2px 0 rgba(255,255,85,.8), 3px 3px 0 rgba(0,255,255,.6), 0 0 12px rgba(255,105,180,.4); }
  50%  { text-shadow: 0 0 1px #000, 2px 2px 0 rgba(255,255,255,.9), 3px 3px 0 rgba(255,255,85,.7), 0 0 14px rgba(255,255,85,.3); }
  100% { text-shadow: 0 0 1px #000, 2px 2px 0 rgba(102,0,102,.8), 3px 3px 0 rgba(255,255,85,.7), 0 0 12px rgba(0,255,255,.3); }
}

#sp-confirm-msg {
  font-size: 16px;
  color: #7a9970;
  line-height: 1.6;
  margin: 4px 0;
}

#sp-confirm-paid,
#sp-confirm-order {
  font-size: 16px;
  margin: 3px 0;
}

.sp-order-num { letter-spacing: 1px; }

#sp-confirm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sp-contact-btn {
  color: #7a9970;
  border-color: #7a9970;
}
.sp-contact-btn:hover { background: #7a9970; color: #2a2a2a; }

/* ── Toast notification ── */
.sp-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #222;
  color: #5fbb46;
  font-family: 'VT323', monospace;
  font-size: 17px;
  padding: 6px 12px;
  border: 1px solid #5fbb46;
  z-index: 10002;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.sp-toast.sp-toast-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── [+ MIX] button inside track list ── */
.add-to-mix-btn {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1.6;
  background: transparent;
  color: #00aaff;
  border: 1px solid #00aaff;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}

.add-to-mix-btn:hover {
  background: #00aaff;
  color: #000;
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
}

.add-to-mix-btn.in-mix {
  background: #00aaff;
  color: #000;
  border-color: #00aaff;
  box-shadow: 0 0 5px rgba(0, 170, 255, 0.4);
}

.add-to-mix-btn.in-mix:hover {
  background: #ff4444;
  color: #fff;
  border-color: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

body.dark-mode .add-to-mix-btn {
  color: #ff00cc;
  border-color: #ff00cc;
  box-shadow: 0 0 5px rgba(255, 0, 204, 0.35);
}

body.dark-mode .add-to-mix-btn:hover {
  background: #ff00cc;
  color: #000;
  box-shadow: 0 0 10px rgba(255, 0, 204, 0.7);
}

body.dark-mode .add-to-mix-btn.in-mix {
  background: #ff00cc;
  color: #000;
  border-color: #ff00cc;
  box-shadow: 0 0 8px rgba(255, 0, 204, 0.6);
}

body.dark-mode .add-to-mix-btn.in-mix:hover {
  background: #ff3366;
  border-color: #ff3366;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.7);
}

/* ── Mobile: queue-list becomes the host for the store pane.
      It needs to show even on mobile when store tab is active. ── */
@media (max-width: 980px) {
  /* When store pane is visible inside queue-list, let the container expand */
  .queue-list.active-tab #sp-store-pane:not(.sp-hidden) ~ #sp-queue-pane,
  .queue-list.active-tab #sp-queue-pane.sp-hidden {
    display: none !important;
  }

  /* Terminal fits mobile width */
  #sp-terminal {
    font-size: 17px;
  }

  #sp-window {
    max-height: 65vh;
    font-size: 17px;
  }

  .sp-field-row label {
    font-size: 15px;
  }

  .sp-field-row input {
    font-size: 15px;
    min-width: 80px;
  }

  /* Panel tabs on mobile are slightly bigger for tap target */
  .sp-panel-tab {
    font-size: 9px;
    padding: 10px 6px;
  }

  /* Toast above any bottom chrome */
  .sp-toast {
    bottom: 70px;
  }
}
