/* Base Reset & Font */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --nullstate-border: #7f3aed;
  --nullstate-bg: linear-gradient(to bottom, #2d2d2d, #7c3aed);
  --gaia-border: #38c759;
  --gaia-bg: linear-gradient(to left, #2d2d2d, #34c759);
  --anarcap-border: #f9c518;
  --anarcap-bg: linear-gradient(to right, #2d2d2d, #f5c518);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #121212;
  color: #e0e0e0;
}

header {
  margin: 2rem 2rem 0 2rem; /* simulate padding from window edges */
  padding: 1rem 2rem;       /* inner spacing */
  background-color: #181818;
  color: #fff;
  border-radius: 8px; /* optional: looks better with spacing */
}

main {
  flex: 1 0 auto;
  padding: 2rem;
}

footer {
  padding: 1rem;
  text-align: center;
  background: #181818;
  color: #888;
  margin-top: 4rem;
  width: 100%;
  box-sizing: border-box;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.header {
  background-color: #87ddbb;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.04);
  color: #00f4b0;
  background-color: #051417; /* subtle glow */
  background: linear-gradient(135deg, #031b1d 0%, #031b1d 70px, #051417 110px, #051417 100%);
  box-shadow: 0 0 10px #00f4b0aa; /* light glow effect */
}

header.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 2px solid #333;
}

.logo-img {
  height: 100px;
  width: 100px;
  margin-right: 1rem;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #ffffff;
}

.tagline {
  margin-left: auto;
  font-style: italic;
  font-size: 0.9rem;
  color: #888;
}

.hidden {
  display: none !important;
}

.main {
  padding: 2rem;
  flex: 1;
}

/* Map Simulation Area */
.map-container {
  background-color: #121212;
  padding: 2rem;
  margin-top: 3rem;
  border: 2px solid #222;
  border-radius: 1rem;
}

.map {
  display: grid;
  grid-template-columns: repeat(10, 32px);
  gap: 4px;
  justify-content: center;
}

.tile {
  width: 32px;
  height: 32px;
  background-color: #2a2a2a;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tile:hover {
  background-color: #444;
}

.resource-tile {
  background-color: #3e7726;
}

.player-info {
  margin-top: 2rem;
  background-color: #181818;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
}

.reputation-bar {
  margin-top: 0.5rem;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.reputation-bar-fill {
  height: 100%;
  background: linear-gradient(to right, red, orange, yellow, limegreen, cyan);
}

.faction-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 50%;
  background-color: #2a2a2a;
  color: #fff;
  border: 2px solid #666;
  transition: transform 0.2s, background-color 0.3s;
}

.swal-radial-popup {
  border-radius: 1rem;
  border: 1px solid rgba(94, 234, 212, 0.2);
  box-shadow: 0 0 25px rgba(94, 234, 212, 0.3);
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  backdrop-filter: blur(6px);
}

.swal-radial-title {
  color: #5eead4;
  font-size: 1.5rem;
  text-shadow: 0 0 4px rgba(94, 234, 212, 0.3);
}

.swal-radial-text {
  color: #94a3b8;
  font-size: 1rem;
}

.swal-radial-confirm {
  background-color: #5eead4 !important;
  color: #0f172a !important;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
}

.swal-radial-cancel {
  background-color: #f87171 !important;
  color: #fff !important;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
}

select, input {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus, input:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.2);
}

label {
  display: block;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #ccc;
}

#reputation-symbols div {
  font-size: 1.2rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #121212; /* or whatever "empty" background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Orbitron', sans-serif;
  color: #e0e0e0;
  font-size: 1.5rem;
}

.spinner {
  border: 8px solid #333;
  border-top: 8px solid #00ffe7;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-message {
  font-size: 1.6rem;
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  text-align: center;
  padding: 2rem;
}

.loading-light {
  display: inline-block;
    background: linear-gradient(
    to right,
    #ffffff 20%,
    #888888 40%,
    #ffffff 60%
  );
  background-size: 200% auto;
  background-position: 0% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lightSweep 4s linear infinite;
}

@keyframes lightSweep {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.dots::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 8s steps(1, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }   
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #1f2937; /* Tailwind gray-800 */
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #4b5563; /* Tailwind gray-600 */
  border-radius: 10px;
  border: 2px solid #1f2937; /* Match track bg */
}

/* Firefox support */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}
.breathe {
  animation: breathe 3s ease-in-out infinite;
}

.auth-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-box {
  background: #1f1f1f;
  border: 1px solid #444;
  padding: 2rem;
  border-radius: 8px;
  width: 300px;
  text-align: center;
}

