:root {
  --bg: #041019;
  --bg2: #10233d;
  --panel: rgba(5, 12, 24, 0.72);
  --panel-strong: rgba(4, 8, 18, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #9bb2cf;
  --accent: #7ef0ff;
  --accent-2: #ffd166;
  --danger: #ff7b72;
  --landing-bg: url("/assets/landing01.webp");
  --game-bg: url("/assets/game.webp");
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: auto;
  font-family: "Chakra Petch", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(3, 14, 26, 0.68), rgba(5, 13, 26, 0.9)),
    var(--landing-bg),
    radial-gradient(circle at 20% 10%, rgba(72, 163, 255, 0.22), transparent 26%),
    radial-gradient(circle at 80% 14%, rgba(255, 209, 102, 0.16), transparent 20%),
    linear-gradient(180deg, #081423 0%, #0a1730 44%, #06101c 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.game-started {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 8, 18, 0.48), rgba(5, 12, 24, 0.78)),
    var(--game-bg),
    radial-gradient(circle at 20% 10%, rgba(72, 163, 255, 0.22), transparent 26%),
    radial-gradient(circle at 80% 14%, rgba(255, 209, 102, 0.16), transparent 20%),
    linear-gradient(180deg, #081423 0%, #0a1730 44%, #06101c 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
}

.app-shell {
  position: relative;
  width: 1920px;
  height: 1080px;
  margin: 0 auto;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 420ms ease, transform 420ms ease;
}

body.game-started .app-shell {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.landing-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 28px;
  transition: opacity 380ms ease, transform 380ms ease;
}

.landing-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(2, 8, 18, 0.32), rgba(2, 8, 18, 0.82)),
    radial-gradient(circle at 16% 0%, rgba(126, 240, 255, 0.35), transparent 25%),
    radial-gradient(circle at 84% 12%, rgba(255, 209, 102, 0.24), transparent 24%);
}

.landing-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
  text-align: center;
  padding: 44px 48px;
  border-radius: 34px;
  background: rgba(3, 10, 22, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.landing-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
  font-size: 17px;
}

.landing-title {
  margin: 10px 0 0;
  font-family: "Bungee", sans-serif;
  font-size: 68px;
  line-height: 0.98;
}

.landing-copy {
  margin: 22px auto 0;
  max-width: 760px;
  font-size: 27px;
  line-height: 1.25;
}

.landing-copy strong {
  color: var(--accent-2);
}

.start-button {
  margin-top: 30px;
  min-width: 220px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  font-family: "Bungee", sans-serif;
  font-size: 30px;
  letter-spacing: 0.04em;
  color: #041019;
  background: linear-gradient(135deg, #7ef0ff, #ffd166);
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.38);
}

.topbar {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 22px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  z-index: 3;
}

