* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
}

body {
  background: #040408;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 320px;
  height: 460px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.fade-out {
  opacity: 0;
  transform: scale(0.9) translateY(-30px);
  pointer-events: none;
  display: none !important;
}

.vault-side {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.terminal-container {
  position: relative;
  width: 240px;
  height: 380px;
  background: #0a0a0f;
  border-radius: 16px;
  border: 2px solid #141420;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.card-slot {
  width: 160px;
  height: 12px;
  background: #020204;
  border-radius: 4px;
  border-bottom: 2px solid #1f1f2e;
  z-index: 5;
}

.security-card {
  width: 140px;
  height: 180px;
  background: linear-gradient(135deg, #162447, #0f172a);
  border-radius: 8px;
  position: absolute;
  top: -40px;
  cursor: grab;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  padding: 15px;
  z-index: 2;
}

.security-card:active { cursor: grabbing; }

.chip {
  width: 32px;
  height: 25px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 4px;
  margin-bottom: 15px;
}

.card-lines {
  flex: 1;
  border-left: 2px dashed rgba(255, 255, 255, 0.1);
}

.pull-text {
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
}

.status-light {
  width: 36px;
  height: 36px;
  background: #221212;
  border-radius: 50%;
  position: absolute;
  bottom: 40px;
  border: 3px solid #0f0f14;
  transition: all 0.4s ease;
}

.system-active .status-light {
  background: #10b981;
  box-shadow: 0 0 30px #10b981;
}

.system-active .security-card {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border-color: #22d3ee;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
}

/* واجهة اللعبة الاحترافية المتكاملة */
.game-container {
  display: none;
  flex-direction: column;
  align-items: center;
  background: #09090e;
  padding: 30px;
  border-radius: 28px;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-container.visible {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.game-header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.game-title {
  color: #3b82f6;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.stat-box {
  background: #11111b;
  color: #f8fafc;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: bold;
  border: 1px solid #1e1e2f;
  font-size: 15px;
}

.stat-box span {
  color: #3b82f6;
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.canvas-relative {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #1e1e2f;
}

#gameCanvas {
  background: #050508;
  display: block;
}

/* الشاشات المتراكبة للربح والخسارة */
.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 8, 0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.canvas-overlay h1 {
  font-size: 42px;
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.neon-red { color: #ef4444; text-shadow: 0 0 20px #ef4444; }
.neon-green { color: #10b981; text-shadow: 0 0 20px #10b981; }

.canvas-overlay p {
  color: #64748b;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 25px;
}

.retry-btn {
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
  padding: 12px 30px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.retry-btn:hover { background: #ef4444; color: #fff; box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }

.retry-btn.success { color: #10b981; border-color: #10b981; }
.retry-btn.success:hover { background: #10b981; color: #fff; box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }

.game-controls {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}

.game-btn {
  flex: 2;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 14px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.game-btn.reset {
  flex: 1;
  background: #13131f;
  border: 1px solid #27273f;
  box-shadow: none;
}
.game-btn.reset:hover { background: #1c1c2e; color: #ef4444; border-color: #ef4444; }