* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a1a;
  font-family: 'Courier New', monospace;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
}

#hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  color: #e74c3c;
  text-shadow: 0 0 6px rgba(231,76,60,0.5);
}

#hud-bottom-center {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 400px;
}

.bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bar-label {
  color: #ecf0f1;
  font-size: 14px;
  font-weight: bold;
  width: 24px;
  text-shadow: 1px 1px 2px #000;
}

.bar-bg {
  width: 180px;
  height: 14px;
  background: #2c3e50;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #3e5060;
}

.bar-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.bar-fill.hp { background: #2ecc71; }
.bar-fill.en { background: #3498db; }
.bar-fill.boss { background: #e74c3c; }

.boss-bar .bar-bg {
  width: 360px;
  height: 18px;
}

.bar-text {
  color: #ecf0f1;
  font-size: 12px;
  text-shadow: 1px 1px 2px #000;
}

#weapon-name {
  color: #f39c12;
  font-size: 13px;
  margin-top: 4px;
  text-shadow: 1px 1px 2px #000;
}

#boss-name {
  color: #e74c3c;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
  text-shadow: 0 0 8px rgba(231,76,60,0.4);
}

/* Controls Panel */
#controls-panel {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: rgba(13, 13, 43, 0.85);
  border: 1px solid #3e5060;
  border-radius: 4px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #bdc3c7;
  z-index: 20;
  pointer-events: none;
  min-width: 220px;
  box-shadow: 0 0 16px rgba(108,92,231,0.2);
}

#controls-panel.hidden { display: none; }

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #3e5060;
  color: #f39c12;
  font-weight: bold;
  letter-spacing: 1px;
}

.controls-hint { color: #7f8c8d; font-weight: normal; font-size: 10px; }
.controls-table { border-collapse: collapse; width: 100%; }
.controls-table td { padding: 2px 4px; vertical-align: middle; }
.controls-table td:first-child { white-space: nowrap; color: #ecf0f1; }

.hop {
  color: #f1c40f;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(241,196,15,0.5);
}

kbd {
  background: #2c3e50;
  border: 1px solid #546778;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #ecf0f1;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  display: inline-block;
  min-width: 14px;
  text-align: center;
}

/* Intro / Title Screen */
#intro-screen {
  position: fixed;
  inset: 0;
  background-color: #0a0a1a;
  background-image:
    linear-gradient(to bottom, rgba(10,10,26,0.35) 0%, rgba(10,10,26,0.75) 100%),
    url('sprites/ui/splashstart.png');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  animation: introFadeIn 0.8s ease-out;
}

#intro-title-img {
  max-width: 86%;
  width: 440px;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.6)) drop-shadow(0 0 18px rgba(46,204,113,0.45));
  margin-bottom: 4px;
  animation: titleBob 2.5s ease-in-out infinite;
}

#intro-screen.closing {
  animation: introFadeOut 0.5s ease-in forwards;
}

/* Big pixel-art title anchored top-left over the hero banner */
#intro-title {
  position: absolute;
  top: 28px;
  left: 36px;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  image-rendering: pixelated;
  z-index: 5;
  animation: titleBob 2.5s ease-in-out infinite;
  pointer-events: none;
}
#intro-title .it-line1 {
  font-size: 52px;
  letter-spacing: 4px;
  color: #2ecc71;
  text-shadow:
    0 0 20px rgba(46,204,113,0.8),
    0 0 38px rgba(46,204,113,0.5),
    4px 4px 0 #0a0a1a,
    6px 6px 0 rgba(0,0,0,0.55);
  line-height: 1;
}
#intro-title .it-line2 {
  font-size: 26px;
  letter-spacing: 6px;
  color: #f1c40f;
  margin-top: 6px;
  text-shadow:
    0 0 12px rgba(241,196,15,0.8),
    3px 3px 0 #0a0a1a;
}

@keyframes introFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes introFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.05); pointer-events: none; }
}

