:root {
  color-scheme: dark;
  --ink: #f7f4ec;
  --muted: #c7c9c4;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(19, 22, 24, 0.74);
  --accent: #d6b15d;
  --accent-2: #60b6c7;
  --danger: #c97962;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #101315;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-height: 42px;
}

button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: 100vh;
  min-height: 540px;
}

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

#scene {
  display: block;
  height: 100%;
  width: 100%;
  touch-action: none;
}

.hud {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  left: 20px;
  pointer-events: none;
  position: absolute;
  right: 20px;
  top: 18px;
}

.brand,
.status,
.controls,
.panel {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.brand {
  border-radius: 8px;
  min-width: 190px;
  padding: 12px 14px;
}

.brand span {
  color: var(--accent);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.status {
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  max-width: 280px;
  padding: 12px 14px;
  text-align: left;
}

.controls {
  align-items: center;
  border-radius: 8px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  left: 20px;
  padding: 10px;
  position: absolute;
}

.controls button:not(.swatch) {
  padding: 0 14px;
}

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

.swatch {
  border-radius: 999px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(214, 177, 93, 0.35);
}

.stone {
  background: linear-gradient(135deg, #8c8a80, #d5d0bd);
}

.wood {
  background: linear-gradient(135deg, #6b3e24, #c99152);
}

.glass {
  background: linear-gradient(135deg, #5dbdd0, #e9fbff);
}

.panel {
  align-content: center;
  border-radius: 0;
  border-width: 0 1px 0 0;
  display: grid;
  padding: 36px 28px;
}

.panel h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  margin: 0 0 18px;
}

.panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 28px;
}

.panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.panel dl div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.panel dt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.panel dd {
  color: var(--ink);
  margin: 0;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(66vh, 1fr) auto;
    height: auto;
    min-height: 100vh;
  }

  .stage {
    min-height: 66vh;
  }

  .panel {
    border-width: 1px 0 0;
    padding: 24px 20px 32px;
  }

  .hud {
    flex-direction: column;
    gap: 10px;
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .brand,
  .status {
    max-width: none;
    width: 100%;
  }

  .controls {
    bottom: 12px;
    flex-wrap: wrap;
    left: 12px;
    right: 12px;
  }
}
