:root {
  color-scheme: light;
  --green: #2e9b47;
  --grey: #8d8d8d;
  --text: #303030;
  --bg-start: #fff8de;
  --bg-end: #ffe9f4;
  --card-bg: rgba(255, 255, 255, 0.92);
  --border: rgba(0, 0, 0, 0.08);
  --active: #fff0ad;
  --selected: #ff9f43;
  --lamp: #ffd54f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: min(92vw, 460px);
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.title {
  margin: 0 0 12px;
  font-size: 28px;
  color: var(--green);
  font-weight: 700;
}

.reminder {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--grey);
}

.gift-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gift-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gift-input:focus {
  border-color: #89c48a;
  box-shadow: 0 0 0 4px rgba(46, 155, 71, 0.12);
}

.go-button {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.go-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(46, 155, 71, 0.2);
}

.go-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.result-card {
  width: min(92vw, 520px);
}

.marquee-card {
  position: relative;
}

.marquee-board {
  position: relative;
  padding: 20px;
  border-radius: 24px;
  border: 3px solid #ffc857;
  background: linear-gradient(180deg, #fffdf4 0%, #fff6da 100%);
  box-shadow: 0 0 0 8px rgba(255, 214, 79, 0.25);
}

.marquee-board::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 8px dotted var(--lamp);
  opacity: 0.95;
  pointer-events: none;
  animation: lamps-blink 0.8s infinite alternate;
}

.draw-label {
  position: relative;
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  color: #8e5f00;
  z-index: 1;
}

.gift-grid {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gift-item {
  min-height: 74px;
  padding: 12px 10px;
  border-radius: 16px;
  background: #fffdf7;
  border: 2px solid #f2e4b7;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease;
}

.gift-item.active {
  background: linear-gradient(135deg, #fff2a6 0%, var(--active) 100%);
  border-color: #efb82e;
  color: #7a4a00;
  transform: scale(1.04);
  box-shadow: 0 0 0 4px rgba(255, 213, 79, 0.35), 0 10px 18px rgba(239, 184, 46, 0.18);
}

.gift-item.selected {
  background: linear-gradient(135deg, #ffbb5c 0%, var(--selected) 100%);
  border-color: #f08a20;
  color: #ffffff;
  transform: scale(1.07);
  box-shadow: 0 0 0 5px rgba(255, 159, 67, 0.28), 0 12px 26px rgba(240, 138, 32, 0.3);
}

.draw-result {
  margin: 18px 0 0;
  min-height: 24px;
  font-size: 16px;
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--green);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes lamps-blink {
  from {
    opacity: 0.55;
    filter: drop-shadow(0 0 4px rgba(255, 213, 79, 0.45));
  }

  to {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.95));
  }
}


@media (max-width: 480px) {
  .page-shell {
    padding: 16px;
  }

  .card {
    width: min(100vw - 24px, 420px);
    padding: 20px 16px;
    border-radius: 18px;
  }

  .title {
    font-size: 24px;
  }

  .gift-input,
  .go-button {
    font-size: 15px;
  }

  .marquee-board {
    padding: 14px;
    border-radius: 20px;
  }

  .marquee-board::before {
    inset: 8px;
    border-width: 6px;
    border-radius: 14px;
  }

  .gift-grid {
    gap: 8px;
  }

  .gift-item {
    min-height: 60px;
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.3;
  }

  .draw-result {
    font-size: 14px;
  }

  .back-link {
    font-size: 15px;
  }
}
