@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;800&display=swap");

:root {
  --pink: #ff78b2;
  --pink-dark: #e25595;
  --purple: #9b7bff;
  --text: #3b2d52;
  --muted: #7d6f92;
  --card: rgba(255, 255, 255, 0.94);
  --shadow: 0 18px 45px rgba(110, 74, 146, 0.14);
  --blue: #5c7cfa;
  --bg1: #fff8fc;
  --bg2: #f7f0ff;
  --panel: #6c63ff;
  --panel-dark: #4d44d8;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top right, rgba(255, 203, 227, 0.6), transparent 26%),
    radial-gradient(circle at bottom left, rgba(209, 216, 255, 0.85), transparent 34%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  font-family: "Cairo", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  padding: 16px;
}

button,
select,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  font-size: 14px;
  border-radius: 14px;
  padding: 10px 15px;
  border: none;
}

button:hover {
  color: #fff;
  background-color: var(--pink-dark);
}

button:active {
  transform: scale(0.98);
}

select {
  width: 220px;
  padding: 8px 10px;
  appearance: none;
  border-radius: 12px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: var(--text);
}

select:focus,
button:focus,
input:focus {
  outline: 0;
}

.settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 20;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 10px 24px rgba(110, 74, 146, 0.2);
}

.settings {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  background-color: rgba(59, 45, 82, 0.96);
  color: #fff;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(0);
  transition: transform 0.3s ease-in-out;
  z-index: 15;
}

.settings.hide {
  transform: translateY(-110%);
}

#settings-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.container {
  background: linear-gradient(135deg, var(--panel), var(--panel-dark));
  padding: 22px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  color: #fff;
  position: relative;
  text-align: center;
  width: 560px;
  max-width: 95vw;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.back-link,
.brand {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.back-link {
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
}

.brand {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

h1 {
  margin: 10px 0 0;
  min-height: 56px;
  font-size: clamp(28px, 5vw, 38px);
}

h2 {
  background-color: rgba(0, 0, 0, 0.18);
  padding: 10px;
  border-radius: 14px;
  margin: 0 0 16px;
  font-size: 24px;
}

small {
  display: block;
  margin-bottom: 8px;
  opacity: 0.95;
  font-size: 15px;
}

input {
  border: 0;
  border-radius: 14px;
  font-size: 18px;
  width: 320px;
  max-width: 100%;
  padding: 14px 18px;
  margin-top: 14px;
  text-align: center;
  color: var(--text);
}

.score-container {
  position: absolute;
  top: 82px;
  left: 20px;
  font-weight: 700;
}

.time-container {
  position: absolute;
  top: 82px;
  right: 20px;
  font-weight: 700;
}

.end-game-container {
  background-color: inherit;
  border-radius: inherit;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  padding: 20px;
}

.end-game-container button {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-weight: 800;
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 18px 14px 22px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 30px;
    min-height: 48px;
  }

  .score-container,
  .time-container {
    position: static;
    margin: 8px 0 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  #settings-form {
    padding: 10px 14px;
  }
}