/* Ball Game - Modern Fullscreen Redesign (Conway-like) */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.ball-game-container {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  overflow: hidden;
  position: relative;
  user-select: none;
}

/* Fullscreen Canvas */
.game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Floating Top Bar */
.floating-topbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.back-link {
  color: white;
  text-decoration: none;
  font-size: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 4px 8px;
}

.back-link:hover {
  opacity: 1;
}

.topbar-center {
  display: flex;
  gap: 12px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13px;
}

.stat-pill .stat-icon {
  font-size: 14px;
}

.stat-pill .stat-value {
  font-weight: 600;
  color: #667eea;
  min-width: 20px;
  text-align: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.icon-btn.active {
  background: rgba(102, 126, 234, 0.25);
  border-color: #667eea;
}

.icon-btn.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* Hover Badge */
.hover-badge {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  pointer-events: none;
  z-index: 50;
  text-transform: capitalize;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.95) 0%, rgba(15, 15, 30, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 28px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin: 0 0 24px 0;
  font-size: 24px;
  color: #667eea;
}

.modal h3 {
  margin: 20px 0 12px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
}

/* Help Section */
.help-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.help-section:last-of-type {
  border-bottom: none;
}

.help-section h3 {
  margin-bottom: 12px;
  color: #667eea;
  opacity: 1;
}

.help-section ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.help-section li {
  font-size: 14px;
  opacity: 0.9;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.help-section li:last-child {
  border-bottom: none;
}

.help-section p {
  font-size: 14px;
  opacity: 0.8;
  margin: 10px 0;
  line-height: 1.6;
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 14px 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
  .floating-topbar {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 95%;
    gap: 12px;
  }

  .topbar-left h1 {
    display: none;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .stat-pill {
    padding: 4px 10px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .floating-topbar {
    top: 8px;
    padding: 8px 12px;
    gap: 8px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .divider {
    display: none;
  }

  .modal {
    padding: 20px;
    max-height: 85vh;
  }
}
