/*
  BGSC Miner PHP Edition · CSS principal
  ------------------------------------------------------------
  Este archivo controla:
  - layout responsive móvil
  - estilo cyberpunk BGSC
  - animaciones de ventiladores, barras, brillos y modales
*/

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg: #05000c;
  --panel: #0c0018;
  --panel2: #130022;
  --purple: #b600ff;
  --purple2: #7700cc;
  --gold: #FFD700;
  --cyan: #00d4ff;
  --green: #39ff14;
  --orange: #FF9800;
  --red: #ff4444;
  --text: #ffffff;
  --muted: #ffffff66;
  --soft: #ffffff18;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #16002a 0%, transparent 32%),
    linear-gradient(180deg, #05000c, #020005);
  color: var(--text);
  font-family: "Courier New", monospace;
}

.app-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 14px 10px 70px;
}

.panel {
  background: linear-gradient(135deg, var(--panel2), #080014);
  border: 1px solid #b600ff33;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 0 18px #00000066;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  opacity: .8;
}

.header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: hdrGlow 3s ease-in-out infinite;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border: 1px solid #b600ff77;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--purple);
  box-shadow: 0 0 18px #b600ff44;
}

h1, h2, h3 {
  font-family: Orbitron, monospace;
  margin: 0;
}

h1 {
  color: var(--purple);
  font-size: 20px;
  letter-spacing: 3px;
}

h1 span {
  color: #ffffff44;
  font-weight: 400;
  font-size: 14px;
}

h2 {
  font-size: 13px;
  margin-bottom: 10px;
  color: #fff;
}

p {
  margin: 0;
}

.brand p,
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.center { text-align: center; }

.coin-box {
  background: #07001a;
  border: 1px solid #FFD70044;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 116px;
  text-align: center;
}

.coin-box small {
  display: block;
  color: #FFD700aa;
  font-size: 9px;
}

.coin-box strong {
  display: block;
  font-family: Orbitron, monospace;
  font-size: 19px;
  color: var(--gold);
}

.coin-selector {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.coin-btn {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid #ffffff14;
  background: #0d0018;
  color: #ffffff88;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  font-family: monospace;
}

.coin-btn.active {
  color: #fff;
  box-shadow: 0 0 14px currentColor;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.stats-grid div {
  background: #08000f;
  border: 1px solid #ffffff0c;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.stats-grid small,
.progress-label span {
  color: #ffffff55;
  font-size: 8px;
}

.stats-grid strong,
.progress-label strong {
  display: block;
  font-family: Orbitron, monospace;
  color: var(--cyan);
  font-size: 10px;
  margin-top: 3px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 9px 2px 4px;
}

.bar {
  height: 7px;
  background: #0a0014;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width .25s;
}

.bar-fill.energy {
  background: linear-gradient(90deg, var(--purple), var(--gold));
}

.tabs {
  display: flex;
  gap: 5px;
  background: #08000f;
  border: 1px solid #b600ff18;
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 10px;
}

.tab {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #ffffff44;
  font-family: Orbitron, monospace;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
}

.view { display: none; }
.view.active { display: block; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: linear-gradient(135deg, #10001e, #08000f);
  border: 1px solid #ffffff12;
  border-radius: 14px;
  padding: 13px;
  position: relative;
  overflow: hidden;
}

.card.clickable { cursor: pointer; }

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  opacity: .7;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-title {
  font-family: Orbitron, monospace;
  font-size: 12px;
  font-weight: 700;
}

.card-sub {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  border: 1px solid #ffffff22;
  color: #ffffffaa;
}

.btn, .select {
  border-radius: 10px;
  border: 1px solid #ffffff22;
  background: #10001e;
  color: #ffffffaa;
  padding: 10px 12px;
  cursor: pointer;
  font-family: Orbitron, monospace;
  font-size: 10px;
  font-weight: 700;
}

.btn.primary {
  color: white;
  border-color: #b600ff66;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 0 18px #b600ff44;
}

.btn.danger {
  color: white;
  border-color: #ff444466;
  background: linear-gradient(135deg, #ff4444, #990000);
}

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

.hidden { display: none !important; }

.room {
  margin-top: 8px;
  border: 1px solid #ffffff10;
  border-radius: 12px;
  padding: 10px;
  background: #08000f;
}

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.gauges {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.gauge {
  flex: 1;
}

.rack {
  background: linear-gradient(180deg, #111120, #08080e);
  border: 1px solid #222235;
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
}

.rack-head {
  display: flex;
  justify-content: space-between;
  font-family: Orbitron, monospace;
  font-size: 10px;
  color: var(--purple);
  margin-bottom: 6px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.slot {
  min-height: 74px;
  border: 1px dashed #ffffff18;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #07000f;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.slot.filled {
  border-style: solid;
  background: linear-gradient(135deg, #1a1025, #07000f);
}

.slot.off {
  opacity: .45;
}

.gpu-mini {
  width: 100%;
  padding: 6px;
  text-align: center;
}

.gpu-name {
  font-size: 9px;
  font-family: Orbitron, monospace;
  color: #fff;
}

.gpu-fans {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 5px;
}

.fan {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  animation: spinFan 1.2s linear infinite;
}

.fan::before,
.fan::after {
  content: "";
  position: absolute;
  inset: 8px 2px;
  background: currentColor;
  border-radius: 50%;
}

.fan::after {
  transform: rotate(90deg);
}

.slot-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  position: absolute;
  top: 5px;
  right: 5px;
  box-shadow: 0 0 6px var(--green);
  animation: blinkLED 1.3s ease-in-out infinite;
}

.mine-button {
  width: 145px;
  height: 145px;
  border-radius: 50%;
  border: 3px solid var(--purple);
  background: radial-gradient(circle at 38% 32%, #280050, #080012);
  color: white;
  box-shadow: 0 0 28px #b600ff55, inset 0 0 20px #b600ff22;
  cursor: pointer;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mine-button span { font-size: 44px; }
.mine-button small {
  color: #b600ffaa;
  font-family: monospace;
  font-weight: bold;
}

#blockCanvas {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid #b600ff22;
  background: linear-gradient(180deg,#060010,#0b0018);
  cursor: crosshair;
}

.modal {
  position: fixed;
  inset: 0;
  background: #000000cc;
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  width: min(100%, 420px);
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(135deg, #130025, #09001a);
  border: 1px solid #b600ff66;
  border-radius: 18px;
  padding: 18px;
  position: relative;
  box-shadow: 0 0 60px #b600ff33;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffffff11;
  border: 1px solid #ffffff22;
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.code-preview {
  white-space: pre-wrap;
  background: #030007;
  border: 1px solid #ffffff18;
  border-radius: 10px;
  padding: 12px;
  color: #ffffffaa;
  font-size: 10px;
  overflow: auto;
}

.alert {
  border: 1px solid #ff444466;
  background: #ff000012;
  color: #ff8888;
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  margin: 8px 0;
  animation: barDanger .8s infinite;
}

@keyframes spinFan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes blinkLED {
  0%, 100% { opacity: 1; }
  50% { opacity: .2; }
}

@keyframes hdrGlow {
  0%,100% { box-shadow: 0 0 10px #b600ff22; }
  50% { box-shadow: 0 0 26px #b600ff77; }
}

@keyframes barDanger {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}

@media (max-width: 380px) {
  .header-panel { align-items: flex-start; }
  .coin-box { min-width: 104px; padding: 8px; }
  h1 { font-size: 18px; }
}
