:root {
  --neon-cyan: #00f3ff;
  --cyber-purple: #7028e4;
  --matrix-green: #00ff9d;
  --cyber-black: #0a0a12;
  --hologram-gradient: linear-gradient(45deg, var(--cyber-purple), var(--neon-cyan));
}

/* Main block */
.cybertool-container {
  --bg-alpha: 0.68;
  --panel-bg: rgba(10,10,18,var(--bg-alpha));
  --glass: rgba(255,255,255,0.03);
  --edge: rgba(255,255,255,0.04);

  box-sizing: border-box;
  width: 100%;
  max-width: 1100px;
  margin: 18px auto;
  padding: 18px;
  border-radius: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  color: var(--neon-cyan);
  background: linear-gradient(180deg, rgba(7,7,12,1) 0%, rgba(6,6,10,0.98) 60%, rgba(8,8,12,0.9) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 30px rgba(0,0,0,0.7), 0 0 120px rgba(112,40,228,0.04) inset;
  border: 1px solid rgba(255,255,255,0.03);
}

/* Particles & canvas overlay (positioned, behind content) */
.cybertool-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cybertool-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Header */
.cybertool-header {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-bottom: 12px;
}
.cybertool-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
  background: -webkit-linear-gradient(90deg, var(--neon-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: lowercase;
  padding: 6px 12px;
  display: inline-block;
  backdrop-filter: blur(6px) saturate(120%);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
}

/* Body layout - mobile-first */
.cybertool-body {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: start;
}

/* Panels */
.cybertool-panel {
  min-height: 120px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--edge);
  box-shadow: 0 8px 20px rgba(2,2,6,0.5);
  position: relative;
  backdrop-filter: blur(6px) saturate(120%);
  overflow: hidden;
}

/* Controls layout */
.cybertool-fieldset {
  border: none;
  margin: 0 0 8px 0;
  padding: 0;
}
.cybertool-legend {
  display: block;
  font-size: 12px;
  color: var(--matrix-green);
  margin-bottom: 8px;
}
.cybertool-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.cybertool-label {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}
.cybertool-input,
.cybertool-select {
  min-height: 44px; /* touch target */
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
  background: linear-gradient(180deg, rgba(8,8,12,0.5), rgba(6,6,10,0.4));
  color: var(--neon-cyan);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: box-shadow .22s ease, transform .18s ease;
}
.cybertool-input:focus,
.cybertool-select:focus {
  box-shadow: 0 6px 18px rgba(112,40,228,0.12), 0 0 8px rgba(0,243,255,0.06);
  transform: translateY(-2px);
}

/* Buttons */
.cybertool-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.cybertool-btn {
  cursor: pointer;
  user-select: none;
  min-height: 44px; /* touch target */
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color: var(--neon-cyan);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform .14s ease, box-shadow .14s ease, background .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cybertool-btn:active { transform: translateY(1px) scale(.998); }

.cybertool-btn--primary {
  background: linear-gradient(90deg, rgba(112,40,228,0.16), rgba(0,243,255,0.06));
  border-image-source: linear-gradient(90deg, var(--hologram-gradient));
  border-image-slice: 1;
  box-shadow: 0 6px 26px rgba(112,40,228,0.08);
}
.cybertool-btn--ghost {
  opacity: 0.92;
  border: 1px solid rgba(255,255,255,0.03);
}
.cybertool-btn--small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.cybertool-btn--destructive { color: rgba(255,140,120,0.9); }

/* Hover-activated gradient on panels & buttons */
.cybertool-panel:hover,
.cybertool-btn:hover {
  box-shadow: 0 18px 60px rgba(112,40,228,0.06), 0 0 60px rgba(0,243,255,0.02);
  transform: translateY(-4px);
}
.cybertool-panel::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 10% 10%, rgba(112,40,228,0.06), transparent 6%),
              radial-gradient(circle at 90% 90%, rgba(0,243,255,0.04), transparent 6%);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity .35s ease;
  opacity: .9;
}
.cybertool-panel:hover::after { opacity: 1; transform: translateY(-4px); }

/* Output area */
.cybertool-output-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.cybertool-meta { font-size: 12px; color: rgba(255,255,255,0.5); display:flex; gap:8px; flex-wrap:wrap; }
.cybertool-output {
  display: grid;
  gap: 10px;
  align-content: start;
}

/* Ticket card */
.cybertool-ticket {
  padding: 12px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.03);
  background: linear-gradient(180deg, rgba(5,5,8,0.6), rgba(8,8,12,0.4));
  box-shadow: 0 6px 20px rgba(2,2,6,0.5);
  min-height: 64px;
}
.cybertool-ticket__numbers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.cybertool-ball {
  min-width: 44px;
  min-height: 44px;
  display:inline-grid;
  place-items:center;
  padding: 8px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: #05050a;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), 0 0 14px rgba(112,40,228,0.06);
}
.cybertool-ball--power {
  background: linear-gradient(90deg, var(--matrix-green), rgba(255,255,255,0.95));
  box-shadow: 0 8px 28px rgba(0,255,157,0.06);
}

/* Loader */
.cybertool-loader {
  display: none;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-top: 10px;
}
.cybertool-loader[aria-hidden="false"] { display:flex; }
.cybertool-loader__ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.04);
  border-top-color: var(--neon-cyan);
  animation: cybertool-spin 1s linear infinite;
}
@keyframes cybertool-spin { to { transform: rotate(360deg); } }
.cybertool-loader__text {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* Saves list */
.cybertool-saves {
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
  padding: 4px;
}
.cybertool-save {
  display:flex;
  justify-content:space-between;
  gap:8px;
  padding:6px 8px;
  border-radius:8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.02);
  font-size:13px;
  color: rgba(255,255,255,0.8);
}

/* Footer note */
.cybertool-footer {
  margin-top: 12px;
  text-align:center;
  z-index:3;
}
.cybertool-note { color: rgba(255,255,255,0.35); font-size:12px; }

/* Responsive: horizontal split on wider screens */
@media (min-width: 600px) {
  .cybertool-body { grid-template-columns: 1fr 1.25fr; align-items: start; }
  .cybertool-panel { min-height: 220px; }
}

/* Accessibility focus ring */
.cybertool-input:focus,
.cybertool-select:focus,
.cybertool-btn:focus { outline: 3px solid rgba(0,243,255,0.08); outline-offset: 2px; }

/* Small refinements */
.cybertool-meta__item { background: rgba(255,255,255,0.02); padding:6px 8px; border-radius:8px; }
