@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* 🎒 Hotbar Switch Test - Authentic Minecraft Aesthetic (style.css) */
:root {
  --test-accent: #00f0ff;
  --test-accent-soft: rgba(0, 240, 255, 0.12);
  --test-accent-border: rgba(0, 240, 255, 0.3);
  --mc-stone-bg: #8b8b8b;
  --mc-dark-bevel: #373737;
  --mc-light-bevel: #ffffff;
  --mc-yellow: #ffff55;
  --mc-gold: #ffaa00;
  --mc-green: #55ff55;
  --mc-aqua: #55ffff;
  --mc-red: #ff5555;
  --font-pixel: 'VT323', monospace;
}

/* Authentic Material Symbol for Test Icon */

/* Full-bleed arena during active gameplay */
body:has(#panelTask.active) {
  overflow: hidden !important;
}

body:has(#panelTask.active) .t-shell {
  padding: 0 !important;
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) .t-card {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 9999 !important;
  background: #080c14 !important;
  box-shadow: none !important;
}

body:has(#panelTask.active) .t-nav,
body:has(#panelTask.active) header.site-header,
body:has(#panelTask.active) footer,
body:has(#panelTask.active) nav:not(.top-header),
body:has(#panelTask.active) .ambient-glow,
body:has(#panelTask.active) .t-description,
body:has(#panelTask.active) .t-ad-slot {
  display: none !important;
}

body:has(#panelTask.active) #panelTask,
body:has(#panelTask.active) .t-task {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) .hotbar-arena {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
  padding: 70px 20px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
}

/* Ensure top header and timer are ALWAYS visible */
body:has(#panelTask.active) .top-header,
.top-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  top: 16px !important;
  left: 20px !important;
  right: 20px !important;
  width: auto !important;
  max-width: calc(100vw - 40px) !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
  pointer-events: none !important;
}
body:has(#panelTask.active) .top-header * {
  pointer-events: auto !important;
}

/* Remaining Countdown Progress Bar */
.hotbar-timer-progress-track {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 4px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  z-index: 110 !important;
  overflow: hidden !important;
}

.hotbar-timer-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #38bdf8);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  transition: width 0.1s linear;
}

.hotbar-timer-progress-fill.critical {
  background: linear-gradient(90deg, #ef4444, #f87171) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9) !important;
}

.timer-pill.critical {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4) !important;
}

.timer-pill.critical #hud-timer {
  color: #f87171 !important;
}

/* Authentic Minecraft Bedrock / Deep Dark Background */
.hotbar-arena {
  position: relative;
  width: 100%;
  min-height: 520px;
  height: 65vh;
  max-height: 720px;
  background-color: #12141a;
  background-image: 
    radial-gradient(circle at 50% 45%, rgba(24, 28, 40, 0.7) 0%, rgba(7, 9, 13, 0.97) 100%),
    repeating-linear-gradient(45deg, #151821 0, #151821 16px, #0e1118 16px, #0e1118 32px);
  border: 3px solid #2a2e3d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center vertically for ergonomics */
  align-items: center;
  user-select: none;
  /* Authentic Pixel Minecraft Crosshair */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='14' y='7' width='4' height='18' fill='%23000000'/%3E%3Crect x='7' y='14' width='18' height='4' fill='%23000000'/%3E%3Crect x='15' y='8' width='2' height='16' fill='%23ffffff'/%3E%3Crect x='8' y='15' width='16' height='2' fill='%23ffffff'/%3E%3C/svg%3E") 16 16, crosshair;
}

/* Centered battle station grouping prompt and hotbar */
.battle-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  z-index: 10;
}

@media (max-width: 640px) {
  .hotbar-arena {
    min-height: 360px;
    height: 52vh;
  }
  .battle-station {
    gap: 20px;
  }
}

.round-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  padding: 6px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.timer-pill {
  background: rgba(13, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--test-accent, #00f0ff);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--test-accent, #00f0ff);
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

#hud-timer {
  margin: 0;
  font-family: var(--font-m, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: none;
}

.restart-pill {
  margin-left: auto !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  backdrop-filter: blur(12px) !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  pointer-events: auto !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.restart-pill:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35) !important;
}
  border-color: #ef4444;
  color: #ffffff;
}

/* ════ SLEEK FLOATING ITEM CALLOUT ════ */
.prompt-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  pointer-events: none;
}

.floating-item-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-item-callout.flash-hit {
  transform: scale(1.18);
}

.floating-item-callout.flash-miss {
  transform: scale(0.88);
}

.callout-icon-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 116px;
  height: 116px;
  background: linear-gradient(160deg, #9ca3af 0%, #8b8b8b 55%, #767d8a 100%);
  border: 2.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.8),
    0 0 24px rgba(226, 232, 240, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-item-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.5));
  animation: floatBob 2.2s ease-in-out infinite alternate;
}

@keyframes floatBob {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(2deg); }
}

.floating-item-callout.flash-hit .callout-icon-wrap {
  border-color: #10b981 !important;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.6), inset 0 0 24px rgba(16, 185, 129, 0.3) !important;
  transform: scale(1.08);
}

.floating-item-callout.flash-miss .callout-icon-wrap {
  border-color: #ef4444 !important;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.6), inset 0 0 24px rgba(239, 68, 68, 0.3) !important;
  transform: scale(0.94);
}

.callout-key-hint {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  color: #94a3b8;
  text-shadow: 1px 1px 0 #000000;
  margin-top: 8px;
}

/* ════ PRO MINECRAFT 9-SLOT HOTBAR & ACTIVE SELECTOR ════ */
.hotbar-hud-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  z-index: 20;
}

