* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e5e7eb;
  padding-top: 20px;
  transition: background 0.3s, color 0.3s;
}

.glass {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.scoreboard {
  width: 360px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 1rem;
  font-weight: 600;
}

.top-controls {
  width: 360px;
  margin-bottom: 20px;
}

#categorySelect,
#difficultySelect {
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #e5e7eb;
  margin-right: 10px;
}

.custom-word-box {
  margin-top: 12px;
  display: flex;
  gap: 6px;
}

.custom-word-box input {
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #e5e7eb;
  flex: 1;
}

.custom-word-box button {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.game {
  width: 360px;
  position: relative;
}

#gameBlocker {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  display: none;
  z-index: 20;
}

.game-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
}

#hangmanCanvas {
  display: block;
  margin: 0 auto 10px;
}

.word {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 10px;
  font-size: 1.8rem;
}

.letter-slot {
  border-bottom: 2px solid #64748b;
  min-width: 22px;
  text-align: center;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wrong-letters {
  min-height: 20px;
  color: #f97373;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  margin-top: 16px;
}

.key {
  border: none;
  border-radius: 10px;
  padding: 8px 0;
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
  cursor: pointer;
  transition: 0.15s;
}

.key:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
}

.key:disabled {
  opacity: 0.35;
}

.footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
}

.btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #22c55e;
  color: #022c22;
  font-weight: 700;
}

.result {
  min-height: 20px;
}

.result.win {
  color: #4ade80;
}

.result.lose {
  color: #f97373;
}

/* Theme toggle button */
.theme-toggle {
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
  transition: 0.25s;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
}

/* Shake animation */
.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* Bounce animation */
.bounce {
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Light theme */
.light {
  background: linear-gradient(135deg, #f0f4ff, #dbeafe);
  color: #1e293b;
}

.light .glass {
  background: rgba(255,255,255,0.6);
  color: #1e293b;
}

.light .key {
  background: rgba(0,0,0,0.06);
  color: #1e293b;
}

.light #gameBlocker {
  background: rgba(255,255,255,0.4);
}

.light #categorySelect,
.light #difficultySelect,
.light .custom-word-box input {
  background: rgba(0,0,0,0.06);
  color: #1e293b;
}

.light .custom-word-box button {
  background: #2563eb;
}

.light .btn {
  background: #16a34a;
  color: #022c22;
}