.game-logo {
  position: absolute;
  right: 32px;
  top: 18px;
  width: 220px;
  height: auto;
  z-index: 4;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.eyebrow,
.title,
.sidebar-label,
.sidebar-copy,
.sidebar-metric {
  margin: 0;
}

.eyebrow {
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  margin-top: 6px;
  font-family: "Bungee", sans-serif;
  font-size: 54px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.status-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-right: 238px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-size: 18px;
  font-weight: 600;
}

.pill strong {
  margin-left: 6px;
  color: var(--accent-2);
}

.pill-accent {
  color: var(--accent);
}

.action-pill {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #7ef0ff, #ffd166);
  color: #051019;
  font-family: "Chakra Petch", sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.game-stage {
  position: absolute;
  inset: 132px 380px 28px 28px;
  border-radius: 38px;
  background:
    radial-gradient(circle at 50% 0%, rgba(126, 240, 255, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(14, 32, 54, 0.92), rgba(5, 12, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 22px 46px rgba(0,0,0,0.28);
  overflow: hidden;
  touch-action: none;
}

.ceiling {
  position: absolute;
  left: 560px;
  top: 98px;
  width: 770px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126,240,255,0.32), rgba(255,255,255,0.08), rgba(255,209,102,0.3));
  box-shadow: 0 0 18px rgba(126, 240, 255, 0.24);
}

.board-layer,
.shots-layer {
  position: absolute;
  inset: 0;
}

.bubble,
.flying-bubble {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: none;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.bubble::after,
.flying-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 24%, rgba(255,255,255,0.38), transparent 34%);
  pointer-events: none;
}

.bubble-inner,
.flying-bubble-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #041019;
  font-size: 18px;
  font-weight: 700;
  background: var(--bubble-color, #7ef0ff);
}

.bubble-inner img,
.flying-bubble-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.7; /* Rendi la foto profilo parzialmente trasparente */
}

.bubble-color-only {
  width: 100%;
  height: 100%;
  display: block;
}

.bubble-neutral {
  opacity: 0.92;
}

.bubble-exploding {
  animation: bubbleExplode 180ms ease-out forwards;
}

@keyframes bubbleExplode {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: saturate(1);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.26);
    opacity: 0.88;
    filter: saturate(1.35) brightness(1.15);
  }
  100% {
    transform: translate(-50%, -50%) scale(0.24);
    opacity: 0;
    filter: saturate(1.55) brightness(1.24);
  }
}

.aim-guide {
  position: absolute;
  left: 960px;
  top: 972px;
  width: 8px;
  height: 350px;
  transform-origin: center bottom;
  transform: translate(-50%, -100%) rotate(-90deg);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(110, 251, 255, 0.95), rgba(110, 251, 255, 0.02));
  opacity: 0.82;
  filter: drop-shadow(0 0 8px rgba(126, 240, 255, 0.45));
  transition: transform 70ms linear;
}

.cannon {
  position: absolute;
  left: 960px;
  top: 972px;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
}

.cannon-barrel {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 56px;
  height: 168px;
  border-radius: 24px;
  transform: translate(-50%, 40%) rotate(0deg);
  transform-origin: center 120px;
  background:
    linear-gradient(90deg, rgba(110, 251, 255, 0.8), rgba(110, 251, 255, 0) 36%),
    linear-gradient(180deg, #79d9ff 0%, #2d5f91 30%, #123256 75%, #0a223d 100%);
  box-shadow:
    inset 0 0 0 2px rgba(178, 241, 255, 0.42),
    inset 0 -14px 24px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(126, 240, 255, 0.32);
  transition: transform 70ms linear;
}

.cannon-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7ef0ff, #275173 70%, #0c2035 100%);
  box-shadow:
    0 0 0 8px rgba(255,255,255,0.08),
    0 0 24px rgba(126, 240, 255, 0.35),
    0 18px 24px rgba(0,0,0,0.25);
}

.next-shot-preview {
  position: absolute;
  left: 1056px;
  top: 972px;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--next-shot-color, #7ef0ff);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(126, 240, 255, 0.34);
}

.next-shot-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.5), transparent 34%);
  pointer-events: none;
}

.sidebar {
  position: absolute;
  top: 148px;
  right: 28px;
  width: 324px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 3;
}

.sidebar-card {
  padding: 18px 18px 20px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.sidebar-card.hidden {
  display: none;
}

.sidebar-label {
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-copy {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.22;
}

.sidebar-metric {
  margin-top: 12px;
  font-family: "Bungee", sans-serif;
  font-size: 62px;
  line-height: 1;
  color: var(--accent-2);
}

.action-button,
.debug-input {
  width: 100%;
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  font: inherit;
}

.action-button {
  padding: 14px 16px;
  background: linear-gradient(135deg, #7ef0ff, #8c9cff);
  color: #051019;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.debug-input {
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 18px;
}

.shot-badge {
  position: absolute;
  left: 32px;
  bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  font-size: 18px;
  z-index: 3;
}