#intro-content { text-align: center; max-width: 600px; padding: 40px; }

#intro-title {
  font-size: 56px;
  font-weight: bold;
  color: #2ecc71;
  letter-spacing: 4px;
  text-shadow: 0 0 12px rgba(46,204,113,0.6), 0 4px 0 #0a5a2a, 0 6px 0 rgba(0,0,0,0.4);
  margin-bottom: 4px;
  animation: titleBob 2.5s ease-in-out infinite;
}

@keyframes titleBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

#intro-subtitle {
  font-size: 20px;
  color: #f39c12;
  font-style: italic;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(243,156,18,0.4);
  margin-bottom: 20px;
}

#intro-hero {
  /* reset button defaults */
  appearance: none;
  -webkit-appearance: none;
  border: none;
  padding: 0;
  outline: none;
  background-color: transparent;

  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
  background-image: url('sprites/player/frogsworth.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 24px rgba(46,204,113,0.55));
  animation: heroFloat 2s ease-in-out infinite;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  display: block;
  position: relative;
  z-index: 2;
}
#intro-hero:hover {
  filter: drop-shadow(0 0 32px rgba(46,204,113,0.9));
}
#intro-hero:active {
  transform: scale(0.94);
}
/* Wander mode: applied by JS after idle timeout — overrides static centering */
#intro-hero.wander {
  position: fixed;
  margin: 0;
  animation: heroFloat 2s ease-in-out infinite;
  transition: left 4.5s cubic-bezier(.4,0,.4,1), top 4.5s cubic-bezier(.4,0,.4,1);
  z-index: 210;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}

#intro-tagline {
  color: #bdc3c7;
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 28px;
  font-style: italic;
}

#intro-controls {
  display: inline-block;
  text-align: left;
  background: rgba(13,13,43,0.6);
  border: 1px solid #3e5060;
  border-radius: 4px;
  padding: 14px 22px;
  margin-bottom: 24px;
}

.intro-ctrl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ecf0f1;
  margin: 4px 0;
}

.intro-ctrl-row span { color: #bdc3c7; }

#intro-start {
  font-size: 16px;
  color: #f1c40f;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(241,196,15,0.5);
  animation: startBlink 1s ease-in-out infinite;
}

@keyframes startBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Info link on title screen */
.intro-info-link {
  display: inline-block;
  margin-top: 18px;
  color: #6c5ce7;
  font-size: 13px;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 1px dotted rgba(108,92,231,0.6);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.intro-info-link:hover {
  color: #a29bfe;
  border-bottom-color: #a29bfe;
}

/* Info / Story modal */
#info-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: introFadeIn 0.25s ease-out;
}
#info-modal.hidden { display: none; }

