@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700;900&display=swap');

:root {
  --bg-primary: #050510;
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff00ea;
  --panel-bg: rgba(10, 10, 25, 0.85);
  --border-glow: rgba(0, 243, 255, 0.5);
  --text-main: #ffffff;
}

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

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: linear-gradient(to bottom, rgba(5,5,16,0.9), transparent);
}

.stat-box {
  color: #aaa;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(0, 243, 255, 0.05);
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 243, 255, 0.2);
  backdrop-filter: blur(4px);
  min-width: 130px;
  text-align: center;
}

.stat-box span {
    color: var(--text-main);
    display: inline-block;
    margin-left: 5px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.progress-container {
  flex-grow: 1;
  margin: 0 30px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 234, 0.2);
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  box-shadow: 0 0 10px var(--neon-magenta);
  transition: width 0.1s linear;
}

#top-bar-level {
  position: absolute;
  bottom: 30px;
  left: 30px;
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px var(--neon-magenta), 0 0 30px var(--neon-magenta);
  opacity: 0.9;
  letter-spacing: 2px;
}

.notification {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(0,0,0,0.5);
    padding: 10px 30px;
    border-radius: 50px;
    border: 1px solid var(--neon-cyan);
    pointer-events: none;
}

.notification.hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(10px);
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0.4s;
}

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

.panel {
  background: var(--panel-bg);
  padding: 40px;
  border-radius: 24px;
  border: 2px solid var(--border-glow);
  box-shadow: 0 15px 50px rgba(0, 243, 255, 0.2), inset 0 0 20px rgba(0, 243, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 90%;
  width: 500px;
}

.neon-text {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 15px 0;
  letter-spacing: 4px;
  text-shadow: 
    0 0 10px var(--neon-cyan),
    0 0 20px var(--neon-cyan),
    0 0 40px var(--neon-cyan);
}

.panel p {
  color: #ccc;
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.glow-btn {
  background: linear-gradient(45deg, #00b3cc, var(--neon-magenta));
  border: none;
  border-radius: 50px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 15px 50px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 0, 234, 0.4);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  width: 80%;
}

.glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 0, 234, 0.8), 0 0 15px rgba(0, 243, 255, 0.8);
}

.glow-btn:active {
  transform: scale(0.95);
}

/* Animations */
.tutorial-anim {
  width: 120px;
  height: 120px;
  border-top: 4px solid rgba(0, 243, 255, 0.8);
  border-bottom: 4px solid rgba(255, 0, 234, 0.8);
  margin-bottom: 30px;
  position: relative;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
}

.tut-player {
  width: 24px;
  height: 24px;
  background: #fff;
  box-shadow: 0 0 15px #fff, 0 0 30px var(--neon-cyan);
  position: absolute;
  left: 48px;
  border-radius: 4px;
  animation: tut-flip 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes tut-flip {
  0%, 15% { top: 92px; }
  35%, 65% { top: 0px; }
  85%, 100% { top: 92px; }
}

#stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.stat-item {
  background: rgba(0,0,0,0.4);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

.stat-item div:first-child {
    font-size: 0.9rem;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px var(--neon-magenta);
}

.thumbnail-container {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.3);
  border: 2px solid rgba(0, 243, 255, 0.5);
  background: #000;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .neon-text { font-size: 2.2rem; }
  .panel { padding: 30px 20px; border-width: 1px; }
  .glow-btn { font-size: 1.1rem; padding: 12px 30px; width: 100%; }
  #top-bar { padding: 15px 15px; }
  .progress-container { margin: 0 15px; }
  .stat-box { min-width: auto; font-size: 0.9rem; padding: 5px 10px; }
  .thumbnail-container { height: 140px; }
}
