:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #0b0b0b;
  background: #f4f4f4;
  --paper: #fdfdfd;
  --red: #ff0033;
  --ink: #242424;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #1667c5; outline-offset: 4px; }
h1:focus { outline: none; }
img { display: block; max-width: 100%; }

.experience {
  position: relative;
  isolation: isolate;
  max-width: 880px;
  min-height: 100svh;
  margin-inline: auto;
  overflow: hidden;
  background: var(--paper);
}

.screen {
  position: relative;
  min-height: 100svh;
  padding: 66px 24px 64px;
  text-align: center;
  animation: appear .24s ease both;
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.welcome {
  display: grid;
  align-items: center;
  padding-block: 160px;
}

.welcome-content { z-index: 1; }
.corner { position: absolute; pointer-events: none; user-select: none; }
.puppets {
  width: clamp(150px, 32%, 258px);
  left: -23px;
  top: -26px;
  rotate: -12deg;
}
.clapper {
  width: clamp(180px, 36%, 300px);
  bottom: -54px;
  right: -55px;
  rotate: 24deg;
}

.brand { width: clamp(160px, 43vw, 200px); margin: 0 auto; }
h1 { margin: 41px auto 12px; }
h1 img { width: min(100%, 370px); margin: auto; mix-blend-mode: multiply; }
.welcome h1 { margin-top: 47px; }
.welcome h1 img { width: min(100%, 385px); }
.details h1 img { width: min(100%, 341px); }
.selfie h1 img { width: min(100%, 321px); }
.gallery h1 img { width: min(100%, 356px); }

.turtlepic {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding-bottom: 24px;
}
#turtlepic-gallery {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 400px;
  margin-top: 16px;
  border: 0;
}

p { font-size: clamp(16px, 3.6vw, 19px); line-height: 1.28; margin: 0; }
button:not(.back, .text-button, .selfie-button, .photo, .icon-button) {
  min-width: 140px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background .18s, transform .18s;
}
button:not(.back, .text-button, .selfie-button, .photo, .icon-button):hover:not(:disabled) {
  background: #d6002b;
}
button:not(.back, .text-button, .selfie-button, .photo, .icon-button):active:not(:disabled) {
  transform: scale(.97);
}
button.secondary:not(.icon-button) { background: var(--ink); }
button.secondary:not(.icon-button):hover:not(:disabled) { background: #404040; }
.welcome button { margin-top: 23px; }

.inner { padding-top: clamp(46px, 10svh, 100px); }
.back, .icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
  color: #222;
  font-size: 27px;
  line-height: 1;
}
.back { position: absolute; left: 20px; top: 20px; }
.back:hover, .icon-button:hover { background: #e6e6e6; }

form { margin: clamp(32px, 8svh, 76px) auto 0; max-width: 430px; }
fieldset {
  display: grid;
  margin: 0;
  padding: 20px 16px 15px;
  border: 0;
  border-radius: 5px;
  background: #f7f7f7;
  text-align: left;
}
label { margin: 0 0 7px 3px; color: #2a2a2a; font-size: 14px; font-weight: 600; }
input:not([type="file"]) {
  width: 100%;
  min-height: 47px;
  margin-bottom: 16px;
  padding: 0 17px;
  border: 1px solid #dadada;
  border-radius: 999px;
  background: transparent;
  color: #222;
  font-size: 16px;
}
input::placeholder { color: #696969; }
.text-button {
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #555;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: #111; }
fieldset .text-button { justify-self: start; }
.continue { margin-top: clamp(27px, 6svh, 72px); }

.selfie-button {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(104px, 24vw, 145px);
  aspect-ratio: 1;
  margin: 26px auto 17px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eee;
  color: #a5a5a5;
}
.selfie-button:hover { background: #e6e6e6; color: #777; }
.selfie-button svg { width: 59%; }
.selfie-button:has(img:not([hidden])) svg { display: none; }
.selfie-button img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.camera-badge {
  position: absolute;
  right: 14%;
  bottom: 14%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
}
.selfie-note { display: grid; gap: 5px; max-width: 280px; margin: auto; }
.selfie-note strong { font-size: 15px; }
.selfie-note small { font-size: 13px; line-height: 1.35; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.actions button { flex: 0 1 166px; }
.selfie > .text-button { margin-top: 7px; }
.error { margin: 12px auto 0; max-width: 350px; color: #a30022; font-size: 14px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, clamp(53px, 12vw, 93px));
  gap: 6px;
  max-width: 460px;
  margin: 24px auto 0;
  padding: 7px;
  border: 1px solid #5c5c5c;
}
.photo { min-width: 0; padding: 0; overflow: hidden; border: 0; border-radius: 4px; background: #e5e5e5; }
.photo:first-child { grid-column: span 2; grid-row: span 2; }
.photo:nth-child(4) { grid-column: span 2; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.photo:hover img { transform: scale(1.06); }
.wrap { display: block; margin: 20px auto 8px; font-size: 19px; }
.demo-label { position: absolute; left: 15px; bottom: 14px; font-size: 11px; color: #6a6a6a; }

dialog {
  width: min(92vw, 580px);
  max-height: 94svh;
  padding: 17px;
  border: 0;
  border-radius: 15px;
  background: var(--paper);
  color: #111;
}
dialog::backdrop { background: #111b; }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dialog-toolbar h2 { font-size: 19px; margin: 0; }
.dialog-toolbar button { flex: 0 0 44px; }
video, #full-photo { display: block; width: 100%; max-height: 62svh; object-fit: contain; border-radius: 8px; background: #171717; }
video { aspect-ratio: 4 / 3; transform: scaleX(-1); }
#take-photo { display: block; margin: 14px auto 0; }
.photo-controls { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 12px; font-size: 14px; }
.photo-controls button.secondary { min-width: 85px; padding-inline: 12px; }

@media (max-width: 380px) {
  .screen { padding-inline: 16px; }
  .actions button:not(.back) { min-width: 125px; flex-basis: 136px; padding-inline: 9px; }
  .back { left: 12px; top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
