/* ============ Secret Santa — Christmas theme ============ */
:root {
  --red: #c0392b;
  --red-bright: #e74c3c;
  --green: #1e5631;
  --green-dark: #0b2e18;
  --gold: #f1c40f;
  --cream: #fdf6e3;
  --ink: #1b1b1b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(ellipse at top, #14532d 0%, #0b2e18 55%, #061d0f 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Candy-cane striped top bar */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    45deg,
    var(--red) 0 16px,
    #fff 16px 32px
  );
  z-index: 50;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#emoji-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 140px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============ Typography ============ */
.title {
  font-family: "Mountains of Christmas", cursive;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  text-align: center;
  margin: 0;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--red), 0 6px 18px rgba(0,0,0,0.6);
}
.title.small { font-size: clamp(2rem, 6vw, 3rem); }

.tagline {
  text-align: center;
  font-size: 1.1rem;
  margin: 0 auto;
  max-width: 52ch;
  opacity: 0.9;
}

h2 {
  font-family: "Mountains of Christmas", cursive;
  font-size: 1.7rem;
  margin: 0 0 10px;
  color: #ffd76e;
}

.fineprint { font-size: 0.9rem; opacity: 0.75; margin: 8px 0 0; }
.error { color: #ff9c9c; font-weight: 700; margin: 8px 0 0; }
.hidden { display: none !important; }

/* ============ Cards ============ */
.card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.howto { margin: 0 0 16px; padding-left: 1.2em; line-height: 1.9; }

/* ============ Buttons ============ */
.btn {
  font-family: inherit;
  font-weight: 900;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35);
}
.btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.35); }

.btn-primary {
  background: linear-gradient(180deg, var(--red-bright), var(--red));
  color: #fff;
}
.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-danger {
  background: #7f1d1d;
  color: #fecaca;
}
.btn-danger-ghost {
  background: transparent;
  color: #ff9c9c;
  border: 1px dashed #ff9c9c;
  box-shadow: none;
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.btn-row.center { justify-content: center; }

/* Big pulsing draw button */
.btn-draw {
  font-size: 1.4rem;
  padding: 18px 36px;
  background: linear-gradient(180deg, #22c55e, #15803d);
  color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 0 0 rgba(34,197,94,0.6); }
  50% { transform: scale(1.05); box-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 0 18px rgba(34,197,94,0); }
}

/* ============ Roster ============ */
.add-row { display: flex; gap: 10px; }
.add-row input {
  flex: 1;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.3);
  color: var(--cream);
  outline: none;
}
.add-row input:focus { border-color: var(--gold); }

.roster-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #14532d, #0e3a20);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  font-weight: 700;
  animation: pop 0.25s ease;
}
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.chip-remove {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--cream);
  border-radius: 50%;
  width: 26px; height: 26px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}
.chip-remove:hover { background: var(--red); }

.countdown {
  font-family: "Mountains of Christmas", cursive;
  font-size: clamp(2rem, 7vw, 3.4rem);
  text-align: center;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin: 10px 0;
  letter-spacing: 2px;
}

/* ============ Lookup result ============ */
.assignment {
  font-family: "Mountains of Christmas", cursive;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--red), #7f1d1d);
  border-radius: var(--radius);
  padding: 20px;
  margin: 14px 0 0;
  animation: pop 0.3s ease;
}
/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 70;
  max-width: 90vw;
  text-align: center;
  animation: toastin 0.25s ease;
}
@keyframes toastin {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.5;
  margin-top: 20px;
}
/* ============ Added in the rebuild ============ */
.center { text-align: center; }
a { color: #ffd76e; }

h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin: 20px 0 6px;
}

.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-weight: 700; }
.field input,
.stack input {
  font-family: inherit;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.3);
  color: var(--cream);
  outline: none;
  color-scheme: dark;
}
.field input:focus,
.stack input:focus { border-color: var(--gold); }

.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.stack .btn { align-self: flex-start; }

details { margin-top: 14px; }
details summary { cursor: pointer; font-weight: 700; opacity: 0.85; }

/* Personal code box shown right after joining */
.code-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(241, 196, 15, 0.12);
  border: 2px dashed var(--gold);
}
.code-box p { margin: 0 0 8px; }
.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  color: var(--gold);
  margin: 6px 0 10px;
  user-select: all;
}

/* People who joined from this device */
.my-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.my-entries li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.my-entries .my-name { font-weight: 900; }
.my-entries code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: #ffd76e;
  text-decoration: underline;
  cursor: pointer;
}
.btn-link.danger { color: #ff9c9c; }

.roster-chip { padding: 8px 14px; }
.roster-chip.mine { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.roster-chip.mine::after { content: " (you)"; opacity: 0.7; font-weight: 400; }

.fx { position: absolute; }

#invite-url { font-size: 0.95rem; }

@media (max-width: 480px) {
  .add-row { flex-direction: column; }
  .add-row .btn { width: 100%; }
}
