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

:root {
  --bg-start: #090a14;
  --bg-end: #0e1123;
  --card: rgba(12, 16, 38, 0.95);
  --card-border: rgba(72, 208, 255, 0.18);
  --text: #e7f3ff;
  --muted: #95a5c0;
  --accent: #60d4ff;
  --accent-strong: #8c6cff;
  --danger: #ff6b6b;
  --success: #4ef0b8;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(96, 212, 255, 0.14), transparent 22%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(96, 212, 255, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  opacity: 0.45;
}

.overlay-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 100px 100px;
  opacity: 0.15;
}

body,
button,
select {
  font-family: 'Inter', sans-serif;
}

#page {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

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

.logo-badge {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #34d1ff, #9c6cff);
  color: #0b1221;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(96, 212, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.4vw, 2.8rem);
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.status-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 212, 255, 0.14);
  border-radius: 999px;
  padding: 12px 18px;
  min-width: 130px;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 24px;
  border-radius: 24px;
  background: rgba(9, 12, 28, 0.92);
  border: 1px solid rgba(96, 212, 255, 0.1);
  box-shadow: var(--shadow);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  color: var(--muted);
}

.control-group span {
  font-size: 0.95rem;
}

.custom-select {
  position: relative;
  min-width: 210px;
}

.custom-select select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(96, 212, 255, 0.14);
  background: rgba(12, 16, 38, 0.95);
  color: var(--text);
  appearance: none;
  font-size: 1rem;
}

.custom-select::after {
  content: '▾';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.button-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 16px;
  padding: 14px 26px;
  min-width: 140px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #09101f;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  background: linear-gradient(135deg, #60d4ff, #9c6cff);
  box-shadow: 0 18px 50px rgba(96, 212, 255, 0.22);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 62px rgba(96, 212, 255, 0.28);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.game-board {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.card {
  width: min(100%, 860px);
  padding: 18px;
  border-radius: 28px;
  background: rgba(9, 12, 28, 0.9);
  border: 1px solid rgba(96, 212, 255, 0.12);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, opacity 0.4s ease;
}

.card.visible {
  opacity: 1;
  transform: none;
}

#mazeCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 30%, rgba(96, 212, 255, 0.12), transparent 25%),
    linear-gradient(180deg, rgba(15, 22, 56, 0.98), rgba(8, 10, 20, 0.98));
}

#mazeContainer {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.border {
  border: 5px solid rgba(96, 212, 255, 0.35);
  box-shadow: inset 0 0 40px rgba(96, 212, 255, 0.08);
}

.game-instructions {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 760px;
}

#toastContainer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(12, 16, 38, 0.95);
  border: 1px solid rgba(96, 212, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(78, 240, 184, 0.3);
}

.toast-info {
  border-color: rgba(96, 212, 255, 0.3);
}

.toast-warning {
  border-color: rgba(255, 107, 107, 0.35);
}

.modal-overlay {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 20, 0.85);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 80;
}

.modal-overlay.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-overlay.visible .modal-card {
  animation: modalPop 0.28s ease forwards;
}

.modal-card {
  border: 1px solid rgba(96, 212, 255, 0.16);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  text-align: center;
  background: rgba(12, 16, 38, 0.98);
  border-radius: 24px;
  padding: 28px;
  max-width: 420px;
  width: min(100%, 440px);
}

.modal-card h1 {
  margin: 0;
  font-size: 1.9rem;
  margin-bottom: 12px;
}

.modal-card p {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-card button {
  margin-top: 18px;
  width: 100%;
}

@media (max-width: 920px) {
  .game-header,
  .game-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .status-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .game-controls {
    padding: 18px;
  }

  .button-group,
  .control-group {
    width: 100%;
  }

  .button-group {
    justify-content: stretch;
  }

  button,
  .custom-select select {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .game-header {
    gap: 12px;
  }

  .logo-badge {
    width: 52px;
    height: 52px;
    font-size: 1.45rem;
  }

  .status-pill {
    min-width: auto;
    padding: 10px 14px;
  }
}


#mazeContainer.preview canvas {
  filter: blur(8px);
  opacity: 0.5;
  transition: all 0.8s ease;
  animation: pulseGlow 2s infinite alternate;
}

#mazeContainer.active canvas {
  filter: blur(0px);
  opacity: 1;
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 10px #00ffff;
  }
  to {
    box-shadow: 0 0 25px #00ffff;
  }
}#mazeContainer.preview canvas {
  filter: blur(10px);
  opacity: 0.6;
  pointer-events: none;
  transition: filter 0.8s ease, opacity 0.8s ease;
}





