:root {
  --orange: #ff5a00;
  --orange2: #ff7a00;
  --black: #080808;
  --panel: #151515;
  --white: #f1f1f1;
  --line: #363636;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
}
body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #e9e9e9;
}
.shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-content: center;
  padding: 38px;
  background: radial-gradient(circle at 78% 30%, #2b1408 0, transparent 25%),
    #000;
}
.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: linear-gradient(#ff5a0020 1px, transparent 1px),
    linear-gradient(90deg, #ff5a0020 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
}
.brand {
  position: absolute;
  z-index: 5;
  top: 6%;
  left: 4%;
  width: clamp(210px, 20vw, 290px);
  padding: 20px 38px 20px 24px;
  background: #f4f4f4;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
  filter: drop-shadow(0 8px 18px #0008);
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}
.layout {
  position: relative;
  z-index: 2;
  width: min(1180px, 94vw);
  min-height: min(720px, 88svh);
  display: grid;
  grid-template-columns: 210px minmax(285px, 420px) 200px;
  gap: 48px;
  align-items: center;
  justify-content: center;
  padding: 42px 60px;
  border: 1px solid #bdbdbd;
  border-radius: 30px;
  background: linear-gradient(
    114deg,
    #ededed 0 31%,
    #ff5a00 31.1% 31.7%,
    #121212 31.8% 100%
  );
  box-shadow:
    0 22px 90px #000,
    0 0 35px #ff5a0014;
}
.layout:after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid #ffffff18;
  border-radius: 20px;
  pointer-events: none;
}
.stats {
  align-self: center;
  margin: 80px 0 0;
  color: #101010;
  display: grid;
  gap: 14px;
  z-index: 1;
}
.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px 15px;
  border: 1px solid #c6c6c6;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px #0001;
}
.stat-card > span {
  display: grid;
  gap: 5px;
}
.stat-icon {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stats label,
.preview label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.stats strong {
  color: #080808;
  font-size: 32px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.frame {
  position: relative;
  padding: 5px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #0b0b0b;
  box-shadow:
    0 0 0 3px #ff5a00,
    0 22px 50px #000;
}
.frame:before,
.frame:after {
  content: "";
  position: absolute;
  background: var(--orange);
  z-index: 3;
}
.frame:before {
  width: 54px;
  height: 3px;
  top: -12px;
  left: 18px;
}
.frame:after {
  width: 3px;
  height: 54px;
  right: -12px;
  bottom: 18px;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(20, 1fr);
  aspect-ratio: 1/2;
  overflow: hidden;
  background: linear-gradient(145deg, #191919, #070707);
}
.cell {
  position: relative;
  border-right: 1px solid #ffffff0c;
  border-bottom: 1px solid #ffffff0c;
}
.cell:after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 2px;
  height: 2px;
  background: #ff5a003f;
}
.cell.block {
  margin: 1.5px;
  border: 1px solid color-mix(in srgb, var(--c) 68%, white);
  border-radius: 2px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--c) 72%, white),
    color-mix(in srgb, var(--c) 90%, black)
  );
  box-shadow:
    inset 0 0 0 1px #ffffff22,
    0 0 8px color-mix(in srgb, var(--c) 38%, transparent);
  transition:
    filter 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}
