html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #cfe9ff;
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #6a4c93;
}
canvas { display: block; touch-action: none; }
[hidden] { display: none !important; }

#menu, #win {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 240, 250, 0.72);
  gap: 6px;
}
h1 { font-size: 44px; margin: 0; text-shadow: 3px 3px 0 #ffc2d9; }
p { font-size: 20px; margin: 4px 0 10px; }

#cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 1000px;
  padding: 0 12px;
}
.card {
  width: 120px;
  padding: 8px 6px;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 4px 4px 0 rgba(106, 76, 147, 0.25);
  cursor: pointer;
  image-rendering: pixelated;
}
.card:hover { transform: translateY(-4px); }
.card.selected { border-color: #6a4c93; background: #fff8d6; }
.card img { width: 100px; height: 125px; }
.card span { display: block; margin-top: 4px; }

button {
  margin-top: 16px;
  padding: 12px 40px;
  font: inherit;
  font-size: 24px;
  color: #fff;
  background: #b48ef0;
  border: 4px solid #6a4c93;
  box-shadow: 4px 4px 0 #6a4c93;
  cursor: pointer;
}
button:hover { background: #c7a5f7; }

#hud {
  position: fixed;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 4px solid #fff;
  box-shadow: 4px 4px 0 rgba(106, 76, 147, 0.25);
  font-size: 22px;
}
#bar { margin-top: 6px; width: 200px; height: 14px; background: #eadcf8; }
#fill { width: 0; height: 100%; background: #ff8fc0; transition: width 0.3s; }
#hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  text-align: center;
}
