:root {
  --bg: #0a0a12;
  --card: #12121f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: #9aa3b5;
  --accent: #ff2d95;
  --accent2: #7c5cff;
  --radius: 14px;
  --font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.25), transparent),
    radial-gradient(800px 400px at 10% 100%, rgba(255, 45, 149, 0.12), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.hero .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: -0.02em;
}

.hero .sub {
  margin: 0;
  color: var(--muted);
}

.card {
  margin-top: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* Two-column card: random animal | form */
.guest-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.35rem 1.35rem 1.5rem;
}

@media (min-width: 720px) {
  .guest-card {
    flex-direction: row;
    align-items: stretch;
    gap: 1.75rem;
    padding: 1.5rem 1.75rem 1.65rem;
  }
}

.guest-card__visual {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .guest-card__visual {
    width: 168px;
  }
}

.guest-card__img-wrap {
  position: relative;
  width: 100%;
  max-width: 132px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(124, 92, 255, 0.2), rgba(255, 45, 149, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.guest-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.guest-card__img.is-loaded {
  opacity: 1;
}

.guest-card__img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  opacity: 0.35;
  pointer-events: none;
}

.guest-card__shuffle {
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.guest-card__shuffle:hover {
  color: var(--text);
  border-color: rgba(124, 92, 255, 0.45);
}

.guest-card__main {
  flex: 1;
  min-width: 0;
}

.guest-card__main .field {
  margin-bottom: 0.9rem;
}

.guest-card__toprow {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .guest-card__toprow {
    grid-template-columns: 1fr 1fr;
  }
}

.guest-card__message textarea {
  min-height: 120px;
}

.guest-form__anon {
  margin-bottom: 1rem;
}

.guest-form--anonymous .guest-card__identity {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.check input {
  margin-top: 0.2rem;
}

.check small {
  display: block;
  color: var(--muted);
  opacity: 0.85;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.7rem 1.1rem;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  font-weight: 600;
  width: 100%;
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Toast */
.guest-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  max-width: min(92vw, 380px);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.guest-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.guest-toast--ok {
  border-color: rgba(92, 240, 168, 0.35);
}

.guest-toast--err {
  border-color: rgba(255, 123, 123, 0.45);
}

.guest-toast__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guest-toast__msg {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.35;
}

.guest-toast--ok .guest-toast__msg {
  color: #5cf0a8;
}

.guest-toast--err .guest-toast__msg {
  color: #ff9a9a;
}

.guest-toast__close {
  flex: 0 0 auto;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.guest-toast__close:hover {
  color: var(--text);
}

code {
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
