/* === ROOT VARIABLES === */
:root {
  --bg: #f8fafc;
  --container-bg: white;
  --text: #1a202c;
  --primary: #5a67d8;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #f6ad55;
  --shadow: 0 12px 30px rgba(0,0,0,0.15);
  --border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a202c;
    --container-bg: #2d3748;
    --text: #f7fafc;
    --primary: #7c8dff;
    --success: #68d391;
    --danger: #fc8181;
    --warning: #f6ad55;
    --shadow: 0 12px 30px rgba(0,0,0,0.4);
    --border: #4a5568;
  }
}

.dark-mode {
  --bg: #1a202c;
  --container-bg: #2d3748;
  --text: #f7fafc;
  --primary: #7c8dff;
  --success: #68d391;
  --danger: #fc8181;
  --warning: #f6ad55;
  --shadow: 0 12px 30px rgba(0,0,0,0.4);
  --border: #4a5568;
}

/* === GLOBAL === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
  transition: background 0.3s;
}

.container {
  background: var(--container-bg);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  width: 100%;
  max-width: 420px;
  transition: all 0.3s;
}

/* === HEADER === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  color: var(--primary);
  font-size: 1.8rem;
}

/* === DAILY BADGE === */
.daily-badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.8rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* === SCORE === */
.score-container {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* === WORD DISPLAY === */
#word-display {
  font-size: 2rem;
  letter-spacing: 0.4rem;
  margin: 1.2rem 0;
  font-weight: bold;
  user-select: none;
  color: var(--text);
}

/* === INPUT GROUP === */
.input-group {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

input {
  width: 60px;
  height: 60px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  border: 3px solid var(--border);
  border-radius: 12px;
  text-transform: uppercase;
  background: var(--container-bg);
  color: var(--text);
  transition: all 0.3s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

/* === BUTTONS === */
button {
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: bold;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
  min-width: 100px;
}

button:hover:not(:disabled) {
  background: #4349a8;
  transform: translateY(-1px);
}

button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

#restart-btn {
  background: var(--success);
}

#restart-btn:hover {
  background: #38a169;
}

#sound-toggle, #theme-toggle {
  background: var(--container-bg);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

#sound-toggle.sound-on,
#theme-toggle.dark-on {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

#hint-btn {
  background: var(--warning);
  color: white;
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: 0.3s;
  min-width: 90px;
}

#hint-btn:hover:not(:disabled) {
  background: #e69a44;
  transform: translateY(-1px);
}

#hint-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#message {
  margin: 1rem 0;
  font-weight: bold;
  min-height: 1.5rem;
  font-size: 1.1rem;
}

/* === CONFETTI CANVAS === */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  #word-display { font-size: 1.6rem; letter-spacing: 0.3rem; }
  input { width: 50px; height: 50px; font-size: 1.5rem; }
  button { padding: 0.7rem 1.4rem; font-size: 0.95rem; }
}