* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
}

/* ================= Splash Screen ================= */
.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.splash-logo {
  width: 130px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  animation: splashPop 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splashPop {
  0% { transform: scale(0.6) translateY(20px); opacity: 0; }
  60% { transform: scale(1.08) translateY(-6px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.splash-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.8s ease 0.2s forwards;
  opacity: 0;
}

.splash-loader {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.splash-loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffd32a, #2ed573);
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.8);
}

.splash-text {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ================= Main Game Container ================= */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6eff82;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ================= Single Floating Menu Button (Bottom Right) ================= */
.floating-menu-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.floating-menu-btn:active {
  transform: scale(0.92);
}

.menu-icon {
  font-size: 16px;
}

.menu-streak {
  font-size: 15px;
  font-weight: 900;
  color: #ffd32a;
}

.menu-gear {
  font-size: 13px;
  opacity: 0.8;
  margin-left: 2px;
}

/* ================= Footer Credit (Bottom Left) ================= */
.game-footer-credit {
  position: absolute;
  bottom: 14px;
  left: 12px;
  text-align: left;
  pointer-events: none;
  z-index: 10;
}

.game-footer-credit span {
  font-size: 9.5px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.45);
  padding: 3px 8px;
  border-radius: 8px;
  backdrop-filter: blur(2px);
}

/* ================= Prompt Banner ================= */
.prompt-banner {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #ffd32a;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  border: 2px solid #ffd32a;
  transition: opacity 0.2s ease;
}

.prompt-banner small {
  font-size: 12px;
  color: #fff;
  font-weight: normal;
}

.prompt-banner.hidden {
  opacity: 0;
}

/* ================= Result Banner ================= */
.result-banner {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-banner.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
}

.result-text {
  font-size: 40px;
  font-weight: 900;
  padding: 6px 20px;
  border-radius: 16px;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
  border: 3px solid #fff;
}

.result-text.goal {
  background: #2ed573;
  box-shadow: 0 8px 24px rgba(46, 213, 115, 0.6);
}

.result-text.post {
  background: #54a0ff;
  box-shadow: 0 8px 24px rgba(84, 160, 255, 0.6);
}

.result-text.miss {
  background: #ff4757;
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.6);
}

.result-text.block {
  background: #ffa502;
  box-shadow: 0 8px 24px rgba(255, 165, 2, 0.6);
}

.result-sub {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.8);
  padding: 4px 12px;
  border-radius: 10px;
}

/* ================= OpenSea NFT Pop-art Card Reveal Overlay ================= */
.nft-snap-card-overlay {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nft-snap-card-overlay.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.0);
}

.nft-card {
  background: #ffffff;
  border: 3px solid #1a1a2e;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 10px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.nft-card-badge {
  background: linear-gradient(135deg, #2ed573, #ffd32a);
  color: #1a1a2e;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 16px;
  border: 2px solid #1a1a2e;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  box-shadow: 2px 2px 0px #1a1a2e;
  text-transform: uppercase;
}

.nft-card-img {
  width: 176px;
  height: 176px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px 225px 15px 255px / 255px 15px 225px 18px;
  border: 2.5px solid #1a1a2e;
  background: #f0f0f5;
  box-shadow: 2px 2px 0px #1a1a2e;
}

/* ================= Menu Modal Popup ================= */
.menu-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.menu-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.menu-card {
  position: relative;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 24px 20px;
  width: 88%;
  max-width: 320px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 2;
  animation: menuPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes menuPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.menu-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.menu-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.menu-title {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}

.close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:active {
  transform: scale(0.9);
}

.menu-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.stat-value.gold {
  color: #ffd32a;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-action-btn:active {
  transform: scale(0.96);
}

.modal-action-btn.danger {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.4);
  color: #ff6b81;
}

.modal-action-btn.danger:hover {
  background: rgba(255, 71, 87, 0.3);
}

.modal-credit-footer {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.modal-credit-footer p {
  font-size: 11px;
  color: #94a3b8;
}

.modal-credit-footer strong {
  color: #fff;
}
