:root {
  --primary: #123c2d;
  --secondary: #56c271;
  --paper: #fffaf0;
  --beige: #efe3c8;
  --ink: #143228;
  --muted: #66776d;
  --shadow: 0 22px 55px rgba(18, 60, 45, 0.18);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(86, 194, 113, 0.22), transparent 36%),
    linear-gradient(135deg, #f5efe2 0%, #e4f4df 52%, #f9fbf6 100%);
  overflow: hidden;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  width: min(100vw, 520px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 0 80px rgba(18, 60, 45, 0.14);
}

.topbar {
  position: absolute;
  z-index: 8;
  top: max(16px, env(safe-area-inset-top));
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  border-radius: 24px;
  place-items: center;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 900;
  font-size: 0.72rem;
  
}

.topbar-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topbar-copy strong {
  font-size: 0.9rem;
}

.topbar-copy span {
  color: var(--muted);
  font-size: 0.72rem;
}

.app-swiper,
.swiper-wrapper,
.screen {
  width: 100%;
  height: 100%;
}

.screen {
  position: relative;
  display: grid;
  align-items: center;
  padding: 96px 20px 112px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.screen-content {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: auto 0;
}

.hero-screen {
  color: #fff;
  background: var(--primary);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(18, 60, 45, 0.2), rgba(18, 60, 45, 0.74)),
    url("/assets/img/bg.png");
  background-size: cover;
  background-position: center;
}

.hero-content {
  align-self: end;
  padding-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(86, 194, 113, 0.18);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.hero-screen .eyebrow {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 11vw, 4.4rem);
  line-height: 0.96;
  max-width: 11ch;
}

h2 {
  margin: 14px 0 16px;
  font-size: 2rem;
  line-height: 1.05;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

p,
.lead {
  color: var(--muted);
  line-height: 1.55;
}

.hero-screen p {
  color: rgba(255, 255, 255, 0.84);
}

.primary-action,
.secondary-action,
.vote-card button,
.share-grid button,
.share-grid a {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action {
  width: 100%;
  margin-top: 12px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 30px rgba(18, 60, 45, 0.22);
  font-weight: 850;
}

.hero-screen .primary-action {
  background: #fff;
  color: var(--primary);
}

.secondary-action {
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(18, 60, 45, 0.12);
  font-weight: 800;
}

.primary-action:hover,
.secondary-action:hover,
.vote-card button:hover,
.share-grid button:hover,
.share-grid a:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 38px rgba(18, 60, 45, 0.2);
}

.rule-grid,
.mascot-strip,
.vote-grid,
.share-grid {
  display: grid;
  gap: 12px;
}

.rule-grid {
  grid-template-columns: 1fr 1fr;
  margin: 22px 0 10px;
}

.rule-grid article,
.mini-mascot,
.form-card,
.vote-card,
.confirm-box,
.result-box {
  border: 1px solid rgba(18, 60, 45, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 25px rgba(18, 60, 45, 0.08);
  backdrop-filter: blur(16px);
}

.rule-grid article {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.rule-grid i,
.mini-mascot i,
.screen-icon {
  color: var(--secondary);
  font-size: 1.8rem;
}

.mascot-strip {
  grid-template-columns: repeat(3, 1fr);
  margin: 24px 0;
}

.mini-mascot {
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.journey-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 60, 45, 0.1);
  margin-bottom: 18px;
}

.journey-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), #f1c45b);
  transition: width 300ms ease;
}

.video-card,
.vote-card video {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow);
}

.video-card video,
.vote-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.42);
  font-size: 5rem;
  display: none;
}


.trait-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.trait-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.64);
}

.trait-list i {
  color: var(--secondary);
}

.form-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(18, 60, 45, 0.14);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(86, 194, 113, 0.18);
}

.check-row {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.check-row input {
  min-height: 20px;
  margin-top: 1px;
}

.vote-grid {
  padding: 0 3px 32px 0;
}

.screen[data-screen="choose"] {
  align-items: start;
}

.screen[data-screen="choose"] .screen-content {
  margin: 0;
}

.vote-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  grid-template-areas:
    "media title"
    "media text"
    "media action";
  align-items: center;
  gap: 8px 12px;
  padding: 10px;
}

.vote-card video {
  grid-area: media;
  border-radius: 18px;
  box-shadow: none;
}

.vote-card h3 {
  grid-area: title;
  margin: 0;
}

.vote-card p {
  grid-area: text;
  font-size: 0.88rem;
  line-height: 1.35;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vote-card button {
  grid-area: action;
}

.vote-card button,
.share-grid button,
.share-grid a {
  width: 100%;
  color: var(--primary);
  background: #fff;
  border: 1px solid rgba(18, 60, 45, 0.1);
  font-weight: 850;
}

.confirm-box,
.result-box {
  padding: 22px;
  text-align: center;
}

.confirm-box strong,
.result-box strong {
  display: block;
  color: var(--primary);
  font-size: 2.4rem;
  line-height: 1;
  margin: 18px 0;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: #af3d2c;
  font-weight: 700;
}

.success-screen {
  text-align: center;
}

.success-orb {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--secondary), #f1c45b);
  color: #fff;
  font-size: 3rem;
  box-shadow: var(--shadow);
  animation: pulse 1.8s infinite;
}

.share-grid {
  grid-template-columns: 1fr 1fr;
}

.share-grid i {
  font-size: 1.25rem;
}

.copied {
  background: var(--secondary) !important;
  color: #fff !important;
}

.bottom-nav {
  position: absolute;
  z-index: 9;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}


.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 45px;
}

.bottom-nav button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(18, 60, 45, 0.12);
  pointer-events: auto;
}

.progress-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(12px);
}

.progress-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(18, 60, 45, 0.23);
}

.progress-dots span.active {
  width: 18px;
  border-radius: 99px;
  background: var(--primary);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  gap: 16px;
  background: rgba(18, 60, 45, 0.66);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
  margin: 0 auto;
}

.confetti {
  position: fixed;
  z-index: 40;
  top: -14px;
  width: 9px;
  height: 16px;
  border-radius: 2px;
}

.shake {
  animation: shake 420ms ease;
}

@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
  }

  .app-shell {
    height: min(860px, 96dvh);
    border-radius: 36px;
  }
}

@media (max-width: 380px) {
  .screen {
    padding-inline: 16px;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .rule-grid,
  .share-grid {
    grid-template-columns: 1fr;
  }

  .vote-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}
