/* Wordguess — Finnish Wordle with retro neon style */

.wg-page {
  --wg-green: #00e676;
  --wg-gold: #ffd600;
  --wg-gray: #3a3a3c;
  --wg-dark: #1a1a2e;
  --wg-bg: #0f0f23;
  --wg-key-bg: #818384;
  --wg-key-hover: #6a6a6c;
  --wg-active: #565758;
}

.wg-ui {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.wg-ui header h1 {
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 10px 0;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

/* Board */
.wg-streaks {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wg-streak {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 16px rgba(0, 230, 118, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.wg-streak__label {
  color: rgba(255, 255, 255, 0.68);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.wg-streak strong {
  color: var(--wg-green);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.35);
}

.wg-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.wg-row {
  display: flex;
  gap: 6px;
}

.wg-tile {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  font-family: "Space Grotesk", system-ui, sans-serif;
  text-transform: uppercase;
  border: 2px solid var(--wg-gray);
  background: transparent;
  color: #fff;
  transition: transform 0.1s ease, background 0.3s ease, border 0.3s ease;
  user-select: none;
  border-radius: 4px;
}

.wg-tile.filled {
  border-color: #565758;
  animation: wg-pop 0.08s ease;
}

@keyframes wg-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.wg-tile.flip {
  animation: wg-flip 0.4s ease forwards;
}

@keyframes wg-flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

.wg-tile.correct {
  background: var(--wg-green);
  border-color: var(--wg-green);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.5);
}

.wg-tile.present {
  background: var(--wg-gold);
  border-color: var(--wg-gold);
  box-shadow: 0 0 12px rgba(255, 214, 0, 0.5);
}

.wg-tile.absent {
  background: var(--wg-gray);
  border-color: var(--wg-gray);
}

/* Keyboard */
.wg-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 500px;
}

.wg-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.wg-key {
  min-width: 30px;
  height: 58px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: var(--wg-key-bg);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex: 1;
  transition: background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.wg-key:hover {
  background: var(--wg-key-hover);
}

.wg-key:active {
  background: var(--wg-active);
}

.wg-key.wide {
  flex: 1.5;
  font-size: 0.7rem;
}

.wg-key.correct {
  background: var(--wg-green);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.wg-key.present {
  background: var(--wg-gold);
  box-shadow: 0 0 8px rgba(255, 214, 0, 0.4);
}

.wg-key.absent {
  background: var(--wg-gray);
}

/* Message */
.wg-message {
  min-height: 40px;
  font-size: 1rem;
  text-align: center;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: opacity 0.3s ease;
  color: var(--accent-a);
}

.wg-message.error {
  color: #f44336;
}

.wg-message.success {
  color: var(--wg-green);
}

/* New Game Button */
.wg-new-game-btn {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: none;
}

.wg-new-game-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.wg-new-game-btn.visible {
  display: block;
}

/* Stage section wraps the game so it sits in the game-panel */
.wg-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 1.5rem 0;
}

/* Responsive */
@media (max-width: 420px) {
  .wg-streaks {
    width: min(100%, 300px);
    gap: 8px;
  }

  .wg-streak {
    min-height: 64px;
    padding: 10px;
  }

  .wg-streak__label {
    font-size: 0.64rem;
  }

  .wg-streak strong {
    font-size: 1.45rem;
  }

  .wg-tile {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }

  .wg-key {
    min-width: 24px;
    height: 48px;
    font-size: 0.75rem;
  }

  .wg-ui header h1 {
    font-size: 1.4rem;
  }
}
