.modal,
.preloader,
body::before {
  width: 100%;
  height: 100%;
}

.modal.hidden,
body::before {
  pointer-events: none;
}

#phaser-container,
canvas {
  max-width: 100%;
  max-height: 100vh;
}

*,
body {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal,
.preloader {
  justify-content: center;
  display: flex;
}

body::before {
  content: "";
  content: "";
  position: absolute;
  background: radial-gradient(circle at 50% 50%,
      rgba(102, 204, 0, 0.15) 0,
      rgba(0, 0, 0, 0.5) 80%);
  z-index: 0;
}

.preloader {
  align-items: center;
  backdrop-filter: blur(4px);
}

.preloader-text {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  color: #ffea00;
  text-shadow: 0 4px 0 #c50, 0 0 20px #f60;
  letter-spacing: 2px;
  animation: 1.4s infinite alternate pulseGlow;
}

.modal {
  backdrop-filter: blur(12px);
  align-items: center;
}

.modal-content {
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 210, 255, 0.3);
  backdrop-filter: blur(8px);
}

.modal-title {
  background: linear-gradient(135deg, #ffe6b0, #00d2ff);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 800;
  letter-spacing: 2px;
}

.btn {
  font-size: 18px;
  box-shadow: 0 5px 0 #003349;
}

.btn:hover {
  box-shadow: 0 8px 20px rgba(0, 210, 255, 0.5);
  transform: translateY(4px);
  box-shadow: 0 4px 0 #c50, 0 8px 10px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to bottom, #ff6, #ffb300);
}

.game-container {
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

@media (max-width: 860px) {
  .modal-content {
    padding: 20px;
  }

  .modal-title {
    font-size: 32px;
  }
}

* {
  box-sizing: border-box;
  user-select: none;
  box-sizing: border-box;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  background: radial-gradient(circle, #0a6b5e, #031c19);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.game-container,
.modal {
  justify-content: center;
  top: 0;
  left: 0;
}

@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 5px #00d2ff;
    opacity: 0.8;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.05);
    text-shadow: 0 4px 0 #c50, 0 0 30px #ff0;
  }
}

.modal {
  position: fixed;
  background: rgba(3, 28, 25, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  z-index: 5000;
  transition: 0.4s;
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(0px);
}

.modal-content {
  background: rgba(10, 107, 94, 0.95);
  border: 4px solid #6c0;
  border-radius: 20px;
  padding: 30px;
  max-width: 750px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  color: #e5f5f0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.5);
  font-family: "Segoe UI", sans-serif;
}

.btn,
.modal-title {
  text-transform: uppercase;
  font-family: Impact, sans-serif;
}

.modal-title {
  font-size: 30px;
  text-align: center;
  color: #fff;
  text-shadow: 0 6px 0 #c50, 0 8px 15px rgba(0, 0, 0, 0.6);
  margin-bottom: 25px;
  letter-spacing: 4px;
}

.section-title {
  font-size: 16px;
  color: #ffea00;
  border-left: 6px solid #f60;
  padding-left: 12px;
  margin: 10px 0;
  font-weight: 900;
  text-transform: uppercase;
}

.marble-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 15px 0;
}

.marble-item {
  text-align: center;
  font-weight: 700;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.marble-sample {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #888);
  margin-bottom: 8px;
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.5),
    inset 2px 2px 5px rgba(255, 255, 255, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.marble-red {
  background: radial-gradient(circle at 35% 30%, #ff4d4d, #900);
}

.marble-blue {
  background: radial-gradient(circle at 35% 30%, #4da6ff, #004099);
}

.marble-purple {
  background: radial-gradient(circle at 35% 30%, #c3f, #609);
}

.marble-orange {
  background: radial-gradient(circle at 35% 30%, #ffb347, #b35900);
}

.marble-cyan {
  background: radial-gradient(circle at 35% 30%, #a6ff4d, #390);
}

.btn {
  background: linear-gradient(to bottom, #ffea00, #f90);
  border: 3px solid #fff;
  padding: 10px 28px;
  border-radius: 15px;
  font-weight: 900;
  cursor: pointer;
  width: 100%;
  margin-top: 25px;
  color: #331a00;
  letter-spacing: 2px;
  transition: 0.15s;
  box-shadow: 0 8px 0 #c50, 0 15px 20px rgba(0, 0, 0, 0.5);
}

.game-container {
  align-items: center;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  transition: 0.3s;
  background: 0 0;
  display: none;
  width: 100vw;
  height: 100vh;
  position: absolute;
}

#phaser-container,
body {
  justify-content: center;
}

@media (max-width: 860px) {
  .modal-content {
    padding: 10px;
  }

  .modal-title {
    font-size: 20px;
  }
}

#phaser-container {
  align-items: center;
  width: 100%;
  height: 95%;
  margin-top: 3%;
  margin-bottom: 3%;
}

canvas {
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.5), 0 30px 50px rgba(0, 0, 0, 0.5);
  transition: 0.2s;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 0 6px #074f45, 0 30px 50px rgba(0, 0, 0, 0.8);
  display: block;
}

body {
  position: relative;
  min-height: 100vh;
  background: #053a33;
  font-family: Impact, "Arial Black", sans-serif;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.game-container.active {
  display: block;
  display: flex;
  justify-content: center;
  align-items: center;
}