/* Visual "Festa no Ar" */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 20%, #ffd84d 0 7px, transparent 8px),
    radial-gradient(circle at 88% 14%, #4de1ff 0 9px, transparent 10px),
    radial-gradient(circle at 7% 78%, #7dffb0 0 10px, transparent 11px),
    radial-gradient(circle at 93% 70%, #fff 0 6px, transparent 7px),
    linear-gradient(135deg, #5b2bd9, #c32bb5 55%, #ff5c8a);
  background-attachment: fixed;
}
body { min-height: 100vh; padding: 10px 20px 14px; font: 17px/1.4 "Segoe UI", system-ui, sans-serif; color: #2b1457; }

/* ---- Faixa do topo ---- */
header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 52px; }
h1, #clock, .code, h2 { font-family: "Segoe UI Black", "Segoe UI", system-ui, sans-serif; font-weight: 900; }
h1 { color: #fff; font-size: 30px; letter-spacing: -.5px; }
#prompt { grid-column: 2; background: #fff; border-radius: 40px; padding: 7px 26px; font-size: 21px; box-shadow: 0 5px 0 #0000002e; max-width: 56vw; overflow-wrap: anywhere; }
#clock { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; background: #ffd84d; border-radius: 40px; padding: 4px 24px; font-size: 28px; box-shadow: 0 5px 0 #b98d00; }
#notice { width: fit-content; margin: 10px auto 0; background: #fff3b0; border-radius: 30px; padding: 8px 20px; box-shadow: 0 4px 0 #b98d00; }

/* ---- Cartões ---- */
main:not(.stage), .card { background: #fff; border-radius: 28px; box-shadow: 0 9px 0 #0000002e; }
main:not(.stage) { max-width: 640px; margin: 22px auto; padding: 24px; text-align: center; }
main.stage { display: flex; justify-content: center; align-items: stretch; gap: 16px; margin-top: 10px; }
h2 { font-size: 24px; margin-bottom: 8px; }

/* ---- Campos e botões ---- */
label { display: block; font-weight: 700; }
input:not([type="color"]) { width: 100%; font: inherit; font-size: 20px; text-align: center; color: inherit; background: #f1e9ff; border: 3px solid #e4d6ff; border-radius: 40px; padding: 10px 18px; margin: 6px 0 14px; }
input:focus-visible { outline: 3px solid #5b2bd9; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 40px; padding: 10px 20px; margin: 4px; cursor: pointer; font: 700 16px "Segoe UI", system-ui, sans-serif; color: #2b1457; background: #f1e9ff; box-shadow: 0 4px 0 #bda6f0; }
.b:active { translate: 0 2px; }
.b:focus-visible { outline: 3px solid #ffb300; }
.b.on { background: #5b2bd9; color: #fff; box-shadow: 0 4px 0 #321580; }
.b.go { background: #2fd678; color: #06381c; font-size: 21px; padding: 12px 34px; box-shadow: 0 5px 0 #168a48; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Sala e espera ---- */
.code { font-size: 56px; letter-spacing: 12px; color: #5b2bd9; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.chips li { border-radius: 40px; padding: 8px 18px; font-weight: 700; box-shadow: 0 4px 0 #00000026; overflow-wrap: anywhere; }
.chips li:nth-child(6n+1) { background: #ffd84d; }
.chips li:nth-child(6n+2) { background: #8fe9ff; }
.chips li:nth-child(6n+3) { background: #a5f7c6; }
.chips li:nth-child(6n+4) { background: #ffc1d3; }
.chips li:nth-child(6n+5) { background: #ffcf9e; }
.chips li:nth-child(6n) { background: #d9c8ff; }
.chips li.away { opacity: .45; }

/* ---- Álbum ---- */
.step { background: #f1e9ff; border-radius: 22px; padding: 14px; margin: 12px 0; }
.author { font-weight: 700; color: #5b2bd9; margin-bottom: 6px; }
.phrase { font-size: 24px; overflow-wrap: anywhere; }

/* ---- Folha e ferramentas ---- */
.sheet { display: block; width: 100%; max-width: 800px; aspect-ratio: 4 / 3; margin: 0 auto; background: #fff; border: 5px solid #e4d6ff; border-radius: 20px; touch-action: none; }
/* Na tela de descrever, o desenho encolhe para o campo e o botão ficarem à vista. */
main:not(.stage) > .sheet { max-width: min(100%, max(320px, calc((100vh - 310px) * 4 / 3))); }
.card.paper { padding: 8px; display: flex; align-items: center; }
/* Altura da janela menos faixa e margens; a largura limita em janelas estreitas. */
.stage .sheet { width: min(calc((100vh - 112px) * 4 / 3), calc(100vw - 320px)); min-width: 360px; max-width: none; cursor: crosshair; }
.panel { width: 232px; padding: 10px; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.panel .b { margin: 0; padding: 7px; }
.panel .go { margin-top: 5px; padding: 11px; }
.colors { display: grid; grid-template-columns: repeat(4, 30px); justify-content: center; gap: 6px; }
.swatch { width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 2px #0003; }
.swatch.on { box-shadow: 0 0 0 4px #ffb300; }
.pick { position: relative; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wheel { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0004; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.sizes { display: flex; gap: 6px; }
.panel .sizes .b { flex: 1; flex-direction: column; gap: 0; padding: 5px 0; border-radius: 16px; font-size: 12px; }

/* ---- Fundo em movimento ---- */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.fly { position: absolute; left: 0; opacity: .75; animation: cross linear infinite; }
.fly svg { display: block; width: 100%; animation: sway 3.5s ease-in-out infinite alternate; }
.fly.back { animation-direction: reverse; }
@keyframes cross { from { transform: translateX(-120px); } to { transform: translateX(100vw); } }
@keyframes sway { from { transform: translateY(-9px) rotate(-12deg); } to { transform: translateY(9px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .sky { display: none; } }