.info-card {
  position: relative;
  max-width: 640px;
  width: 100%;
  /* no max-height — the modal itself scrolls, so content is never cut */
  background: linear-gradient(180deg, #141432 0%, #0c0c22 100%);
  border: 1px solid #3e5060;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(108,92,231,0.25);
  padding: 28px 32px 28px;
  margin: auto 0;
  font-family: 'Courier New', monospace;
  color: #ecf0f1;
}

#info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 1px solid #3e5060;
  border-radius: 4px;
  color: #bdc3c7;
  font-size: 14px;
  width: 28px;
  height: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#info-close:hover { color: #fff; border-color: #6c5ce7; }

.info-title {
  color: #2ecc71;
  letter-spacing: 3px;
  font-size: 22px;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(46,204,113,0.4);
}

.info-section {
  color: #f39c12;
  letter-spacing: 2px;
  font-size: 14px;
  margin: 18px 0 8px;
  text-shadow: 0 0 6px rgba(243,156,18,0.3);
}

.info-body {
  font-size: 13px;
  line-height: 1.6;
  color: #bdc3c7;
  margin-bottom: 10px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.info-list li {
  font-size: 12px;
  line-height: 1.55;
  color: #bdc3c7;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(62,80,96,0.4);
}
.info-list.compact li { padding: 3px 0; border: none; }
.info-list b { color: #ecf0f1; }

.info-splash {
  width: 100%;
  height: 140px;
  margin: 12px 0 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
  border: 1px solid #3e5060;
  image-rendering: pixelated;
}

.info-foot {
  margin-top: 18px;
  font-size: 11px;
  color: #7f8c8d;
  text-align: center;
}

.em.green { color: #2ecc71; font-weight: bold; }
.em.red   { color: #e74c3c; font-weight: bold; }
.em.gold  { color: #f1c40f; font-weight: bold; }
.em.hop   { color: #f1c40f; font-weight: bold; text-shadow: 0 0 4px rgba(241,196,15,0.5); }

/* Mute toggle — only visible (as a circle) when muted, so it doesn't
   overlap the "vibe coding" badge in the bottom-right corner. */
#mute-toggle {
  position: fixed;
  bottom: 16px;
  right: 96px;
  z-index: 400;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: transparent;
  transition: transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#mute-toggle.muted {
  background: rgba(13,13,43,0.85);
  border-color: #7f8c8d;
  color: #ecf0f1;
  opacity: 0.9;
}
#mute-toggle.muted:hover {
  border-color: #6c5ce7;
  background: rgba(30,30,70,0.95);
  transform: scale(1.08);
}

/* Intro footer — createa.meme credit */
#intro-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 15;
  pointer-events: auto;
}
#intro-footer .footer-link {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 2.2px;
  font-weight: 700;
  padding: 8px 18px;
  color: #ecf0f1;
  text-decoration: none;
  background: rgba(13,13,43,0.55);
  border: 1px solid rgba(108,92,231,0.45);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: transform 0.15s, border-color 0.15s, color 0.15s, background 0.15s;
}
#intro-footer .footer-link:hover {
  color: #f1c40f;
  border-color: #f1c40f;
  background: rgba(30,30,70,0.75);
  transform: translateY(-2px);
}
#intro-footer .footer-brand {
  color: #2ecc71;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(46,204,113,0.55);
}
#intro-footer .footer-link:hover .footer-brand { color: #f1c40f; text-shadow: 0 0 10px rgba(241,196,15,0.65); }
#intro-footer .footer-spark { color: #f1c40f; margin: 0 6px; opacity: 0.85; }

/* Difficulty selector on the intro screen */
#difficulty-select {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.diff-btn {
  background: rgba(13,13,43,0.7);
  border: 2px solid #3e5060;
  border-radius: 10px;
  padding: 8px 14px;
  color: #ecf0f1;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 92px;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.diff-btn:hover { transform: translateY(-2px); border-color: #6c5ce7; }
.diff-btn.active {
  border-color: #2ecc71;
  background: rgba(46,204,113,0.18);
  box-shadow: 0 0 10px rgba(46,204,113,0.5);
}
.diff-btn .diff-icon { font-size: 22px; color: #e74c3c; line-height: 1; }
.diff-btn .diff-label { font-size: 12px; font-weight: 900; letter-spacing: 1px; color: #f1c40f; }

/* Hint banner (e.g. "SHOOT THE FIREWALL!") */
#hint-banner {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  font-family: 'Courier New', monospace;
  text-align: center;
  color: #f1c40f;
  text-shadow: 0 0 10px #e67e22, 2px 2px 0 #000;
  pointer-events: none;
  animation: hbPulse 0.8s ease-in-out infinite alternate;
}
#hint-banner.hidden { display: none; }
#hint-banner .hb-arrow { font-size: 42px; color: #e74c3c; text-shadow: 0 0 8px #c0392b; }
#hint-banner .hb-text  { font-size: 34px; font-weight: 900; letter-spacing: 2px; }
#hint-banner .hb-sub   { font-size: 15px; color: #ecf0f1; margin-top: 4px; letter-spacing: 1px; }
@keyframes hbPulse {
  from { transform: translateX(-50%) scale(1.0); filter: brightness(1.0); }
  to   { transform: translateX(-50%) scale(1.06); filter: brightness(1.25); }
}

/* Title-screen ambient particles */
#intro-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.spore {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46,204,113,0.8);
  opacity: 0.7;
  animation: sporeFloat linear infinite;
}
.spore.gold { background: #f1c40f; box-shadow: 0 0 8px rgba(241,196,15,0.8); }
.spore.cyan { background: #6c5ce7; box-shadow: 0 0 10px rgba(108,92,231,0.9); }

@keyframes sporeFloat {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.6; }
  100% { transform: translate(var(--dx, 0px), -110vh) scale(0.6); opacity: 0; }
}

/* Level-start splash */
#level-splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(10,10,26,0.45) 0%, rgba(10,10,26,0) 70%);
  animation: lsFade 5s ease-in-out forwards;
}
#level-splash.hidden { display: none; }
#level-splash .ls-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  animation: lsImgFade 5s ease-in-out forwards;
}
#level-splash .ls-image.empty { display: none; }
@keyframes lsImgFade {
  0%   { opacity: 0; transform: scale(1.05); }
  15%  { opacity: 0.55; transform: scale(1.0); }
  80%  { opacity: 0.55; }
  100% { opacity: 0;  transform: scale(0.98); }
}
#level-splash .ls-stage {
  font-family: 'Courier New', monospace;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 10px;
  color: #f1c40f;
  text-shadow:
    0 0 14px rgba(241,196,15,1),
    0 0 28px rgba(241,196,15,0.7),
    3px 3px 0 #0a0a1a;
  transform: translateY(8px);
  animation: lsSlide 5s ease-out forwards;
}
#level-splash .ls-name {
  font-family: 'Courier New', monospace;
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #2ecc71;
  text-shadow:
    0 0 20px rgba(46,204,113,0.9),
    0 0 42px rgba(46,204,113,0.55),
    4px 4px 0 #0a0a1a;
  margin-top: 8px;
  animation: lsPop 5s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
}
@keyframes lsFade {
  0%, 80% { opacity: 1; }
  100%    { opacity: 0; }
}
@keyframes lsSlide {
  0%   { transform: translateY(30px); opacity: 0; }
  15%  { transform: translateY(0);   opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes lsPop {
  0%   { transform: scale(0.4); opacity: 0; filter: blur(18px); }
  20%  { transform: scale(1.05); opacity: 1; filter: blur(0); }
  30%  { transform: scale(1); }
  80%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* God-mode indicator */
#god-indicator {
  position: fixed;
  bottom: 62px;
  right: 12px;
  z-index: 400;
  padding: 6px 12px;
  background: rgba(241,196,15,0.15);
  border: 1px solid #f1c40f;
  border-radius: 16px;
  color: #f1c40f;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(241,196,15,0.9);
  animation: godPulse 1.2s ease-in-out infinite;
}
#god-indicator.hidden { display: none; }
@keyframes godPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(241,196,15,0.4); }
  50%      { transform: scale(1.05); box-shadow: 0 0 18px rgba(241,196,15,0.8); }
}

