@font-face {
  font-family: "Archivo Black";
  src: url("/assets/archivo-black.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("/assets/barlow-regular.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}
@font-face {
  font-family: Barlow;
  src: url("/assets/barlow-bold.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
}

:root {
  color-scheme: dark;
  --ink: #102425;
  --deep: #0b1d22;
  --pine: #18373a;
  --paper: #fff1cb;
  --muted: #bad0c4;
  --lime: #d9f892;
  --sun: #ffc74f;
  --coral: #f66549;
  --border: #3d615f;
  font-family: Barlow, "Trebuchet MS", system-ui, sans-serif;
  background: var(--deep);
  color: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% -22%, #2e524d, transparent 66%), var(--deep);
}
body.in-room {
  overflow: hidden;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:enabled { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 3px;
}
button:active:enabled { translate: 0 1px; }
h1, h2, p { margin: 0; }

.shell {
  margin-inline: auto;
  width: min(100%, 510px);
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}
.masthead {
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.masthead-actions { display: flex; align-items: center; gap: 7px; }
.masthead-actions .secondary { min-width: 75px; }
.studio-logo {
  display: block;
  width: 142px;
  max-width: 52%;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}
.icon-button {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: url("/assets/ui/sound-off.svg") center / 100% 100% no-repeat;
}
.sound.on { background-image: url("/assets/ui/sound-on.svg"); }

.entry {
  border: 1px solid #587a6b;
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 10px 0 #07161b90;
  overflow: hidden;
}
.cover {
  position: relative;
  width: 100%;
  min-height: 219px;
  aspect-ratio: 1.95;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  background: #21484d url("/assets/ui/hero-praia.svg") center / cover no-repeat;
  border-bottom: 3px solid #f09a65;
}
.cover-kiosk {
  position: absolute;
  right: 3.5%;
  bottom: 4%;
  width: min(38%, 180px);
  pointer-events: none;
}
.cover-kiosk::before {
  content: "";
  position: absolute;
  inset: 75% 5% 0;
  border-radius: 50%;
  background: #112c3599;
  transform: translateX(-16%) rotate(-12deg);
  filter: blur(4px);
}
.cover-kiosk img { position: relative; display: block; width: 100%; height: auto; }
.cover-copy { position: relative; padding: 17px 5.5% 18px; }
.beach-name {
  display: inline-block;
  margin: 0 0 8px 2px;
  color: #fff1cb;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .145em;
}
.cover h1 {
  color: var(--paper);
  font: 900 clamp(43px, 10.9vw, 75px)/.77 "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: -.085em;
  text-shadow: 1px 2px #131f21, 2px 4px #131f21, 3px 6px #131f21;
  transform: skew(-5deg) rotate(-2deg);
  transform-origin: 0 85%;
}
.cover h1 span { display: block; }
.cover h1 span:nth-child(2) { margin-top: .145em; color: #ffd16a; }
.cover h1 span:nth-child(3) { margin-top: .035em; color: #ff8862; }
.entry-body { padding: 15px 16px 11px; }
.entry-tagline { margin-bottom: 12px; }
.entry-tagline h2, .sheet h2 {
  font: 900 clamp(22px, 6.5vw, 34px)/1.04 "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: -.055em;
}
.entry-tagline p { color: var(--muted); margin-top: 5px; font-size: 16px; }
.runner-select {
  --runner-color: #de9158;
  display: grid;
  width: 100%;
  min-height: 61px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 3px 11px 3px 3px;
  border: 1px solid #587f73;
  border-bottom: 3px solid #0a171a;
  border-radius: 9px;
  background: #1a393c;
  color: var(--paper);
  text-align: left;
}
.runner-select:hover { border-color: var(--runner-color); }
.runner-select img {
  width: 54px;
  height: 51px;
  object-fit: contain;
  border-radius: 6px;
  background: color-mix(in srgb, var(--runner-color) 29%, #112b2f);
}
.runner-current { display: grid; gap: 1px; min-width: 0; }
.runner-current small { color: var(--muted); font-size: 13px; }
.runner-current strong {
  overflow: hidden;
  color: var(--paper);
  font: 900 18px / 1.13 "Archivo Black", "Arial Black", sans-serif;
  text-overflow: ellipsis;
}
.runner-change { color: #ffda83; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.control-select {
  position: relative;
  margin: 7px 0 10px;
  padding: 0 0 0 78px;
  border: 0;
}
.control-select legend {
  position: absolute;
  left: 0;
  top: 9px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.control-options { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.control-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.control-options label {
  display: grid;
  min-height: 37px;
  place-items: center;
  border: 1px solid #426765;
  border-radius: 7px;
  background: #0e2b30;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.control-options input:checked + label {
  border-color: #e9ba67;
  background: #e8b85e;
  color: #193136;
}
.control-options input:focus-visible + label { outline: 2px solid var(--sun); outline-offset: 2px; }
.runner-dialog {
  width: min(94%, 530px);
  max-height: min(90dvh, 650px);
  padding: 13px 13px 15px;
  border: 1px solid #83a695;
  border-radius: 13px;
  background: #132e31;
  color: var(--paper);
  box-shadow: 0 10px 35px #00161baa;
}
.runner-dialog::backdrop { background: #071318c9; }
.runner-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.runner-dialog-header h2 {
  font: 900 clamp(16px, 5.3vw, 24px) / 1.08 "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: -.055em;
}
.runner-dialog-header .text-button { flex: none; color: #ffdb8d; }
.runner-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.runner-card {
  --runner-color: #ffcf72;
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  padding: 4px 3px 6px;
  border: 1px solid #557b70;
  border-radius: 7px;
  background: #1e4142;
  color: var(--paper);
  text-align: center;
}
.runner-card[aria-pressed="true"] { border-color: #ffe49e; box-shadow: inset 0 0 0 1px #ffe49e; }
.runner-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 4px;
  background: color-mix(in srgb, var(--runner-color) 32%, #123137);
}
.runner-card strong { margin-top: 4px; font-size: 15px; }
.runner-card small { color: var(--muted); font-size: 11px; line-height: 1.08; }

.entry-form { display: grid; gap: 7px; }
.entry-form label { font-size: 15px; font-weight: 700; color: var(--paper); }
.entry-form input, .invite input {
  display: block;
  width: 100%;
  min-height: 47px;
  padding: 9px 12px;
  border: 1px solid #60776b;
  border-radius: 10px;
  background: var(--deep);
  color: var(--paper);
  font-size: 17px;
}
.entry-form input::placeholder { color: #a5b7ab; }
.room-field { display: grid; gap: 7px; }
.primary {
  width: 100%;
  min-height: 49px;
  padding: 8px 15px 10px;
  border: 0;
  border-radius: 6px;
  background: url("/assets/ui/button-solo.svg") center / 100% 100% no-repeat;
  color: #192b2a;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 15px;
  letter-spacing: -.025em;
}
.primary:focus-visible, .primary:enabled:hover { filter: brightness(1.08); }
.primary:disabled { filter: saturate(.42); opacity: .64; }
.entry-primary { margin-top: 3px; }
.solo-button, .primary.entry-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-block: 6px 9px;
}
.solo-button img { width: 29px; height: 29px; }
.primary.entry-secondary {
  min-height: 45px;
  margin-top: 0;
  background-image: url("/assets/ui/button-sala.svg");
  color: var(--paper);
}
.primary.entry-secondary::before {
  content: "";
  width: 27px;
  height: 27px;
  background: url("/assets/ui/icon-sala.svg") center / contain no-repeat;
}
.text-button {
  background: transparent;
  border: 0;
  min-height: 39px;
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #8b9e8e;
}
.entry-meta {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 9px 0 3px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}
.form-error {
  border-left: 2px solid var(--coral);
  padding-left: 8px;
  color: #ffc8b3;
  font-size: 15px;
}

body[data-rasch-id="required"]:not(.signed-in) #entry-form { display: none; }
.account-panel { margin-block: 9px; }
.account-panel > .form-error { margin-top: 6px; }
.account-info {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px 5px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1a393c;
}
.account-info > div { min-width: 0; }
.account-info span, .account-info strong { display: block; }
.account-info span { color: var(--muted); font-size: 12px; }
.account-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info .text-button { flex: none; }
.access-dialog .entry-form { gap: 6px; }
.access-dialog #account-submit { margin-top: 5px; }
.ranking-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}
.ranking-filter select {
  min-height: 40px;
  padding: 6px 7px;
  border: 1px solid #5c8174;
  border-radius: 8px;
  background: #102428;
  color: var(--paper);
  font: inherit;
}
.ranking-status { padding: 12px 0 5px; color: var(--muted); }
.ranking-scroll { margin-top: 8px; overflow: auto; }
.ranking-scroll table { width: 100%; border-collapse: collapse; }
.ranking-scroll :is(td, th) {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.ranking-scroll td { overflow-wrap: anywhere; }
.ranking-scroll :is(th, td):last-child { text-align: right; white-space: nowrap; }

body.in-room .shell {
  width: min(100%, 725px);
  height: 100vh;
  height: 100dvh;
  padding: max(5px, env(safe-area-inset-top)) 6px max(5px, env(safe-area-inset-bottom));
}
.game {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: 42px auto minmax(0, 1fr);
  gap: 5px;
}
.game-bar, .scoreboard {
  width: min(100%, 490px);
  justify-self: center;
}
.game-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-inline: 4px;
}
.game-bar .sound {
  justify-self: end;
  width: 39px;
  height: 39px;
}
.game-controls {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}
.heat-hud { --heat: 0%; min-width: 48px; }
.heat-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
}
.heat-track {
  display: block;
  height: 6px;
  border: 1px solid #866b47;
  border-radius: 5px;
  background: #372c23;
  overflow: hidden;
}
.heat-track span {
  display: block;
  width: var(--heat);
  height: 100%;
  background: var(--sun);
  transition: width 95ms linear;
}
.heat-hud.hot .heat-label { color: #ffb591; }
.heat-hud.hot .heat-track span { background: var(--coral); }
.game-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.04;
  letter-spacing: .09em;
  font-weight: 700;
}
.game-mode { min-width: 0; }
.game-exit {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--paper);
  background: #132c25;
  font-size: 13px;
  font-weight: 700;
}
.clock {
  color: var(--paper);
  min-width: 84px;
  text-align: center;
  font: 900 28px/1 "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.clock.urgent { color: #ff9d77; }
.scoreboard {
  display: grid;
  grid-auto-columns: minmax(0,1fr);
  grid-auto-flow: column;
  gap: 4px;
  padding-inline: 2px;
}
.scoreboard:empty { display: none; }
.score-card {
  position: relative;
  min-width: 0;
  display: grid;
  align-items: center;
  grid-template-columns: 22px minmax(0,1fr);
  column-gap: 6px;
  padding: 4px 6px 5px 7px;
  border-radius: 8px;
  border: 1px solid #385347;
  background: var(--ink);
}
.score-card.mine { border-color: #789274; }
.player-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--player-color, var(--lime));
  box-shadow: inset 0 0 0 1px #ffffff45;
}
.player-avatar {
  width: 22px;
  height: 22px;
  grid-row: span 2;
  border-bottom: 2px solid var(--player-color, var(--sun));
}
.score-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.02;
}
.score-number {
  color: var(--paper);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-card.scoring .score-number { color: var(--lime); }
.score-card.away { opacity: .65; }

.stage {
  grid-row: 3;
  position: relative;
  width: min(100%, min(490px, calc((100dvh - 108px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) * 450 / 660)));
  aspect-ratio: 450 / 660;
  justify-self: center;
  align-self: start;
  max-height: 100%;
  border: 1px solid #58705a;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  background: #ddb15e;
  box-shadow: 0 6px 0 #0a1812;
  user-select: none;
  -webkit-user-select: none;
}
#arena {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.motion-message, .gesture-hint, .shade-status, .connection {
  position: absolute;
  left: 50%;
  max-width: calc(100% - 12px);
  width: max-content;
  transform: translateX(-50%);
  text-align: center;
  border-radius: 7px;
  padding: 6px 9px;
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
}
.motion-message {
  top: 5%;
  color: #241f1a;
  background: #ffdb73;
  border: 1px solid #533f20;
  box-shadow: 0 2px #5d412b;
}
.gesture-hint, .connection {
  bottom: 8px;
  background: #152921f5;
  color: var(--paper);
  border: 1px solid #9cb78e;
}
.gesture-hint span { margin-inline: 2px; }
.shade-status {
  bottom: 36px;
  background: #234838f0;
  border: 1px solid #d0edb7;
  color: #ebffd7;
}
.shade-status.sand {
  background: #663d28f7;
  border-color: #ffcc8d;
  color: #fff0cd;
}
.shade-status.hot {
  color: #ffe6ba;
  background: #8d3a2eea;
  border-color: #ffc575;
}
.shade-status.solo { bottom: 8px; }
.countdown {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  pointer-events: none;
  font: 900 clamp(44px, 15vw, 103px)/1 "Archivo Black", "Arial Black", sans-serif;
  letter-spacing: -.075em;
  -webkit-text-stroke: 2px #2a2a1b;
  paint-order: stroke fill;
  color: var(--lime);
  text-shadow: 3px 5px #253124;
}
.move-target {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: url("/assets/ui/move-target.svg") center / contain no-repeat;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: enter-target .18s ease-out both;
}
@keyframes enter-target {
  from { opacity: .3; scale: 1.35; }
  to { opacity: 1; scale: 1; }
}
.joystick {
  --stick-anchor-x: 0px;
  --stick-anchor-y: 0px;
  --stick-x: 0px;
  --stick-y: 0px;
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(var(--stick-anchor-x), var(--stick-anchor-y), 0);
  width: 58px;
  height: 58px;
  margin-left: -29px;
  margin-top: -29px;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 50%;
  background: #24372938;
  border: 1px solid #fff2c99e;
}
.joystick span {
  width: 20px;
  height: 20px;
  border: 1px solid #1b3228ac;
  border-radius: 50%;
  background: #fff2c9aa;
  translate: var(--stick-x) var(--stick-y);
}
.stage-overlay {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 9px;
  background: linear-gradient(0deg,#10281ce6,#10281c0d 92%);
  overscroll-behavior: contain;
}
.sheet {
  position: relative;
  margin-top: auto;
  background: #132c25f7;
  border: 1px solid #6e846a;
  border-radius: 15px;
  box-shadow: 0 6px 24px #071b16ad;
  padding: 13px 12px 5px;
}
.sheet .eyeline {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
  color: var(--lime);
}
.sheet h2 { font-size: clamp(20px, 6vw, 29px); overflow-wrap: anywhere; }
.sheet-description { margin-top: 5px; font-size: 15px; color: var(--muted); }
.invite {
  margin-block: 10px;
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 4px;
  align-items: center;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.invite div { min-width: 0; padding-left: 3px; }
.invite div span { display: block; font-size: 12px; color: var(--muted); }
.invite strong {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, monospace;
  font-size: clamp(12px, 3vw, 18px);
  color: var(--sun);
  overflow-wrap: anywhere;
}
.invite input { grid-column: 1 / -1; }
.secondary {
  min-height: 40px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 0;
  background: url("/assets/ui/button-sala.svg") center / 100% 100% no-repeat;
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
}
.sheet .text-button { display: block; margin-inline: auto; }
.sheet .form-error { margin-bottom: 8px; }
.result .ranking {
  padding: 0;
  margin: 8px 0 10px;
  list-style: none;
}
.ranking li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 3px;
  border-bottom: 1px solid #3d5549;
}
.ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking strong { font-variant-numeric: tabular-nums; }
.rematch-status {
  min-height: 13px;
  padding-top: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.connection { bottom: auto; top: 8px; background: #152921; border-color: #ffcc8d; }

@media (max-width: 370px) {
  .shell { padding-inline: 10px; }
  .entry-body { padding-inline: 14px; }
  .score-card { column-gap: 3px; padding-inline: 4px; }
  .score-name { font-size: 12px; }
}
@media (max-height: 670px) and (orientation: portrait) {
  .cover { min-height: 205px; }
  .entry-body { padding-top: 13px; }
  .entry-tagline { margin-bottom: 11px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .game {
    display: grid;
    grid-template: minmax(42px,auto) minmax(0,1fr) / minmax(115px,180px) auto;
    justify-content: center;
    align-items: start;
    gap: 5px 9px;
  }
  .game-bar { grid-row: 1; }
  .game-mode:has(.game-exit[hidden]) { display: none; }
  .game-bar { grid-template-columns: 1fr auto; }
  .game-mode:has(.game-exit:not([hidden])) { grid-column: 1 / -1; }
  .game-controls { flex-direction: column-reverse; gap: 4px; }
  .scoreboard { grid-row: 2; grid-auto-flow: row; }
  .stage {
    grid-area: 1 / 2 / span 2;
    width: min(100%, calc((100dvh - 12px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) * 450 / 660));
  }
  .sheet { padding-top: 8px; }
  .sheet .primary { min-height: 41px; }
  .sheet .text-button { min-height: 31px; }
  .cover { min-height: 212px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .move-target { animation: none; }
}

/* ===================== Modo Tabuleiro ===================== */
.game { grid-template-rows: 42px 46px auto minmax(0, 1fr); }
.stage {
  grid-row: 4;
  width: min(100%, min(490px, calc((100dvh - 160px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) * 450 / 660)));
  border: 1px solid #6d8a6f;
  box-shadow: 0 0 0 1px #0a181280, 0 10px 28px #03100c99, 0 4px 0 #0a1812;
}
.hud {
  width: min(100%, 490px);
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding-inline: 2px;
}
.thermo {
  --heat: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 7px;
  border-radius: 12px;
  border: 1px solid #45655e;
  background: linear-gradient(180deg, #17353a, #0f2529);
  box-shadow: inset 0 1px 0 #ffffff14, 0 2px 0 #06120f;
}
.thermo-bulb {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff6d4 0 12%, #ffcd5a 30%, #ff8a3d 62%, #c7432b 100%);
  box-shadow: 0 0 0 2px #26464a, 0 0 calc(4px + var(--heat-glow, 0px)) #ff8a3dcc, inset 0 -3px 5px #0000004d;
}
.thermo-bulb::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 10%, #fff1c9 10% 14%, transparent 14% 35%, #fff1c9 35% 39%, transparent 39% 60%, #fff1c9 60% 64%, transparent 64% 85%, #fff1c9 85% 89%, transparent 89%);
  mask: radial-gradient(circle, transparent 38%, #000 40%);
  opacity: .75;
}
.thermo.cool .thermo-bulb {
  background: radial-gradient(circle at 36% 32%, #f3feff 0 12%, #9ff0ff 30%, #3ccbe0 62%, #1d7c8f 100%);
  box-shadow: 0 0 0 2px #26464a, 0 0 8px #4fe0ffaa, inset 0 -3px 5px #0000004d;
}
.thermo.hot .thermo-bulb { animation: thermo-pulse .55s ease-in-out infinite alternate; }
@keyframes thermo-pulse { to { transform: scale(1.12); filter: saturate(1.4) brightness(1.1); } }
.thermo-body { display: grid; gap: 3px; min-width: 0; }
.thermo-top { display: flex; justify-content: space-between; align-items: baseline; line-height: 1; }
.thermo-label { color: #a9c2b8; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; }
.thermo-value { font: 900 13px/1 "Archivo Black", "Arial Black", sans-serif; color: var(--paper); font-variant-numeric: tabular-nums; }
.thermo.hot .thermo-value { color: #ffb28a; }
.thermo-tube {
  position: relative;
  height: 9px;
  border-radius: 6px;
  background: linear-gradient(180deg, #08171a, #12282c);
  box-shadow: inset 0 1px 2px #000a, 0 0 0 1px #2f514f;
  overflow: hidden;
}
.thermo-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--heat);
  border-radius: 6px;
  background: linear-gradient(90deg, #ffe08a, #ffb347 45%, #ff7a3d 75%, #ff3b2f);
  background-size: 260px 100%;
  box-shadow: 0 0 10px #ff8a3d88;
  transition: width 120ms linear;
}
.thermo-tube::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #ffffff3a 0 35%, transparent 36%),
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), #0f252980 calc(10% - 1px) 10%);
  pointer-events: none;
}
.sun-track { position: relative; height: 3px; border-radius: 2px; background: #2a4a47; margin-top: 1px; }
.sun-turn { position: absolute; top: -2px; width: 2px; height: 7px; border-radius: 1px; background: #ffc74f88; }
.sun-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6c8, #ffc74f 60%, #ff9d3d);
  box-shadow: 0 0 6px #ffc74f;
}
.hud-score {
  position: relative;
  min-width: 104px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 6px;
  padding: 4px 12px 5px;
  border-radius: 12px;
  border: 1px solid #6f7d4a;
  background: linear-gradient(180deg, #2b3a1f, #1a2814);
  box-shadow: inset 0 1px 0 #ffffff18, 0 2px 0 #06120f;
}
.hud-score-label { grid-column: 1 / -1; color: #c7d98f; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; line-height: 1; }
.hud-score strong {
  font: 900 21px/1.05 "Archivo Black", "Arial Black", sans-serif;
  color: var(--lime);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #0b160a;
}
.hud-score strong.bump { animation: score-bump .32s ease-out; }
@keyframes score-bump { 30% { transform: scale(1.18); color: #fff6c8; } }
.streak {
  align-self: center;
  padding: 2px 6px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd66d, #f39b3c);
  color: #3a2410;
  font: 900 11px/1.1 "Archivo Black", "Arial Black", sans-serif;
  box-shadow: 0 0 10px #ffc74f88;
}
.score-number { font-family: "Archivo Black", "Arial Black", sans-serif; font-weight: 900; font-size: 15px; }
.gesture-hint { bottom: 14px; }
.motion-message {
  top: 10px;
  bottom: auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: #142b2ff0;
  border: 1px solid #ffd66d;
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 18px #0008;
  animation: toast-in .22s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px) scale(.92); } }
.text-button.inline { display: inline; padding: 0; min-height: 0; font-size: inherit; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 2px;
}
.result-stats div {
  padding: 7px 4px 6px;
  border-radius: 10px;
  background: #0d211c;
  border: 1px solid #36544a;
  text-align: center;
}
.result-stats dt { color: var(--muted); font-size: 10.5px; line-height: 1.1; }
.result-stats dd { margin: 3px 0 0; font: 900 17px/1 "Archivo Black", "Arial Black", sans-serif; color: var(--paper); }
.result-stats div.good dd { color: #8ff0ff; }
.result-stats div.bad dd { color: #ffab86; }

/* Tutorial */
.tutorial {
  width: min(94vw, 420px);
  padding: 0;
  border: 1px solid #6e846a;
  border-radius: 20px;
  color: var(--paper);
  background: linear-gradient(180deg, #16352f, #0e2420);
  box-shadow: 0 18px 50px #000a;
}
.tutorial::backdrop { background: #04100dcc; backdrop-filter: blur(3px); }
.tutorial-step { padding: 18px 18px 6px; }
.tutorial-step .eyeline { margin: 14px 0 4px; font-size: 10px; font-weight: 700; letter-spacing: .17em; color: var(--lime); }
.tutorial-step h2 { font: 900 24px/1.05 "Archivo Black", "Arial Black", sans-serif; letter-spacing: -.02em; }
.tutorial-step p:not(.eyeline) { margin-top: 7px; color: #d6e4d6; font-size: 15px; line-height: 1.35; }
.tag { padding: 1px 6px; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.tag.hot { color: #ffd2b5; background: #ff7a3d33; box-shadow: 0 0 0 1px #ff9a5e, 0 0 8px #ff7a3d88; }
.tag.cool { color: #dffbff; background: #4fe0ff22; box-shadow: 0 0 0 1px #7fe8ff; }
.tutorial-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px 18px; }
.tutorial-actions .primary { min-width: 140px; }
.tutorial-art {
  position: relative;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #fadb9f, #f4c98c);
  box-shadow: inset 0 0 0 1px #ffffff40, inset 0 -18px 30px #d98d6755;
}
.art-move, .art-warn {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  padding: 10px 60px;
}
.art-move i, .art-warn i {
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px #fff6e066, inset 0 -1px 0 #9a6a3a22;
  background: #ffffff10;
}
.art-warn i.shade { background: radial-gradient(circle, #1f4450aa 40%, #1f445066 100%); box-shadow: 0 0 10px 4px #1f445055; }
.art-warn i.hot { box-shadow: 0 0 0 2px #ffb06e, 0 0 14px #ff7a3d; animation: warn-pulse .5s ease-in-out infinite alternate; }
.art-warn i.cool { box-shadow: 0 0 0 2px #bff8ff, 0 0 12px #4fe0ff; outline: 2px dashed #e9fdff; outline-offset: -6px; }
@keyframes warn-pulse { to { filter: brightness(1.3); box-shadow: 0 0 0 2px #ffcf9e, 0 0 22px #ff7a3d; } }
.art-move .walker {
  position: absolute;
  left: 76px;
  top: 104px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffb3a0, #ff5c5a 70%);
  box-shadow: 0 0 0 3px #fff1cb, 0 6px 6px -2px #0005;
  animation: walk 2.4s ease-in-out infinite;
}
.art-move .chip {
  position: absolute;
  right: 62px;
  top: 8px;
  padding: 2px 9px;
  border-radius: 9px;
  background: #182c32f0;
  color: var(--paper);
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 0 0 1px #ffd66d;
}
.art-move i:nth-child(3) { box-shadow: 0 0 0 2px #ffd66d, 0 0 12px #ffd66d; }
@keyframes walk {
  0%, 12% { transform: translate(0, 0); }
  45% { transform: translate(132px, 0); }
  80%, 100% { transform: translate(132px, -86px); }
}
.art-hazards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  height: auto;
  background: linear-gradient(180deg, #fbe3ae, #f1c58a);
}
.art-hazards figure { margin: 0; display: grid; justify-items: center; gap: 3px; }
.art-hazards img, .art-hazards canvas { width: 64px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 2px #8a5a3055); }
.art-hazards figcaption { color: #5a3622; font-size: 11.5px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .art-move .walker, .art-warn i.hot, .thermo.hot .thermo-bulb { animation: none; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .game { grid-template-rows: 40px 42px auto minmax(0, 1fr); gap: 4px; }
  .stage { width: min(100%, min(490px, calc((100dvh - 146px) * 450 / 660))); }
}

@media (orientation: portrait) and (min-height: 701px) {
  .game { grid-template-rows: 42px 46px auto auto; align-content: center; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .game {
    grid-template: auto auto minmax(0, 1fr) / minmax(160px, 220px) auto;
    align-content: stretch;
  }
  .game-bar { grid-area: 1 / 1; }
  .hud { grid-area: 2 / 1; grid-template-columns: 1fr; }
  .scoreboard { grid-area: 3 / 1; align-self: start; }
  .stage {
    grid-area: 1 / 2 / span 3;
    width: min(100%, calc((100dvh - 12px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) * 450 / 660));
  }
}

/* Tutorial: personagem de verdade em vez de bolinha, areia com textura e trilha pontilhada. */
.tutorial-art {
  background:
    radial-gradient(circle at 20% 30%, #ffffff30 0 1px, transparent 1.5px) 0 0 / 13px 11px,
    radial-gradient(circle at 70% 60%, #b9824a22 0 1px, transparent 1.5px) 0 0 / 17px 15px,
    radial-gradient(120% 90% at 50% 0%, #ffe7b6, #f4c98c 70%, #e7b07a);
}
.art-move .walker {
  width: 42px;
  height: 42px;
  left: 66px;
  top: 88px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 4px 2px #6a3a1a55);
  z-index: 2;
}
.art-move .trail {
  position: absolute;
  left: 89px;
  top: 28px;
  width: 132px;
  height: 86px;
  border: 0 dotted #fff8e2;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-bottom-right-radius: 14px;
  opacity: .9;
  filter: drop-shadow(0 0 3px #ffd66d);
  animation: trail-fade 2.4s ease-in-out infinite;
}
@keyframes trail-fade { 0%, 10% { opacity: 0; } 25%, 70% { opacity: .9; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .art-move .trail { animation: none; } }
