* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #f7eee5; color: #431a2a; font: 1rem/1.5 system-ui, sans-serif; }
main {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  text-align: center;
}
h1 { max-width: 15ch; margin: 0; font: 400 clamp(2.15rem, 7vw, 3.65rem)/1.02 Georgia, serif; text-wrap: balance; }
.hint { margin: .65rem 0 1rem; }
.card {
  position: relative;
  width: min(100%, 310px, max(215px, 47svh));
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #792c47;
  border: 1px solid #792c47;
  border-radius: 16px;
  box-shadow: 0 12px 32px #5526382b;
}
.card.open { width: min(100%, 560px); }
img, canvas, .label { position: absolute; inset: 0; width: 100%; height: 100%; }
img { object-fit: contain; visibility: hidden; }
.card.started img, .card.open img { visibility: visible; }
canvas { display: block; touch-action: none; cursor: crosshair; }
.label { display: grid; align-content: center; pointer-events: none; color: #fff5e8; font: 400 2rem/1.3 Georgia, serif; }
.label span { display: block; font-size: 3rem; margin-bottom: .2em; }
.card.started .label, .card.open .label, .card.open canvas { display: none; }
button {
  touch-action: manipulation;
  min-height: 46px;
  padding: .55rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid #792c47;
  border-radius: 999px;
  background: #fff8f0;
  color: #63243a;
  font: 600 1rem/1.4 system-ui, sans-serif;
  cursor: pointer;
}
button:focus-visible, #message:focus-visible { outline: 3px solid #63243a; outline-offset: 4px; }
button:active { background: #efd5d6; }
@media (hover: hover) and (pointer: fine) { button:hover { background: #f5e0e1; } }
#message { max-width: 35ch; margin: 1.1rem 0 0; }