:root {
  --bg-top: #0e1f17;
  --bg-bottom: #1b3d2a;
  --surface: rgba(11, 33, 22, 0.88);
  --surface-soft: rgba(18, 49, 33, 0.78);
  --text: #effff3;
  --text-soft: #c4ebcd;
  --line: rgba(193, 255, 119, 0.34);
  --accent: #c9ff48;
  --accent-2: #ffa935;
  --danger: #ff5f5f;
  --success: #7eff7e;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  font-family: "Gruppo", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(201, 255, 72, 0.2), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(255, 169, 53, 0.18), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

header {
  width: min(1100px, 96vw);
  height: 250px;
  margin-top: 20px;
  border-radius: 24px 24px 0 0;
  border: 3px solid var(--accent-2);
  border-bottom: none;
  box-shadow: var(--shadow);
  background-image:
    linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08)),
    url("../../../assets/images/baniere.png");
  background-size: cover;
  background-position: center;
}

.section-1 {
  width: min(1100px, 96vw);
  margin-bottom: 34px;
  border: 3px solid var(--accent-2);
  border-top: none;
  border-radius: 0 0 24px 24px;
  padding: 22px 14px 28px;
  background: linear-gradient(160deg, rgba(8, 27, 18, 0.94), rgba(16, 43, 30, 0.9));
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.panel {
  width: min(760px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.intro-panel {
  padding: 18px 16px;
  text-align: center;
}

.badge {
  margin: 0 0 8px;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 255, 72, 0.5);
  color: #ecffd4;
  background: rgba(201, 255, 72, 0.16);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 8px;
  color: #e7ff9d;
  font-family: "Fredericka the Great", cursive;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

h2 {
  margin: 0 0 12px;
  font-family: "Fredericka the Great", cursive;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  color: #f5ffd8;
}

h3 {
  margin: 0;
  font-family: "Fredericka the Great", cursive;
  color: #fff4d9;
}

p {
  margin: 8px 0;
  font-size: 1.02rem;
  color: var(--text-soft);
}

.control-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.difficulty-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 115px;
  font-family: "Gruppo", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease;
}

#difficulte1 {
  background: linear-gradient(180deg, #99ff9a, #5ad45d);
}

#difficulte2 {
  background: linear-gradient(180deg, #fff4a3, #ffdb51);
}

#difficulte3 {
  background: linear-gradient(180deg, #ff9e9e, #ff5f5f);
}

#startButton {
  min-width: 220px;
  color: #1b1b1b;
  background: linear-gradient(180deg, #ffd084, var(--accent-2));
  box-shadow: 0 6px 0 #c77b18;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:active {
  transform: translateY(2px);
}

.container-jeu {
  padding: 14px;
  display: grid;
  gap: 12px;
  justify-items: center;
}

#jeuCanvas {
  width: min(600px, 100%);
  height: auto;
  border-radius: 12px;
  border: 3px dotted #ffc8e9;
  background: #294b32;
}

#timer-container {
  width: min(600px, 100%);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--surface-soft);
  display: flex;
  justify-content: center;
}

#timerCanvas {
  width: 100%;
  max-width: 600px;
  height: 50px;
  display: block;
}

.game-over,
.partie-gagnerId {
  display: none;
  margin: 0;
  font-family: "Fredericka the Great", cursive;
}

#gameOverMessage {
  color: #ffe2e2;
  background: rgba(143, 21, 21, 0.86);
  padding: 10px 16px;
  border-radius: 10px;
}

#partieGagnerMessage {
  color: #163b18;
  background: rgba(167, 255, 150, 0.9);
  padding: 10px 16px;
  border-radius: 10px;
}

#reloadButton {
  background: linear-gradient(180deg, #ff9999, #ff5f5f);
}

#reloadButtonGagner {
  background: linear-gradient(180deg, #b8ff9a, var(--success));
}

.hidden {
  display: none !important;
}

#start-container.hidden {
  display: none !important;
}

footer {
  width: min(1100px, 96vw);
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 12px;
  border-top: 3px solid var(--accent-2);
  display: flex;
  justify-content: flex-end;
  background: rgba(12, 33, 23, 0.78);
}

#contact {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  color: #effff3;
  background: rgba(104, 174, 255, 0.24);
}

#contact a {
  color: #ffd79f;
}

#contact a:hover {
  color: #fff0d6;
}

@media (max-width: 760px) {
  header {
    height: 170px;
    border-radius: 18px 18px 0 0;
  }

  .section-1 {
    border-radius: 0 0 18px 18px;
    padding: 16px 8px 20px;
  }

  .panel {
    border-radius: 12px;
  }

  .difficulty-row {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  button,
  #startButton {
    width: 100%;
    min-width: 0;
  }
}