/* Game Modal Styles */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0B0E14; /* AppColors.backgroundDark */
  padding: 16px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.game-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 850px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-top: 16px;
}

.header-icon-btn {
  background: transparent;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
}

.timer-badge, .wallet-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #151922;
  border-radius: 24px;
  padding: 8px 16px;
  font-weight: bold;
  border: 1px solid rgba(255,255,255,0.05);
}

.timer-badge span { color: #8A939E; }
.wallet-badge span { color: #7000FF; }

.level-info-pill {
  align-self: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #8A939E;
  letter-spacing: 2px;
  background: #151922;
  padding: 8px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 32px;
}

.game-board-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(26,31,53,0.8), rgba(11,14,20,0.8));
  border-radius: 32px;
  border: 1px solid rgba(112, 0, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: visible;
  touch-action: none;
}

.game-board {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 20px;
  gap: 10px;
  position: relative;
  z-index: 10;
}

.game-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.game-lines path {
  fill: none;
  stroke: url(#line-gradient);
  stroke-width: 20;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.6));
  animation: drawPath 0.3s ease-out;
}

.grid-cell {
  background: #1F2023;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: transparent; /* hide numbers unless endpoint */
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, background-color 0.2s;
  position: relative;
}

.grid-cell.active {
  background: rgba(255, 0, 85, 0.2);
  transform: scale(0.95);
}

.grid-cell.endpoint {
  color: white;
}

.grid-cell.endpoint::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid white;
  z-index: -1;
}

/* Endpoint colors */
.grid-cell.endpoint[data-num="1"] { text-shadow: 0 0 10px #00F0FF; }
.grid-cell.endpoint[data-num="1"]::before { border-color: #00F0FF; box-shadow: 0 0 15px rgba(0,240,255,0.4) inset; }

.grid-cell.endpoint[data-num="8"] { text-shadow: 0 0 10px #FF0055; }
.grid-cell.endpoint[data-num="8"]::before { background: linear-gradient(135deg, #FF0055, #FFB11A); border: none; box-shadow: 0 0 20px rgba(255,0,85,0.6); }

/* Walls */
.grid-cell.wall-top { box-shadow: inset 0 4px 0 0 rgba(0, 231, 255, 0.6); }
.grid-cell.wall-bottom { box-shadow: inset 0 -4px 0 0 rgba(0, 231, 255, 0.6); }
.grid-cell.wall-left { box-shadow: inset 4px 0 0 0 rgba(0, 231, 255, 0.6); }
.grid-cell.wall-right { box-shadow: inset -4px 0 0 0 rgba(0, 231, 255, 0.6); }

/* Multiple walls combinator logic (CSS handles inset box-shadow accumulation poorly without comma separation, but for simple walls it works if we use border instead, or we can just use multiple box-shadow classes). Let's use border to be safe and accurate to the design. */
.grid-cell.wall-top { border-top: 3px solid rgba(0, 231, 255, 0.6) !important; }
.grid-cell.wall-bottom { border-bottom: 3px solid rgba(0, 231, 255, 0.6) !important; }
.grid-cell.wall-left { border-left: 3px solid rgba(0, 231, 255, 0.6) !important; }
.grid-cell.wall-right { border-right: 3px solid rgba(0, 231, 255, 0.6) !important; }

.bottom-controls {
  margin-top: auto;
  margin-bottom: 24px;
  background: #151922;
  border-radius: 32px;
  display: flex;
  justify-content: space-evenly;
  padding: 24px 16px;
  border: 1px solid rgba(255,255,255,0.05);
}

.control-btn {
  background: transparent;
  border: none;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.control-btn.accent {
  color: #7000FF;
}

.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 20;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  background: linear-gradient(135deg, rgba(26,31,53,0.9), rgba(11,14,20,0.95));
  border: 1px solid rgba(112, 0, 255, 0.4);
  border-radius: 32px;
  padding: 48px 32px;
  width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.superb-text {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 16px;
  color: white;
}

.round-text {
  font-size: 1.1rem;
  color: #8A939E;
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.coin-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.coin-plus {
  color: #FFB11A;
  font-size: 1.8rem;
  font-weight: 900;
}

.win-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.get-2x-btn {
  background: #FF0055;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(255, 0, 85, 0.3);
}

.next-btn {
  background: #1F2023;
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 16px 40px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
}

.hidden-msg {
  color: #FFB11A;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
  font-size: 1rem;
}
