/* Demo makine harcama simülasyonu — alt orta */
.demo-machine-fab {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  z-index: 1075;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Ubuntu, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(148, 163, 184, 0.25);
  cursor: pointer;
}

.demo-machine-fab:hover {
  filter: brightness(1.08);
}

.demo-machine-fab-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.demo-machine-panel {
  position: fixed;
  left: 50%;
  bottom: 128px;
  transform: translateX(-50%) translateY(14px) scale(0.96);
  z-index: 1082;
  width: min(360px, calc(100vw - 24px));
  background: #0b1220;
  color: #e8eef7;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  font-family: Ubuntu, system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.demo-machine-panel.is-open {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.demo-machine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.18), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-machine-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.demo-machine-rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
  animation: demoMachinePulse 1.4s ease-out infinite;
}

@keyframes demoMachinePulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.demo-machine-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

.demo-machine-panel .demo-sim-note {
  margin: 8px 12px 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.28);
  border: 1px solid rgba(248, 113, 113, 0.65);
}

.demo-machine-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 6px;
}

.demo-machine-tab {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.demo-machine-tab.is-active {
  background: linear-gradient(180deg, #4f46e5, #3730a3);
  color: #fff;
}

.demo-machine-status {
  padding: 8px 12px 0;
  font-size: 11px;
  color: #94a3b8;
  min-height: 1.4em;
}

.demo-machine-cardrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.demo-machine-cardmeta {
  min-width: 0;
  font-size: 12px;
}

.demo-machine-cardmeta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-machine-cardmeta span {
  color: #94a3b8;
  font-size: 11px;
}

.demo-machine-pickcard {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
  cursor: pointer;
  white-space: nowrap;
}

.demo-machine-cardpicker {
  display: none;
  max-height: 160px;
  overflow: auto;
  margin: 6px 12px 0;
  padding: 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  flex-direction: column;
  gap: 4px;
}

.demo-machine-panel.is-picking-card .demo-machine-cardpicker {
  display: flex;
}

.demo-machine-cardopt {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 9px;
  text-align: left;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  cursor: pointer;
}

.demo-machine-cardopt:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.demo-machine-cardopt.is-selected {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
}

.demo-machine-cardopt.is-blank {
  opacity: 0.45;
  cursor: not-allowed;
}

.demo-machine-cardopt-name {
  font-size: 12px;
  font-weight: 600;
}

.demo-machine-cardopt-meta {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}

.demo-machine-list {
  max-height: min(38vh, 280px);
  overflow: auto;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-machine-item {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  cursor: pointer;
}

.demo-machine-item:hover {
  border-color: rgba(99, 102, 241, 0.55);
}

.demo-machine-item.is-selected {
  border-color: #818cf8;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.12));
}

.demo-machine-item-name {
  font-size: 13px;
  font-weight: 600;
}

.demo-machine-item-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.demo-machine-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}

.demo-machine-tier {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
}

.demo-machine-tier.is-selected {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #bbf7d0;
}

.demo-machine-actions {
  padding: 0 12px 12px;
}

.demo-machine-play {
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #052e16;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.demo-machine-play:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Oynatma: sadece animasyon sahnesi */
.demo-machine-panel.is-playing .demo-machine-head,
.demo-machine-panel.is-playing .demo-sim-note,
.demo-machine-panel.is-playing .demo-machine-tabs,
.demo-machine-panel.is-playing .demo-machine-cardrow,
.demo-machine-panel.is-playing .demo-machine-cardpicker,
.demo-machine-panel.is-playing .demo-machine-status,
.demo-machine-panel.is-playing .demo-machine-list,
.demo-machine-panel.is-playing .demo-machine-tiers,
.demo-machine-panel.is-playing .demo-machine-actions {
  display: none !important;
}

.demo-machine-stage {
  display: none;
  position: relative;
  margin: 0;
  height: 168px;
  border-radius: 16px;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(56, 189, 248, 0.2), transparent 55%),
    linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #020617 100%);
}

.demo-machine-panel.is-playing .demo-machine-stage {
  display: block;
}

.demo-machine-cabinet {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  width: 118px;
  height: 78px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #475569 0%, #1e293b 70%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 8px 16px rgba(0,0,0,0.35);
}

.demo-machine-cabinet::before {
  content: attr(data-label);
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}

.demo-machine-slot {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 10px;
  border-radius: 3px;
  background: #020617;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.demo-machine-slot-led {
  position: absolute;
  right: 10px;
  top: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
}

.demo-machine-panel.is-playing .demo-machine-slot-led {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  animation: demoMachinePulse 0.55s ease-out infinite;
}

.demo-machine-panel.is-play-ok .demo-machine-slot-led {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
  animation: none;
}

.demo-machine-flycard {
  position: absolute;
  left: 18px;
  top: 48px;
  width: 54px;
  height: 34px;
  border-radius: 5px;
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 55%, #94a3b8 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translate(0, 18px) rotate(-12deg);
}

.demo-machine-flycard::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  background: #f59e0b;
}

.demo-machine-panel.is-playing .demo-machine-flycard {
  animation: demoMachineCardTap 1.6s cubic-bezier(0.22, 0.7, 0.25, 1) forwards;
}

@keyframes demoMachineCardTap {
  0% { opacity: 0; transform: translate(0, 22px) rotate(-14deg); }
  18% { opacity: 1; transform: translate(28px, 8px) rotate(-6deg); }
  45% { opacity: 1; transform: translate(72px, -2px) rotate(0deg); }
  62% { opacity: 1; transform: translate(78px, 2px) rotate(0deg) scale(0.92); }
  78% { opacity: 0.85; transform: translate(78px, 2px) scale(0.88); }
  100% { opacity: 0; transform: translate(78px, 6px) scale(0.8); }
}

.demo-machine-stage-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #bae6fd;
}

@media (max-width: 640px) {
  .demo-machine-fab {
    bottom: 70px;
  }
  .demo-machine-panel {
    bottom: 118px;
  }
}