.hotbar-container {
  display: flex;
  background: #8f8f8f;
  border: 3px solid #000000;
  box-shadow: inset 3px 3px 0 #ffffff, inset -3px -3px 0 #373737, 0 16px 40px rgba(0, 0, 0, 0.95);
  padding: 4px;
  gap: 3px;
  position: relative;
}

.hotbar-slot {
  position: relative;
  width: 68px;
  height: 68px;
  background: #8b8b8b;
  border: 2px solid #373737;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.hotbar-slot:hover {
  background: #9c9c9c;
  transform: translateY(-3px);
}

.hotbar-slot.selected {
  background: #a3a3a3 !important;
  border: 4px solid #ffffff !important;
  outline: 3px solid #000000 !important;
  box-shadow: 
    0 -4px 16px rgba(255, 255, 255, 0.9),
    0 4px 16px rgba(255, 255, 255, 0.9),
    0 0 30px rgba(0, 240, 255, 0.7),
    inset 0 0 14px rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-8px) scale(1.12) !important;
  z-index: 15;
}

.slot-bracket-top {
  display: none;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #ffff55;
  filter: drop-shadow(0 0 6px #ffff55);
}

.hotbar-slot.selected .slot-bracket-top {
  display: block;
}

.slot-number {
  position: absolute;
  top: 2px;
  left: 5px;
  font-family: var(--font-pixel);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  text-shadow: 2px 2px 0 #3f3f3f;
  z-index: 2;
}

.hotbar-slot.selected .slot-number {
  color: var(--mc-yellow);
  font-size: 1.45rem;
  text-shadow: 2px 2px 0 #3f3f00, 0 0 10px rgba(255, 255, 85, 0.9);
}

.slot-icon-box {
  width: 46px;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.slot-icon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.65));
  pointer-events: none;
  transition: transform 0.12s ease;
}

.hotbar-slot.selected .slot-icon-img {
  transform: scale(1.12);
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.75)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.slot-label {
  position: absolute;
  bottom: 2px;
  font-size: 11px;
  font-family: var(--font-pixel);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  text-transform: uppercase;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 1px 1px 0 #000000;
}

.hotbar-slot.selected .slot-label {
  color: var(--mc-yellow);
  text-shadow: 1px 1px 0 #3f3f00;
}

/* Floating Hit / Miss Text */
.floating-text {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-pixel);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--mc-green);
  text-shadow: 3px 3px 0 #000000;
  transform: translate(-50%, -50%);
  animation: floatUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -20%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(0.9); }
}

