* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #16213e;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  background: #1a1a2e;
  text-align: center;
  padding: 15px 20px;
}

header {
  border-bottom: 1px solid #3a3a5e;
  font-family: 'Nova Flat', sans-serif;
}

header a {
  color: #ffd600;
  font-size: 1.6rem;
  text-decoration: none;
}

.container {
  background: #fff;
  color: #333;
  max-width: 700px;
  width: 95%;
  margin: 30px auto;
  padding: 25px 20px;
  border-radius: 12px;
  border: 1px solid #3a3a5e;
  box-shadow: 0 0 20px rgba(0,0,0,.25);
  flex-grow: 1;
}

h1 {
  margin: 0 0 20px;
  font-size: 2rem;
  text-align: center;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

select, button {
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f0f0f0;
  cursor: pointer;
  transition: all .2s;
}

select:focus, button:hover {
  background: #e6e6e6;
}

#hint {
  text-align: center;
  font-style: italic;
  color: #555;
  margin: 10px 0;
  display: none;
}

#word {
  font-size: 2.2rem;
  letter-spacing: 14px;
  text-align: center;
  word-break: break-word;
  margin: 20px 0;
}

#letters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 10px;
  max-width: 100%;
  margin: 20px auto;
}

.letter {
  background: #2d89ef;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  padding: 12px 0;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s;
  width: 100%;
}

.letter:hover {
  background: #1b5fb5;
}

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

#info {
  text-align: center;
  font-size: 1rem;
  margin: 20px 0;
}

#timer {
  color: #e67e22;
}

#score {
  color: #27ae60;
}

#restart {
  display: block;
  margin: 0 auto;
  background: #27ae60;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
}

#restart:hover {
  background: #219150;
}

footer {
  font-size: .9rem;
  color: #ccc;
  border-top: 1px solid #3a3a5e;
  margin-top: auto;
}

#footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
}

#footer a {
  color: #ccc;
  text-decoration: none;
}

.footer {
  background: #1a1a2e;
  border-top: 1px solid #39395d;
  padding-top: 15px;
}

@media (max-width: 600px) {
  .container {
    padding: 20px 15px;
    margin: 15px auto;
  }

  #word {
    font-size: 1.6rem;
    letter-spacing: 8px;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  select, button {
    width: 100%;
    max-width: 300px;
  }

  #footer {
    flex-direction: column;
    text-align: center;
  }
}
