/* === GRAMMATIKGROTTAN – STYLES === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0f0e17;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
}

/* CANVAS */
#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* OVERLAY */
.gg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 30, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.gg-modal {
  background: linear-gradient(160deg, #1a1535 0%, #251d4a 100%);
  border: 1px solid #4c3d8f;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 92%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(124, 58, 237, 0.35);
}

.gg-gem-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
}

.gg-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #c4b5fd;
  margin-bottom: 0.3rem;
  letter-spacing: 1px;
}

.gg-subtitle {
  color: #a5b4fc;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* LEVEL GRID */
.gg-level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.gg-level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.7rem 0.5rem;
  background: #2d2460;
  border: 2px solid #4c3d8f;
  border-radius: 12px;
  cursor: pointer;
  color: #c4b5fd;
  transition: all 0.18s ease;
  font-family: inherit;
}

.gg-level-btn:hover,
.gg-level-btn.active {
  background: #4c3d8f;
  border-color: #7c3aed;
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
  transform: translateY(-2px);
}

.gg-level-num {
  font-size: 1.4rem;
  font-weight: 800;
}

.gg-level-name {
  font-size: 0.7rem;
  margin-top: 2px;
  opacity: 0.85;
}

/* BUTTONS */
.gg-start-btn {
  display: inline-block;
  padding: 0.75rem 2.2rem;
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.6rem;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}

.gg-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.6);
}

.gg-menu-btn {
  display: inline-block;
  padding: 0.6rem 1.8rem;
  background: transparent;
  color: #a5b4fc;
  border: 1px solid #4c3d8f;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
  margin-top: 0.4rem;
}

.gg-menu-btn:hover {
  border-color: #7c3aed;
  color: #c4b5fd;
}

/* INSTRUCTIONS */
.gg-instructions {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #6d5fa8;
  line-height: 1.5;
}

.gg-instructions kbd {
  background: #2d2460;
  border: 1px solid #4c3d8f;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: #c4b5fd;
}

/* HUD */
.gg-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.2rem;
  background: rgba(10, 8, 30, 0.75);
  border-bottom: 1px solid #2d2460;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.gg-hud-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: #c4b5fd;
}

.gg-hud-item .fa-heart { color: #f87171; }
.gg-hud-item .fa-star  { color: #fbbf24; }
.gg-hud-item .fa-gem   { color: #7c3aed; }

.gg-hud-level {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* FEEDBACK TOAST */
.gg-feedback {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 20, 60, 0.9);
  border: 1px solid #4c3d8f;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #c4b5fd;
  z-index: 60;
  pointer-events: none;
}

.gg-feedback.correct  { border-color: #34d399; color: #34d399; }
.gg-feedback.wrong    { border-color: #94a3b8; color: #94a3b8; }

/* TOUCH CONTROLS */
.gg-touch-controls {
  position: fixed;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  z-index: 50;
}

.gg-touch-btn {
  width: 56px;
  height: 56px;
  background: rgba(30, 20, 60, 0.8);
  border: 2px solid #4c3d8f;
  border-radius: 50%;
  color: #c4b5fd;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.gg-touch-jump {
  width: 64px;
  height: 64px;
  background: rgba(92, 33, 182, 0.7);
  border-color: #7c3aed;
}
