:root {
  color-scheme: dark;
  --bg: #171411;
  --panel: #211b16;
  --line: #49362b;
  --muted: #cfbbab;
  --text: #fff4e9;
  --orange: #ff9862;
  --green: #a7b38a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 55% 5%,#302018,transparent 63%),var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui,sans-serif;
}

a {
  color: inherit;
  text-underline-offset: .25em;
}

button {
  font: inherit;
}

a:focus-visible,button:focus-visible {
  outline: 2px solid #ffbd95;
  outline-offset: 4px;
}

.wrap {
  width: min(1240px,calc(100% - 72px));
  margin: auto;
}

.bar {
  border-bottom: 1px solid var(--line);
}

header {
  min-height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.brand b {
  color: var(--orange);
}

.brand-mark {
  width: 23px;
  height: 29px;
  background: linear-gradient(142deg,#ffd782,#f66435 64%,#9f291c);
  border-radius: 86% 7% 71% 69%;
  transform: rotate(-26deg);
  display: inline-block;
}

nav {
  display: flex;
  gap: 25px;
  font-size: .9rem;
  color: var(--muted);
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: minmax(245px,.72fr) minmax(0,1.5fr);
  gap: clamp(36px,5vw,83px);
  padding: 45px 0 54px;
  align-items: center;
}

h1,h2 {
  font: normal 2.2rem/1.02 Georgia,serif;
  margin: 0;
  letter-spacing: -.04em;
}

h1 {
  font-size: clamp(4rem,7.1vw,7.25rem);
  line-height: .91;
}

h1 em {
  display: block;
  color: var(--orange);
  font-weight: normal;
}

.intro p {
  color: var(--muted);
  max-width: 32ch;
  margin: 27px 0 24px;
  font-size: 1.08rem;
}

.primary {
  background: var(--orange);
  color: #24150e;
  border: 0;
  padding: 13px 23px;
  border-radius: 3px;
  font-weight: 750;
  cursor: pointer;
  min-height: 48px;
}

.primary:hover {
  background: #ffb38a;
}

.primary:disabled {
  opacity: .7;
  cursor: default;
}

.how {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 17px 0 0;
  font-size: .9rem;
  color: var(--muted);
  max-width: 350px;
}

.how strong {
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}

.game {
  min-width: 0;
  border: 1px solid #624433;
  border-radius: 10px;
  background: #211912;
  overflow: hidden;
  box-shadow: 0 24px 70px #0007;
}

.scene {
  position: relative;
  aspect-ratio: 1.78;
  isolation: isolate;
  overflow: hidden;
  background: #150c08 url('../fuoco_img/camino.webp') center 58% / cover no-repeat;
  --glow: .45;
}

.scene::after {
  content: "";
  inset: 0;
  position: absolute;
  background: linear-gradient(180deg,#0a0706a8,transparent 45%,#0a07063d);
  pointer-events: none;
  z-index: -1;
}

.glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: var(--glow);
  animation: braci 1.8s ease-in-out infinite alternate;
  background: radial-gradient(ellipse at 50% 65%,#fa501f87,transparent 58%);
  mix-blend-mode: screen;
  transition: opacity .3s;
}

.drag-ghost {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  transform: translate(-50%,-50%);
  box-shadow: 0 7px 18px #0009;
}

.dragover {
  box-shadow: inset 0 0 0 2px var(--orange);
}

.time {
  position: absolute;
  top: 17px;
  right: 18px;
  background: #140c09d8;
  border: 1px solid #805039;
  border-radius: 4px;
  padding: 4px 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ember {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff2b7;
  box-shadow: 0 0 11px 3px #fb6c35;
  pointer-events: none;
  animation: rise .75s ease-out forwards;
}

@keyframes rise {
  to {
    transform: translate(var(--dx),var(--dy));
    opacity: 0;
  }
}

.controls {
  padding: 18px 22px 16px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .87rem;
  color: var(--muted);
}

.meter-label strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.meter {
  margin: 7px 0 5px;
  height: 10px;
  background: #3a2b23;
  border-radius: 8px;
  position: relative;
}

.band {
  position: absolute;
  left: 45%;
  width: 24%;
  height: 100%;
  background: #85936c;
  border-radius: 2px;
  opacity: .8;
}

.pin {
  position: absolute;
  left: 54%;
  width: 4px;
  height: 16px;
  top: -3px;
  border-radius: 3px;
  background: #fff2e2;
  transition: left .2s;
}

.status {
  color: var(--green);
  font-size: .83rem;
}

.score {
  text-align: right;
  color: var(--muted);
  font-size: .82rem;
}

.score strong {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.wood {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 22px;
  gap: 10px;
}

.wood p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.logs {
  display: flex;
  gap: 8px;
}

.log {
  cursor: grab;
  background: #2b1f18;
  border: 1px solid #664935;
  border-radius: 4px;
  width: 62px;
  height: 44px;
  display: grid;
  place-content: center;
  touch-action: none;
}

.log:hover,.log.dragging {
  background: #593522;
  border-color: var(--orange);
}

.log:disabled {
  opacity: .45;
  cursor: default;
}

.log i {
  width: 33px;
  height: 14px;
  border-radius: 4px 40% 40% 4px;
  transform: rotate(-19deg);
  pointer-events: none;
  display: block;
  background: repeating-linear-gradient(9deg,#75462e 0 1px,#965e3d 2px 4px,#cd9058 5px 6px);
  position: relative;
  box-shadow: 0 3px 2px #0007;
}

.log i::after {
  content: "";
  width: 13px;
  height: 14px;
  position: absolute;
  right: -2px;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse,#9f5e3c 0 1px,#e0aa74 1.5px 2.8px);
  border: 1px solid #8e4c2f;
}

.result {
  padding: 0 22px 16px;
  color: var(--orange);
  font-weight: 650;
}

.result[hidden] {
  display: none;
}

.compare {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  display: grid;
  grid-template-columns: .72fr 1.5fr;
  gap: clamp(36px,5vw,83px);
  align-items: start;
}

.compare p {
  margin: .55em 0 0;
  color: var(--muted);
}

.switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.switches button {
  border: 1px solid #775743;
  background: transparent;
  color: var(--text);
  padding: 7px 12px;
  border-radius: 3px;
  cursor: pointer;
}

.switches [aria-pressed="true"] {
  background: #603925;
  border-color: #d27a4f;
}

.compare-track {
  width: 100%;
  height: 8px;
  background: #3a2b23;
  border-radius: 7px;
  margin-top: 15px;
  overflow: hidden;
}

.compare-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg,#cf5c36,#ffab68);
  transition: width .3s;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

footer {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  color: var(--muted);
  font-size: .88rem;
}

@media(max-width:800px) {
  .wrap {
    width: calc(100% - 36px);
  }
  .grid,.compare {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .grid {
    padding: 32px 0;
  }
  .intro p {
    margin: 17px 0;
    max-width: 48ch;
  }
  h1 {
    font-size: clamp(3.3rem,9.8vw,5rem);
  }
  h1 em {
    display: inline;
  }
  .how {
    margin: 16px 0 0;
    max-width: none;
  }
  .scene {
    aspect-ratio: 1.4;
  }
  .compare {
    padding-bottom: 32px;
  }
}

@media(max-width:440px) {
  nav {
    gap: 12px;
  }
  .brand {
    gap: 8px;
    font-size: .84rem;
  }
  .brand-mark {
    width: 18px;
    height: 22px;
  }
  .controls,.wood {
    padding-left: 13px;
    padding-right: 13px;
  }
  .log {
    width: 48px;
  }
  .scene {
    aspect-ratio: 1.27;
  }
  .time {
    right: 12px;
    top: 12px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration: .01ms!important;
    transition: none!important;
  }
}

@keyframes braci {
  from {
    filter: brightness(.8);
  }
  to {
    filter: brightness(1.4);
  }
}

.audio-controls {
  display: flex;
  justify-content: flex-end;
  padding: 8px 22px 0;
}

.audio-controls button {
  border: 1px solid #775743;
  border-radius: 4px;
  padding: 5px 10px;
  color: var(--text);
  background: transparent;
  font-size: .88rem;
  cursor: pointer;
}

.audio-controls button:hover {
  background: #36271e;
}

.audio-controls button[aria-pressed="false"] {
  color: var(--muted);
}
