/* The profile picture maker: one card, the crop square in it. */

.photo-page {
  min-height: 100dvh;
}

.photo-top {
  position: relative;
  z-index: 2;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
}

.photo-top .gbtn {
  min-height: 44px;
  padding: 6px 16px;
  font-size: 1.1rem;
}

.photo {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding: 12px 16px max(24px, env(safe-area-inset-bottom));
}

.photo-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.photo-card h1 {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 2.8rem);
  color: var(--yellow);
}

.photo-card .sub {
  margin: 0;
}

/* ---------- before a photo ---------- */

.drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 34px 16px;
  border: 3px dashed rgba(255, 248, 234, 0.55);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.drop:hover,
.drop.over {
  background: rgba(0, 0, 0, 0.22);
  border-color: var(--yellow);
}

.drop[hidden] {
  display: none;
}

.drop-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.drop strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--yellow);
}

.drop-hint {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ---------- the crop ---------- */

.editor {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
}

.editor[hidden] {
  display: none;
}

.stage {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--ink);
  touch-action: none;
  cursor: grab;
}

.stage:active {
  cursor: grabbing;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* The circle the game shows, with the corners dimmed around it. */
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -2px;
  pointer-events: none;
}

.zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 320px);
  font-weight: 800;
  font-size: 1.3rem;
}

.zoom input {
  flex: 1;
  accent-color: var(--yellow);
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.photo-actions .gbtn {
  min-height: 52px;
  font-size: 1.2rem;
}

.photo-note {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}
