@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@500;700&display=swap');

    * {
      box-sizing: border-box;
    }

    body {
      user-select: none;
      -webkit-user-select: none;
      overflow: hidden;
      font-family: 'Share Tech Mono', monospace;
    }

    canvas {
      image-rendering: pixelated;
    }

    .scanlines::before {
      content: "";
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.015), rgba(0, 0, 255, 0.04));
      z-index: 2;
      background-size: 100% 3px, 5px 100%;
      pointer-events: none;
    }

    .vignette::after {
      content: "";
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.8) 100%);
      z-index: 1;
      pointer-events: none;
    }

    .game-over-overlay {
      position: absolute;
      inset: 0;
      z-index: 40;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(4px);
      pointer-events: auto;
    }

    .game-over-box {
      text-align: center;
      padding: 2rem 3rem;
      border: 3px solid transparent;
      max-width: 440px;
      position: relative;
    }

    .game-over-box::before {
      content: "";
      position: absolute;
      inset: 4px;
      border: 1px solid transparent;
      opacity: 0.3;
      pointer-events: none;
    }

    .game-over-box .btn {
      position: relative;
      z-index: 10;
    }

    .btn {
      border: 3px solid #000;
      font-family: 'Share Tech Mono', monospace;
      cursor: pointer;
      transition: all 0.1s;
      letter-spacing: 0.05em;
    }

    .btn:hover {
      filter: brightness(1.25);
    }

    .btn:active {
      transform: translateY(2px);
    }

    .panel-btn {
      width: 100%;
      border: 3px solid #000;
      padding: 6px 8px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      font-family: 'Share Tech Mono', monospace;
      cursor: pointer;
      transition: all 0.12s;
      color: #f4f4f5;
    }

    .panel-btn:hover {
      filter: brightness(1.3);
    }

    .panel-btn:active {
      transform: translateY(1px);
    }

    .builder-input {
      height: 29px;
      border: 3px solid #000;
      font-family: 'Share Tech Mono', monospace;
      font-size: 11px;
      color: #d4d4d8;
      background: #27272a;
      padding: 0 6px;
      outline: none;
      box-sizing: border-box;
    }
    .builder-input:focus {
      border-color: #3b82f6;
      background: #1e1e22;
    }

    .builder-sub-btn {
      height: 29px;
      min-width: 29px;
      border: 3px solid #000;
      font-family: 'Share Tech Mono', monospace;
      font-size: 11px;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.1s;
      color: #f4f4f5;
      background: #3f3f46;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      box-sizing: border-box;
    }
    .builder-sub-btn:hover {
      filter: brightness(1.3);
    }
    .builder-sub-btn:active {
      transform: translateY(1px);
    }

    #threat-bar {
      transition: width 0.3s;
    }

    ::-webkit-scrollbar {
      width: 4px;
    }

    ::-webkit-scrollbar-track {
      background: #18181b;
    }

    ::-webkit-scrollbar-thumb {
      background: #3f3f46;
    }

    #tooltip {
      position: fixed;
      pointer-events: none;
      z-index: 100;
      display: none;
      background: #09090b;
      border: 2px solid #3f3f46;
      padding: 4px 8px;
      font-size: 10px;
      color: #a1a1aa;
      max-width: 180px;
    }

    /* Tailwind Color Utilities */
    .bg-zinc-950 {
      background-color: #09090b;
    }

    .bg-zinc-900 {
      background-color: #18181b;
    }

    .bg-zinc-800 {
      background-color: #27272a;
    }

    .bg-zinc-700 {
      background-color: #3f3f46;
    }

    .bg-zinc-600 {
      background-color: #52525b;
    }

    .bg-blue-950 {
      background-color: #172554;
    }

    .bg-blue-900 {
      background-color: #1e3a8a;
    }

    .bg-blue-800 {
      background-color: #1e40af;
    }

    .bg-blue-500 {
      background-color: #3b82f6;
    }

    .bg-red-950 {
      background-color: #450a0a;
    }

    .bg-red-900 {
      background-color: #7f1d1d;
    }

    .bg-green-950 {
      background-color: #052e16;
    }

    .bg-green-900 {
      background-color: #15803d;
    }

    .bg-green-700 {
      background-color: #3a7535;
    }

    .bg-green-400 {
      background-color: #4ade80;
    }

    .bg-amber-950 {
      background-color: #78350f;
    }

    .bg-amber-900 {
      background-color: #92400e;
    }

    .bg-violet-950 {
      background-color: #2e1065;
    }

    .bg-violet-900 {
      background-color: #5b21b6;
    }

    .text-zinc-100 {
      color: #f4f4f5;
    }

    .text-zinc-300 {
      color: #d4d4d8;
    }

    .text-zinc-400 {
      color: #a1a1aa;
    }

    .text-zinc-500 {
      color: #71717a;
    }

    .text-zinc-600 {
      color: #52525b;
    }

    .text-blue-300 {
      color: #93c5fd;
    }

    .text-blue-400 {
      color: #60a5fa;
    }

    .text-blue-200 {
      color: #bfdbfe;
    }

    .text-red-400 {
      color: #f87171;
    }

    .text-red-300 {
      color: #fca5a5;
    }

    .text-green-300 {
      color: #86efac;
    }

    .text-green-400 {
      color: #4ade80;
    }

    .text-green-600 {
      color: #16a34a;
    }

    .text-green-700 {
      color: #15803d;
    }

    .text-amber-400 {
      color: #facc15;
    }

    .text-amber-500 {
      color: #f59e0b;
    }

    .text-violet-500 {
      color: #8b5cf6;
    }

    .text-black {
      color: #000;
    }

    .text-white {
      color: #fff;
    }

    .border-zinc-700 {
      border-color: #3f3f46;
    }

    .border-zinc-800 {
      border-color: #27272a;
    }

    .border-zinc-900 {
      border-color: #18181b;
    }

    .border-blue-500 {
      border-color: #3b82f6;
    }

    .border-blue-700 {
      border-color: #1d4ed8;
    }

    .border-red-500 {
      border-color: #ef4444;
    }

    .border-red-600 {
      border-color: #dc2626;
    }

    .border-green-600 {
      border-color: #16a34a;
    }

    .border-black {
      border-color: #000;
    }

    /* Display & Flex */
    .flex {
      display: flex;
    }

    .inline-flex {
      display: inline-flex;
    }

    .block {
      display: block;
    }

    .inline {
      display: inline;
    }

    .hidden {
      display: none;
    }

    .grid {
      display: grid;
    }

    .grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .flex-col {
      flex-direction: column;
    }

    .flex-row {
      flex-direction: row;
    }

    .flex-1 {
      flex: 1 1 0%;
    }

    .flex-wrap {
      flex-wrap: wrap;
    }

    .items-center {
      align-items: center;
    }

    .items-start {
      align-items: flex-start;
    }

    .items-end {
      align-items: flex-end;
    }

    .justify-center {
      justify-content: center;
    }

    .justify-between {
      justify-content: space-between;
    }

    .justify-start {
      justify-content: flex-start;
    }

    .justify-end {
      justify-content: flex-end;
    }

    .gap-1 {
      gap: 0.25rem;
    }

    .gap-2 {
      gap: 0.5rem;
    }

    .gap-3 {
      gap: 0.75rem;
    }

    .gap-4 {
      gap: 1rem;
    }

    .gap-5 {
      gap: 1.25rem;
    }

    .space-y-1>*+* {
      margin-top: 0.25rem;
    }

    .space-y-2>*+* {
      margin-top: 0.5rem;
    }

    .space-y-3>*+* {
      margin-top: 0.75rem;
    }

    .space-y-6>*+* {
      margin-top: 1.5rem;
    }

    .space-x-2>*+* {
      margin-left: 0.5rem;
    }

    .space-x-3>*+* {
      margin-left: 0.75rem;
    }

    /* Spacing */
    .p-0 {
      padding: 0;
    }

    .p-1 {
      padding: 0.25rem;
    }

    .p-2 {
      padding: 0.5rem;
    }

    .p-2\.5 {
      padding: 0.625rem;
    }

    .p-3 {
      padding: 0.75rem;
    }

    .p-4 {
      padding: 1rem;
    }

    .p-10 {
      padding: 2.5rem;
    }

    .px-1 {
      padding-left: 0.25rem;
      padding-right: 0.25rem;
    }

    .px-1\.5 {
      padding-left: 0.375rem;
      padding-right: 0.375rem;
    }

    .px-2 {
      padding-left: 0.5rem;
      padding-right: 0.5rem;
    }

    .px-3 {
      padding-left: 0.75rem;
      padding-right: 0.75rem;
    }

    .px-4 {
      padding-left: 1rem;
      padding-right: 1rem;
    }

    .py-0\.5 {
      padding-top: 0.125rem;
      padding-bottom: 0.125rem;
    }

    .py-1 {
      padding-top: 0.25rem;
      padding-bottom: 0.25rem;
    }

    .py-1\.5 {
      padding-top: 0.375rem;
      padding-bottom: 0.375rem;
    }

    .py-2 {
      padding-top: 0.5rem;
      padding-bottom: 0.5rem;
    }

    .py-3 {
      padding-top: 0.75rem;
      padding-bottom: 0.75rem;
    }

    .mb-1 {
      margin-bottom: 0.25rem;
    }

    .mb-2 {
      margin-bottom: 0.5rem;
    }

    .mt-0\.5 {
      margin-top: 0.125rem;
    }

    .mt-1 {
      margin-top: 0.25rem;
    }

    .mt-2 {
      margin-top: 0.5rem;
    }

    .mt-3 {
      margin-top: 0.75rem;
    }

    .mr-1 {
      margin-right: 0.25rem;
    }

    .ml-1 {
      margin-left: 0.25rem;
    }

    /* Sizing */
    .w-full {
      width: 100%;
    }

    .w-1 {
      width: 0.25rem;
    }

    .w-1\.5 {
      width: 0.375rem;
    }

    .w-3 {
      width: 0.75rem;
    }

    .w-4 {
      width: 1rem;
    }

    .w-6 {
      width: 1.5rem;
    }

    .w-7 {
      width: 1.75rem;
    }

    .w-16 {
      width: 4rem;
    }

    .w-32 {
      width: 8rem;
    }

    .w-56 {
      width: 14rem;
    }

    .h-full {
      height: 100%;
    }

    .h-screen {
      height: 100vh;
    }

    .h-1 {
      height: 0.25rem;
    }

    .h-1\.5 {
      height: 0.375rem;
    }

    .h-2 {
      height: 0.5rem;
    }

    .h-3 {
      height: 0.75rem;
    }

    .h-4 {
      height: 1rem;
    }

    .h-6 {
      height: 1.5rem;
    }

    .h-7 {
      height: 1.75rem;
    }

    .h-20 {
      height: 5rem;
    }

    .max-w-lg {
      max-width: 32rem;
    }

    .max-w-md {
      max-width: 28rem;
    }

    .max-w-sm {
      max-width: 24rem;
    }

    .max-w-xl {
      max-width: 36rem;
    }

    .max-w-56 {
      max-width: 14rem;
    }

    .min-w-0 {
      min-width: 0;
    }

    .max-h-20 {
      max-height: 5rem;
    }

    .max-h-screen {
      max-height: 100vh;
    }

    /* Position */
    .relative {
      position: relative;
    }

    .absolute {
      position: absolute;
    }

    .fixed {
      position: fixed;
    }

    .inset-0 {
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
    }

    .inset-4 {
      top: 1rem;
      right: 1rem;
      bottom: 1rem;
      left: 1rem;
    }

    .top-0 {
      top: 0;
    }

    .top-0\.5 {
      top: 0.125rem;
    }

    .top-2 {
      top: 0.5rem;
    }

    .right-0 {
      right: 0;
    }

    .right-0\.5 {
      right: 0.125rem;
    }

    .right-2 {
      right: 0.5rem;
    }

    .bottom-2 {
      bottom: 0.5rem;
    }

    .left-2 {
      left: 0.5rem;
    }

    .z-1 {
      z-index: 1;
    }

    .z-10 {
      z-index: 10;
    }

    .z-40 {
      z-index: 40;
    }

    .z-50 {
      z-index: 50;
    }

    .z-100 {
      z-index: 100;
    }

    /* Border & Rounded */
    .border {
      border: 1px solid transparent;
    }

    .border-2 {
      border: 2px solid transparent;
    }

    .border-4 {
      border: 4px solid transparent;
    }

    .border-t-4 {
      border-top: 4px solid transparent;
    }

    .border-b-4 {
      border-bottom: 4px solid transparent;
    }

    .border-r-4 {
      border-right: 4px solid transparent;
    }

    .border-l-4 {
      border-left: 4px solid transparent;
    }

    .rounded {
      border-radius: 0.25rem;
    }

    .rounded-full {
      border-radius: 9999px;
    }

    .rounded-sm {
      border-radius: 0.125rem;
    }

    /* Text Utilities */
    .text-xs {
      font-size: 0.75rem;
      line-height: 1rem;
    }

    .text-\[9px\] {
      font-size: 9px;
    }

    .text-\[10px\] {
      font-size: 10px;
    }

    .text-\[11px\] {
      font-size: 11px;
    }

    .text-\[12px\] {
      font-size: 12px;
    }

    .text-sm {
      font-size: 0.875rem;
      line-height: 1.25rem;
    }

    .text-base {
      font-size: 1rem;
      line-height: 1.5rem;
    }

    .text-lg {
      font-size: 1.125rem;
      line-height: 1.75rem;
    }

    .text-xl {
      font-size: 1.25rem;
      line-height: 1.75rem;
    }

    .text-3xl {
      font-size: 1.875rem;
      line-height: 2.25rem;
    }

    .text-4xl {
      font-size: 2.25rem;
      line-height: 2.5rem;
    }

    .text-6xl {
      font-size: 3.75rem;
      line-height: 1;
    }

    .font-bold {
      font-weight: 700;
    }

    .font-black {
      font-weight: 900;
    }

    .font-normal {
      font-weight: 400;
    }

    .leading-relaxed {
      line-height: 1.625;
    }

    .leading-tight {
      line-height: 1.25;
    }

    .tracking-wider {
      letter-spacing: 0.05em;
    }

    .tracking-widest {
      letter-spacing: 0.1em;
    }

    .tracking-tighter {
      letter-spacing: -0.05em;
    }

    .uppercase {
      text-transform: uppercase;
    }

    .capitalize {
      text-transform: capitalize;
    }

    .text-center {
      text-align: center;
    }

    .font-mono {
      font-family: monospace;
    }

    /* Overflow & Visibility */
    .overflow-hidden {
      overflow: hidden;
    }

    .overflow-y-auto {
      overflow-y: auto;
    }

    .select-none {
      -webkit-user-select: none;
      user-select: none;
    }

    /* Cursor */
    .cursor-pointer {
      cursor: pointer;
    }

    .cursor-not-allowed {
      cursor: not-allowed;
    }

    .cursor-crosshair {
      cursor: crosshair;
    }

    /* Transforms */
    .rotate-45 {
      transform: rotate(45deg);
    }

    .translate-y-2px {
      transform: translateY(2px);
    }

    /* Opacity */
    .opacity-0 {
      opacity: 0;
    }

    .opacity-30 {
      opacity: 0.3;
    }

    .opacity-60 {
      opacity: 0.6;
    }

    /* Other Utilities */
    .shrink-0 {
      flex-shrink: 0;
    }

    .pointer-events-none {
      pointer-events: none;
    }

    .pointer-events-auto {
      pointer-events: auto;
    }

    /* Hover States */
    .hover\:bg-blue-900:hover {
      background-color: #1e3a8a;
    }

    .hover\:bg-blue-800:hover {
      background-color: #1e40af;
    }

    .hover\:bg-blue-400:hover {
      background-color: #60a5fa;
    }

    .hover\:bg-zinc-800:hover {
      background-color: #27272a;
    }

    .hover\:bg-zinc-700:hover {
      background-color: #3f3f46;
    }

    .hover\:bg-red-900:hover {
      background-color: #7f1d1d;
    }

    .hover\:bg-red-800:hover {
      background-color: #991b1b;
    }

    .hover\:bg-green-900:hover {
      background-color: #15803d;
    }

    .hover\:bg-green-800:hover {
      background-color: #166534;
    }

    .hover\:bg-amber-900:hover {
      background-color: #92400e;
    }

    .hover\:bg-amber-800:hover {
      background-color: #a16207;
    }

    .hover\:bg-violet-900:hover {
      background-color: #5b21b6;
    }

    .hover\:border-blue-500:hover {
      border-color: #3b82f6;
    }

    /* Responsive (md:) */
    @media (min-width: 768px) {
      .md\:w-auto {
        width: auto;
      }

      .md\:mt-0 {
        margin-top: 0;
      }

      .md\:flex-row {
        flex-direction: row;
      }

      .md\:items-center {
        align-items: center;
      }
    }

    /* Animation & Transitions */
    .fade-in {
      animation: fadeIn 0.2s ease-out;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: scale(0.97);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .pulse-red {
      animation: pulseRed 0.6s infinite;
    }

    @keyframes pulseRed {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0.4;
      }
    }

    .pulse-yellow {
      animation: pulseYellow 0.5s infinite;
    }

    @keyframes pulseYellow {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0.2;
      }
    }

    #cmd-menu .cmd-option[data-cmd="attack"]:hover { background: #2f1515 !important; }
    #cmd-menu .cmd-option[data-cmd="defend"]:hover { background: #16223b !important; }
    #cmd-menu .cmd-option[data-cmd="patrol"]:hover { background: #143014 !important; }
  