:root {
    --color-primary: #00ff00;
    --color-secondary: #ff00ff;
    --color-background: #000000;
    --color-text: #ffffff;
    --color-alert: #ff0000;
    --color-health: #00ff44;
    --color-stability: #ffcc00;
    --color-responsiveness: #00ccff;
    --color-connectivity: #ff9900;
    --color-energy: #ffcc00;
    --color-memory: #00ccff;
    --color-bandwidth: #00ff99;
    --color-package: #ff9966;
    --color-resonance: #cc66ff;
    --hud-background: rgba(0, 20, 40, 0.85);
    --hud-border: rgba(0, 180, 255, 0.5);
    --hud-section-bg: rgba(0, 40, 80, 0.5);
    --font-family: "MesloLGS NF", monospace;
}

@font-face {
  font-family: "MesloLGS NF";
  src: url("/fonts/MesloLGS_NF_Regular.ttf");
  font-weight: normal;
  font-style: normal;
 }
 @font-face {
     font-family: "MesloLGS NF";
     src: url("/fonts/MesloLGS_NF_Bold.ttf");
     font-weight: bold;
     font-style: normal;
 }
 @font-face {
     font-family: "MesloLGS NF";
     src: url("/fonts/MesloLGS_NF_Italic.ttf");
     font-weight: normal;
     font-style: italic;
 }
 @font-face {
     font-family: "MesloLGS NF";
     src: url("/fonts/MesloLGS_NF_Bold_Italic.ttf");
     font-weight: bold;
     font-style: italic;
 }

body {
    margin: 0;
    padding: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family);
    overflow: hidden;
    line-height: 1.1;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#statusOverlay {
    position: absolute;
    top: 0;
    /* left: 1rem; */
    left: 0;
    display: flex;
    flex-direction: column;
    /* gap: 0.5rem; */
    gap: 0;
    pointer-events: none;
    z-index: 10;    
    font-family: var(--font-family);
    color: #0f0;
    background: none;
    padding: 0.4rem;
    width: 220px;
    /* border: 1px solid #333; */
}

.status-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.primary-stats {
    /* font-size: 1.2rem; */
    /* font-weight: bold; */
}

.extended-stats {
    opacity: 0.8;
    border-top: 1px solid #333;
    padding-top: 0.5rem;
}

#notifications {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 130px;
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 0;
  overflow: hidden;
  font-size: 0.8rem;
}

