:root {
  --bg1: #120014;
  --bg2: #2b0033;
  --card: rgba(255, 255, 255, 0.08);
  --card2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --shadow: rgba(0, 0, 0, 0.35);

  --hot: #ff3b7a;
  --hot2: #ff7aa7;
  --cold: #7dd3fc;

  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 900px at 20% 10%, rgba(255, 59, 122, 0.22), transparent 55%),
    radial-gradient(1000px 800px at 85% 25%, rgba(125, 211, 252, 0.16), transparent 60%),
    radial-gradient(800px 700px at 40% 95%, rgba(255, 122, 167, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow: hidden;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.card {
  width: min(560px, 100%);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), var(--card2));
  box-shadow: 0 24px 80px var(--shadow);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.header {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.question {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
}

.questionText {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.tease {
  margin: 10px 0 0;
  min-height: 20px;
  color: rgba(255, 255, 255, 0.78);
}

.arena {
  margin-top: 18px;
  position: relative;
  height: 160px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.btn {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  color: white;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  touch-action: manipulation;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btnYes {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  background: linear-gradient(180deg, var(--hot), #ff1d66);
}

.btnYes:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.85);
  outline-offset: 3px;
}

.btnNo {
  position: absolute;
  right: 18px;
  bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btnNo:focus-visible {
  outline: 3px solid rgba(255, 122, 167, 0.85);
  outline-offset: 3px;
}

.noZone {
  position: absolute;
  inset: 0;
}

.footer {
  margin-top: 14px;
}

.hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  z-index: 2;
}

.view {
  margin-top: 18px;
}

/* Ensure hidden attribute always hides elements */
[hidden] { display: none !important; }

/* Result overlay */
.result {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.lockForm {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.12);
}

.label {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 8px;
}

.lockRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

/* Date choice grid */
.dateGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dateBtn {
  background: linear-gradient(180deg, var(--hot), #ff1d66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.dateBtn:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.85);
  outline-offset: 3px;
}

.input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  outline: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px var(--shadow);
}

/* Date picker: keep same look, let OS calendar UI handle picking */
.input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
  padding-right: 48px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

/* WebKit date field text styling (Chrome/Edge/Safari) */
.input[type="date"]::-webkit-datetime-edit {
  color: rgba(255, 255, 255, 0.92);
}

.input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.input[type="date"]::-webkit-datetime-edit-text {
  color: rgba(255, 255, 255, 0.55);
}

.input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.95;
  filter: invert(1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px;
  margin-right: 2px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.input[type="date"]::-webkit-calendar-picker-indicator:hover {
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.10));
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.input:focus {
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
}

.lockForm .btnYes {
  position: static;
  box-shadow: none;
}

@media (max-width: 460px) {
  .dateGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Quiz styles */
.quizArea {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.12);
}

.quizQuestion {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.quizGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.optionBtn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
}

.optionBtn:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.85);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .quizGrid { grid-template-columns: 1fr; }
}

.error {
  margin: 10px 0 0;
  color: rgba(255, 122, 167, 0.92);
  font-size: 13px;
}

.shake {
  animation: shake 380ms ease-in-out;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.gameHud {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.12);
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.meterFill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hot), var(--cold));
  width: 0%;
  transition: width 180ms ease;
}

.gameArea {
  margin-top: 14px;
  position: relative;
  height: 240px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.heart {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 59, 122, 0.20);
  color: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-size: 22px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
  animation: pop 220ms ease-out;
}

.heart:active {
  transform: scale(0.98);
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.gameActions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.gameActions .btnYes {
  position: static;
}

.resultInner {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  border-radius: 22px;
  padding: 18px;
}

.resultInner h2 {
  margin: 0;
  font-size: 22px;
}

.resultText {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.resultText.small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.resultActions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btnGhost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.installTip {
  margin: 16px 0 0;
  width: min(560px, 100%);
  text-align: center;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