.auth-box input {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  font-size: 1rem;
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #555;
}

#extra-fields {
  display: none;
}

#register-btn {
  display: none;
}

.choose-faction-title {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  margin: 0 auto;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #f0f0f0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
}

@media (max-width: 600px) {
  .choose-faction-title {
    font-size: 1.8rem;
    height: auto;
    padding: 1rem;
  }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1 0 auto;
}

.auth-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px #4caf9f);
}

.auth-overlay {
  transition: opacity 0.3s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.factions {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem; /* Adds space between cards */
  justify-content: center;
}

.faction-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 320px;
  max-width: 90vw;
  height: auto;
  margin: 2rem auto; /* Center horizontally */
  text-align: center;
  transition: background 0.3s ease;
  cursor: pointer;
  opacity: 0.9;
  pointer-events: auto; /* Enable interaction */
}

.faction-card:hover {
  background: rgba(255 255 255 / 0.18);
}

.faction-card.enabled {
  opacity: 1;
  pointer-events: auto;
}

.selected {
  border: 2px solid var(--selected-border);
  background: var(--selected-bg);
}

/* Faction icon placeholders */
.icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 0 6px #0af);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  user-select: none;
}


.gaia {
  background: linear-gradient(145deg, #121212, #323232);
  filter: drop-shadow(0 0 12px #4caf50);
  color: #4caf50;
}

.anarcap {
  background: linear-gradient(145deg, #121212, #323232);
  filter: drop-shadow(0 0 12px #e65100);
  color: #e65100;
}

.nullstate {
  background: linear-gradient(145deg, #121212, #323232);
  filter: drop-shadow(0 0 12px #00ffe7);
  color: #00ffe7;
}

.faction-card h2 {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.03em;
}
.faction-card p {
  flex-grow: 1;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.btn {
  align-self: flex-start;
  background: #00ffe7;
  color: #121212;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background-color 0.3s ease;
  user-select: none;
}
.btn:hover,
.btn:focus {
  background: #00cbb8;
  outline: none;
}

#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#offline-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align:center;
}

.section { margin-bottom: 2rem; }
    
input, select, button {
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 1rem;
}

@media (max-width: 480px) {
  header h1 {
    font-size: 2.25rem;
  }
  header p {
    font-size: 1rem;
  }
}

.wallet-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
  padding: 2rem;
}

.wallet-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 2rem 3rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  max-width: 400px;
}

.wallet-card h2 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.wallet-card p {
  font-size: 1rem;
  margin-bottom: 2rem;
  color: #ccc;
}

.wallet-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.wallet-button:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.rep-red { color: #ff5555; }
.rep-neutral { color: #dddddd; }
.rep-blue { color: #59bfff; }
.rep-green { color: #38c759; }

.rep-burning-red {
  color: #ff3c3c;
  text-shadow: 0 0 4px #ff6a00, 0 0 8px #ff2e2e;
  animation: flicker 1s infinite alternate;
}

@keyframes flicker {
  0% { text-shadow: 0 0 3px #ff0000, 0 0 7px #ff8c00; opacity: 0.95; }
  50% { text-shadow: 0 0 5px #ff4500, 0 0 10px #ffa500; opacity: 0.85; }
  100% { text-shadow: 0 0 4px #ff0000, 0 0 8px #ff6a00; opacity: 1; }
}

.rep-electric-green {
  color: #80ff80;
  text-shadow: 0 0 6px #00ff00, 0 0 12px #66ff66;
  animation: zap 1.5s infinite ease-in-out;
}

@keyframes zap {
  0% { text-shadow: 0 0 5px #00ff00, 0 0 10px #66ff66; transform: scale(1); }
  50% { text-shadow: 0 0 10px #00ff00, 0 0 18px #80ff80; transform: scale(1.05); }
  100% { text-shadow: 0 0 5px #00ff00, 0 0 10px #66ff66; transform: scale(1); }
}

#globeViz {
  width: 100%;    /* or 100%, or whatever */
  height: 100%;
  position: relative;  /* needed for proper canvas sizing */
}

#globeViz canvas {
  border-radius: 1rem; /* or 50% for a circle */
  overflow: hidden;
}

#country-land-panel {
  position: absolute;
  top: 10%;
  right: 5%;
  background: rgba(255,255,255,0.95);
  padding: 1em;
  border-radius: 8px;
  box-shadow: 0 0 10px #0003;
  z-index: 1000;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 5px;
  margin-top: 1em;
}

.land-tile {
  width: 40px;
  height: 40px;
  background: #cfc;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #999;
  cursor: pointer;
}
