* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1d3b5c 0%, #0d1b2e 55%, #060d18 100%);
  font-family: "Fredoka", system-ui, sans-serif;
  color: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: fixed;
  inset: 0;
}

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  padding: 18px 12px 0;
}

.hud h1 {
  margin: 0;
  font-family: "Mountains of Christmas", "Fredoka", cursive;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: #ffe9a8;
  text-shadow: 0 0 18px rgba(255, 210, 100, 0.55), 0 3px 0 #a3222a;
  letter-spacing: 1px;
}

.hud .hint {
  margin: 4px 0 0;
  font-size: clamp(0.8rem, 2vw, 1rem);
  opacity: 0.75;
}
.hud .hint-short { display: none; }

.controls {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  pointer-events: auto; /* header itself ignores taps */
}

.controls button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}
.controls button:hover { background: rgba(255, 255, 255, 0.22); }
.controls button:active { transform: scale(0.95); }

@media (max-width: 640px) {
  .controls { position: static; justify-content: center; margin-top: 10px; }
  .hud .hint-long { display: none; }
  .hud .hint-short { display: inline; }
}

/* Gift details modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 16, 0.6);
  backdrop-filter: blur(3px);
  padding: 20px;
  animation: fade 0.15s ease-out;
}
.modal[hidden] { display: none; }

.card {
  position: relative;
  width: min(420px, 100%);
  background: #fffaf0;
  color: #2b1d14;
  border-radius: 18px;
  padding: 34px 26px 26px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border-top: 10px solid #c0392b;
  animation: pop 0.22s cubic-bezier(.2, 1.4, .4, 1);
  user-select: text;
  -webkit-user-select: text;
}

.card .bow {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 46px;
}

.card h2 { margin: 0 0 6px; font-size: 1.6rem; color: #a3222a; }
.card .price { margin: 0 0 10px; font-weight: 600; color: #1e8449; }
.card .desc { margin: 0 0 20px; line-height: 1.45; }
.card .price:empty, .card .desc:empty { display: none; }

.card .link {
  display: inline-block;
  background: #1e8449;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  transition: background 0.15s;
}
.card .link:hover { background: #16693a; }
.card .link[hidden] { display: none; }

.card .close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #7a6a5c;
  cursor: pointer;
}

.error {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #a3222a;
  padding: 18px 24px;
  border-radius: 12px;
  max-width: 90%;
  text-align: center;
}

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }
