/* retro cam: a little digital camera drawn with CSS */
.cam-page { gap: 14px; }
.cam-page .game-title p { font-size: 22px; }

/* ---------- settings above the camera ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; }
.tgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tgroup .lbl { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.swatch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 8px;
  border: 1.5px solid var(--burgundy); border-radius: 999px;
  background: transparent; color: var(--burgundy);
  font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
}
.swatch i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.15); }
.swatch[data-color="burgundy"] i { background: linear-gradient(155deg, #93303f, #5f1523); }
.swatch[data-color="blue"] i { background: linear-gradient(155deg, #d9e8f6, #85a8cf); }
.swatch[aria-pressed="true"] { background: var(--burgundy); color: var(--paper); }
.swatch:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 2px; }

/* ---------- camera colours ---------- */
.camera[data-color="burgundy"] {
  --body: linear-gradient(155deg, #9a3445 0%, #7b1e2e 38%, #5c1421 100%);
  --edge: #4a0f1b;
  --brand: rgba(255, 236, 226, .82);
  --center: #4a0f1b;
  --center-text: #f4ecdc;
  --label: rgba(255, 236, 226, .75);
}
.camera[data-color="blue"] {
  --body: linear-gradient(155deg, #e1edf8 0%, #a9c7e4 40%, #83a6cd 100%);
  --edge: #6f93bd;
  --brand: #2f4360;
  --center: #6f93bd;
  --center-text: #ffffff;
  --label: #2f4360;
}

/* ---------- camera size + layout ---------- */
.camera {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 760px, calc((100svh - 300px) * 1.55));
  min-width: 290px;
}
.camera[data-orient="portrait"] { width: min(100%, 400px, calc((100svh - 300px) * .52)); min-width: 260px; }

.cam-top { display: flex; justify-content: flex-end; align-items: flex-end; gap: 16px; height: 16px; padding-right: 11%; }
.mic { width: 26px; height: 6px; margin-bottom: 2px; background: radial-gradient(circle, rgba(0,0,0,.45) 1px, transparent 1.5px) 0 0 / 5px 6px; }
.shutter {
  width: 74px; height: 16px;
  border: 0; border-radius: 10px 10px 3px 3px;
  background: linear-gradient(#fafbfc, #b9bec6);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .08s;
}
.shutter:active:not(:disabled) { transform: translateY(3px); }
.shutter:disabled { cursor: default; opacity: .7; }
.shutter:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }

.cam-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 29%;
  gap: 4%;
  align-items: center;
  padding: 4.5% 4.5% 4%;
  border-radius: 28px;
  background: var(--body);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .35),
    inset 0 -5px 12px rgba(0, 0, 0, .22),
    inset 0 0 0 1px var(--edge),
    0 34px 50px -26px rgba(43, 13, 19, .65);
}
.cam-body::before { /* glossy sheen */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 32%);
  pointer-events: none;
}
.camera.turning .cam-body { animation: turn .55s cubic-bezier(.2, .8, .2, 1.1); }
@keyframes turn { from { transform: rotate(-90deg) scale(.75); opacity: .4; } to { transform: none; opacity: 1; } }

/* vertical camera, and small screens: buttons go under the screen */
.camera[data-orient="portrait"] .cam-body { grid-template-columns: 1fr; gap: 14px; padding: 6% 6% 5%; }
@media (max-width: 620px) {
  .camera .cam-body { grid-template-columns: 1fr; gap: 14px; padding: 5% 5% 4.5%; }
}

/* ---------- screen ---------- */
.screen-side { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.bezel {
  padding: 3.4%;
  border-radius: 12px;
  background: linear-gradient(160deg, #26222a, #0e0c10);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06), 0 1px 0 rgba(255, 255, 255, .25);
}
.lcd {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: #0d0b0c;
  container-type: size;
}
.camera[data-orient="portrait"] .lcd { aspect-ratio: 3 / 4; }
.lcd::after { /* glass reflection */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 40%);
  pointer-events: none;
}
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#view.soft { image-rendering: auto; }
.brand {
  margin: 0;
  text-align: center;
  font: 600 13px/1 var(--body);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--brand);
}
.brand small { font: 500 9px/1 var(--mono); letter-spacing: .14em; opacity: .75; margin-left: 6px; }

/* on-screen info */
.osd { position: absolute; inset: 0; z-index: 2; pointer-events: none; font: 500 max(10px, 3.4cqw)/1 var(--mono); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); letter-spacing: .04em; }
.osd[hidden] { display: none; }
.osd > span { position: absolute; display: flex; align-items: center; gap: 6px; }
.osd-tl { top: 4cqh; left: 3.5cqw; text-transform: uppercase; }
.osd-tr { top: 4cqh; right: 3.5cqw; }
.osd-bl { bottom: 4cqh; left: 3.5cqw; }
.osd-br { bottom: 4cqh; right: 3.5cqw; text-transform: uppercase; }
.rec { color: #ff5a4f; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.batt { display: inline-flex; gap: 2px; padding: 2px; border: 1.5px solid #fff; border-radius: 2px; }
.batt i { width: 3px; height: 7px; background: #fff; }
.focus { inset: 0; margin: auto; width: 28cqw; height: 26cqh; }
.focus i { position: absolute; width: 14%; height: 18%; border-color: rgba(255, 255, 255, .85); border-style: solid; border-width: 0; }
.focus i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.focus i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.focus i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.focus i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

.flash { position: absolute; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.count { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; font: 400 34cqh/1 var(--display); color: #fff; text-shadow: 0 3px 0 rgba(123, 30, 46, .9); pointer-events: none; }
.count[hidden] { display: none; }

/* power-on screen */
.boot {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; justify-items: center; gap: max(8px, 3cqh);
  padding: 4cqw;
  text-align: center;
  background: radial-gradient(circle at 50% 40%, #3a1820, #120a0d 75%);
}
.boot[hidden] { display: none; }
.boot-logo { margin: 0; font: max(26px, 9cqw)/1 var(--hand); color: #f4ecdc; }
.boot-btn {
  padding: max(10px, 2.6cqw) max(16px, 5cqw);
  border: 0; border-radius: 999px;
  background: #a9c7e4; color: #2b0d13;
  font: 600 max(12px, 3.4cqw)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #6f93bd;
}
.boot-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #6f93bd; }
.boot-link { padding: 4px; border: 0; background: none; color: rgba(244, 236, 220, .85); font: 500 max(10px, 2.8cqw)/1.2 var(--mono); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.boot-err { margin: 0; max-width: 86cqw; font: 500 max(10px, 2.8cqw)/1.35 var(--mono); color: #f5b9b0; }
.boot-btn:focus-visible, .boot-link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- buttons side ---------- */
.controls-side { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.viewfinder { display: flex; align-items: center; gap: 10px; }
.viewfinder .lens { width: 38px; height: 30px; border-radius: 8px; background: radial-gradient(circle at 40% 40%, #4a4f5a, #0c0d10 60%); box-shadow: inset 0 0 0 3px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.3); }
.viewfinder .leds { display: grid; gap: 5px; }
.viewfinder .leds i { width: 9px; height: 5px; border-radius: 3px; background: #3a3d44; box-shadow: inset 0 1px 1px rgba(0,0,0,.5); }

.small-btns { display: flex; gap: 18px; }
.sbtn-wrap { display: grid; justify-items: center; gap: 4px; }
.sbtn-wrap span { font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.sbtn {
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffffff, #c8ccd3 60%, #9aa0a9);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .35), inset 0 -2px 2px rgba(0, 0, 0, .15);
  font: 600 10px/1 var(--mono); color: #3b3f46; text-transform: uppercase;
  cursor: pointer;
}
.sbtn:active { transform: translateY(2px); box-shadow: 0 1px 1px rgba(0,0,0,.35); }

.pad {
  position: relative;
  width: min(100%, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fdfdfe 0%, #d6d9de 38%, #a2a8b1 68%, #cdd1d6 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(255, 255, 255, .4), inset 0 -6px 10px rgba(0, 0, 0, .18);
}
.pad-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 32%; height: 24%;
  padding: 0; border: 0;
  background: transparent;
  font: 600 clamp(11px, 1.6vw, 14px)/1 var(--mono);
  letter-spacing: .04em; text-transform: uppercase;
  color: #3b3f46;
  cursor: pointer;
  border-radius: 10px;
}
.pad-btn:hover { color: #000; }
.pad-btn:active { background: rgba(0, 0, 0, .08); }
.pad-btn.up { top: 4%; left: 34%; }
.pad-btn.down { bottom: 4%; left: 34%; font-size: clamp(15px, 2.2vw, 19px); }
.pad-btn.left { left: 3%; top: 38%; width: 24%; font-size: clamp(16px, 2.2vw, 20px); }
.pad-btn.right { right: 3%; top: 38%; width: 24%; font-size: clamp(16px, 2.2vw, 20px); }
.pad-btn[aria-pressed="true"] { color: #c0392b; }
.pad-center {
  position: absolute; inset: 0; margin: auto;
  width: 40%; height: 40%;
  border: 3px solid #eef0f3; border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, rgba(255,255,255,.25), transparent 55%), var(--center);
  color: var(--center-text);
  font: 600 clamp(11px, 1.6vw, 14px)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 3px 5px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.pad-center:active:not(:disabled) { transform: scale(.95); }
.pad-center:disabled { opacity: .7; cursor: default; }
.pad button:focus-visible, .sbtn:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }

.speaker { width: 46px; height: 18px; background: radial-gradient(circle, rgba(0, 0, 0, .4) 1.4px, transparent 1.8px) 0 0 / 7px 6px; }

/* buttons in a row under the screen (vertical camera + phones) */
.camera[data-orient="portrait"] .controls-side { flex-direction: row; justify-content: space-between; align-items: center; padding: 0 2%; }
.camera[data-orient="portrait"] .viewfinder { display: none; }
.camera[data-orient="portrait"] .small-btns { flex-direction: column; gap: 10px; }
.camera[data-orient="portrait"] .pad { width: min(52%, 176px); }
.camera[data-orient="portrait"] .speaker { width: 18px; height: 46px; background-size: 6px 7px; }
@media (max-width: 620px) {
  .camera .controls-side { flex-direction: row; justify-content: space-between; align-items: center; padding: 0 2%; }
  .camera .viewfinder { display: none; }
  .camera .small-btns { flex-direction: column; gap: 10px; }
  .camera .pad { width: min(50%, 176px); }
  .camera .speaker { width: 18px; height: 46px; background-size: 6px 7px; }
  .pad-btn { font-size: 11px; }
  .pad-btn.down, .pad-btn.left, .pad-btn.right { font-size: 17px; }
}

/* ---------- help + privacy ---------- */
.legend-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 4px 0 0; padding: 0; list-style: none; max-width: 640px; font: 11px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.legend-row b { color: var(--burgundy); font-weight: 500; }
.privacy { margin: 0; max-width: 420px; text-align: center; font: 22px/1.1 var(--hand); color: var(--burgundy); }

/* ---------- review sheet ---------- */
.review {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(43, 13, 19, .72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.review[hidden] { display: none; }
.review-card {
  width: min(100%, 560px);
  max-height: 100%;
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--paper) var(--grain);
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  animation: pop .35s cubic-bezier(.2, .8, .2, 1.2);
}
@keyframes pop { from { transform: scale(.9) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.review-card h2 { margin: 0 0 10px; font: 36px/1 var(--hand); color: var(--burgundy); }
.print { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 14px; }
.print img { display: block; width: auto; max-width: 100%; max-height: min(52svh, 520px); border-radius: 4px; box-shadow: 0 14px 26px -14px rgba(59, 18, 25, .6); }
.review-hint { margin: 12px 0 0; font: 11px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.review-hint:empty { display: none; }
.review-dl { display: inline-block; margin-top: 6px; font: 500 12px/1 var(--mono); color: var(--burgundy); }
.review-dl[hidden] { display: none; }

/* caption field on the photo card */
.caption-field { display: grid; gap: 4px; max-width: 360px; margin: 0 auto 16px; text-align: left; }
.caption-field span { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.caption-field input {
  width: 100%;
  padding: 6px 2px 4px;
  border: 0;
  border-bottom: 2px dashed var(--burgundy);
  background: transparent;
  color: var(--burgundy);
  font: 30px/1.1 var(--hand);
  outline: none;
}
.caption-field input::placeholder { color: rgba(123, 30, 46, .4); }
.caption-field input:focus { border-bottom-style: solid; }

/* ---------- printing animation ---------- */
.review { overflow: hidden; }
.review-card { transition: background-color .5s, box-shadow .5s; }
.review.printing .review-card { background: transparent; box-shadow: none; overflow: visible; }
.review-card > :not(.print):not(h2) { transition: opacity .5s .1s; }
.review.printing .review-card > :not(.print):not(h2) { opacity: 0; pointer-events: none; }
.review.printing h2 { color: var(--paper); }

/* the photo comes out of the "printer" below, in little motor steps */
.print.out { animation: printOut 2.6s linear both; }
@keyframes printOut {
  0%   { transform: translateY(105vh) rotate(0); }
  15%  { transform: translateY(80vh) rotate(-.6deg); }
  22%  { transform: translateY(80vh) rotate(-.6deg); }
  40%  { transform: translateY(54vh) rotate(.5deg); }
  47%  { transform: translateY(54vh) rotate(.5deg); }
  65%  { transform: translateY(28vh) rotate(-.4deg); }
  72%  { transform: translateY(28vh) rotate(-.4deg); }
  90%  { transform: translateY(-1.5%) rotate(.3deg); }
  100% { transform: translateY(0) rotate(0); }
}
/* then the picture slowly develops, like an instant photo */
.develop {
  position: absolute;
  left: var(--dl, 6%); top: var(--dt, 5%); width: var(--dw, 88%); height: var(--dh, 70%);
  background: radial-gradient(circle at 50% 45%, #6c6458, #4a443c);
  opacity: 0;
  pointer-events: none;
}
.print.out .develop { opacity: 1; }
.print.developed .develop { opacity: 0; transition: opacity 2.4s ease-in; }
.print.out img { filter: none; }

@media (prefers-reduced-motion: reduce) {
  .print.out { animation: none; }
  .print.developed .develop { transition: none; }
}