/* Coin counter */
#coin-display {
  color: #f1c40f;
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: bold;
  text-align: right;
  text-shadow: 0 0 6px rgba(241,196,15,0.6), 2px 2px 0 #0a0a1a;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
#coin-display .coin-icon {
  display: inline-block;
  color: #f1c40f;
  text-shadow: 0 0 8px rgba(241,196,15,0.9);
  animation: coinSpin 2.4s linear infinite;
}
#coin-display.bump {
  animation: coinBump 0.32s ease-out;
}
@keyframes coinSpin {
  0%,100% { transform: rotateY(0deg) scale(1); }
  50%     { transform: rotateY(180deg) scale(1.15); }
}
@keyframes coinBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); color: #fff; }
  100% { transform: scale(1); }
}

/* Pause overlay */
#pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,26,0.78);
  backdrop-filter: blur(3px);
}
#pause-overlay.hidden { display: none; }
#pause-overlay .pause-card {
  background: rgba(20,20,45,0.95);
  border: 2px solid #6c5ce7;
  border-radius: 12px;
  padding: 32px 42px;
  text-align: center;
  box-shadow: 0 0 40px rgba(108,92,231,0.5);
  color: #ecf0f1;
  font-family: 'Courier New', monospace;
}
#pause-overlay h2 {
  color: #2ecc71;
  font-size: 40px;
  letter-spacing: 8px;
  margin-bottom: 8px;
  text-shadow: 0 0 14px rgba(46,204,113,0.7);
}
#pause-overlay p {
  color: #a0a0c0;
  margin-bottom: 18px;
  font-size: 13px;
}
#pause-overlay .controls-table {
  margin: 0 auto;
  font-size: 13px;
  color: #ecf0f1;
  border-collapse: separate;
  border-spacing: 12px 4px;
}
#pause-overlay kbd {
  background: #2c3e50;
  border: 1px solid #3e5060;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
}