/* Visual Preview Box on Intro */
.hotbar-preview-box {
  width: 100%;
  max-width: 480px;
  margin: 18px auto 14px;
  background: #1f232d;
  border: 2px solid #2e3446;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Floating Prompt Item Showcase in Preview */
.preview-prompt-stage {
  position: relative;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-prompt-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.preview-item-icon-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  background: linear-gradient(160deg, #9ca3af 0%, #8b8b8b 55%, #767d8a 100%);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.6), 
    0 0 16px rgba(226, 232, 240, 0.2), 
    inset 0 1.5px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev-item-sprite {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.45));
}

.prev-prompt-water {
  animation: prevWaterAnim 4.8s linear infinite;
}

.prev-prompt-pearl {
  animation: prevPearlAnim 4.8s linear infinite;
}

.prev-prompt-pearl .preview-item-icon-wrap {
  border-color: rgba(255, 85, 255, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 85, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

@keyframes prevWaterAnim {
  0%, 46% {
    opacity: 1;
    transform: scale(1);
  }
  48%, 98% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes prevPearlAnim {
  0%, 48% {
    opacity: 0;
    transform: scale(0.85);
  }
  50%, 94% {
    opacity: 1;
    transform: scale(1);
  }
  96%, 100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

.preview-hotbar-mock {
  position: relative;
  display: flex;
  background: #8f8f8f;
  border: 2px solid #000000;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #373737, 0 6px 16px rgba(0, 0, 0, 0.5);
  padding: 3px;
  gap: 2px;
  border-radius: 2px;
  max-width: 100%;
  box-sizing: border-box;
}

.preview-slot {
  width: 38px;
  height: 38px;
  background: #8b8b8b;
  border: 1px solid #373737;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.12s ease;
  box-sizing: border-box;
}

.preview-slot span {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 12px;
  color: #ffffff;
  font-family: var(--font-pixel);
  text-shadow: 1px 1px 0 #3f3f3f;
  pointer-events: none;
}

.p-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.5));
}

/* Dynamic Preview Active Highlight States */
.prev-slot-3 {
  animation: prevSlot3Glow 4.8s linear infinite;
}

.prev-slot-5 {
  animation: prevSlot5Glow 4.8s linear infinite;
}

@keyframes prevSlot3Glow {
  0%, 15% {
    border: 1px solid #373737;
    outline: none;
    transform: none;
  }
  20%, 46% {
    border: 3px solid #ffffff !important;
    outline: 2px solid #000000 !important;
    transform: translateY(-4px) scale(1.12);
    background: #a8a8a8 !important;
    z-index: 5;
  }
  48%, 100% {
    border: 1px solid #373737;
    outline: none;
    transform: none;
    background: #8b8b8b;
    z-index: 1;
  }
}

@keyframes prevSlot5Glow {
  0%, 49% {
    border: 1px solid #373737;
    outline: none;
    transform: none;
    background: #8b8b8b;
    z-index: 1;
  }
  54%, 88% {
    border: 3px solid #ffffff !important;
    outline: 2px solid #000000 !important;
    transform: translateY(-4px) scale(1.12);
    background: #a8a8a8 !important;
    z-index: 5;
  }
  92%, 100% {
    border: 1px solid #373737;
    outline: none;
    transform: none;
    background: #8b8b8b;
    z-index: 1;
  }
}

/* Standardized Click Cursor Bounding Box per .agents/AGENTS.md */
.hotbar-preview-click {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
  animation: hotbarCursorMove 4.8s linear infinite;
}

.hotbar-preview-click .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  display: block;
  color: #ffffff;
}

@keyframes hotbarCursorMove {
  0% {
    left: 45%;
    top: 145px;
    opacity: 0;
    transform: translate(-35%, -15%) scale(1);
  }
  10% {
    left: 40%;
    top: 125px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  /* Move to Slot 3 */
  20% {
    left: 36%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  /* Tap Slot 3 */
  23% {
    left: 36%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(0.82);
  }
  28% {
    left: 36%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  /* Travel to Slot 5 */
  46% {
    left: 44%;
    top: 120px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  54% {
    left: 51%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  /* Tap Slot 5 */
  58% {
    left: 51%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(0.82);
  }
  64% {
    left: 51%;
    top: 116px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  82% {
    left: 58%;
    top: 135px;
    opacity: 1;
    transform: translate(-35%, -15%) scale(1);
  }
  92%, 100% {
    left: 58%;
    top: 150px;
    opacity: 0;
    transform: translate(-35%, -15%) scale(1);
  }
}

.hotbar-preview-caption {
  font-size: 0.92rem;
  color: var(--color-on-surface-variant);
  text-align: center;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .preview-slot {
    width: 30px;
    height: 30px;
  }
  .p-img {
    width: 20px;
    height: 20px;
  }
  .preview-slot span {
    font-size: 10px;
  }
  .hotbar-slot {
    width: 36px;
    height: 48px;
  }
  .slot-icon-box {
    width: 28px;
    height: 28px;
  }
  .slot-icon-img {
    width: 26px;
    height: 26px;
  }
  .slot-number {
    font-size: 1rem;
  }
  .slot-label {
    display: none;
  }
  .callout-item-name {
    font-size: 1.6rem;
  }
}
