* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0e2432;
  color: #eff5e8;
  font-family: system-ui, sans-serif;
}
body {
  display: grid;
  place-items: center;
  background: radial-gradient(
    ellipse at 50% 32%,
    #264a55 0%,
    #142e3c 48%,
    #081a28 100%
  );
}
#GameDiv {
  position: relative;
  width: min(100vw, 56.25dvh);
  height: min(100dvh, 177.777vw);
  overflow: hidden;
  background: #82c2d7;
  box-shadow: 0 25px 120px #010c1760;
  border-radius: 14px;
}
#Cocos3dGameContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#GameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
#loading {
  position: absolute;
  inset: 0;
  background: #122d3c url('./art/arena/garden-two-lanes-v1.png') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-direction: column;
  font-size: 14px;
  z-index: 5;
  transition: opacity .45s ease;
}
#loading.opening-complete { opacity: 0; pointer-events: none; }
.opening-logo {
  width: 87%;
  height: auto;
  animation: opening-reveal .8s ease-out both;
  filter: drop-shadow(0 8px 12px #001b3866);
}
.opening-status {
  position: absolute;
  bottom: 9%;
  padding: 9px 16px;
  border-radius: 18px;
  background: #08283dd9;
}
@keyframes opening-reveal {
  from { opacity: 0; transform: scale(.84) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .opening-logo { animation: none; }
  #loading { transition: none; }
}
#loading[hidden] {
  display: none;
}
#loading strong {
  font-size: 25px;
  letter-spacing: 2px;
}
.crystal {
  font-size: 54px;
  color: #82e7f4;
  animation: pulse 1.2s ease-in-out infinite;
}
.error {
  padding: 40px;
  text-align: center;
}
@keyframes pulse {
  50% {
    transform: translateY(-8px);
    opacity: 0.6;
  }
}
@media (max-width: 600px) {
  #GameDiv {
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .crystal {
    animation: none;
  }
}

.showcase-mode {
  background: #0a1b27;
}
.showcase-mode #GameDiv {
  background: #112a38;
  border: 1px solid #284353;
}
.art-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.art-heading {
  position: absolute;
  inset: 0 0 auto;
  padding: 7% 7% 12%;
  background: linear-gradient(#112a38 72%, transparent);
}
.art-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e0c58e;
  font-size: clamp(8px, 2.5vw, 11px);
  letter-spacing: 1.5px;
  font-weight: 750;
}
.art-eyebrow > span:last-child {
  margin-left: auto;
  padding: 5px 7px;
  border: 1px solid #b69b6755;
  border-radius: 4px;
  font-size: 0.85em;
}
.art-mark {
  color: #70e6ff;
  font-size: 17px;
}
.art-heading h1 {
  margin: 18px 0 5px;
  color: #f3eedf;
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: clamp(24px, 7vw, 36px);
  letter-spacing: -0.7px;
}
.art-heading p {
  margin: 0;
  font-size: clamp(10px, 3vw, 13px);
  color: #9caeb8;
}
.art-footer {
  position: absolute;
  inset: auto 0 0;
  padding: 9% 7% 5%;
  background: linear-gradient(transparent, #112a38 21%);
}
.art-caption {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  color: #91a8b4;
  font-size: clamp(7px, 2.1vw, 9px);
  letter-spacing: 1px;
}
.art-caption > span:last-child {
  color: #d3bb87;
}
.art-controls {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr;
  gap: 6px;
  pointer-events: auto;
}
.art-controls button {
  appearance: none;
  min-height: 36px;
  padding: 4px;
  color: #d4e1e5;
  background: #1a3647;
  border: 1px solid #3a5363;
  border-radius: 7px;
  font:
    500 17px system-ui,
    sans-serif;
  cursor: pointer;
}
.art-controls [data-art="motion"] {
  font-size: 12px;
}
.art-controls button:hover {
  background: #29495c;
  border-color: #9db9c3;
}
.art-controls button:focus-visible,
.art-play:focus-visible,
.art-entry:focus-visible {
  outline: 2px solid #93f1fc;
  outline-offset: 3px;
}
.art-play {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  margin-top: 12px;
  padding: 12px 15px;
  border: 1px solid #ccb174;
  border-radius: 7px;
  color: #172d3a;
  background: #dcc38c;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.art-play:hover {
  background: #ecd6a2;
}
.art-note {
  margin: 10px 0 0;
  text-align: center;
  color: #8199a8;
  font-size: 9px;
  line-height: 1.5;
}
.art-entry {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 7px 12px;
  border: 1px solid #8cadb344;
  border-radius: 20px;
  background: #0e2532e8;
  color: #c5ddd9;
  font-size: 10px;
  text-decoration: none;
  z-index: 6;
}
@media (max-height: 640px) {
  .art-entry {
    bottom: 2px;
    padding: 3px 8px;
    font-size: 8px;
  }
}
