:root {
  --sky: #6fd3ff;
  --sky-deep: #209fd8;
  --cheese: #ffc83d;
  --cheese-dark: #7b4300;
  --ink: #263238;
  --leaf: #63b946;
  --paper: rgba(255, 255, 255, 0.94);
  --paper-strong: #ffffff;
  --shadow: 0 18px 46px rgba(28, 72, 93, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--sky);
}

button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
}

.screen::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background: linear-gradient(180deg, #69d0ff 0%, #dff7ff 58%, #a9e773 100%);
}

.screen::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.12));
  pointer-events: none;
}

.cover-screen {
  padding: 0;
  justify-content: flex-end;
  background: #63cdf6;
}

.cover-screen::before {
  background: #63cdf6;
}

.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.cover-actions {
  position: relative;
  width: min(100% - 36px, 430px);
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.cover-actions::before {
  position: absolute;
  inset: -26px -18px -18px;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(17, 94, 127, 0), rgba(17, 94, 127, 0.52));
  filter: blur(10px);
}

.story-screen {
  justify-content: center;
  background-image: url("imatges/SayCheese Resource.jpg");
  background-size: cover;
  background-position: center;
}

.mission-screen {
  background-image: url("imatges/SayCheese Background.jpg");
  background-size: cover;
  background-position: center;
}

.story-card,
.mission-card {
  width: min(100%, 430px);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.story-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.mission-card {
  display: grid;
  max-height: calc(100dvh - 118px);
  gap: 12px;
  padding: 18px;
}

.mission-card.needs-photo {
  gap: 9px;
  padding: 14px;
}

.mini-logo {
  width: min(82%, 300px);
  margin: 0 auto 2px;
}

.eyebrow,
.place {
  margin: 0;
  color: var(--cheese-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #183042;
  font-size: clamp(1.8rem, 7vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  margin: 0;
  color: #304a55;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.45;
}

.mission-top,
.progress {
  display: flex;
  width: min(100%, 430px);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-top {
  width: 100%;
}

.mission-number,
.stamp-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
}

.mission-number {
  width: 42px;
  justify-content: center;
  background: var(--sky-deep);
  color: #fff;
}

.stamp-badge {
  max-width: calc(100% - 52px);
  padding: 0 12px;
  overflow: hidden;
  border: 2px solid rgba(123, 67, 0, 0.18);
  background: #fff7d7;
  color: var(--cheese-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-block {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(238, 250, 255, 0.9);
}

.mission-block span {
  color: #087aa9;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mission-block p {
  margin: 0;
  color: #273f48;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.28;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  color: #4b2c00;
  background:
    radial-gradient(circle at 22% 35%, rgba(255, 170, 28, 0.8) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 58%, rgba(255, 170, 28, 0.65) 0 5px, transparent 6px),
    linear-gradient(180deg, #ffd95f 0%, var(--cheese) 100%);
  box-shadow: 0 10px 0 #d89515, 0 16px 26px rgba(104, 73, 0, 0.24);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
  letter-spacing: 0;
}

.primary-button:disabled {
  color: rgba(75, 44, 0, 0.58);
  background: linear-gradient(180deg, #f7e8af 0%, #e7d58f 100%);
  box-shadow: 0 6px 0 #bba45c, 0 10px 20px rgba(83, 71, 32, 0.16);
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 6px 0 #d89515, 0 10px 18px rgba(104, 73, 0, 0.22);
}

.primary-button:disabled:active {
  transform: none;
}

.photo-gate {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border: 2px dashed rgba(8, 122, 169, 0.34);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-label {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--sky-deep);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 950;
}

.photo-status {
  color: #304a55;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.15;
}

.photo-preview {
  width: 58px;
  height: 46px;
  border: 2px solid #fff;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(20, 54, 66, 0.16);
}

.reset-button {
  width: min(100%, 430px);
  min-height: 38px;
  border: 0;
  color: rgba(20, 54, 66, 0.72);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.progress {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 999px;
  color: #183042;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 28px rgba(15, 85, 113, 0.12);
  font-size: 0.9rem;
  font-weight: 900;
}

.progress-rail {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(111, 211, 255, 0.34);
}

.progress-rail i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cheese), var(--leaf));
}

.final-screen .story-card {
  background: rgba(255, 255, 255, 0.96);
}

@media (min-width: 700px) {
  .screen {
    padding-inline: 28px;
  }

  .cover-image {
    object-fit: contain;
    background: #63cdf6;
  }
}

@media (max-height: 700px) {
  .screen {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .mission-card {
    gap: 8px;
    padding: 14px;
  }

  .mission-block {
    padding: 8px 10px;
  }

  h1 {
    font-size: clamp(1.55rem, 6vw, 2rem);
  }

  .mission-block p,
  .lead {
    font-size: 0.95rem;
    line-height: 1.23;
  }

  .primary-button {
    min-height: 52px;
  }

  .photo-gate {
    padding: 8px;
  }

  .photo-label {
    min-height: 38px;
  }
}

@media (max-height: 610px) {
  .mission-card {
    max-height: calc(100dvh - 92px);
  }

  .mission-block {
    gap: 1px;
  }

  .mission-block p {
    font-size: 0.9rem;
  }
}
