/* ---------------------------------------------------------------------------
   Aubrey art: string art board, activity HUDs and banners.
   --------------------------------------------------------------------------- */

/* A dark nail board that fades in behind the particles during the string
   art scene. */
.aub-board {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.65) 100%),
    repeating-linear-gradient(92deg, rgba(255, 220, 170, 0.025) 0 2px, rgba(0, 0, 0, 0) 2px 9px, rgba(0, 0, 0, 0.18) 9px 11px, rgba(0, 0, 0, 0) 11px 23px),
    repeating-linear-gradient(88deg, rgba(120, 70, 30, 0.08) 0 40px, rgba(0, 0, 0, 0) 40px 97px),
    linear-gradient(180deg, #1b120c 0%, #120b07 50%, #0b0705 100%);
  box-shadow: inset 0 0 0 10px #2b1a0e, inset 0 0 0 13px #0a0604, inset 0 0 60px rgba(0, 0, 0, 0.8);
}

body.scene-stringart .aub-board { opacity: 1; }

body.theme-aubrey::before,
body.theme-aubrey::after { transition: opacity 1.2s ease; }

body.theme-aubrey.scene-stringart::before,
body.theme-aubrey.scene-stringart::after { opacity: 0; }

/* ---------------------------------------------------------------------------
   Activity HUD (bottom right)
   --------------------------------------------------------------------------- */
.aub-hud {
  position: fixed;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  min-width: 120px;
  max-width: calc(50vw - 16px);
  padding: 10px 14px 9px;
  border-radius: 18px;
  background: rgba(6, 42, 99, 0.72);
  border: 2px solid rgba(255, 224, 80, 0.75);
  box-shadow: 0 6px 18px rgba(0, 20, 60, 0.35);
  color: #fff7c2;
  font: 600 14px/1.25 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.aub-hud-title {
  font-family: 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: #ffd93b;
  text-shadow: 0 2px 0 rgba(120, 60, 0, 0.45);
  margin-bottom: 3px;
  white-space: nowrap;
}

.aub-hud-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}

.aub-hud-row b {
  font-family: 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  font-weight: 400;
  font-size: 17px;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.aub-hud-row.pop b { animation: aub-pop 0.35s ease-out; }

@keyframes aub-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); color: #ffd93b; }
  100% { transform: scale(1); }
}

.aub-meter {
  margin-top: 6px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 240, 160, 0.7);
  overflow: hidden;
}

.aub-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe45c, #ffb31a 60%, #ff5a36);
  transition: width 0.12s ease-out;
}

/* ---------------------------------------------------------------------------
   Toasts and end-of-round banner (centre)
   --------------------------------------------------------------------------- */
.aub-toast {
  position: fixed;
  left: 50%;
  /* Below the dock's top HUD pill (.px-top) on every screen size. */
  top: max(30%, 150px);
  z-index: 4;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px 8px;
  border-radius: 999px;
  background: rgba(6, 42, 99, 0.7);
  border: 2px solid rgba(255, 224, 80, 0.7);
  color: #fff7c2;
  font: 400 clamp(16px, 4.6vw, 24px)/1.15 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.aub-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.aub-banner {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 26px;
  background: radial-gradient(120% 100% at 50% 0%, #2a9be0 0%, #115ab0 55%, #0a3f7d 100%);
  border: 3px solid #ffd93b;
  box-shadow: 0 14px 40px rgba(0, 20, 60, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  color: #fff7c2;
  text-align: center;
  font: 600 15px/1.35 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.aub-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.aub-banner h2 {
  margin: 0 0 6px;
  font: 400 clamp(24px, 7vw, 34px)/1.05 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  letter-spacing: 0.03em;
  color: #ffd93b;
  text-shadow: 0 3px 0 rgba(120, 60, 0, 0.5);
}

.aub-banner p { margin: 0 0 12px; }

.aub-banner button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px 9px;
  background: #ffd93b;
  color: #062a63;
  font: 400 18px/1 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 0 #c78f00;
  transition: transform 0.15s ease;
}

.aub-banner button:hover,
.aub-banner button:focus-visible { transform: translateY(-2px); outline: 2px solid #fff; outline-offset: 2px; }
.aub-banner button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c78f00; }

@media (max-width: 480px) {
  .aub-hud {
    /* Clears the caption + next button stack (caption top sits ~138px up). */
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
    padding: 7px 10px 6px;
    min-width: 100px;
    font-size: 12px;
  }
  .aub-hud-title { font-size: 13px; }
  .aub-hud-row b { font-size: 14px; }
}

@media (max-height: 440px) {
  .aub-hud { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); padding: 6px 10px 5px; }
  .aub-toast { top: max(22%, 128px); }
}

@media (prefers-reduced-motion: reduce) {
  .aub-board, .aub-toast, .aub-banner, .aub-meter i { transition: none; }
  .aub-hud-row.pop b { animation: none; }
  .aub-banner, .aub-banner.show { transform: translate(-50%, -50%); }
}
