* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #221712;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #332219 0%, #1c130f 100%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

#office3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#office3d-canvas:active {
  cursor: grabbing;
}

#office3d-canvas[hidden],
#game-canvas[hidden],
.office3d-presets[hidden] {
  display: none !important;
}

.office3d-presets {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(40, 32, 26, 0.88);
  border: 2px solid #1a100a;
  box-shadow:
    inset 2px 2px 0 #6b4933,
    inset -2px -2px 0 #24160f,
    0 4px 0 rgba(14, 8, 5, 0.48);
  border-radius: 5px;
  z-index: 22;
}

/* 11-Style Icon-Only Wooden Pixel Dock (top-left) */
.style-dock {
  position: fixed;
  top: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  max-width: calc(100vw - 170px);
  background: rgba(45, 29, 20, 0.90);
  border: 2px solid #1a100a;
  box-shadow:
    inset 2px 2px 0 #6b4933,
    inset -2px -2px 0 #261710,
    0 4px 0 rgba(14, 8, 5, 0.52);
  border-radius: 4px;
  z-index: 22;
}

.style-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #3a261b;
  border: 2px solid #1c110b;
  box-shadow:
    inset 1px 1px 0 #634430,
    inset -1px -1px 0 #24160f;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s ease, filter 0.1s ease, border-color 0.12s ease;
}

.style-btn:hover {
  filter: brightness(1.18);
  transform: translateY(-1px);
}

.style-btn:active {
  transform: translateY(1px);
}

.style-btn.active {
  background: #5e3e27;
  border-color: #ffe28a;
  box-shadow:
    inset 1px 1px 0 #9e6f49,
    0 0 0 1px #1e120c,
    0 0 8px rgba(255, 218, 114, 0.55);
}

.controls {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #3d281d;
  border: 2px solid #1e120c;
  box-shadow:
    inset 2px 2px 0 #6b4933,
    inset -2px -2px 0 #2a1a12,
    0 3px 0 rgba(18, 10, 6, 0.55);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s ease, filter 0.1s ease;
}

.ctrl-btn:hover {
  filter: brightness(1.12);
}

.ctrl-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 #2a1a12,
    inset -2px -2px 0 #6b4933;
}

.ctrl-btn.active {
  background: #5c3a25;
  box-shadow:
    inset 2px 2px 0 #8d6041,
    inset -2px -2px 0 #3a2316,
    0 3px 0 rgba(18, 10, 6, 0.55);
}

.ctrl-mst-hq {
  background: #1b2c35;
  border-color: #4dd0b8;
  text-decoration: none;
  box-shadow:
    inset 1px 1px 0 #2b534d,
    0 3px 0 rgba(12, 18, 26, 0.6),
    0 0 10px rgba(108, 230, 255, 0.35);
}

.ctrl-mst-club {
  background: #5a3420;
  border-color: #ffe47a;
  text-decoration: none;
  box-shadow:
    inset 1px 1px 0 #ce4826,
    0 3px 0 rgba(30, 16, 8, 0.6),
    0 0 10px rgba(255, 224, 122, 0.35);
}

.hint-pad {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 15;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.8s ease;
  filter: drop-shadow(0 3px 0 rgba(20, 12, 8, 0.5));
}

.hint-pad.faded {
  opacity: 0.18;
}
