.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.screen.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.screen.dim {
  background: rgba(255, 248, 239, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.screen.veil {
  background: radial-gradient(ellipse at center, rgba(255, 248, 239, 0.7) 0%, rgba(255, 248, 239, 0.3) 50%, rgba(255, 248, 239, 0) 80%);
}

.clay-button {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 12px 28px;
  border: none;
  border-radius: 24px;
  font: 800 24px/1.1 'Nunito', system-ui, sans-serif;
  color: #fff;
  background: var(--coral);
  box-shadow: inset 0 -8px 0 var(--coral-deep), 0 8px 18px var(--shadow);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.clay-button:active {
  transform: translateY(4px) scale(0.97, 0.95);
  box-shadow: inset 0 -4px 0 var(--coral-deep), 0 4px 10px var(--shadow);
}

.clay-button.mint { background: var(--mint); box-shadow: inset 0 -8px 0 var(--mint-deep), 0 8px 18px var(--shadow); }
.clay-button.sun { background: var(--sun); box-shadow: inset 0 -8px 0 var(--sun-deep), 0 8px 18px var(--shadow); color: var(--ink); text-shadow: none; }
.clay-button.lilac { background: var(--lilac); box-shadow: inset 0 -8px 0 var(--lilac-deep), 0 8px 18px var(--shadow); }
.clay-button.sky { background: var(--sky); box-shadow: inset 0 -8px 0 var(--sky-deep), 0 8px 18px var(--shadow); }

.clay-button.big {
  min-width: 200px;
  min-height: 96px;
  font-size: 36px;
  border-radius: 32px;
}

.icon-button {
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 20px;
}

.icon-button svg {
  width: 34px;
  height: 34px;
}

.hold-button {
  position: relative;
  overflow: hidden;
}

.hold-button .hold-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

.title-logo {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.title-logo .logo-block {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font: 800 34px/1 'Nunito', system-ui, sans-serif;
  color: #fff;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.14), 0 8px 16px var(--shadow);
  animation: logo-bob 2.4s ease-in-out infinite;
}

.title-logo .logo-block:nth-child(2n) { animation-delay: 0.3s; }
.title-logo .logo-block:nth-child(3n) { animation-delay: 0.6s; }

@keyframes logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.title-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(100%, 320px);
}

.title-actions .clay-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.title-actions .button-icon {
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.title-actions .button-icon svg {
  width: 100%;
  height: 100%;
}

.title-actions .clay-button:not(.big) {
  font-size: 22px;
}

.title-name {
  margin: 0;
  font: 800 clamp(30px, 8vw, 54px)/1.05 'Nunito', system-ui, sans-serif;
  text-align: center;
  color: var(--ink);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
}

.top-bar {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.message-card {
  max-width: 440px;
  padding: 28px;
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 0 12px 30px var(--shadow);
  text-align: center;
  font-size: 20px;
}

.message-card h2 {
  margin: 0 0 10px;
  font-weight: 800;
}

.debug-overlay {
  position: absolute;
  top: calc(4px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 600 12px/1.3 ui-monospace, monospace;
  white-space: pre;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .title-logo .logo-block {
    animation: none;
  }
}