.cell.ghost {
  margin: 3px;
  border: 1px dashed #ff6a007d;
  background: #ff5a000a;
}
.cell.clear {
  animation: clear 0.34s forwards;
}
@keyframes clear {
  20% {
    background: #fff;
    box-shadow: 0 0 24px #ff7a00;
  }
  55% {
    filter: brightness(2.4);
  }
  to {
    opacity: 0;
    transform: scale(0.12) rotate(18deg);
  }
}
.debris {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.shard {
  position: absolute;
  width: 8px;
  height: 3px;
  background: var(--orange);
  box-shadow: 0 0 9px var(--orange2);
  animation: shatter 0.62s cubic-bezier(0.12, 0.7, 0.25, 1) forwards;
}
@keyframes shatter {
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.2);
  }
}
.side {
  position: relative;
  display: grid;
  gap: 34px;
  padding: 54px 12px 38px;
  min-height: 520px;
  align-content: center;
}
.side > *:not(.side-circuit) {
  position: relative;
  z-index: 2;
}
.side-circuit {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #111;
  stroke: var(--orange);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.preview {
  position: relative;
  display: grid;
  gap: 8px;
}
.preview label {
  color: #ddd;
}
.preview > div {
  height: 105px;
  display: grid;
  place-items: center;
  border: 1px solid #bcbcbc;
  border-radius: 8px;
  background: linear-gradient(145deg, #1c1c1c, #0b0b0b);
  box-shadow: inset 0 0 24px #000;
}
.mini {
  display: grid;
  gap: 2px;
}
.mini i {
  width: 22px;
  height: 22px;
}
.mini i.on {
  border: 1px solid color-mix(in srgb, var(--c) 70%, white);
  border-radius: 2px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--c) 70%, white),
    color-mix(in srgb, var(--c) 90%, black)
  );
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent);
}
.pause {
  border: 0;
  background: none;
  color: #eee;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  margin: 3px 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: left;
}
.pause b {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  font-size: 18px;
  color: var(--orange);
  transition: 0.2s;
}
.pause:hover b {
  background: var(--orange);
  color: #111;
  box-shadow: 0 0 24px #ff5a0055;
}
.keys {
  position: relative;
  padding: 14px 12px 14px 18px;
  border: 1px solid #555;
  border-left: 3px solid var(--orange);
  border-radius: 4px;
  background: #0b0b0b;
  font:
    10px/2.1 "Segoe UI",
    Arial;
  letter-spacing: 0.05em;
  color: #bbb;
}
.keys:after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--orange);
  transform: rotate(45deg);
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  text-align: center;
  background: #080808e8;
  backdrop-filter: blur(5px);
  animation: fade 0.25s;
}
.overlay:before {
  content: "";
  width: 56px;
  height: 3px;
  margin: 0 auto 18px;
  background: var(--orange);
}
.overlay small {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--orange);
}
.overlay h1 {
  font-size: 30px;
  font-weight: 300;
  margin: 10px 0 18px;
}
.overlay button {
  border: 1px solid var(--orange);
  border-radius: 4px;
  background: transparent;
  color: #eee;
  padding: 10px 20px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.13em;
}
.overlay button:hover {
  background: var(--orange);
  color: #111;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.circuit {
  position: absolute;
  z-index: 3;
  right: 4%;
  width: 22%;
  height: 55px;
  border-top: 1px solid var(--orange);
  border-right: 1px solid var(--orange);
  pointer-events: none;
}
.circuit:before,
.circuit:after,
.circuit i {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--orange);
  border-radius: 50%;
  background: #090909;
}
.circuit:before {
  left: -5px;
  top: -5px;
}
.circuit:after {
  right: -5px;
  bottom: -5px;
}
.circuit i:nth-child(1) {
  left: 28%;
  top: -5px;
}
.circuit i:nth-child(2) {
  right: -5px;
  top: 45%;
}
.circuit i:nth-child(3) {
  right: 35%;
  bottom: -5px;
}
.circuit-top {
  top: 8%;
}
.circuit-bottom {
  bottom: 8%;
  transform: scaleY(-1);
}
nav {
  display: none;
  position: relative;
  z-index: 4;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
nav button {
  width: 43px;
  height: 40px;
  border: 1px solid #777;
  border-radius: 4px;
  background: #111;
  color: #eee;
  font: 17px Arial;
  touch-action: manipulation;
}
nav button:active {
  border-color: var(--orange);
  color: var(--orange);
}
@media (max-width: 900px) {
  .shell {
    place-content: start center;
    padding: 72px 12px 14px;
  }
  .brand {
    top: 20px;
    left: 12px;
    width: 190px;
    padding: 11px 28px 11px 14px;
  }
  .layout {
    width: min(600px, 100%);
    min-height: 0;
    grid-template-columns: minmax(230px, 355px) 115px;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border-color: #777;
    border-top: 3px solid var(--orange);
    background: #121212;
  }
  .stats {
    grid-column: 1/-1;
    grid-row: 1;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0 0 8px;
    color: #fff;
  }
  .stats div {
    grid-template-columns: 28px 1fr;
    gap: 8px;
    min-height: 68px;
    padding: 9px 10px;
    border: 1px solid #d0d0d0;
    border-left: 3px solid var(--orange);
    border-radius: 5px;
    background: #fff;
  }
  .stats div:after {
    display: none;
  }
  .stats label {
    color: #222 !important;
  }
  .stats strong {
    font-size: 24px;
    color: #050505 !important;
    text-shadow: none;
  }
  .stat-icon {
    width: 26px;
    height: 26px;
  }
  .frame {
    grid-row: 2;
    grid-column: 1;
  }
  .side {
    grid-row: 2;
    grid-column: 2;
    align-self: start;
    gap: 18px;
    min-height: 300px;
    padding: 35px 5px 24px;
    color: #fff;
  }
  .preview > div {
    height: 78px;
  }
  .keys {
    display: none;
  }
  .pause {
    grid-template-columns: 40px 1fr;
    gap: 7px;
  }
  .pause b {
    width: 40px;
    height: 40px;
  }
  nav {
    display: flex;
  }
}
@media (max-width: 520px) {
  .shell {
    padding: 65px 7px 10px;
  }
  .layout {
    grid-template-columns: minmax(205px, 1fr) 80px;
    gap: 7px;
    padding: 9px;
  }
  .frame {
    max-height: calc(100svh - 180px);
    width: max-content;
  }
  .board {
    height: calc(100svh - 190px);
    width: calc((100svh - 190px) / 2);
  }
  .preview > div {
    height: 62px;
  }
  .mini {
    transform: scale(0.72);
  }
  .preview label {
    font-size: 8px;
  }
  .pause {
    display: block;
    text-align: center;
    font-size: 8px;
  }
  .pause b {
    width: 36px;
    height: 36px;
    margin: 0 auto 4px;
  }
  .stats {
    padding-left: 0;
  }
  .stats div {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 7px 4px;
  }
  .stat-icon {
    width: 22px;
    height: 22px;
  }
  .stats label {
    font-size: 8px;
  }
  .stats strong {
    font-size: 20px;
  }
  nav {
    margin-top: 7px;
  }
  nav button {
    width: 39px;
    height: 37px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
