:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Noto Sans JP", sans-serif;
  background: transparent;
}

#app {
  width: min(100vw, 940px);
  margin: 0 auto;
  padding: 12px;
}

body.zoom-mode #app {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}

header h1 {
  margin: 0;
  font-size: 24px;
}

header p {
  margin: 4px 0 12px;
}

#layerErrors {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(200, 32, 32, 0.88);
  color: #fff;
  max-width: min(92vw, 560px);
}

#layerErrors strong {
  display: block;
  margin-bottom: 6px;
}

#layerErrorList {
  margin: 0;
  padding-left: 16px;
  max-height: 140px;
  overflow: auto;
  font-size: 12px;
}

#layerErrorList li {
  margin-bottom: 4px;
  line-height: 1.35;
}

#controls,
#hostPanel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  min-width: 140px;
}

input,
select,
button {
  font-size: 14px;
  padding: 8px;
}

.hidden {
  display: none !important;
}

#game {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 2px solid #202020;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(2px);
}

body.zoom-mode #game {
  display: none;
}

body.zoom-mode #controls,
body.zoom-mode #hostPanel {
  display: none;
}

body.zoom-mode header {
  display: none !important;
}

body.zoom-mode #mobileControls {
  display: none !important;
}

body.zoom-mode #game {
  display: none !important;
}

body.immersive-surface #app {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}

body.immersive-surface header,
body.immersive-surface #controls,
body.immersive-surface #hostPanel,
body.immersive-surface #game,
body.immersive-surface #mobileControls {
  display: none !important;
}

#mobileControls {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  justify-content: center;
  gap: 24px;
}

#mobileControls button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 900px) {
  #mobileControls {
    display: flex;
  }
}
