/* Màn hình đang tải của Aqualator (#boot trong index.html, điều khiển bởi src/boot.ts).
   Nạp trước bundle game nên giữ nhỏ, không phụ thuộc styles.css. Hình vẽ sinh từ tools/brand. */

.aq-boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  background: #3cb6e6;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.aq-boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* Cảnh thuỷ sinh phủ kín, giữ đáy bể khi màn hình hẹp (scene.svg tự đung đưa cây) */
.aq-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

.aq-center {
  position: absolute;
  inset: 0 0 16vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 16px;
  text-align: center;
}
.aq-lockup { display: flex; align-items: center; justify-content: center; }
.aq-fish {
  width: clamp(120px, 17vw, 250px);
  height: auto;
  margin-right: -1.5vw;
  transform-origin: 50% 60%;
  /* Chỉ biến đổi transform: trình duyệt ghép lớp trên GPU, không vẽ lại khi game đang nạp */
  will-change: transform;
  animation: aq-swim 2.6s ease-in-out infinite;
}
@keyframes aq-swim {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-12px) rotate(-3deg); }
}
.aq-wordmark { width: clamp(280px, 46vw, 680px); height: auto; }

@media (max-width: 640px), (max-aspect-ratio: 4/5) {
  .aq-lockup { flex-direction: column; }
  .aq-fish { margin: 0 0 -10px; width: clamp(110px, 34vw, 200px); }
  .aq-wordmark { width: min(88vw, 520px); }
}

.aq-bar {
  position: relative;
  width: min(420px, 78vw);
  height: 24px;
  margin-top: 8px;
  border-radius: 999px;
  background: #0e2a52;
  box-shadow: 0 0 0 4px #fff, 0 6px 0 4px #0e2a52;
  overflow: hidden;
}
.aq-fill {
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 6%;
  max-width: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(180deg, #b9fbff, #36c9f0 50%, #1a8fd6);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55);
  transition: width 0.35s ease;
}

.aq-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 2px 0 0;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  text-shadow: 0 2px 0 #0e2a52, 0 0 8px rgba(14, 42, 82, 0.55);
}
.aq-tip img { width: 32px; height: 32px; }

@media (prefers-reduced-motion: reduce) {
  .aq-fish { animation: none; }
}

/* Màn hình báo lỗi (src/ErrorBoundary.tsx): game hỏng hẳn, bể 3D lỗi, hoặc không có WebGL */
.aq-problem {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #3cb6e6;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
}
.stage .aq-problem { position: absolute; z-index: 0; }
.aq-problem-card {
  position: relative;
  max-width: 440px;
  padding: 20px 24px 22px;
  border: 4px solid #13284d;
  border-radius: 22px;
  background: #fff8ec;
  box-shadow: 0 6px 0 #13284d;
  text-align: center;
  color: #13284d;
}
.aq-problem-card img { margin-top: -64px; }
.aq-problem-card h1 { margin: 4px 0 6px; font-size: 24px; line-height: 1.15; }
.aq-problem-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.4; color: #3d4766; }
.aq-problem-card code {
  display: block;
  margin: 0 0 14px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f0e6d4;
  font-size: 12px;
  color: #6b5b45;
  overflow-wrap: anywhere;
}
.aq-problem-card button {
  padding: 8px 26px;
  border: 3px solid #13284d;
  border-radius: 999px;
  background: #2ec4b6;
  box-shadow: 0 4px 0 #13284d;
  font: 800 18px 'Baloo 2', system-ui, sans-serif;
  color: #fff;
  cursor: pointer;
}
.aq-problem-card button:active { transform: translateY(3px); box-shadow: 0 1px 0 #13284d; }
