    body,
    html {
      margin: 0;
      padding: 0;
      background: #2a2a2a;
    }

    #map-container {
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      /* important for bounds */
      position: relative;
    }

    #zoom-wrapper {
      transform-origin: 0 0;
      /* transformations are relative to top-left */
      position: absolute;
      top: 0;
      left: 0;
      overflow: hidden;
      opacity: 0;
      will-change: transform;
    }

    #map-image {
      display: block;
      width: 4096px;
      height: 3044px;
      overflow: hidden;
    }

    #map-borders {
      position: absolute;
      top: 0;
      left: 0;
      width: 4096px;
      height: 3044px;
    }

    #map-container {
      user-select: none;
    }



    /* Base styles for all paths */
    #map-borders path {
      fill: transparent;
      stroke: transparent;
      stroke-width: 2;
      cursor: pointer;
      transition: fill 0.2s, stroke 0.2s;
    }

    /* Highlight effect (for single paths or grouped countries) */
    #map-borders path.highlight,
    #map-borders g.highlight path {
      fill: rgba(255, 166, 0, 0.4);
      /* orange tint */
      stroke: rgb(255, 134, 35);
      stroke-opacity: 1;
    }

    /* Optional: "selected" state if you add clicks later */
    #map-borders path.selected,
    #map-borders g.selected path {
      fill: rgba(255, 247, 232, 0.5);
      stroke: rgb(0, 0, 0);
      stroke-opacity: 1;
    }

    /* Info window styles stuff start */
    .info-window {
      position: absolute;
      top: 20px;
      right: 20px;
      width: 250px;
      background: rgba(43, 43, 43, 0.8);
      border: 1px solid black;
      border-radius: 8px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
      color: white;
      font-family: 'Black Ops One', sans-serif;
      z-index: 12;
    }

    #country-name {
      text-align: center;
      margin-top: 8px;
      /* space below close button */
      font-size: 1.2rem;
      margin-bottom: 8px;
    }


    .close-btn {
      position: absolute;
      top: 6px;
      right: 8px;
      background: transparent;
      border: none;
      color: white;
      font-size: 18px;
      cursor: pointer;
      transform: translateY(-5px);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.3s ease, color 0.2s ease, opacity 0.3s ease;
    }

    /* Hover effect */
    .close-btn:hover {
      color: #ff6b6b;
      transform: scale(1.2);
    }


    .info-window.expanded .close-btn {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    /* Info window content — now stacks vertically */
    .info-window-content {
      display: flex;
      flex-direction: column; /* stack children vertically */
      align-items: center;    /* center horizontally */
      gap: 0.5rem;
    
      /* collapsed by default */
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: max-height 0.4s ease, opacity 0.4s ease;
    }
    .flag-blurb-row {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    /* Expanded state — smooth reveal */
    .info-window.expanded .info-window-content {
      max-height: 600px;
      /* enough for flag + blurb */
      opacity: 1;
      overflow: visible;
    }

    /* Flag */
    #country-flag {
      width: 100px;
      height: 80px;
      display: block;
      border-radius: 8px;
      flex-shrink: 0;
      margin-left: 2px
    }

    /* Blurb */
    #country-blurb {
      flex: 1;
      height: 80px;
      /* matches flag height */
      overflow-y: auto;
      scrollbar-gutter: stable;
      padding-right: 0.5rem;
      line-height: 1.2;
      background: linear-gradient(to right,
          rgba(255, 255, 255, 0) 98%,
          rgba(0, 0, 0, 0.1) 100%);
    }

    /* Scrollbar (Chrome, Edge, Safari) */
    #country-blurb::-webkit-scrollbar,
    .info-window::-webkit-scrollbar {
      width: 6px;
    }

    #country-blurb::-webkit-scrollbar-track,
    .info-window::-webkit-scrollbar-track {
      background: transparent;
    }

    #country-blurb::-webkit-scrollbar-thumb,
    .info-window::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.4);
      border-radius: 3px;
    }

    #country-blurb::-webkit-scrollbar-thumb:hover,
    .info-window::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.7);
    }

    /* Scrollbar (Firefox) */
    #country-blurb,
    .info-window {
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
    }

    /* Optional: make flag + text slide up softly when expanded */
    .info-window-content>* {
      transform: translateY(-10px);
      opacity: 0;
      transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .info-window.expanded .info-window-content>* {
      transform: translateY(0);
      opacity: 1;
    }
    .info-window.expanded {
      padding-top: 36px;
    }
    .region-line {
      text-align: center;
      font-size: 0.9rem;
      margin-top: 4px;
      margin-bottom: 1px;
      opacity: 0;
      transform: translateY(-10px);
      transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .info-window.expanded .region-line {
      opacity: 1;
      transform: translateY(0);
    }

    .player-count-line {
      display: flex;
      flex-direction: column;
      text-align: center;
    }
    #country-player-count {
      padding-top: 3px;
      font-size: larger;
    }
    .info-window-country-buttons {
      display: flex;
      flex-direction: column;
      padding-bottom: 1rem;
      gap: 0.5rem;
    }
    #info-window-colonization-btn, 
    #info-window-something-btn {
      font: inherit;
      color: white;
      background: #666;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    #info-window-colonization-btn:hover, 
    #info-window-something-btn:hover {
      color: #e74c3c;
      background: #555;
      text-shadow: 2px 2px 8px rgba(231, 76, 60, 0.9)
    }
    #info-window-player-country-search {
      all: unset;
      cursor: pointer;
    }
    #info-window-player-country-search:hover {
      color: #e74c3c;
      text-shadow: 2px 2px 8px rgba(231, 76, 60, 0.9)
    }
    
    /* Up to 1000px */
    @media (max-width: 1000px) {
      .info-window {
        width: 35vw;
      }
    
      .info-window-country-buttons {
        flex-direction: row;
      }
    
      .info-window.expanded {
        max-height: calc(100dvh - 4.5rem - 70px);
        overflow-y: auto;
      }
    }
    
    @media (min-width: 499px) and (max-width: 700px) {
      .info-window {
        width: 46vw;
      }
    }
    @media (max-width: 683px) {
      .info-window.expanded {
        max-height: calc(100dvh - 4.5rem - 50px)
      }
    }
    @media (max-width: 499px) {
      .info-window {
        width: 72vw;
      }
    }
    /* info window stuff end */
    
    /* navbar stuff start */
    .navbar {
      background: url('../images/extra-dark-steel.png') no-repeat center center/cover;
      box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
      padding: 1rem 2rem;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 10000;
      border-top-left-radius: 1rem;
      border-top-right-radius: 1rem;
      transition: all 0.3s ease;
      touch-action: none;
    }
    
    .navbar-container {
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      flex-wrap: wrap;
    }
    
    .navbar ul {
      list-style: none;
      display: flex;
      margin: 0;
      padding: 0;
      flex-wrap: wrap;
    }
    .navbar li {
      white-space: nowrap;
      flex-shrink: 0; /* prevents link text from compressing */
    }
    
    .navbar a {
      font-family: 'Black Ops One', sans-serif;
      color: #f2f2f2;
      text-decoration: none;
      font-weight: 600;
      transition: color 0.3s, transform 0.3s;
      padding: 0.5rem 0.75rem;
      font-size: 1rem;
    }
    
    .navbar a:hover {
      color: #e74c3c;
      text-shadow: 2px 2px 8px rgba(231, 76, 60, 0.9);
    }
    
    .nav-divider {
      margin: 0 0.5rem;
      color: #f2f2f2;
      font-family: 'Black Ops One', sans-serif;
      flex-shrink: 0;
    }
  
    #mobile-portrait-map-navbar-expand-button {
      display: none;
      margin: 0;
      padding: 0;
    }
  
    @media (max-width: 683px) {
      .navbar {
        padding: 1rem 1rem;
      }
      .navbar a {
        padding: 0.5rem 0.5rem;
      }
      .navbar li {
        flex-shrink: 1;
      }
      .nav-divider {
        margin: 0 0.15rem;
      }
    }
    /* collapsed menu on mobile */
    /* collapsed menu on mobile */
    @media (max-width: 565px) {
      #mobile-portrait-map-navbar-expand-button {
        display: block;
      }
    
      .navbar ul {
        max-height: 0;          
        overflow: hidden;
        flex-direction: column;  /* default collapsed: stack vertically */
        transition: max-height 0.3s ease, flex-direction 0.3s ease;
      }
    
      /* expanded state */
      .navbar.expanded ul {
        max-height: 43vh;
        flex-direction: column;     /* make horizontal when expanded */
        flex-wrap: nowrap;
        padding-top: 1rem;
        overflow-y: auto;        /* allow wrapping if needed */
      }
      .navbar {
        max-height: 50vh;
      }
      .nav-divider {
        display: none;
      }
      .navbar li {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        text-align: center;
        font-size: larger;
      }
      .navbar-container {
        flex-direction: column;
      }
    }
    /* navbar stuff end */
    
    /* chat box stuff start */
    .chat-box {
      position: fixed;
      bottom: 51px;
      left: 0;
      width: 300px;
      height: 400px;
      background: #1c1b1b;
      border: 1px solid #ccc;
      box-shadow: 0 4px 12px rgba(0,0,0,0.2);
      display: none; /* hidden by default */
      flex-direction: column;
    }
    .chat-header {
      background: #444;
      color: white;
      padding: 10px;
      font-weight: bold;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .chat-messages {
      flex: 1;
      padding: 10px;
      overflow-y: auto;
      font-size: 14px;
      color: white;
    }
    .chat-input {
      border-top: 1px solid #ccc;
      display: flex;
    }
    .chat-input input {
      flex: 1;
      padding: 8px;
      border: none;
      outline: none;
    }
    .chat-input button {
      padding: 8px 12px;
      border: none;
      background: #333;
      color: white;
      cursor: pointer;
    }
    /* chat box stuff end */