/* Level-end victory overlay */
#level-complete {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(46,204,113,0.25) 0%, rgba(10,10,26,0.85) 70%);
  animation: lcFadeIn 0.8s ease-out forwards;
  font-family: 'Courier New', monospace;
  pointer-events: none;
}
#level-complete.hidden { display: none; }
#level-complete .lc-main {
  font-size: 84px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #f1c40f;
  text-shadow:
    0 0 22px rgba(241,196,15,0.9),
    0 0 48px rgba(241,196,15,0.55),
    5px 5px 0 #0a0a1a;
  animation: lcPop 1.0s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
}
#level-complete .lc-sub {
  color: #2ecc71;
  font-size: 22px;
  letter-spacing: 6px;
  margin-top: 18px;
  text-shadow: 0 0 10px rgba(46,204,113,0.6);
  animation: lcFadeIn 1.2s ease-out 0.4s both;
}
@keyframes lcFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lcPop {
  0%   { transform: scale(0.3) rotate(-10deg); opacity: 0; filter: blur(20px); }
  60%  { transform: scale(1.12) rotate(2deg);  opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Level-complete stats */
#level-complete .lc-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 40px;
  background: rgba(20,20,45,0.85);
  border: 2px solid #f1c40f;
  border-radius: 10px;
  padding: 18px 28px;
  box-shadow: 0 0 24px rgba(241,196,15,0.35);
  font-family: 'Courier New', monospace;
  animation: lcStatsFade 1.2s ease-out 0.9s both;
}
#level-complete .lc-stat {
  display: contents;
}
#level-complete .lc-k {
  color: #bdc3c7;
  letter-spacing: 3px;
  font-size: 13px;
}
#level-complete .lc-v {
  color: #2ecc71;
  text-align: right;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(46,204,113,0.5);
}
/* Boss-fight sub-section inside the stats grid. Uses display:contents so its
   children participate in the parent 2-col grid. Header spans both columns. */
#level-complete #lc-boss-section { display: contents; }
#level-complete #lc-boss-section.hidden { display: none; }
#level-complete .lc-boss-hdr {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(241,196,15,0.4);
  color: #e74c3c;
  letter-spacing: 4px;
  font-size: 14px;
  text-align: center;
  text-shadow: 0 0 8px rgba(231,76,60,0.6);
}
#level-complete .lc-rank .lc-v {
  color: #f1c40f;
  font-size: 28px;
  text-shadow: 0 0 10px rgba(241,196,15,0.9);
}
#level-complete .lc-hint {
  margin-top: 22px;
  color: #ecf0f1;
  font-size: 13px;
  letter-spacing: 2px;
  opacity: 0.8;
  animation: lcStatsFade 1.2s ease-out 1.6s both;
}
@keyframes lcStatsFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