.notification {
  font-family: var(--font-family);
  background-color: #000000;
  color: var(--color-primary, #00ff00);
  border: 1px solid rgba(0, 255,0, 0.2);
  margin-bottom: 8px;
  padding: 8px 16px;
  max-width: 80%;
  text-align: left;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s, transform 0.5s;
  position: relative;
}

.notification.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

.notification.info {
  border: 1px solid rgba(0, 255,0, 0.2);
  color: var(--color-primary, #00ff00);
}

/* .notification.info::after {
  background-color: var(--color-primary, #00ff00);
} */

.notification.warning {
  border-color: var(--color-stability, #ffcc00);
  color: var(--color-stability, #ffcc00);
}

/* .notification.warning::before {
  content: "! ";
  color: var(--color-stability, #ffcc00);
} */

/* .notification.warning::after {
  background-color: var(--color-stability, #ffcc00);
} */

.notification.error {
  border-color: var(--color-alert, #ff0000);
  color: var(--color-alert, #ff0000);
}

/* .notification.error::before {
  content: "!! ";
  color: var(--color-alert, #ff0000);
} */

/* .notification.error::after {
  background-color: var(--color-alert, #ff0000);
} */

.notification.success {
  border-color: var(--color-health, #00ff44);
  color: var(--color-health, #00ff44);
}

/* .notification.success::before {
  content: "+ ";
  color: var(--color-health, #00ff44);
} */

/* .notification.success::after {
  background-color: var(--color-health, #00ff44);
} */

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

#promptArea {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
    z-index: 100;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    pointer-events: none;
    max-width: 80%;
}
/* 
.prompt {
    font-family: monospace;
    padding: 15px 25px;
    background-color: #000000;
    border: 2px solid var(--color-primary, #00ff00);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    color: var(--color-primary, #00ff00);
    transition: opacity 0.5s, transform 0.5s;
    position: relative;
}

.prompt.critical {
    border-color: var(--color-alert, #ff0000);
    color: var(--color-alert, #ff0000);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.prompt.warning {
    border-color: var(--color-stability, #ffcc00);
    color: var(--color-stability, #ffcc00);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

.prompt.success {
    border-color: var(--color-health, #00ff44);
    color: var(--color-health, #00ff44);
    box-shadow: 0 0 15px rgba(0, 255, 68, 0.3);
}

.prompt.fade-out {
    opacity: 0;
    transform: translateY(-20px);
} */

.debug-overlay {
    position: fixed;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

#buttonInterface {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
}

.button-row {
    display: flex;
    width: 100%;
    max-width: 1024px;
    justify-content: space-between;
}

.button-position {
    /* Each position takes equal space */
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 5px;

    text-align: center; /* Center the text MAYBE WORKS */
}

.network-button {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #0f0;
    padding: 10px 15px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 120px;
    position: relative;
    overflow: hidden;
}

.network-button:hover {
    background: #2a2a2a;
}

.network-button.active {
    background: #0f0;
    color: #000;
}

.network-button.hidden {
    display: none;
}

#activityLog {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    /* border-top: 1px solid #333; */
    /* border-bottom: 1px solid #333; */
    font-family: var(--font-family);    
    color: #0f0;
    text-align: center;
    padding: 5px 0;
}

.log-content {
    display: flex;
    justify-content: center;
    gap: 20px;
    white-space: nowrap;
    overflow-x: auto;
}

.log-entry {
    display: inline-flex;
    gap: 10px;
    padding: 0 10px;
}

#extendedStats {
    display: none;
}

.stat-item {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.stat-item .label {
    color: #888;
} 

#phaseIndicator {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-family);
  z-index: 100;
}

.phase-name {
  font-weight: bold;
  font-size: 14px;
}

.subview-name {
  font-size: 12px;
  opacity: 0.8;
}

/* View Switcher */
#viewSwitcher {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
}

.view-button {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
}

.view-button.active {
  background-color: rgba(0, 100, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Resource Indicators */
/* .resource-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
} */

#energyIndicator, #memoryIndicator, #bandwidthIndicator {
  display: flex;
  align-items: center;
  gap: 5px;
}

.resource-bar {
  width: 100px;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.energy-fill {
  height: 100%;
  background-color: #ffcc00;
  transition: width 0.3s ease;
}

.memory-fill {
  height: 100%;
  background-color: #00ccff;
  transition: width 0.3s ease;
}

.bandwidth-fill {
  height: 100%;
  background-color: #00ff99;
  transition: width 0.3s ease;
}

.package-fill {
    background: linear-gradient(to right, var(--color-package), #ffcc66);
    box-shadow: 0 0 5px var(--color-package);
}

.resonance-fill {
    background: linear-gradient(to right, var(--color-resonance), #ff99ff);
    box-shadow: 0 0 5px var(--color-resonance);
}

/* Cooldown indicator */
.cooldown {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: height 0.1s linear;
}

/* Issue notification */
.issue-notification {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 8px;
  padding: 15px;
  max-width: 300px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.issue-notification.low {
  border-left: 4px solid yellow;
}

.issue-notification.medium {
  border-left: 4px solid orange;
}

.issue-notification.high {
  border-left: 4px solid red;
}

.issue-header {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.issue-name {
  font-size: 14px;
  margin-bottom: 5px;
}

.issue-severity, .issue-metric {
  font-size: 12px;
  opacity: 0.8;
}

.issue-dismiss {
  margin-top: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.issue-dismiss:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Animation classes */
.health-increase, .health-decrease {
  position: absolute;
  font-weight: bold;
  transition: transform 1s ease, opacity 1s ease;
  opacity: 1;
}

.health-increase {
  color: #00ff00;
}

.health-decrease {
  color: #ff0000;
}

.connectivity-increase, .connectivity-decrease {
  position: absolute;
  font-weight: bold;
  transition: transform 1s ease, opacity 1s ease;
  opacity: 1;
}

.connectivity-increase {
  color: #00ccff;
}

.connectivity-decrease {
  color: #ff6600;
}

.scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0,255,255,0.2) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 50;
}

/* .network-button.active {
  transform: scale(0.95);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
  background-color: rgba(0, 255, 255, 0.3);
  border-color: rgba(0, 255, 255, 1);
  transition: all 0.1s ease;
} */

/* #viewSwitcher, #phaseIndicator {
  display: none !important;
} */

/* Game HUD Styling */
/* #statusOverlay.game-hud {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
    z-index: 10;
    font-family: var(--font-family);

    color: #fff;
    padding: 1rem;
    max-width: 320px;
} */

.hud-section {
    /* background: var(--hud-section-bg); */
    /* border-radius: 4px; */
    padding: 0.6rem;
    /* border-left: 2px solid var(--hud-border); */
}

.hud-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 180, 255, 0.3);
    padding-bottom: 0.3rem;
}

.hud-row {
    margin-bottom: 0.5rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.metric-label, .resource-label {
    width: 110px;
    opacity: 0.8;
}

.metric-bar, .resource-bar {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 20px;
    display: none;
}

.metric-fill, .resource-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.metric-value {
    width: 40px;
    text-align: right;
    font-weight: bold;
    flex-grow: 1;
}

.health-fill {
    background: linear-gradient(to right, var(--color-health), #7eff9a);
    box-shadow: 0 0 5px var(--color-health);
}

.stability-fill {
    background: linear-gradient(to right, var(--color-stability), #ffe066);
    box-shadow: 0 0 5px var(--color-stability);
}

.responsiveness-fill {
    background: linear-gradient(to right, var(--color-responsiveness), #66e0ff);
    box-shadow: 0 0 5px var(--color-responsiveness);
}

.connectivity-fill {
    background: linear-gradient(to right, var(--color-connectivity), #ffcc80);
    box-shadow: 0 0 5px var(--color-connectivity);
}

.energy-fill {
    background: linear-gradient(to right, var(--color-energy), #ffe066);
    box-shadow: 0 0 5px var(--color-energy);
}

.memory-fill {
    background: linear-gradient(to right, var(--color-memory), #66e0ff);
    box-shadow: 0 0 5px var(--color-memory);
}

.bandwidth-fill {
    background: linear-gradient(to right, var(--color-bandwidth), #66ffcc);
    box-shadow: 0 0 5px var(--color-bandwidth);
}

.system-metrics {
    font-size: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.info-item .value {
    font-weight: bold;
    color: #7fffff;
}

/* Keep existing resource indicators for compatibility */
/* .resource-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
} */

#phaseIndicator {
  display: none;
}
#stateMode {
  position: absolute;
  padding: 1rem;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
  font-size: 0.8rem;
}
/* State-specific HUD Styling */
#stateOverlay {
    position: absolute;
    top: 0rem;
    right: 0rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
    z-index: 10;
    font-family: var(--font-family);    
    color: #fff;
    padding: 0.4rem;
    width: 220px;
    font-size: 0.8rem;
}

.state-hud-section {
    padding: 0.6rem;
}

.state-hud-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 180, 255, 0.3);
    padding-bottom: 0.3rem;
    text-align: right;
}

.state-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.state-metric-label {
    width: 110px;
    opacity: 0.8;
}

.state-metric-value {
    font-weight: bold;
    color: #7fffff;
    text-align: right;
    margin-left: auto;
}

/* State-specific info items */
.state-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.state-info-item .value {
    font-weight: bold;
    color: #7fffff;
}

/* Add these styles for the SecurityState UI */
.state-metric-value.safe {
    color: #00ff88;
}

.state-metric-value.warning {
    color: #ffcc00;
}

.state-metric-value.danger {
    color: #ff3300;
}

.scan-progress {
    margin-top: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #00ccff, #00ffcc);
    box-shadow: 0 0 5px #00ccff;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 3px;
    color: #00ccff;
}

.instructions {
    font-size: 0.75rem;
    line-height: 1.2;
}

.last-scan-info {
    font-size: 0.75rem;
}


/* Refine the upgrade screen styles */
.upgrade-screen {
    position: fixed;
    top: 0;
    left: 220px;
    right: 220px;
    bottom: 120px;
    background-color: rgba(0, 20, 40, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    color: white;
    font-family: var(--font-family);

    overflow: hidden;
}

.upgrade-grid-container {
    /* flex: 1; */
    overflow-y: auto;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid rgba(0, 180, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(0, 40, 80, 0.3);
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.upgrade-item {
    background-color: rgba(0, 40, 80, 0.5);
    border: 1px solid rgba(0, 180, 255, 0.3);
    border-radius: 4px;
    padding: 15px;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.upgrade-item.selected {
    background-color: rgba(0, 100, 200, 0.5);
    border-color: rgba(0, 255, 255, 1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.upgrade-item.purchased {
    background-color: rgba(0, 80, 40, 0.5);
    border-color: rgba(0, 255, 136, 0.8);
}

.upgrade-item.locked {
    background-color: rgba(40, 40, 40, 0.5);
    border-color: rgba(180, 180, 180, 0.3);
    opacity: 0.7;
}

.upgrade-controls-guide {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 180, 255, 0.3);
}

.control-button-guide {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-button {
    background-color: rgba(0, 40, 80, 0.8);
    border: 1px solid rgba(0, 180, 255, 0.5);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

/* Navigation button overlay */
.navigation-button-overlay {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1001;
    display: none; /* Start hidden by default */
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
}

.navigation-button-overlay.hidden {
    display: none;
}

.nav-button {
    background-color: rgba(0, 60, 120, 0.8);
    color: white;
    border: 1px solid rgba(0, 180, 255, 0.5);
    transition: all 0.2s ease;
}

.nav-button:hover {
    background-color: rgba(0, 100, 200, 0.8);
}

.nav-button.active {
    background-color: rgba(0, 255, 255, 0.5);
    color: black;
}

/* Highlight the selected upgrade with a pulsing effect */
@keyframes selectedPulse {
    0% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.5); }
}

.upgrade-item.selected {
    animation: selectedPulse 2s infinite;
}

/* Add styles for the upgrade info modal */
.upgrade-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upgrade-info-content {
    background-color: rgba(0, 40, 80, 0.95);
    border: 2px solid rgba(0, 180, 255, 0.8);
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 80%;
    color: white;
    font-family: var(--font-family);

}

.upgrade-info-content h3 {
    color: #00ccff;
    margin-top: 0;
    border-bottom: 1px solid rgba(0, 180, 255, 0.5);
    padding-bottom: 10px;
}

.upgrade-category {
    color: #7fffff;
    font-weight: bold;
    text-transform: capitalize;
}

.upgrade-level {
    color: #ffcc00;
}

.upgrade-description {
    margin: 15px 0;
    line-height: 1.4;
}

.upgrade-cost-detail, .upgrade-effect-detail {
    margin: 10px 0;
}

.upgrade-cost-detail h4, .upgrade-effect-detail h4 {
    color: #7fffff;
    margin-bottom: 5px;
}

.upgrade-requirement {
    color: #ff9900;
    font-style: italic;
    margin-top: 15px;
}

.close-info-button {
    background-color: rgba(0, 100, 200, 0.8);
    color: white;
    border: 1px solid rgba(0, 180, 255, 0.5);
    border-radius: 4px;
    padding: 8px 15px;
    margin-top: 15px;
    cursor: pointer;
    font-family: var(--font-family);

    transition: all 0.2s ease;
}

.close-info-button:hover {
    background-color: rgba(0, 150, 255, 0.8);
}

/* Add category color indicators */
.upgrade-category.category-compute {
    color: #00ccff;
}

.upgrade-category.category-memory {
    color: #00ff88;
}

.upgrade-category.category-bandwidth {
    color: #ff9900;
}

.upgrade-category.category-special {
    color: #ff00ff;
}

/* Class to hide buttons during upgrade screen */
.hidden-during-upgrade {
  display: none !important;
}

#statusOverlay.fade-inactive,
.status-overlay.fade-inactive,
#stateOverlay.fade-inactive  {
  opacity: 0.18 !important;
  transition: opacity 0.1s ease-out;
}

.status-overlay,
#stateOverlay {
  opacity: 1;
  transition: opacity 0.1s ease-in;
}

/* State Transition Overlay */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

.transition-content {
    position: relative;
    background-color: rgba(0, 20, 0, 0.9);
    border: 1px solid #33ff33;
    padding: 20px;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.3);
    text-align: center;
    color: #33ff33;
    font-family: var(--font-family);

    max-width: 80%;
}

.transition-icon {
    font-size: 24px;
    margin-bottom: 15px;
    animation: pulse 1.5s infinite;
    font-family: var(--font-family);
    letter-spacing: -1px;
    width: 36px;
    height: 36px;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #33ff33;
}

.transition-message {
    font-size: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    font-family: var(--font-family);
}

.transition-description {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 15px;
    font-family: var(--font-family);
}

/* Replace emoji icons with ASCII/text alternatives */
.transition-icon.maintenance::before {
    content: '[M]';
}

.transition-icon.node_repair::before {
    content: '[R]';
}

.transition-icon.care_collective::before {
    content: '[C]';
}

.transition-icon.idle::before {
    content: '[I]';
}

.transition-icon.traffic_flow::before {
    content: '[T]';
}

.transition-icon.security::before {
    content: '[S]';
}

.transition-icon.commune::before {
    content: '[N]';
}

.transition-icon.package_collector::before {
    content: '[P]';
}

.transition-icon.network_cleaning::before {
    content: '[X]';
}

.transition-icon.diagnostic::before {
    content: '[D]';
}

.transition-icon.packet_repair::before {
    content: '[F]';
}

.transition-icon.default::before {
    content: '[>]';
}

/* Animation for the icon */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(51, 255, 51, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(51, 255, 51, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(51, 255, 51, 0);
    }
}

.transition-progress {
    width: 100%;
    height: 10px;
    background-color: rgba(51, 255, 51, 0.2);
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid #33ff33;
}

.transition-progress-bar {
    height: 100%;
    background-color: #33ff33;
    width: 0%;
    transition: width 0.1s linear;
}

/* Blinking cursor for terminal effect */
@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.cursor {
    display: inline-block;
    animation: blink-cursor 1s infinite;
    font-weight: bold;
    margin-left: 4px;
}

/* Comms Terminal Styling */
#commsContainer {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  max-height: calc(100vh - 300px);
  background-color: rgba(0, 20, 40, 0.85);
  border: 1px solid rgba(0, 180, 255, 0.5);
  border-radius: 4px;
  color: white;
  font-family: var(--font-family);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#commsContainer.hidden {
  display: none;
}

#commsMessages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column-reverse; /* Newest at bottom */
  gap: 10px;
  min-height: 200px;
}

#commsInput {
  margin: 10px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.5);
  min-height: 20px;
  word-break: break-word;
  font-family: var(--font-family);
  font-size: 14px;
  color: #00ffff;
  border-radius: 4px;
}

#commsHeader {
  padding: 10px;
  background-color: rgba(0, 40, 80, 0.5);
  border-bottom: 1px solid rgba(0, 180, 255, 0.3);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

#commsCharCounter {
  text-align: right;
  padding: 0 10px 10px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
