/* ==================== CSS Variables ==================== */
:root {
  --background-color: #f5f1ee;
  --wall-color: #2d3436;
  --joystick-color: #2d3436;
  --joystick-head-color: #ff6b6b;
  --ball-color: #ff6b6b;
  --end-color: #4834df;
/* Dedicated to my girlfriend */
  --text-color: #2d3436;
  --accent-color: #ff6b6b;
  --success-color: #00b894;
  --shadow-color: rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

/* ==================== Game Header ==================== */
.game-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px var(--shadow-color);
}

.game-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.title-icon {
  width: 40px;
  height: 40px;
  stroke: white;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.game-subtitle {
  font-size: 1.1rem;
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* ==================== Game Container ==================== */
#center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 2rem 1rem;
}

/* Email: 2952671670@qq.com | QQ: 2952671670 */

#game {
  display: grid;
  grid-template-columns: auto 180px;
  grid-template-rows: 1fr auto 1fr;
  gap: 35px;
  perspective: 600px;
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Developer: SinceraXY */

/* ==================== Maze Board ==================== */
#maze {
  position: relative;
  grid-row: 1 / -1;
  grid-column: 1;
  width: 350px;
  height: 315px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--background-color);
  border-radius: 12px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

#end {
  width: 65px;
  height: 65px;
  border: 4px dashed var(--end-color);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 52, 223, 0.1) 0%, transparent 70%);
  animation: targetPulse 2s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% {
    border-color: var(--end-color);
    opacity: 1;
  }
  50% {
    border-color: rgba(72, 52, 223, 0.5);
    opacity: 0.7;
  }
}

/* GameHub Project - https://github.com/nilgpt2024/web-game */

/* ==================== Joystick Control ==================== */
#joystick {
  position: relative;
  background: linear-gradient(145deg, #2d3436, #1e272e);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  grid-row: 2;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 2px 5px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
/* GitHub: https://github.com/nilgpt2024/web-game */
}

#joystick:hover {
  transform: scale(1.05);
}

#joystick-head {
  position: relative;
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a6f);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: grab;
  box-shadow: 
    0 4px 12px rgba(255, 107, 107, 0.4),
    inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3);
  transition: transform 0.1s ease;
  animation: glow 1.5s ease-in-out infinite;
  animation-delay: 2s;
}

#joystick-head:active {
  cursor: grabbing;
  transform: scale(0.95);
}

@keyframes glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(255, 107, 107, 0.4),
      inset -2px -2px 4px rgba(0, 0, 0, 0.2),
      inset 2px 2px 4px rgba(255, 255, 255, 0.3);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 
      0 6px 20px rgba(255, 107, 107, 0.6),
      inset -2px -2px 4px rgba(0, 0, 0, 0.2),
      inset 2px 2px 4px rgba(255, 255, 255, 0.3);
  }
}

.joystick-arrow:nth-of-type(1) {
  position: absolute;
  bottom: 65px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid var(--joystick-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.joystick-arrow:nth-of-type(2) {
  position: absolute;
  top: 65px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--joystick-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.joystick-arrow:nth-of-type(3) {
  position: absolute;
  left: 65px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 12px solid var(--joystick-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.joystick-arrow:nth-of-type(4) {
  position: absolute;
  right: 65px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid var(--joystick-color);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ==================== Instructions & Messages ==================== */
#note {
  grid-row: 3;
  grid-column: 2;
  text-align: center;
  font-size: 0.85em;
  color: var(--text-color);
  transition: opacity 1.5s ease;
  line-height: 1.5;
}

#note strong {
  font-size: 1.1em;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}

#note p {
  margin: 0.4rem 0;
  color: #555;
}

#note kbd {
  background: linear-gradient(145deg, #e0e0e0, #f5f5f5);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 0.9em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: bold;
}

.mode-hint {
  color: var(--accent-color) !important;
  font-weight: 500;
}

.controls-hint {
  font-size: 0.85em;
  color: #888 !important;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

a:hover {
  color: #ff4757;
  text-decoration: underline;
}

a:visited {
  color: inherit;
}

/* ==================== Game Elements ==================== */
.ball {
  position: absolute;
  margin-top: -5px;
  margin-left: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8787, var(--ball-color));
  width: 10px;
  height: 10px;
  box-shadow: 
    0 2px 6px rgba(255, 107, 107, 0.4),
    inset -1px -1px 2px rgba(0, 0, 0, 0.2),
    inset 1px 1px 2px rgba(255, 255, 255, 0.5);
  transition: transform 0.1s ease;
}

.ball:hover {
  transform: scale(1.1);
}

.wall {
  position: absolute;
  background: linear-gradient(145deg, var(--wall-color), #1e272e);
  transform-origin: top center;
  margin-left: -5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);

/* Contact: 2952671670@qq.com */

}

.wall::before,
.wall::after {
  display: block;
  content: '';
  width: 10px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, #3d4852, var(--wall-color));
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wall::before {
  top: -5px;
}

.wall::after {
  bottom: -5px;
}

.black-hole {
  position: absolute;
  margin-top: -9px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #000000, #1a1a1a, #000000);
  width: 18px;
  height: 18px;
  box-shadow: 
    0 0 12px rgba(0, 0, 0, 0.8),
    inset 0 0 8px rgba(255, 255, 255, 0.1);
  animation: holeRotate 4s linear infinite;
}

@keyframes holeRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }
  
  #game {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 2rem 1.5rem;
    gap: 20px;
  }
  
  #maze {
    grid-row: 1;
    grid-column: 1;
    margin: 0 auto;
  }
  
  #joystick {
    grid-row: 2;
    grid-column: 1;
  }
  
  #note {
    grid-row: 3;
    grid-column: 1;
  }
}
