@font-face {
  font-family: "Barlow Condensed";
  src: url("/fontes/BarlowCondensed-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #30180e;
  --red: #bf1821;
  --yellow: #ffc92b;
  --cream: #fff6df;
  --muted: #715044;
  --rule: #e9c380;
  --display: "Barlow Condensed", "Segoe UI", system-ui, sans-serif;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
body, h1, p, ol { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
input, button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #751019; outline-offset: 3px; }
button:disabled { opacity: .62; }
::selection { background: var(--yellow); color: var(--ink); }
img { display: block; }
h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.021em; line-height: .94; }
em { color: var(--red); font-style: normal; }

.led-shell { display: grid; place-items: center; min-height: 100dvh; background: #2e190f; overflow: hidden; }
.led-viewport { width: min(384px, 100vw, 30dvh); aspect-ratio: 3/10; container-type: inline-size; }
.led { width: 100%; height: 100%; overflow: hidden; display: grid; grid-template-rows: 27cqw minmax(0, 1fr) 64cqw; background: #ffe991; }
.led-brand { position: relative; display: flex; align-items: center; gap: 3.5cqw; padding: 0 6cqw; background: var(--cream); border-bottom: .68cqw solid var(--ink); }
.led-brand img { width: 13cqw; height: 13cqw; object-fit: contain; background: var(--red); border-radius: 2cqw; padding: 1.6cqw; }
.led-brand > p { font: 800 6.8cqw/.89 var(--display); letter-spacing: -.018em; }
#led-status { position: absolute; inset: auto 5cqw 2cqw auto; color: #852021; font-size: 2.8cqw; }
.led-main { position: relative; min-height: 0; }
.led-main > section { position: absolute; inset: 0; }

.idle-view { isolation: isolate; overflow: hidden; }
.idle-call { position: relative; z-index: 1; padding: 9cqw 6cqw 0; }
.idle-call h1 { font-size: 16.2cqw; text-transform: uppercase; }
.idle-call p { max-width: 72cqw; margin-top: 4.5cqw; font-size: 5.8cqw; font-weight: 700; line-height: 1.22; }
.idle-art { position: absolute; inset: auto 0 0; height: 158cqw; }
.idle-art canvas {
  display: block;
  width: 100%;
  height: 100%;
  mask-image: linear-gradient(transparent, #000 12%, #000 84%, transparent);
}

.led-join { z-index: 2; display: grid; grid-template-columns: 49cqw minmax(0, 1fr); align-items: center; gap: 4cqw; padding: 5cqw; background: var(--red); border-top: .75cqw solid var(--ink); color: white; }
.led-join a { width: 49cqw; aspect-ratio: 1; display: grid; place-items: center; background: white; border-radius: 2.1cqw; }
.led-join img { width: 100%; height: 100%; image-rendering: pixelated; object-fit: contain; }
.led-join p { text-transform: uppercase; font: 800 9.2cqw/.92 var(--display); }
.led-join span { display: block; font-size: 4.25cqw; line-height: 1.22; font-weight: 650; margin-top: 2.5cqw; }

.game-view { padding: 6cqw 5cqw 0; display: flex; flex-direction: column; }
.led-player { display: flex; align-items: center; gap: 4.2cqw; }
.led-player > img, .personal-view > img, .ranking-view img { border-radius: 50%; object-fit: cover; background: #f7d276; }
.led-player > img { width: 18cqw; height: 18cqw; border: .8cqw solid var(--ink); }
.led-player p { font-size: 3.8cqw; line-height: 1.2; font-weight: 750; }
.led-player h1 { max-width: 65cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10cqw; }
.led-metrics { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; margin-top: 5cqw; }
.led-metrics span { display: block; font-weight: 750; color: var(--muted); font-size: 4cqw; }
.led-metrics strong { font: 800 14.4cqw/.9 var(--display); }
.led-metrics small { font-size: 4cqw; font-weight: 700; }
.led-metrics > div:last-child { text-align: right; }
.time-rail { height: 1cqw; margin-top: 3cqw; background: #d89d4c; border-radius: 99px; }
.time-rail i { display: block; height: 100%; width: 100%; background: var(--red); border-radius: inherit; transform-origin: left; }
.led-board { position: relative; flex: 1; min-height: 0; margin-inline: -5cqw; }
.led-board canvas { width: 100%; height: 100%; display: block; }
.countdown { position: absolute; z-index: 1; inset: 11% 0 auto; text-align: center; color: var(--red); font: 800 33cqw/.8 var(--display); pointer-events: none; }
.hit { position: absolute; top: 5cqw; left: 50%; transform: translateX(-50%); display: block; max-width: 100%; white-space: nowrap; color: var(--cream); background: var(--ink); padding: 1.4cqw 4cqw; border-radius: 2cqw; font-size: 4.1cqw; font-weight: 750; pointer-events: none; }

.personal-view { display: grid; align-content: center; justify-items: center; padding: 0 5cqw 10cqw; }
.personal-view > img { width: 30cqw; height: 30cqw; border: 1cqw solid var(--ink); }
.personal-view > h1 { max-width: 100%; width: 100%; text-align: center; overflow-wrap: anywhere; font-size: 13cqw; margin: 4cqw 0 9cqw; }
.place-number { font: 800 34cqw/.8 var(--display); color: var(--red); font-variant-numeric: tabular-nums; }
.result-label { font-size: 6.7cqw; font-weight: 750; margin-top: 2cqw; }
.result-score { font-weight: 850; font-variant-numeric: tabular-nums; }
.personal-view .result-score { margin-top: 5cqw; color: var(--muted); font-size: 6cqw; }

.ranking-view { padding: 8cqw 6cqw; }
.ranking-view h1 { font-size: 26cqw; text-transform: uppercase; margin-bottom: 7cqw; }
.ranking-view ol { list-style: none; padding: 0; border-top: .6cqw solid var(--ink); }
.ranking-view li { display: grid; grid-template-columns: 11cqw 12cqw minmax(0,1fr) auto; gap: 2.9cqw; align-items: center; min-height: 22cqw; border-bottom: .3cqw solid #9266288c; }
.ranking-view li:first-child .rank-index { color: var(--red); }
.ranking-view .rank-index { font: 800 9.3cqw/1 var(--display); }
.ranking-view img { width: 12cqw; height: 12cqw; }
.ranking-view .rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 4.3cqw; font-weight: 750; }
.ranking-view .rank-score { font: 800 6.9cqw/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }

[data-display="responsive"] .led-shell { display: block; overflow: auto; background: #ffe991; }
[data-display="responsive"] .led-viewport { width: 100%; height: max(100dvh, 500px); aspect-ratio: auto; }
[data-display="responsive"] .led { grid-template-rows: 64px minmax(0, 1fr) auto; }
[data-display="responsive"] .led-brand { gap: 12px; padding: 0 clamp(16px, 4vw, 52px); border-width: 2px; }
[data-display="responsive"] .led-brand img { width: 42px; height: 42px; border-radius: 8px; padding: 4px; }
[data-display="responsive"] .led-brand > p { font-size: 1.3rem; }
[data-display="responsive"] #led-status { inset: auto 16px 6px auto; font-size: .72rem; }
[data-display="responsive"] .idle-view { display: grid; grid-template-rows: auto minmax(0, 1fr); }
[data-display="responsive"] .idle-call { padding: clamp(14px, 4dvh, 24px) clamp(16px, 5vw, 32px) 0; }
[data-display="responsive"] .idle-call h1 { font-size: clamp(2.6rem, 12vw, 4.5rem); }
[data-display="responsive"] .idle-call p { margin-top: 12px; font-size: clamp(1.05rem, 3.8vw, 1.35rem); max-width: 24ch; }
[data-display="responsive"] .idle-art { position: relative; inset: auto; width: min(100%, 450px); height: 100%; margin-inline: auto; }
[data-display="responsive"] .led-join { grid-template-columns: clamp(99px, 28vw, 136px) minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-width: 2px; }
[data-display="responsive"] .led-join a { width: 100%; border-radius: 7px; }
[data-display="responsive"] .led-join p { font-size: clamp(1.6rem, 7vw, 2.15rem); }
[data-display="responsive"] .led-join span { font-size: clamp(.82rem, 3.3vw, 1rem); margin-top: 7px; }
[data-display="responsive"] .game-view { --stage-padding: clamp(16px, 4vw, 42px); padding: 16px var(--stage-padding) 0; }
[data-display="responsive"] .led-board { margin-inline: calc(-1 * var(--stage-padding)); }
[data-display="responsive"] .led-player { gap: 12px; }
[data-display="responsive"] .led-player > img { width: 54px; height: 54px; border-width: 2px; }
[data-display="responsive"] .led-player p { font-size: .84rem; }
[data-display="responsive"] .led-player h1 { max-width: min(65vw, 24ch); font-size: clamp(1.8rem, 4vw, 2.65rem); }
[data-display="responsive"] .led-metrics { margin-top: 12px; }
[data-display="responsive"] .led-metrics span, [data-display="responsive"] .led-metrics small { font-size: .86rem; }
[data-display="responsive"] .led-metrics strong { font-size: clamp(2.4rem, 5.6vw, 3.1rem); }
[data-display="responsive"] .time-rail { height: 4px; margin-top: 9px; }
[data-display="responsive"] .countdown { font-size: clamp(4.5rem, 17dvh, 8rem); }
[data-display="responsive"] .hit { top: 12px; padding: 5px 12px; border-radius: 8px; font-size: .92rem; }
[data-display="responsive"] .personal-view { padding: 16px; }
[data-display="responsive"] .personal-view > img { width: clamp(66px, 13dvh, 105px); height: clamp(66px, 13dvh, 105px); border-width: 3px; }
[data-display="responsive"] .personal-view > h1 { font-size: clamp(2.2rem, 6.5vw, 3.4rem); margin: 10px 0 22px; }
[data-display="responsive"] .place-number { font-size: clamp(5rem, 15dvh, 8rem); }
[data-display="responsive"] .result-label { margin-top: 6px; font-size: 1.3rem; }
[data-display="responsive"] .personal-view .result-score { margin-top: 14px; font-size: 1.15rem; }
[data-display="responsive"] .ranking-view { width: min(100%, 740px); margin-inline: auto; padding: 18px clamp(16px, 4vw, 40px); }
[data-display="responsive"] .ranking-view h1 { font-size: clamp(3rem, 11dvh, 5.5rem); margin-bottom: 14px; }
[data-display="responsive"] .ranking-view ol { border-width: 2px; }
[data-display="responsive"] .ranking-view li { grid-template-columns: 32px 36px minmax(0, 1fr) auto; gap: 12px; min-height: clamp(42px, 8.4dvh, 70px); border-width: 1px; }
[data-display="responsive"] .ranking-view img { width: 36px; height: 36px; }
[data-display="responsive"] .ranking-view .rank-index { font-size: 1.75rem; }
[data-display="responsive"] .ranking-view .rank-name { font-size: clamp(.88rem, 2.4vw, 1.15rem); }
[data-display="responsive"] .ranking-view .rank-score { font-size: clamp(1.3rem, 3vw, 1.9rem); }

@media (min-width: 760px) {
  [data-display="responsive"] .led { grid-template-columns: minmax(0, 1fr) clamp(205px, 23vw, 310px); grid-template-rows: 72px minmax(0, 1fr); }
  [data-display="responsive"] .led-brand { grid-column: 1 / -1; }
  [data-display="responsive"] .led-main { grid-area: 2 / 1; }
  [data-display="responsive"] .led-join { grid-area: 2 / 2; grid-template-columns: 1fr; align-content: center; justify-items: center; gap: 23px; padding: 24px; border-top: 0; border-left: 2px solid var(--ink); text-align: center; }
  [data-display="responsive"] .led-join a { width: min(100%, 196px); }
  [data-display="responsive"] .led-join p { font-size: clamp(2rem, 3.5vw, 3rem); }
  [data-display="responsive"] .idle-view { grid-template: minmax(0, 1fr) / minmax(0, 1.12fr) minmax(0, 1fr); align-items: center; }
  [data-display="responsive"] .idle-call { padding: 0 8px 0 clamp(22px, 5vw, 80px); }
  [data-display="responsive"] .idle-call h1 { font-size: clamp(2.6rem, 5.65vw, 6.4rem); }
  [data-display="responsive"] .idle-call p { margin-top: 19px; }
  [data-display="responsive"] .idle-art { width: min(100%, 520px); }
}

.phone-shell { min-height: 100dvh; background: var(--cream); }
.phone { display: flex; flex-direction: column; width: min(100%, 28rem); min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.phone-brand { display: flex; align-items: center; gap: 12px; font-size: .99rem; font-weight: 850; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.phone-brand img { flex: none; width: 44px; height: 44px; object-fit: contain; padding: 7px; border-radius: 8px; background: var(--red); }
.phone-brand span { flex: 1; }
.phone-sound { min-height: 44px; padding: 5px 8px; border: 1px solid #9d7255; border-radius: 8px; color: var(--ink); background: #fffdf4; font-size: .76rem; font-weight: 780; white-space: nowrap; }
.phone-sound[aria-pressed="false"] { background: transparent; color: var(--muted); }
.phone-section { flex: 1; padding-top: 25px; }
.phone-section > h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); margin-bottom: 23px; }
#profile { display: flex; flex-direction: column; gap: 10px; }
.name-label { display: block; font-size: .94rem; font-weight: 800; }
#nickname { width: 100%; min-height: 51px; padding: 10px 12px; border: 1px solid #9d7255; border-radius: 9px; color: var(--ink); background: #fffdf4; }
#nickname::placeholder { color: #79584c; }
.photo-field { display: flex; gap: 16px; align-items: center; padding: 14px 0 7px; }
.photo-display { width: 86px; height: 86px; flex: 0 0 86px; border-radius: 50%; background: #f5d98f; border: 1px solid #ba8b49; overflow: hidden; }
.photo-display img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-actions .name-label { width: 100%; }
.photo-note { color: var(--muted); font-size: .84rem; line-height: 1.44; margin-bottom: 8px; }
.primary, .secondary { border-radius: 9px; font-weight: 800; border: 1px solid transparent; min-height: 44px; padding: .62rem .82rem; color: var(--ink); }
.primary { background: var(--yellow); border-color: var(--ink); min-height: 52px; }
.secondary { background: #fffdf4; border-color: #9d7255; font-size: .85rem; }
.primary:active, .secondary:active { transform: translateY(1px); }
.queue-view > .place-number, .phone-result > .place-number { font-size: clamp(5rem, 26vw, 8rem); margin-bottom: 18px; }
.queue-view > button, .phone-result > button { margin-top: 19px; }
.queue-view > p:not(.place-number), .phone-result > p:not(.place-number) { font-size: 1.05rem; line-height: 1.4; }
.phone-result > button { width: 100%; }
.phone-result .result-score { margin-top: 5px; }
.phone-play { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 20px; }
.phone-piece-area { display: grid; place-items: center; text-align: center; min-height: 0; padding: 10px 0; }
.phone-ingredient { display: grid; justify-items: center; width: 100%; gap: 14px; }
.phone-ingredient img { width: min(70%, 230px); height: clamp(96px, 28dvh, 216px); object-fit: contain; }
.phone-ingredient h1 { overflow-wrap: anywhere; font-size: clamp(2.2rem, 10vw, 3.5rem); }
.phone-ready p { font-weight: 800; font-size: 1.15rem; }
.phone-ready output { display: block; margin-top: 12px; color: var(--red); font: 800 clamp(5.5rem, 26vw, 8rem)/.85 var(--display); }
.drop-button { width: 100%; min-height: 80px; font: 800 1.64rem/.95 var(--display); text-transform: uppercase; touch-action: manipulation; user-select: none; }
.connection, .form-feedback { margin-top: 10px; font-size: .88rem; font-weight: 650; color: #8b1718; line-height: 1.35; }

@media (max-width: 350px) {
  .phone { padding-inline: 14px; }
  .photo-field { gap: 10px; }
}
