@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

:root {
--sidebar-width: 300px;
--sidebar-width-mobile: 80%;
--tile-size: 48px;
--bottom-nav-height: 50px;
--game-success-color: #43a047;
--game-warning-color: #ffa000;
--game-danger-color: #d32f2f;
--splash-btn-width: 400px;
--splash-btn-height: 50px;
--splash-btn-radius: 8px;
--main-top-nav-height: 50px;
}

nav li {
  list-style: none;
  padding:0;
}

html {
image-rendering: auto;
}
body {
user-select: none;
font-family: "Press Start 2P", cursive, monospace !important;
}
#wrapper {
display: flex;
height: 100vh;
}
#main {
width: 100%;
height: 100%;
overflow: visible;
background-color: var(--pico-card-background-color, #222);
display: flex;
flex-direction: column;
min-height: 0;
}
.hidden {
display: none !important;
}
#splash-screen {
  text-align: center;
  font-family: "Press Start 2P", cursive, monospace !important;
  min-height: 100vh;
  padding-top: 5vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: #373737;
  background-image: url("../img/ui/tile.png");
  background-repeat: repeat;
  padding: 2rem;
  animation: splash-bg-scroll 120s linear infinite;
  background-size: auto;
}

@keyframes splash-bg-scroll {
  0% {
    background-position-y: 0;
    background-position-x: 0;
  }
  100% {
    background-position-y: 1024px;
    background-position-x: 1024px;
  }
}

@keyframes pulse {
50% {
transform: scale(1.1);
}
}
.splash-btn-row,
.splash-load-container {
display: flex;
flex-direction: row;
gap: 1rem;
justify-content: center;
align-items: stretch;
width: 100%;
max-width: 520px;
margin: 0 auto 1rem auto;
}
.splash-btn,
.splash-btn svg {
text-shadow: 1px 0 0 black, -1px 0 0 black, 0 1px 0 black, 0 -1px 0 black,
1px 1px 0 black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black;
}
.splash-btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--splash-btn-height);
  min-height: var(--splash-btn-height);
  font-family: "Press Start 2P", cursive, monospace !important;
  font-size: 1rem;
  border: 3px solid;
  border-color: #a0a0a0 #505050 #505050 #a0a0a0;
  background: #787878;
  color: #e0e0e0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: none;
  cursor: pointer;
  padding: 0 1rem;
  text-shadow: 2px 2px #383838;
  border-radius: 0;
}
.splash-btn:hover {
  color: #ffffa0;
  border-color: #c0c0c0 #606060 #606060 #c0c0c0;
}
.splash-btn:active {
  box-shadow: 0 1px 0 #222;
  border-color: #505050 #a0a0a0 #a0a0a0 #505050;
  background: #686868;
}
.splash-btn-continue {
  background: #5d9c51;
  border-color: #89c57d #416d39 #416d39 #89c57d;
  color: white;
  text-shadow: 2px 2px #365a2f;
  margin-bottom: 1rem;
  position: relative;
}

.splash-btn-continue .continue-label {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  opacity: 0.8;
  text-shadow: 1px 1px #222;
}
.splash-btn-continue:hover {
  background: #6daa5f;
  border-color: #a3d99a #4e8045 #4e8045 #a3d99a;
}
.splash-btn-exit {
  background: #ab3f3f;
  border-color: #d16b6b #7a2d2d #7a2d2d #d16b6b;
  color: white;
  text-shadow: 2px 2px #6e2a2a;
}
.splash-btn-exit:hover {
  background: #c24747;
}
.splash-btn-exit:active {
  background: #9e3939;
  border-color: #7a2d2d #d16b6b #d16b6b #7a2d2d;
}
.splash-btn[disabled],
.splash-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.splash-title {
  font-family: 'minecraftfont', "Press Start 2P", cursive, monospace !important;
  font-size: 3.5rem;
  letter-spacing: 2px;
  margin: 1.5rem 0 1rem 0;
  text-shadow: 4px 4px #3a3a3a;
  white-space: pre-line;
  color: #ededed;
}
.splash-menu-header {
  font-family: "Press Start 2P", cursive, monospace !important;
  font-size: 1.5rem;
  color: white;
  text-shadow: 2px 2px #222;
  margin-bottom: 1rem;
  text-align: center;
}
.splash-subtitle {
font-family: "Press Start 2P", cursive, monospace !important;
font-size: 1.1rem;
color: #b0e0e6;
margin-bottom: 2rem;
text-shadow: 1px 1px 0 #222;
}
.splash-btn-group {
display: flex;
width: var(--splash-btn-width);
max-width: var(--splash-btn-width);
margin: 0 auto 1.5rem auto;
gap: 0;
}
.splash-btn-group .splash-btn,
.cloud-loading {
width: 50% !important;
min-width: 0 !important;
max-width: none !important;
margin: 0;
border-radius: 0;
}
.splash-btn-left {
border-top-left-radius: var(--splash-btn-radius) !important;
border-bottom-left-radius: var(--splash-btn-radius) !important;
}
.splash-btn-right {
  border-top-right-radius: var(--splash-btn-radius) !important;
  border-bottom-right-radius: var(--splash-btn-radius) !important;
}

.splash-btn-full-width {
  width: 100% !important;
  max-width: 100% !important;
}

.splash-footer-links {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.5em;
  text-align: center;
  font-size: 0.7em;
  opacity: 0.6;
  font-family: inherit;
  z-index: 10;
}

.splash-footer-links a {
  color: #8fd694;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.splash-footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}





#parts_section {
z-index: 150;
position: fixed;
top: 0;
left: 0;
height: 100%;
padding-bottom: 80px;
background: #181c22;
border-right: 4px solid #5f6672;
border-left: 4px solid #2a2d34;
border-top: 4px solid #5f6672;
border-bottom: 4px solid #2a2d34;
box-shadow: 0 0 12px #000a;
padding: 0.5rem 0.25rem 0.5rem 0.25rem;
min-width: 200px;
max-width: 90vw;
display: flex;
flex-direction: column;
transition: transform 0.3s ease-in-out;
}
.parts_header {
background: #22252e;
border-bottom: 3px solid #5f6672;
border-top: 3px solid #2a2d34;
padding: 0.25rem 0.5rem;
margin-bottom: 0.25rem;
display: flex;
flex-direction: column;
align-items: stretch;
}
.parts_tabs {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
gap: 4px;
}
.parts_tab {
flex: 1 1 0;
min-width: 0;
max-width: 100%;
margin: 0;
background: #434955;
border: 2px solid #5f6672;
color: #9badb7;
font-family: inherit;
font-size: 1em;
padding: 0.4rem 0.2rem;
border-radius: 0;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.1s, border 0.1s;
min-height: 42px;
}
.parts_tab img {
width: 24px;
height: 24px;
image-rendering: pixelated;
image-rendering: -moz-crisp-edges;
image-rendering: crisp-edges;
object-fit: contain;
}
.parts_tab.active,
.parts_tab:active {
background: #59c435;
color: #181c22;
border-color: #59c435;
}
.parts_tab[disabled] {
opacity: 0.5;
cursor: not-allowed;
}
.parts_help_btn {
flex: 0 0 auto;
margin-left: 0.5em;
background: #434955;
border: 2px solid #5f6672;
color: #fff;
font-family: inherit;
font-size: 1em;
border-radius: 0;
min-width: 32px;
height: 32px;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background 0.1s, border 0.1s;
box-shadow: none;
}
.parts_help_btn.active {
background: #ffa500;
color: #181c22;
border-color: #ffa500;
}
#parts_tab_contents {
flex-grow: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 0 0.5rem 0.5rem 0.5rem;
}
.parts_tab_content {
display: none;
}
.parts_tab_content.active {
display: block;
}
.item-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 2px !important;
width: 100%;
overflow-x: hidden;
  padding: 1px !important;
background: #23272f;
border: 2px solid #5f6672;
border-radius: 0;
margin-bottom: 0.5rem;
}
.item-grid .part {
width: 48px;
height: 48px;
background: #434955;
border: 2px solid #5f6672;
border-radius: 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
transition: background 0.1s, border 0.1s;
padding: 0;
}
.item-grid .part:hover,
.item-grid .part:focus {
background: #59c435;
border-color: #59c435;
color: #181c22;
z-index: 2;
}
.item-grid .part:active {
background: #ffa500;
border-color: #ffa500;
color: #181c22;
}
.item-grid .part.part_active,
.item-grid .part.part_active:hover {
background: #59c435 !important;
border-color: #59c435 !important;
color: #181c22 !important;
box-shadow: 0 0 8px #59c43599 !important;
}
.item-grid .part.unaffordable {
opacity: 0.5;
cursor: not-allowed;
}
.item-grid .part .image {
width: 90%;
height: 90%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
display: block;
padding: 2px !important;
margin: 2px !important;
}
@media (max-width: 600px) {
#parts_section {
min-width: 0;
width: 85vw;
padding: 0.2rem 0.05rem 0.2rem 0.05rem;
}
.parts_header {
padding: 0.1rem 0.2rem;
}
.parts_tabs {
gap: 2px;
}
.parts_tab {
font-size: 0.9em;
padding: 0.4rem 0.2rem;
min-height: 45px;
}
.parts_tab img {
width: 26px;
height: 26px;
}
.item-grid {
  gap: 2px !important;
  padding: 2px !important;
}
.item-grid .part {
width: 40px;
height: 40px;
}
}
#reactor_wrapper {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
min-height: 0;
position: relative;
}

#reactor_background {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background: rgba(255, 0, 0, 0);
transition: background-color 0.5s ease, box-shadow 0.5s ease;
pointer-events: none;
z-index: 1;
overflow: hidden;
border-radius: 8px;
}

/* Heat warning glow effect */
#reactor_background.heat-warning {
box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.3);
}

#reactor_background.heat-critical {
box-shadow: inset 0 0 40px rgba(255, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.3);
}

/* Heat wiggle animation for individual tiles when heat gets too high */
@keyframes tile-heat-wiggle {
0%, 100% { transform: translateX(0px) translateY(0px); }
25% { transform: translateX(-1px) translateY(-1px); }
50% { transform: translateX(1px) translateY(1px); }
75% { transform: translateX(-1px) translateY(1px); }
}

.tile.heat-wiggle {
animation: tile-heat-wiggle 0.3s ease-in-out infinite;
}
#reactor_wrapper::-webkit-scrollbar {
height: 18px;
}
#reactor_wrapper::-webkit-scrollbar-thumb {
background: #5f6672;
border-radius: 8px;
}
#reactor_wrapper::-webkit-scrollbar-track {
background: #23272f;
}

/* Mobile-specific scrollbar styling */
@media (max-width: 900px) {
#reactor_wrapper::-webkit-scrollbar {
height: 12px;
}
#reactor_wrapper::-webkit-scrollbar-thumb {
background: #5f6672;
border-radius: 6px;
}
#reactor_wrapper::-webkit-scrollbar-track {
background: #23272f;
}

}
#reactor {
direction: ltr;
display: grid;
grid-template-columns: repeat(var(--game-cols, 12), var(--tile-size, 48px));
grid-template-rows: repeat(var(--game-rows, 12), var(--tile-size, 48px));
margin: 0;
/* overflow: auto; */
flex: 1 1 auto;
padding: 5px;
}
#reactor button.tile {
width: var(--tile-size, 48px);
height: var(--tile-size, 48px);
min-width: 0;
min-height: 0;
box-sizing: border-box;
}
@media (min-width: 901px) {
#reactor button.tile {
width: var(--tile-size);
height: var(--tile-size);
}
}
.tile {
width: var(--tile-size);
height: var(--tile-size);
background-color: var(--pico-contrast-background-color);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
position: relative;
transition: all 0.1s ease;
border: 1px solid var(--pico-form-element-border-color);
}
@media (min-width: 901px) {
.tile {
width: var(--tile-size);
height: var(--tile-size);
}
}
.tile:hover {
background-color: var(--pico-primary-hover);
}
.tile.enabled {
opacity: 1;
}
.tile[class*="part_"] {
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.percent_wrapper_wrapper {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 14px;
background: rgba(0, 0, 0, 0.85);
border-radius: 0 0 2px 2px;
overflow: hidden;
z-index: 10;
display: block;
}
.percent_wrapper {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
gap: 1px;
}
.percent {
height: 50%;
min-height: 6px;
width: 0%;
transition: width 0.3s ease;
border-radius: 0 0 2px 2px;
}
.percent.heat {
background: linear-gradient(
to right,
#e74c3c,
#c0392b
) !important;
box-shadow: 0 0 4px rgba(231, 76, 60, 0.6);
}
.percent.durability {
background: linear-gradient(
to right,
#59c435,
#27ae60
) !important;
box-shadow: 0 0 4px rgba(89, 196, 53, 0.6);
}
.tile[class*="part_"] .percent_wrapper_wrapper {
height: 10px;
background: rgba(0, 0, 0, 0.8);
}
.tile:hover .percent_wrapper_wrapper {
height: 12px;
background: rgba(0, 0, 0, 0.9);
}
.tile[class*="part_"] .percent_wrapper_wrapper {
background: rgba(0, 0, 0, 0.85);
}
.tile .percent_wrapper_wrapper::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 0 0 2px 2px;
pointer-events: none;
z-index: 1;
}
.tile.spent {
opacity: 0.5;
filter: grayscale(100%);
}
.tile.is-processing {
animation: processing-pulse 1s infinite;
}
@keyframes processing-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.tile.exploding {
background-image: url('../img/ui/effects/explosion_map.png') !important;
background-size: 500% 100% !important;
animation: explosion-animation 0.6s steps(4, end) forwards;
background-repeat: no-repeat !important;
background-color: transparent !important;
z-index: 10;
position: relative;
width: 100% !important;
height: 100% !important;
transform: translateZ(0); /* Force hardware acceleration */
}

/* Hide part image during explosion */
.tile.exploding img {
display: none !important;
}

@keyframes explosion-animation {
0% { background-position: 0% 0%; }
100% { background-position: 100% 0%; }
}
.tile .sell-indicator {
position: absolute;
top: 2px;
right: 2px;
width: 8px;
height: 8px;
background: #ff0000;
border-radius: 50%;
opacity: 0;
transition: opacity 0.2s;
}
.tile.selling .sell-indicator {
opacity: 1;
}
#info_bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100vw !important;
  min-width: 0;
  background: linear-gradient(180deg, #1a1d24 0%, #2a2d34 50%, #1a1d24 100%) !important;
  border-top: 3px solid #444 !important;
  position: fixed;
  left: 0 !important;
  right: 0 !important;
  z-index: 26;
  bottom: var(--bottom-nav-height);
  height: 44px; /* slightly shorter for more space */
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.3),
    0 2px 8px rgba(0,0,0,0.5),
    0 0 20px rgba(0,255,255,0.1);
  overflow: hidden;
}

/* Industrial grille pattern overlay */
#info_bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.3) 2px,
      rgba(0,0,0,0.3) 10px
    );
  pointer-events: none;
  z-index: 1;
}



/* Angled struts removed - no longer needed */

/* Desktop Layout */
.info-bar-desktop {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1em;
  position: relative;
  z-index: 4;
  padding: 0 40px;
}



.info-bar-desktop .info-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  background: rgba(0,0,0,0.3);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.3) 2px,
    rgba(0,0,0,0.3) 10px
  );
  border: 2px solid #555;
  border-radius: 6px;
  min-width: 0;
  max-width: none;
  height: 48px;
  padding: 0 16px;
  white-space: nowrap;
  gap: 0.4em;
  position: relative;
  backdrop-filter: blur(2px);
  transition: all 0.2s ease;
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.1),
    0 1px 3px rgba(0,0,0,0.3);
  text-align: center;
}

.info-bar-desktop .info-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,255,255,0.1) 0%, transparent 50%, rgba(0,255,255,0.05) 100%);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.info-bar-desktop .info-item:hover::before {
  opacity: 1;
}

.info-bar-desktop .info-item.heat,
.info-bar-desktop .info-item.power {
  cursor: pointer;
  background: rgba(0,0,0,0.4);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.3) 2px,
    rgba(0,0,0,0.3) 10px
  );

  border: 2px solid #666;
  outline: none;
  padding: 0 12px;
  margin: 0;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.1),
    0 1px 3px rgba(0,0,0,0.3);
  flex: 3 1 0;
  text-align: center;
}

/* Visual fill indicators for power and heat */
.info-bar-desktop .info-item.power::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 8px,
    rgba(0,255,255,0.4) 8px,
    rgba(0,255,255,0.4) 12px
  );
  background-size: 12px 100%;
  background-repeat: repeat-x;
  clip-path: inset(0 calc(100% - var(--fill-height, 0%)) 0 0);
  transition: clip-path 0.3s ease;
  z-index: -1;
}

.info-bar-desktop .info-item.heat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 2px,
    rgba(244,67,54,0.4) 2px,
    rgba(244,67,54,0.4) 10px
  );
  background-size: 12px 100%;
  background-repeat: repeat-x;
  clip-path: inset(0 calc(100% - var(--fill-height, 0%)) 0 0);
  transition: clip-path 0.3s ease;
  z-index: -1;
}

.info-bar-desktop .info-item.heat:hover,
.info-bar-desktop .info-item.power:hover {
  background: rgba(0,255,255,0.1);
  border-color: #00ffff;
  box-shadow: 
    0 0 10px rgba(0,255,255,0.3),
    inset 0 0 10px rgba(0,255,255,0.1);
  transform: translateY(-1px);
}

.info-bar-desktop .info-item.heat:active,
.info-bar-desktop .info-item.power:active {
  transform: translateY(0);
  box-shadow: 
    0 0 5px rgba(0,255,255,0.2),
    inset 0 0 5px rgba(0,255,255,0.1);
}

.info-bar-desktop .info-item .denom {
  opacity: 0.7;
  font-size: 0.85em;
  margin-left: 0.2em;
  font-weight: normal;
  margin-bottom: 0;
  display: inline;
  position: static;
  color: #aaa;
  text-align: center;
}

.info-bar-desktop .info-item.money {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  background: rgba(0,0,0,0.5);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.3) 2px,
    rgba(0,0,0,0.3) 10px
  );
  border: 2px solid #aaa;
  border-radius: 8px;
  flex: 1 1 0;
  box-shadow: 
    inset 0 1px 2px rgba(255,255,255,0.2),
    0 2px 6px rgba(0,0,0,0.4);
  text-align: center;
}

/* Mobile Layout */
.info-bar-mobile {
  display: none;
}

#info_bar .info-icon {
  width: 8px;
  height: 8px;
  margin-right: 0.2em;
}

/* Info bar icon sizing to match tab icons */
#info_bar .icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,255,255,0.5));
}

#info_bar .info-label {
  font-weight: bold;
  margin-right: 0.2em;
  color: #fff;
  text-shadow: 0 0 4px rgba(0,255,255,0.5);
}

#info_bar .info-value {
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 6px rgba(0,255,255,0.8);
}

#info_bar .info-max {
  opacity: 0.7;
  margin-left: 0.2em;
  font-size: 0.85em;
  color: #aaa;
}
footer#bottom_nav {
background: #23272e !important;
border-top: 2px solid #444 !important;
margin: 0 !important;
padding: 0 5px 5px 5px !important;
position: fixed;
left: 0;
right: 0;
bottom: 5px;
z-index: 25;
}
footer#bottom_nav nav,
footer#bottom_nav ul {
width: 100% !important;
height: 100%;
margin: 0 !important;
padding: 0 !important;
display: flex;
align-items: center;
}
footer#bottom_nav ul {
flex-direction: row;
width: 100%;
height: 100%;
}
footer#bottom_nav li {
flex: 1 1 0;
height: 100%;
display: flex;
align-items: center;
padding:none !important;
}
footer#bottom_nav button {
width: 100%;
height: 100%;
border-radius: 0;
margin: 0;
padding: 0;
font-size: 1.1em;
background: none;
border: none;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
box-sizing: border-box;
}
#bottom_nav button,
#bottom_nav .secondary {
width: 100%;
border-radius: 0;
margin: 0;
padding: 1em 0;
font-size: 1em;
background: none;
border: none;
color: #fff;
  display: flex;              /* ensure horizontal + vertical centering */
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1;
transition: background 0.2s;
}
#bottom_nav button.active,
#bottom_nav .secondary.active {
background: #29aaff;
color: #222;
}
@media (min-width: 901px) {
#bottom_nav,
footer#bottom_nav {
display: none !important;
height: 0 !important;
padding: 0 !important;
margin: 0 !important;
border: none !important;
width: 0 !important;
overflow: hidden
}
#info_bar {
display: flex !important;
flex-direction: row !important;
align-items: center !important;
justify-content: center !important;
height: 50px !important;
padding: 0 !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
width: 100vw !important;
position: fixed !important;
z-index: 26 !important;
border-radius: 0 !important;
background: linear-gradient(180deg, #1a1d24 0%, #2a2d34 50%, #1a1d24 100%) !important;
box-shadow: 
  inset 0 2px 4px rgba(0,0,0,0.3),
  0 2px 8px rgba(0,0,0,0.5),
  0 0 20px rgba(0,255,255,0.1) !important;
overflow: hidden !important;
}
#info_bar::before {
display: block !important;
}
#info_bar::after {
display: block !important;
}
.info-bar-desktop {
display: flex !important;
}
.info-bar-mobile {
display: none !important;
}
}
#main_top_nav {
height: var(--main-top-nav-height, 50px);
}
@media (max-width: 900px) {
#parts_section {
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 200px;
max-width: 75vw;
z-index: 30;
transform: translateX(0);
transition: transform 0.3s cubic-bezier(0.4, 2, 0.6, 1);
}
#parts_section.collapsed {
transform: translateX(-100%);
}
#main_top_nav {
display: none;
}
#bottom_nav {
	 display: grid;
	 grid-template-columns: 1fr 1fr 1fr;
	 position: fixed;
	 bottom: 0;
	 left: 0;
	 right: 0;
	 height: 44px;
	 z-index: 10;
	 padding: 0;
	 gap: 0;
}
#info_bar {
 display: flex;
 flex-direction: column;
 width: 100vw !important;
 min-height: 60px;
 padding: 0 !important;
 margin: 0 !important;
 padding-left: 0 !important; /* override desktop panel offset */
 left: 0 !important;
 right: 0 !important;
 border: none;
 background: linear-gradient(180deg, #1a1d24 0%, #2a2d34 50%, #1a1d24 100%) !important;
}
#info_bar::before {
display: none;
}
#info_bar::after {
display: none;
}
.info-bar-desktop {
display: none !important;
}
.info-bar-mobile {
display: flex !important;
flex-direction: column;
width: 100%;
}
#info_bar .info-row {
display: grid;
grid-template-columns: repeat(3, 1fr);
width: 100%;
align-items: center;
justify-items: center;
gap: 4px;
padding: 0;
margin: 0;
}
#info_bar .info-row.info-main .info-item {
font-size: 1.1em;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
gap: 0.2em;
background: rgba(0,0,0,0.3);
background-image: repeating-linear-gradient(
  90deg,
  transparent 0px,
  transparent 2px,
  rgba(0,0,0,0.3) 2px,
  rgba(0,0,0,0.3) 10px
);
background-size: 12px 100%;
background-repeat: repeat-x;
border: 2px solid #555;
border-radius: 4px;
margin: 2px;
padding: 4px 8px;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
box-shadow: 
  inset 0 1px 2px rgba(255,255,255,0.1),
  0 1px 3px rgba(0,0,0,0.3);
}

/* Visual fill indicators for mobile power and heat */
#info_bar .info-row.info-main .info-item.power::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: repeating-linear-gradient(
  90deg,
  transparent 0px,
  transparent 2px,
  rgba(0,255,255,0.4) 2px,
  rgba(0,255,255,0.4) 10px
);
background-size: 12px 100%;
background-repeat: repeat-x;
clip-path: inset(0 calc(100% - var(--fill-height, 0%)) 0 0);
transition: clip-path 0.3s ease;
z-index: -1;
}

#info_bar .info-row.info-main .info-item.heat::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: repeating-linear-gradient(
  90deg,
  transparent 0px,
  transparent 2px,
  rgba(244,67,54,0.4) 2px,
  rgba(244,67,54,0.4) 10px
);
background-size: 12px 100%;
background-repeat: repeat-x;
clip-path: inset(0 calc(100% - var(--fill-height, 0%)) 0 0);
transition: clip-path 0.3s ease;
z-index: -1;
}
#info_bar .info-row.info-main .info-item:hover {
background: rgba(255,255,255,0.1);
border-color: #fff;
box-shadow: none;
}
#info_bar .info-row.info-main .info-item .value {
color: #fff;
text-shadow: none;
text-align: center;
}
#info_bar .info-row.info-denom .info-item {
font-size: 0.95em;
color: #aaa;
min-height: 1.2em;
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: 0.1em;
}
#info_bar .info-row.info-denom .info-item.money {
color: transparent;
}

/* Ensure EP element is positioned under the money section */
#info_bar .info-row.info-denom .info-item.ep {
grid-column: 2;
}
#mobile_top_bar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 44px + 4px); /* sit just above bottom info bar with tighter spacing */
  left: 8px;
  right: 8px;
  z-index: 20; /* below parts panel (z-index: 30) */
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  padding: 0;
  pointer-events: none; /* allow overlay without blocking reactor interactions */
}
#mobile_top_bar.active { display: flex; }
#mobile_top_bar .mobile-top-stats,
#mobile_top_bar #reactor_stats,
#mobile_top_bar .mobile-top-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: auto; width: 100%; padding-left:5px;padding-right:5px;}
#mobile_top_bar #reactor_stats { display: flex; gap: 6px; margin: 0; padding: 4px 6px; list-style: none; background: rgba(0,0,0,0.25); border-radius: 12px; }
#mobile_top_bar #reactor_stats li { display: flex; align-items: center; }
#mobile_top_bar #reactor_stats li strong { font-size: 0.9em; white-space: nowrap; }
#mobile_top_bar #reactor_copy_paste_btns {display: flex; gap: 6px; align-items: right ; justify-content: right;}
#mobile_top_bar #reactor_copy_paste_btns button { width: 32px; height: 32px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; }

/* Keep bottom info bar visible on mobile; the mobile top bar complements it */
}
#main_content_wrapper {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow: visible;
}
@media (max-width: 400px) {
  .splash-btn {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding-left: 1.2em;
    padding-right: 1.2em;
    font-size: 0.7rem;
    box-sizing: border-box;
  }
  
  .splash-version {
  bottom: 4.5em;
  font-size: 0.4em;
  transition: all 0.3s ease;
}

.splash-version.new-version {
  animation: version-flash 2s ease-in-out infinite;
  color: #ff6b6b;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

@keyframes version-flash {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}
  
  .splash-stats {
    bottom: 3.5em;
    font-size: 0.4em;
  }
  
  .splash-footer-links {
    bottom: 1.5em;
    padding-bottom: 0.5em;
    font-size: 0.4em;
  }
#bottom_nav button {
font-size: 0.7rem;
padding: 0.25rem 0.1rem;
}
footer#bottom_nav {
padding: 0 5px 5px 5px !important;
}
#info_bar {
bottom: 48px;
height: 42px;
padding: 0.25em 0;
width: 100vw;
background: linear-gradient(180deg, #1a1d24 0%, #2a2d34 50%, #1a1d24 100%) !important;
}
#info_bar .grid,
#info_bar .info-bar-row {
flex-direction: row !important;
flex-wrap: nowrap !important;
align-items: center !important;
justify-content: space-around !important;
}
#info_bar .info-bar-item {
min-width: 0;
flex: 1 1 0;
font-size: 0.75em;
gap: 0.1em;
}
#info_bar .info-label,
#info_bar .info-value,
#info_bar .info-max {
font-size: 0.9em;
margin: 0;
padding: 0;
}
#info_bar .info-value {
color: #00ffff;
text-shadow: 0 0 4px rgba(0,255,255,0.8);
}
#info_bar .info-icon,
#info_bar img.info-icon {
width: 6px !important;
height: 6px !important;
min-width: 6px !important;
min-height: 6px !important;
}
}
@media (max-width: 600px) {
#info_bar .info-bar-row {
gap: 0.2rem;
}
#info_bar .info-label {
font-size: 0.95em;
}
#info_bar .info-value {
font-size: 0.95em;
}
#info_bar .info-max {
font-size: 0.75em;
margin-left: 0.05em;
}
#info_bar .info-bar-item {
gap: 0.15em;
}

/* Info bar icon sizing for mobile to match tab icons */
#info_bar .icon {
width: 26px;
height: 26px;
}

/* Mobile splash screen bottom text spacing */
.splash-version {
  bottom: 5em;
  font-size: 0.45em;
}

.splash-stats {
  bottom: 4em;
  font-size: 0.45em;
}

.splash-footer-links {
  bottom: 2em;
  padding-bottom: 0.75em;
  font-size: 0.45em;
}
}
.unaffordable {
opacity: 0.5;
cursor: not-allowed;
}
.unaffordable .image {
filter: grayscale(100%);
}
.icon-inline {
width: 1em;
height: 1em;
vertical-align: -0.125em;
margin: 0 0.1em;
}
@media (min-width: 901px) {
#parts_section {
flex: 0 0 275px;
max-width: 275px;
min-width: 220px;
}
#parts_section.collapsed {
display: none;
}

/* Hide the toggle button on desktop since panel is locked open */
#parts_panel_toggle {
display: none !important;
}

/* Add left padding to main content when parts panel is visible */
body.page-reactor #main {
padding-left: 275px;
}

/* Remove padding from objectives since it's already inside main */
body.page-reactor #objectives_section {
padding-left: 0;
}

/* Add padding to info bar since it's outside main */
body.page-reactor #info_bar {
padding-left: 275px !important;
}

/* Center the reactor grid on desktop */
@media (min-width: 901px) {
body.page-reactor #reactor_wrapper {
justify-content: center;
overflow: hidden;  
}

/* Make tooltips smaller on desktop */
#tooltip {
width: 400px;
max-width: 25vw;
padding: 0.8rem;
font-size: 0.85em;
}
}
}
#parts_panel_toggle {
position: absolute;
left: 100%;
top: 15%;
transform: translateY(-50%);
width: 48px;
height: 100px;
background: var(--pico-card-background-color, #222);
border: 2px solid #59c435;
border-left: none;
border-radius: 0 8px 8px 0;
font-size: 1.25em;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 1000;
opacity: 0.95;
transition: left 0.3s, right 0.3s, border 0.3s, transform 0.2s, opacity 0.2s;
}
#parts_panel_toggle .vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
}
#parts_panel_toggle .selected-part-icon {
position: absolute;
top: 8px;
left: 50%;
transform: translateX(-50%);
width: 24px;
height: 24px;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
border: none;
border-radius: 2px;
background-color: transparent;
z-index: 10;
opacity: 0;
transition: opacity 0.2s ease;
}
#parts_panel_toggle .selected-part-icon.visible {
opacity: 1;
}
@media (max-width: 900px) {
#parts_panel_toggle {
width: 40px !important;
height: 80px !important;
min-width: 40px !important;
min-height: 80px !important;
font-size: 1.3rem !important;
padding: 10px 3px !important;
border-radius: 0 2px 2px 0 !important;
background: #23272e !important;
color: #fff !important;
box-shadow: none !important;
border-top: 2px solid #444 !important;
border-right: 2px solid #444 !important;
border-bottom: 2px solid #444 !important;
border-left: none !important;
z-index: 1100;
display: flex;
align-items: center;
justify-content: center;
}
#parts_panel_toggle .vertical-text {
font-size: 1.1rem !important;
}
#parts_panel_toggle .selected-part-icon {
width: 20px !important;
height: 20px !important;
top: 6px !important;
}
}
.pixel-panel {
border: 2px solid var(--pico-card-border-color, #444);
background: var(--pico-card-background-color, #222);
padding: 12px;
margin-bottom: 1rem;
border-radius: 4px;
}
.pixel-panel.is-inset {
border: 1px solid var(--pico-card-border-color, #444);
background: #333;
}
.upgrade-group {
display: flex;
flex-wrap: wrap;
gap: 2px;
padding: 4px;
}
.upgrade,
.experimental_upgrade {
position: relative;
width: 52px;
height: 52px;
background: none;
border: 1px solid var(--pico-card-border-color, #444);
border-radius: 4px;
cursor: pointer;
transition: all 0.1s ease;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}
.upgrade:hover,
.experimental_upgrade:hover {
border-color: var(--pico-primary-hover, #666);
background: var(--pico-primary-hover, #333);
}
.upgrade:active,
.experimental_upgrade:active {
transform: translateY(1px);
background: var(--pico-primary-active, #444);
}
.upgrade .image,
.experimental_upgrade .image {
width: 95%;
height: 95%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
padding: 2px;
margin: 2px;
}
.upgrade-price,
.experimental_upgrade-price {
position: absolute;
left: 0;
right: 0;
bottom: 4px;
margin: 0 auto;
background: rgba(0, 0, 0, 0.7);
color: #fff;
font-family: inherit;
font-size: 11px;
font-weight: bold;
text-align: center;
border-radius: 3px;
padding: 1px 3px;
pointer-events: none;
z-index: 2;
overflow-wrap: break-word;
white-space: normal;
overflow: visible;
text-overflow: unset;
line-height: 1.1;
}
.upgrade .levels,
.experimental_upgrade .levels {
position: absolute;
top: 2px;
right: 2px;
background: rgba(0, 0, 0, 0.6);
color: white;
font-size: 11px;
padding: 1px 3px;
border-radius: 3px;
z-index: 2;
}
.upgrade.unaffordable,
.experimental_upgrade.unaffordable {
opacity: 0.5;
cursor: pointer;
pointer-events: auto;
}
.upgrade.unaffordable .image,
.experimental_upgrade.unaffordable .image {
filter: grayscale(100%);
}
.upgrade.pixel-btn,
.experimental_upgrade.pixel-btn {
width: 52px;
height: 52px;
padding: 0;
border: 1px solid var(--pico-card-border-color, #444);
}
.upgrade.pixel-btn:hover,
.experimental_upgrade.pixel-btn:hover {
border-color: var(--pico-primary-hover, #666);
background: var(--pico-primary-hover, #333);
}
.upgrade.pixel-btn:active,
.experimental_upgrade.pixel-btn:active {
transform: translateY(1px);
background: var(--pico-primary-active, #444);
}
.experimental_upgrade .image {
width: 90%;
height: 90%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
padding: 5px;
margin: 5px;
}
.experimental_upgrade.unaffordable {
opacity: 0.5;
cursor: not-allowed;
}
.experimental_upgrade.unaffordable .image {
filter: grayscale(100%);
}
#page_content_area {
flex: 1;
overflow: visible;
display: flex;
flex-direction: column;
height: 100%;
}
#page_content_area .page {
flex: 1;
overflow: visible;
display: flex;
flex-direction: column;
height: 100%;
}
.page-upgrades #main,
.page-experimental_upgrades #main {
overflow: auto;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
}
.page-upgrades #main_content_wrapper,
.page-experimental_upgrades #main_content_wrapper {
overflow: auto;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
}
.page-upgrades #page_content_area,
.page-experimental_upgrades #page_content_area {
overflow: auto;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
}
.page-upgrades #page_content_area .page,
.page-experimental_upgrades #page_content_area .page {
overflow: auto;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
}
#upgrades_section,
#experimental_upgrades_section {
padding: 1rem;
padding-bottom: 200px;
overflow-y: auto;
height: 100%;
flex: 1;
-webkit-overflow-scrolling: touch;
scroll-behavior: smooth;
}
#upgrades_section::-webkit-scrollbar,
#experimental_upgrades_section::-webkit-scrollbar {
width: 8px;
}
#upgrades_section::-webkit-scrollbar-track,
#experimental_upgrades_section::-webkit-scrollbar-track {
background: var(--pico-card-background-color, #222);
}
#upgrades_section::-webkit-scrollbar-thumb,
#experimental_upgrades_section::-webkit-scrollbar-thumb {
background: var(--pico-card-border-color, #444);
border-radius: 4px;
}
#upgrades_section::-webkit-scrollbar-thumb:hover,
#experimental_upgrades_section::-webkit-scrollbar-thumb:hover {
background: var(--pico-primary-hover, #666);
}
@media (max-width: 900px) {
#upgrades_section,
#experimental_upgrades_section {
padding: 0.5rem;
padding-bottom: 200px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
@media (max-width: 600px) {
#upgrades_section,
#experimental_upgrades_section {
padding: 0.25rem;
padding-bottom: 200px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
#upgrades_section > *:last-child,
#experimental_upgrades_section > *:last-child {
margin-bottom: 0;
}
#reboot_section,
#refund_section {
margin-bottom: 1rem;
}
#info_bar .info-bar-row {
gap: 0.2rem;
}
#info_bar .info-label {
font-size: 0.95em;
}
#info_bar .info-value-row {
font-size: 0.95em;
}
#info_bar .info-max {
font-size: 0.75em;
margin-left: 0.1em;
}
}
.pixel-btn {
  background: var(--pico-card-background-color, #222);
  border: 2px solid var(--pico-card-border-color, #444);
  color: var(--pico-color, #fff);
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  border-radius: 4px;
}

.google-signin-container {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.google-signin-container .google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-signin-container span {
  font-family: inherit;
  font-size: 14px;
}

/* Horizontal button layout for research page */
.research-buttons-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.research-buttons-container .nav-btn {
  flex: 0 1 auto;
  min-width: 140px;
}

/* Navigation button styling to match top nav */
.nav-btn {
  background: #434955 !important;
  color: #fff !important;
  border: 2px solid #5f6672 !important;
  border-radius: 2px !important;
  padding: 8px 16px !important;
  font-size: 0.9em !important;
  font-family: inherit !important;
  transition: background 0.15s, color 0.15s, border 0.15s !important;
  box-shadow: none !important;
  text-decoration: none !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
  cursor: pointer !important;
}

.nav-btn:hover {
  background: #59c435 !important;
  color: #181c22 !important;
  border-color: #59c435 !important;
}

.nav-btn:active {
  transform: translateY(1px) !important;
  background: #4aaf2a !important;
}

.pixel-btn {
  transition: all 0.1s ease;
text-decoration: none;
display: inline-block;
text-align: center;
line-height: 1.2;
}
.pixel-btn:hover {
border-color: var(--pico-primary-hover, #666);
background: var(--pico-primary-hover, #333);
}
.pixel-btn:active {
transform: translateY(1px);
background: var(--pico-primary-active, #444);
}
.pixel-btn.is-square {
width: 52px;
height: 52px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}
.pixel-btn.btn-start {
background: var(--game-success-color, #43a047);
border-color: var(--game-success-color, #43a047);
color: white;
font-weight: bold;
}
.pixel-btn.btn-start:hover {
background: var(--game-success-hover, #4caf50);
border-color: var(--game-success-hover, #4caf50);
}
.pixel-btn-small {
padding: 4px 8px;
font-size: 12px;
border-width: 1px;
}
.pixel-btn.on {
background: var(--pico-primary, #666);
border-color: var(--pico-primary, #666);
}
.explanitory {
margin: 1rem 0;
padding: 1rem;
}
.explanitory p {
margin: 0.5rem 0 0 0;
font-size: 0.9em;
opacity: 0.8;
}
.part {
position: relative;
width: 52px;
height: 52px;
background: none;
border: 1px solid var(--pico-card-border-color, #444);
border-radius: 4px;
cursor: pointer;
transition: all 0.1s ease;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}
/* Marker class reserved for potential styling of locked items */
.part .tier-progress {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  line-height: 1;
  background: rgba(0,0,0,0.6);
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  pointer-events: none;
}
.part:hover {
border-color: var(--pico-primary-hover, #666);
background: var(--pico-primary-hover, #333);
}
.part:active {
transform: translateY(1px);
background: var(--pico-primary-active, #444);
}
.part .image {
width: 95%;
height: 95%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
padding: 2px;
margin: 2px;
}
.part.unaffordable {
opacity: 0.5;
cursor: not-allowed;
}
.part.unaffordable .image {
filter: grayscale(100%);
}
.part.pixel-btn {
width: 52px;
height: 52px;
padding: 0;
border: 1px solid var(--pico-card-border-color, #444);
}
.part.pixel-btn:hover {
border-color: var(--pico-primary-hover, #666);
background: var(--pico-primary-hover, #333);
}
.part.pixel-btn:active {
transform: translateY(1px);
background: var(--pico-primary-active, #444);
}
.info-icon {
width: 1.2em;
height: 1.2em;
vertical-align: middle;
margin-right: 0.15em;
margin-bottom: 0.1em;
}
.mobile-only {
display: none !important;
}
.desktop-only {
display: inline !important;
}
@media (max-width: 900px) {
.mobile-only {
display: inline !important;
}
.desktop-only {
display: none !important;
}
.info-icon {
width: 1.3em;
height: 1.3em;
margin-right: 0.1em;
margin-bottom: 0.05em;
}
.objective-part-icon {
width: 1.1em;
height: 1.1em;
margin-right: 0.15em;
margin-bottom: 0.05em;
}
}
#objectives_section {
width: 100% !important;
max-width: 100% !important;
margin-left: 0 !important;
margin-right: 0 !important;
height: 70px !important;
left: 0;
right: 0;
overflow: hidden;
box-sizing: border-box;
background: #23272e !important;
border-bottom: 2px solid #444 !important;
text-align: center;
font-family: "Press Start 2P", cursive, monospace !important;
display: flex;
align-items: center;
justify-content: center;
position: sticky !important;
top: 0 !important;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#objectives_content {
overflow: hidden;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 0.5em;
width: 100%;
padding: 0 18px;
box-sizing: border-box;
}
#objective_title_wrapper {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
width: 100%;
gap: 0.5em;
flex: 1;
}
#objective_title {
  overflow: visible;
  white-space: normal;
  text-align: left;
  flex: 1;
  position: relative;
  font-size: 0.9em;
  line-height: 1.3;
  word-wrap: break-word;
  hyphens: auto;
  color: #ffffff;
  text-shadow: 1px 0 0 black, -1px 0 0 black, 0 1px 0 black, 0 -1px 0 black;
  min-width: 0;
}

/* Objective part icon styling */
.objective-part-icon {
  width: 2.2em;
  height: 2.2em;
  vertical-align: middle;
  margin-right: 0.4em;
  margin-bottom: 0.2em;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.1);
}

/* Hide price and level information in objectives */
#objectives_section .upgrade-price,
#objectives_section .levels,
#objectives_section .part-price {
  display: none !important;
}

#objective_title span {
  display: inline;
  animation: none;
}

#objective_title:hover span {
animation-play-state: paused;
}

/* Objective text scrolling for all resolutions */
#objective_title {
overflow: hidden;
white-space: nowrap;
}
#objective_title span {
display: inline-block;
white-space: nowrap;
animation: scroll-objective-title 8s linear infinite;
}
#objective_title:hover span {
animation-play-state: paused;
}
@keyframes scroll-objective-title {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
#objective_reward {
font-size: 1em;
color: #ffe082;
line-height: 1.1;
text-shadow: 1px 0 0 black, -1px 0 0 black, 0 1px 0 black, 0 -1px 0 black;
display: flex;
align-items: center;
gap: 0.2em;
flex-shrink: 0;
font-weight: bold;
justify-content: flex-end;
margin-left: auto;
}

/* Completed objective styling */
#objectives_section.completed {
border: 2px solid #4CAF50;
border-radius: 6px;
box-shadow: 0 0 8px rgba(76, 175, 80, 0.6), 0 0 16px rgba(76, 175, 80, 0.3);
transition: box-shadow 0.3s ease;
}

#objective_title.completed {
/* Remove the old border styling from title */
border: none;
padding: 0;
}

/* Flash animation for objective completion */
#objectives_section.flash {
animation: objective-flash 0.8s ease-out;
}

@keyframes objective-flash {
0% {
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6), 0 0 16px rgba(76, 175, 80, 0.3);
}
50% {
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 30px rgba(76, 175, 80, 0.5);
}
100% {
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6), 0 0 16px rgba(76, 175, 80, 0.3);
}
}

/* Claim button styling */
#objective_reward.claimable .claim-btn {
background: #4CAF50;
color: white;
border: none;
border-radius: 4px;
padding: 8px 16px;
font-family: "Press Start 2P", cursive, monospace;
font-size: 0.8em;
cursor: pointer;
text-shadow: 1px 0 0 black, -1px 0 0 black, 0 1px 0 black, 0 -1px 0 black;
transition: background-color 0.2s;
}

#objective_reward.claimable .claim-btn:hover {
background: #45a049;
}

#objective_reward.claimable .claim-btn:active {
background: #3d8b40;
}
@keyframes objective-scroll-left {
0% {
transform: translateX(0);
opacity: 1;
}
80% {
opacity: 0.5;
}
100% {
transform: translateX(-120%);
opacity: 0;
}
}
@media (max-width: 600px) {
#objectives_section {
height: 60px !important;
}
#pause_banner,
#meltdown_banner {
height: 45px !important;
}
.objective-part-icon {
width: 1.8em;
height: 1.8em;
margin-right: 0.3em;
margin-bottom: 0.15em;
border: 1px solid #444;
border-radius: 3px;
padding: 1px;
background: rgba(0, 0, 0, 0.1);
}
}
#objective_title {
font-size: 0.8em;
white-space: nowrap;
word-break: keep-all;
overflow-wrap: normal;
text-overflow: clip;
line-height: 1.4;
display: block;
padding: 0;
overflow: hidden;
max-height: 100%;
flex: 1;
min-width: 0;
}
#objective_title_wrapper {
max-width: 100vw;
width: 100%;
box-sizing: border-box;
overflow: hidden;
justify-content: flex-start;
flex: 1;
}
#objective_reward {
font-size: 0.9em;
word-break: break-word;
padding: 0;
justify-content: flex-end;
margin-left: auto;
}
#objective_reward::before {
width: 16px;
height: 16px;
}
#objectives_content {
padding: 0 12px;
gap: 0.4em;
overflow: hidden;
}
@media (max-width: 400px) {
#objectives_section {
height: 50px !important;
}
#pause_banner,
#meltdown_banner {
height: 40px !important;
}
.objective-part-icon {
width: 1.6em;
height: 1.6em;
margin-right: 0.2em;
margin-bottom: 0.1em;
border: 1px solid #444;
border-radius: 2px;
padding: 1px;
background: rgba(0, 0, 0, 0.1);
}
#objective_title {
font-size: 0.7em;
line-height: 1.5;
overflow: hidden;
max-height: 100%;
white-space: nowrap;
word-break: keep-all;
overflow-wrap: normal;
flex: 1;
min-width: 0;
}
#objective_reward {
font-size: 0.8em;
justify-content: flex-end;
margin-left: auto;
}
#objective_reward::before {
width: 14px;
height: 14px;
}
#objectives_content {
padding: 0 8px;
gap: 0.3em;
overflow: hidden;
}
}
#controls_nav {
padding-bottom: 5px;
padding-top: 5px;
}
#controls_nav button {
width: 100%;
box-sizing: border-box;
white-space: normal;
word-break: break-word;
padding: 2px;
}
body:not(.page-reactor) #parts_section {
display: none;
}
body:not(.page-reactor) #objectives_section {
display: none;
}
#parts_section {
transition: transform 0.3s ease-in-out;
}
@media (max-width: 900px) {
#parts_section.collapsed {
transform: translateX(-100%);
}
}
#tooltip {
position: fixed;
z-index: 1000;
background: #23272f;
border: 2px solid #5f6672;
border-radius: 0;
padding: 0.75rem;
  max-width: 400px;
min-width: 300px;
width: auto;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
font-size: 0.85em;
line-height: 1.3;
opacity: 1;
transition: opacity 0.2s ease;
}
#tooltip.hidden {
opacity: 0;
pointer-events: none;
}
#tooltip_data {
color: var(--pico-color, #fff);
}

/* Highlight numbers adjacent to power/heat/tick in tooltips */
#tooltip .num {
  font-weight: 900;
  color: #fff;
  /* Subtle outline for pixel-clarity similar to retro fonts */
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}
#tooltip .power-num { color: #8fd694; text-shadow: 1px 0 0 #003, -1px 0 0 #003, 0 1px 0 #003, 0 -1px 0 #003, 0 0 6px rgba(0,255,255,0.35); }
#tooltip .heat-num { color: #ff8888; text-shadow: 1px 0 0 #300, -1px 0 0 #300, 0 1px 0 #300, 0 -1px 0 #300, 0 0 6px rgba(255,80,80,0.35); }
#tooltip .tick-num { color: #ffd27f; text-shadow: 1px 0 0 #330, -1px 0 0 #330, 0 1px 0 #330, 0 -1px 0 #330, 0 0 6px rgba(255,200,100,0.3); }

/* Make formatted numbers inside description easier to scan */
#tooltip_data p[data-role="description"] .num {
  font-size: 1.2em;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.15);
}
#tooltip_data p[data-role="description"] .power-num { background-color: rgba(0, 220, 180, 0.12); }
#tooltip_data p[data-role="description"] .heat-num { background-color: rgba(255, 80, 80, 0.12); }
#tooltip_data p[data-role="description"] .tick-num { background-color: rgba(255, 200, 100, 0.12); }

/* Slightly increase spacing around inline icons for readability */
#tooltip .icon-inline { margin: 0 3px; }
#tooltip_close_btn {
position: absolute;
top: 0;
right:0;
background: #000;
border: none;
color: var(--pico-color, #fff);
font-size: 0.6em;
cursor: pointer;
padding: 0.1rem;
line-height: 1;
border-radius: 2px;
z-index: 10;
width: 25px !important;
height: 25px !important;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.7;
transition: opacity 0.2s;
}
#tooltip_close_btn:hover {
opacity: 1;
}
#tooltip_close_btn:hover {
color: var(--pico-primary-hover, #fff);
}
.tooltip-summary-row {
display: flex;
flex-wrap: wrap;
gap: 0.4rem;
margin-bottom: 0.4rem;
padding-bottom: 0.4rem;
border-bottom: 1px solid var(--pico-card-border-color, #444);
}
.tooltip-summary-item {
display: flex;
align-items: center;
gap: 0.15rem;
font-size: 0.75em;
}
.tooltip-stats {
margin: 0.4rem 0;
font-size: 0.75em;
}
#tooltip_data p[data-role="description"] {
background: #1a1d24;
padding: 0.5rem;
border-radius: 4px;
margin: 0.4rem 0;
border-left: 3px solid #5f6672;
font-size: 0.75em;
  line-height: 1.2;
  /* Indented wrap for bullets */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Allow tooltip content to wrap naturally but keep description bullets on one line */
#tooltip_data { max-width: 100%; overflow: visible; }
#tooltip { box-sizing: border-box; }
#tooltip .tooltip-bonuses,
#tooltip .tooltip-summary-row,
#tooltip .tooltip-stats { max-width: 100%; overflow-wrap: anywhere; }

/* Indented word wrapping for bullets */
.tooltip-bullet { display: block; padding-left: 1.1em; text-indent: -1.1em; white-space: normal; }
.tooltip-bonuses .tooltip-bullet { padding-left: 1.0em; text-indent: -1.0em; }
.tooltip-stats dt {
font-weight: bold;
margin-top: 0.25rem;
}
.tooltip-stats dd {
margin-left: 0.75rem;
margin-bottom: 0.15rem;
}
#tooltip_actions {
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px solid var(--pico-card-border-color, #444);
}
#tooltip_actions { display: flex; align-items: center; justify-content: center; }
#tooltip_actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 520px;
  margin: 0.25rem auto 0.1rem auto;
  font-size: 0.9em;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  background: #236090;
  color: #b0ffb0;
  font-family: inherit;
  font-weight: bold;
  border: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 0 #222, 0 4px 8px #0002;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  box-sizing: border-box;
}
.tooltip-bonuses {
  margin-top: 0.4rem;
  background: #1a1d24;
  padding: 0.5rem;
  border-left: 3px solid #2f6b3a;
  border-radius: 4px;
}
.tooltip-section-title { font-weight: bold; font-size: 0.75em; margin: 0.35rem 0 0.2rem; opacity: 0.9; }
.tooltip-bonus-line {
  font-size: 0.75em;
  line-height: 1.2;
}
.tooltip-bonus-line .pos { color: #5CFF85; }
.tooltip-bonus-line .neg { color: #FF6B6B; }
.tooltip-mobile-unaffordable {
color: #ff6b6b;
font-weight: bold;
}
/* Desktop: Horizontal tooltip layout */
@media (min-width: 769px) {
#tooltip {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: 1rem;
  max-width: 760px;
min-width: 600px;
padding: 1rem;
top: var(--main-top-nav-height, 50px);
left: 50%;
transform: translateX(-50%);
}

#tooltip_data {
flex: 1;
}

.tooltip-summary-row {
flex-direction: row;
flex-wrap: wrap;
}

#tooltip_actions {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  width: 100%;
}
}

@media (max-width: 768px) {
#tooltip {
font-size: 0.8em;
padding: 0.5rem;
 max-width: 100vw;
 min-width: 100vw;
 left: 0;
 right: 0;
 top: calc(var(--main-top-nav-height, 50px) + 8px);
 transform: none;
 position: fixed;
}
.tooltip-summary-row { border-bottom: none; margin-bottom: 0.2rem; padding-bottom: 0; }
#tooltip_actions { margin-top: 0.3rem; }
.tooltip-summary-row {
flex-direction: column;
gap: 0.3rem;
}
#tooltip_close_btn {
width: 24px !important;
height: 24px !important;
font-size: 0.5em;
padding: 0.05rem;
top: 0.2rem;
right: 0.2rem;
}
}
@media (max-width: 500px) {
#info_bar {
bottom: 48px;
height: 40px;
padding: 0 8px;
}
footer#bottom_nav {
height: 48px;
padding: 0 6px 6px 6px !important;
}
footer#bottom_nav button,
footer#bottom_nav .secondary {
font-size: 0.9em;
min-height: 36px;
line-height: 1.1;
padding: 0 0.15em;
}
#info_bar .info-bar-item {
font-size: 0.8em;
gap: 0.1em;
}
#info_bar .info-icon,
#info_bar img.info-icon {
width: 8px !important;
height: 8px !important;
min-width: 8px !important;
min-height: 8px !important;
}
}
@media (min-width: 901px) {
#main_top_nav {
position: fixed;
top: 0;
left: 0;
width: 100vw;
z-index: 1000;
height: var(--main-top-nav-height, 50px);
box-sizing: border-box;
}
#wrapper {
padding-top: var(--main-top-nav-height, 50px);
}
.nav-bar-row {
padding-left: 275px;
border-bottom: 4px solid #5f6672;
border-left: 4px solid #2a2d34;
background: #23272e;
box-shadow: 0 2px 0 #222;
}
.nav-bar-row ul {
gap: 0.5em;
}
.nav-bar-row ul:first-child {
margin-right: 0;
}
.nav-bar-row ul:last-child {
margin-left: 0;
}
#controls_nav {
padding: 5px;
gap: 5px;
}
#controls_nav button {
font-size: 0.3em;
height: 0.3em;
min-height: 0.3em;
padding: 5px;
margin: 5px;
border-width: 2px;
}
#parts_panel_toggle {
display: block !important;
position: static;
margin: 0 auto 0.5em auto;
width: 36px;
height: 36px;
font-size: 1.3em;
background: #23272e;
border: 2px solid #59c435;
border-radius: 6px;
color: #fff;
box-shadow: 0 1px 0 #222;
z-index: 1001;
opacity: 1;
transition: background 0.2s, border 0.2s;
}
#objective_title span {
display: inline-block;
animation: scroll-text 10s linear infinite;
min-width: 100%;
}
#objective_title {
overflow: hidden;
white-space: nowrap;
text-align: center;
width: 100%;
position: relative;
}
}
@keyframes scroll-text {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
#objective_title:hover span {
animation-play-state: paused;
}
.nav-bar-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100vw;
height: var(--main-top-nav-height, 50px);
box-sizing: border-box;
padding: 0 1.5em;
gap: 0.5em;
}
.nav-bar-row ul {
display: flex;
flex-direction: row;
align-items: center;
gap: 0;
margin: 0;
padding: 0;
list-style: none;
}
.nav-bar-row ul#reactor_stats {
flex: 0 0 auto;
gap: 0.2em;
display: flex;
flex-wrap: nowrap;
overflow: hidden;
}

.nav-bar-row ul#engine_status {
flex: 0 0 auto;
gap: 0;
}

#engine_status_indicator {
color: #43a047;
font-size: 1.2em;
transition: color 0.2s ease;
}

#engine_status_indicator.engine-running {
color: #43a047;
}

#engine_status_indicator.engine-paused {
color: #ffa000;
}

#engine_status_indicator.engine-stopped {
color: #d32f2f;
}

#engine_status_indicator.engine-tick {
animation: engine-tick-flash 0.1s ease-in-out;
}

@keyframes engine-tick-flash {
0% {
color: #43a047;
transform: scale(1);
}
50% {
color: #ffffff;
transform: scale(1.2);
}
100% {
color: #43a047;
transform: scale(1);
}
}
.nav-bar-row li {
display: flex;
align-items: center;
height: 100%;
}

.nav-bar-row ul#reactor_stats li {
min-width: 0;
flex-shrink: 1;
}

.nav-bar-row ul#reactor_stats li strong {
font-size: 0.9em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#bottom_nav,
footer#bottom_nav {
width: 100vw !important;
min-width: 0 !important;
margin: 0 !important;
padding: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
box-sizing: border-box !important;
}
#bottom_nav nav,
#bottom_nav ul,
footer#bottom_nav nav,
footer#bottom_nav ul {
width: 100vw !important;
min-width: 0 !important;
margin: 0 !important;
padding: 0 !important;
display: flex !important;
flex-direction: row !important;
align-items: center !important;
justify-content: stretch !important;
}
#bottom_nav li,
footer#bottom_nav li {
flex: 1 1 0 !important;
min-width: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
height: 100%;
}
#bottom_nav button,
footer#bottom_nav button {
width: 100% !important;
min-width: 0 !important;
max-width: 100vw !important;
font-size: 1.1em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0.5em 0 !important;
margin: 0 !important;
border-radius: 0 !important;
box-sizing: border-box !important;
}
#controls_nav button.on {
background: #59c435 !important;
color: #23272e !important;
border: 2px solid #a9844f !important;
box-shadow: 0 2px 0 #222, 0 0 8px #59c43599;
text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff;
outline: 2px solid #a9844f;
outline-offset: -2px;
}
@media (min-width: 901px) {
#controls_nav {
display: flex;
height: 50%;
flex-direction: column;
gap: 5px;
justify-content: center;
align-items: center;
padding: 0 0 8px 0;
}
#controls_nav button {
width: 100%;
min-width: 100px;
max-width: none;
flex: 1 1 auto;
display: inline-flex;
justify-content: center;
align-items: center;
margin: 0;
padding: 8px;
font-size: 0.8em;
background: #434955;
color: #fff;
border: 2px solid #5f6672;
border-radius: 6px;
box-shadow: none;
transition: background 0.15s, color 0.15s, border 0.15s;
}
#controls_nav button.on,
#controls_nav button.active {
background: #59c435;
color: #181c22;
border-color: #59c435;
}
}
@media (max-width: 900px) {
#reactor {
grid-template-columns: repeat(var(--game-cols, 12), var(--tile-size, 48px));
grid-template-rows: repeat(var(--game-rows, 12), var(--tile-size, 48px));
box-sizing: border-box;
padding: 5px;
margin: 0;
transform-origin: center center;
flex-shrink: 0;
}
#reactor_wrapper {
display: flex;
padding: 36px 25px 25px 25px;
align-items: flex-start;
justify-content: flex-start;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
width: 100%;
overflow-x: scroll;
overflow-y: hidden; /* prevent vertical scrollbar on mobile */
}
#reactor_section {
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
margin: 0;
flex: 1 1 auto;
}
#main_content_wrapper {
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden; /* avoid page-level vertical scroll; inner wrapper scrolls horizontally */
position: relative;
}
#main {
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
margin: 0;
overflow: visible;
}
}

.upgrade.pixel-btn.is-square,
.part.pixel-btn.is-square {
border: 3px solid #a9844f;
background: #23272e;
box-shadow: 0 2px 0 #222, 0 0 8px #a9844f33;
border-radius: 6px;
  margin: 1px;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
position: relative;
overflow: visible;
}
/* Small status icon overlay for cell upgrades */
.upgrade .status-overlay {
  position: absolute;
  top: 1px;
  left: 2px;
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 3;
}
.upgrade .image,
.part .image {
width: 48px;
height: 48px;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
margin: 0 auto 2px auto;
display: block;
}
.upgrade-price,
.experimental_upgrade-price {
position: absolute;
bottom: 2px;
right: 2px;
left: auto;
margin: 0;
background: rgba(0, 0, 0, 0.7);
color: white;
font-size: 11px;
font-weight: bold;
padding: 1px 3px;
border-radius: 3px;
z-index: 2;
line-height: 1;
text-align: right;
pointer-events: none;
white-space: nowrap;
overflow: visible;
text-overflow: ellipsis;
}
.upgrade .levels,
.part .levels {
position: absolute;
top: 2px;
right: 2px;
font-size: 0.85em;
color: #fff;
background: #23272eaa;
border-radius: 4px;
padding: 0 4px;
z-index: 2;
pointer-events: none;
}
.upgrade.unaffordable,
.part.unaffordable {
filter: grayscale(1) brightness(0.7);
opacity: 0.7;
}
.upgrade-group,
.item-grid {
display: flex;
flex-wrap: wrap;
gap: 0;
justify-content: flex-start;
align-items: flex-start;
}

/* Line break helper for flex-wrapped upgrade groups */
.upgrade-group .row-break {
  flex-basis: 100%;
  height: 0;
  margin: 0;
  padding: 0;
}
.part-price,
.upgrade-price {
text-align: center;
width: 100%;
overflow-wrap: break-word;
white-space: normal;
overflow: visible;
text-overflow: unset;
left: 0;
right: 0;
position: absolute;
bottom: 4px;
margin: 0 auto;
pointer-events: none;
font-size: clamp(0.8em, 1.1em, 1.2em);
line-height: 1.1;
}
.upgrade.pixel-btn.is-square,
.part.pixel-btn.is-square {
position: relative;
}
.durability-progress,
#info_bar_durability_progress {
background: #59c435 !important;
}
.heat-progress,
#info_bar_heat_progress {
background: #f44336 !important;
}
.tile .percent_wrapper_wrapper {
display: none;
}
.tile[class*="part_"] .percent_wrapper_wrapper {
display: block;
}
#info_bar .info-item.heat,
#info_bar .info-item.power {
cursor: pointer;
background: none;
border: none;
outline: none;
padding: 0;
margin: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
}

.part-price,
.upgrade-price,
.experimental_upgrade-price {
position: absolute;
bottom: 2px;
right: 2px;
left: auto;
margin: 0;
background: rgba(0, 0, 0, 0.7);
color: white;
font-size: 11px;
font-weight: bold;
padding: 1px 3px;
border-radius: 3px;
z-index: 2;
line-height: 1;
text-align: right;
pointer-events: none;
white-space: nowrap;
overflow: visible;
text-overflow: ellipsis;
}
.upgrade-group,
.research-group {
background: #23272f;
border: 2px solid #5f6672;
border-radius: 0;
padding: 2px;
margin-bottom: 0.5rem;
display: flex;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
}
#tooltip .tooltip-buy-btn {
display: block;
width: 100%;
margin: 1.2em 0 0 0;
padding: 0.5em 1.2em;
font-size: 1em;
border-radius: 6px;
background: #236090;
color: #b0ffb0;
font-family: inherit;
font-weight: bold;
border: none;
text-align: center;
cursor: pointer;
box-shadow: 0 2px 0 #222, 0 4px 8px #0002;
transition: background 0.2s, box-shadow 0.2s, color 0.2s;
box-sizing: border-box;
}
#tooltip button:hover,
#tooltip .tooltip-buy-btn:hover {
background: #1ca3ec;
color: #fff;
}
@media (max-width: 500px) {
#info_bar {
bottom: 48px;
height: 44px;
padding: 0 8px;
}
footer#bottom_nav {
height: 48px;
}
footer#bottom_nav button,
footer#bottom_nav .secondary {
font-size: 0.9em;
min-height: 36px;
line-height: 1.1;
padding: 0 0.15em;
}
#info_bar .info-bar-item {
font-size: 0.8em;
gap: 0.1em;
}
#info_bar .info-icon,
#info_bar img.info-icon {
width: 10px !important;
height: 10px !important;
min-width: 10px !important;
min-height: 10px !important;
}
}
@media (max-width: 530px) {
#info_bar {
bottom: 48px;
height: 46px;
padding: 0 12px;
}
footer#bottom_nav {
height: 48px;
font-size: 0.75em;
padding: 0 5px 5px 5px !important;
}
footer#bottom_nav button,
footer#bottom_nav .secondary {
font-size: 0.95em;
min-height: 40px;
line-height: 1.2;
padding: 0 0.2em;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
justify-content: center;
}
footer#bottom_nav li {
min-width: 0;
height: 100%;
display: flex;
align-items: center;
}
#info_bar .info-bar-item {
font-size: 0.85em;
gap: 0.15em;
}
#info_bar .info-icon,
#info_bar img.info-icon {
width: 11px !important;
height: 11px !important;
min-width: 11px !important;
min-height: 11px !important;
}
}
@media (max-width: 900px) {
#reactor {
grid-template-columns: repeat(var(--game-cols, 12), var(--tile-size, 48px));
grid-template-rows: repeat(var(--game-rows, 12), var(--tile-size, 48px));
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
scroll-behavior: smooth;
margin: 0;
padding: 0;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
}
}
@media (max-width: 600px) {
#reactor {
margin: 0;
padding: 0;
flex: 0 0 auto;
}
}
@media (max-width: 400px) {
#reactor {
margin: 0;
padding: 0;
flex: 0 0 auto;
}

}
@media (min-width: 901px) {
#reactor {
grid-template-columns: repeat(var(--game-cols, 12), var(--tile-size));
grid-template-rows: repeat(var(--game-rows, 12), var(--tile-size));
margin: 0;
position: relative;
padding: 0;
}
#reactor_section {
display: flex;
align-items: center;
justify-content: center;
flex: 1 1 auto;
}
}
#pause_banner {
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
background-color: #ffeb3b !important;
color: #000 !important;
text-align: center !important;
padding: 0.5rem !important;
font-weight: bold !important;
font-size: 1.2rem !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
border: none !important;
margin: 0 !important;
width: 100% !important;
max-width: none !important;
height: 70px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
#pause_banner article {
margin: 0 !important;
padding: 0 !important;
background: none !important;
color: #000 !important;
font-weight: bold !important;
text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff !important;
}
#meltdown_banner {
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
z-index: 1000 !important;
background-color: #f44336 !important;
color: #fff !important;
text-align: center !important;
padding: 0.5rem !important;
font-weight: bold !important;
font-size: 1.2rem !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
border: none !important;
margin: 0 !important;
width: 100% !important;
max-width: none !important;
height: 70px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
#meltdown_banner article {
margin: 0 !important;
padding: 0 !important;
background: none !important;
color: #fff !important;
font-weight: bold !important;
text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000 !important;
}

/* Banner visibility rules */
#pause_banner,
#meltdown_banner {
display: none !important;
}

body.game-paused #pause_banner {
display: flex !important;
}

body.reactor-meltdown #meltdown_banner {
display: flex !important;
}

/* Desktop banner positioning */
@media (min-width: 901px) {
#pause_banner,
#meltdown_banner {
margin-top: 50px !important;
}
}
#reactor_section {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
min-height: 0;
}

/* Fit-to-screen: prevent vertical page scroll and keep content within viewport */
body.fit-screen-mode {
  overflow-y: hidden !important;
  height: 100vh;
}
body.fit-screen-mode #wrapper,
body.fit-screen-mode #main_content_wrapper,
body.fit-screen-mode #reactor_section {
  height: 100%;
  overflow-y: hidden !important;
}
body.fit-screen-mode #reactor_wrapper {
  overflow: hidden !important;
}
body.page-privacy_policy nav#main_top_nav,
body.page-privacy_policy footer#bottom_nav,
body.page-privacy_policy footer#info_bar,
body.page-privacy_policy #main_top_nav,
body.page-privacy_policy #bottom_nav,
body.page-privacy_policy #info_bar {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
height: 0 !important;
overflow: hidden
}
body.page-privacy_policy #splash-container,
body.page-privacy_policy #quick-start-modal {
display: none !important;
}
body.page-privacy_policy #wrapper #main_top_nav,
body.page-privacy_policy #wrapper #bottom_nav,
body.page-privacy_policy #wrapper #info_bar {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
height: 0 !important;
overflow: hidden
}
body.page-privacy_policy .about-content {
font-size: 0.9rem;
line-height: 1.5;
}
body.page-privacy_policy .about-content h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
}
body.page-privacy_policy .about-content h3 {
font-size: 1.2rem;
margin-top: 1.5rem;
margin-bottom: 0.5rem;
}
body.page-privacy_policy .about-content p {
margin-bottom: 0.75rem;
}
body.page-privacy_policy .about-content ul {
margin-bottom: 0.75rem;
}
body.page-privacy_policy .about-content li {
margin-bottom: 0.25rem;
}
body.page-privacy_policy #wrapper {
padding: 15px !important;
margin: 15p !important;
overflow: visible !important;
}
body.page-privacy_policy {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif !important;
height: 100vh !important;
overflow-y: auto !important;
}
body.page-privacy_policy #wrapper {
padding: 15px !important;
margin: 15px !important;
min-height: calc(100vh - 30px) !important;
overflow-y: auto !important;
}
body.page-privacy_policy #main {
height: 100% !important;
min-height: calc(100vh - 100px) !important;
overflow-y: auto !important;
width: 100% !important;
}
body.page-privacy_policy #main_content_wrapper {
width: 100% !important;
height: 100% !important;
overflow-y: auto !important;
}
body.page-privacy_policy #page_content_area {
height: 100% !important;
width: 100% !important;
overflow-y: visible !important;
}
body.page-privacy_policy .highlight {
background: #fde82dd7;
color: #222;
border-radius: 4px;
padding: 2px 4px;
font-weight: 500;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Terms of Service Page Styles */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
  color: #fff;
  background-color: #222;
  min-height: 100vh;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #444;
}

.page-header h1 {
  font-size: 2rem;
  color: #1ca3ec;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-subtitle {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
}

.page-content {
  margin-bottom: 3rem;
}

.tos-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #1ca3ec;
}

.tos-section h2 {
  font-size: 1.2rem;
  color: #1ca3ec;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.tos-section h3 {
  font-size: 1rem;
  color: #8fd694;
  margin-bottom: 0.8rem;
}

.tos-section p {
  font-size: 0.7rem;
  margin-bottom: 1rem;
  color: #ccc;
}

.tos-section ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.tos-section li {
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  color: #ccc;
}

.highlight-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(28, 163, 236, 0.1);
  border: 2px solid #1ca3ec;
  border-radius: 8px;
  margin: 1rem 0;
}

.highlight-box.warning {
  background: rgba(255, 160, 0, 0.1);
  border-color: #ffa000;
}

.highlight-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.highlight-box p {
  margin: 0;
  font-size: 0.7rem;
  color: #fff;
}

.page-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 2px solid #444;
}

.back-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: #1ca3ec;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.back-link:hover {
  background: #0d8bd8;
  text-decoration: none;
}

@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }
  
  .page-header h1 {
    font-size: 1.5rem;
  }
  
  .page-subtitle {
    font-size: 0.7rem;
  }
  
  .tos-section {
    padding: 1rem;
    margin-bottom: 2rem;
  }
  
  .tos-section h2 {
    font-size: 1rem;
  }
  
  .tos-section p,
  .tos-section li {
    font-size: 0.6rem;
  }
  
  .highlight-box {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .highlight-icon {
    margin-bottom: 0.5rem;
  }
  
  .back-link {
    font-size: 0.7rem;
    padding: 0.6rem 1.2rem;
  }
}

#reactor_copy_paste_btns {
  position: absolute;
  top: 0px;
  right: 20px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  transform: none;
  z-index: 25;
}

/* Ensure desktop also pins buttons to the reactor area top-right */
@media (min-width: 901px) {
  #reactor_wrapper #reactor_copy_paste_btns {
    position: absolute !important;
    top: 0px;
    right: 20px;
    z-index: 25;
  }
}

#reactor_copy_paste_btns button {
  background: #23272e;
  border: 2px solid #444;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px #0006;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
  padding: 0;
}

#reactor_copy_paste_btns button:hover {
  background: #1ca3ec;
  border-color: #1ca3ec;
}

#reactor_copy_paste_btns #reactor_sell_all_btn:hover {
  background: #c0392b;
  border-color: #c0392b;
}

#reactor_copy_paste_btns img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

#reactor_copy_paste_btns .emoji-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 20px;
  font-size: 22px; /* slightly larger for visual centering */
}

/* Dropper-specific alignment/rotation */
#reactor_copy_paste_btns #reactor_dropper_btn .emoji-icon {
  transform: translateX(-1px) translateY(-1px) rotate(-50deg);
}

/* Active state for dropper/deselect buttons */
#reactor_copy_paste_btns #reactor_dropper_btn.on,
#reactor_copy_paste_btns #reactor_deselect_btn.on {
  background: #1ca3ec;
  border-color: #1ca3ec;
}

/* Active state for fit-to-screen toggle */
#reactor_copy_paste_btns #reactor_fit_btn.on {
  background: #1ca3ec;
  border-color: #1ca3ec;
}

#reactor_copy_paste_modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#reactor_copy_paste_modal.hidden {
  display: none;
}

#reactor_copy_paste_modal .modal-content {
  background-color: #1a1a1a;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 0;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
}

/* Desktop-specific sizing */
@media (min-width: 901px) {
  #reactor_copy_paste_modal .modal-content {
    max-width: 600px;
    max-height: 80%;
    min-width: 500px;
    min-height: 400px;
  }
}

#reactor_copy_paste_modal .modal-content > *:not(.modal-header) {
  padding: 20px;
}

#reactor_copy_paste_modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid #333;
  background: #222;
  border-radius: 8px 8px 0 0;
}

#reactor_copy_paste_modal .modal-header h3 {
  margin: 0;
  color: #4a9eff;
  font-size: 18px;
}



#reactor_copy_paste_text {
  width: 100% !important;
  min-height: 80px !important;
  background-color: #2a2a2a !important;
  border: 1px solid #444 !important;
  color: #fff !important;
  font-family: monospace !important;
  font-size: 12px !important;
  padding: 10px !important;
  margin-bottom: 10px !important;
  resize: vertical !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Hide textarea when not needed for copy/sell actions */
#reactor_copy_paste_text.hidden,
#reactor_copy_paste_text[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

#reactor_copy_paste_cost {
  margin-bottom: 15px;
  color: #4caf50;
  font-weight: bold;
}

#reactor_copy_paste_modal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
  width: 100%;
}

#reactor_copy_paste_modal .modal-actions button {
  padding: 8px 16px;
  background-color: #4a9eff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
}

#reactor_copy_paste_modal .modal-actions .sell-all-btn {
  background-color: #e74c3c;
  flex: 0 0 auto;
  min-width: 100px;
}

#reactor_copy_paste_modal .modal-actions .sell-all-btn:hover {
  background-color: #c0392b;
}

#reactor_copy_paste_modal button:hover {
  background-color: #357abd;
}

#reactor_copy_paste_modal button:disabled {
  background-color: #666;
  cursor: not-allowed;
}

#reactor_copy_paste_modal button.hidden {
  display: none;
}

/* Part summary table styles */
.part-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.part-summary-table th,
.part-summary-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #444;
}

.part-summary-table th {
  background-color: #333;
  color: #fff;
  font-weight: bold;
}

.part-summary-table td {
  color: #ccc;
}

.part-type-checkbox {
  margin: 0;
  transform: scale(0.9);
}

/* Unchecked row styling */
.part-summary-table .unchecked-row {
  opacity: 0.6;
  color: #888;
}

.part-summary-table .unchecked-row td {
  color: #888;
}

/* Mobile responsive styles */
@media (max-width: 900px) {
  /* Keep copy/paste/sell buttons pinned to the top-right of the reactor area without overlapping objectives */
  #reactor_copy_paste_btns {
    display: flex;
    flex: 1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 25; /* below modal (1000), above content */
  }

  #reactor_copy_paste_modal .modal-content {
    max-width: 95%;
    max-height: 95%;
    margin: 10px;
  }

  #reactor_copy_paste_modal .modal-content > *:not(.modal-header) {
    padding: 15px;
  }

  #reactor_copy_paste_modal .modal-header {
    padding: 12px 15px;
  }

  #reactor_copy_paste_modal .modal-header h3 {
    font-size: 16px;
  }

  #reactor_copy_paste_modal_close_btn {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.7em;
    padding: 0.1rem;
  }



  #reactor_copy_paste_text {
    min-height: 60px !important;
    font-size: 11px !important;
    padding: 8px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #reactor_copy_paste_cost {
    margin-bottom: 12px;
    font-size: 14px;
  }

  #reactor_copy_paste_modal .modal-actions {
    gap: 8px;
  }

  #reactor_copy_paste_modal button {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 70px;
  }

  /* Scale down table for mobile */
  .component-summary-section {
    margin-top: 8px;
  }

  .component-header {
    padding: 6px 10px;
    margin-bottom: 0;
  }

  .component-title {
    font-size: 13px;
  }

  .component-info-icon {
    font-size: 14px;
  }

  .component-grid {
    gap: 6px;
    padding: 6px;
    min-height: 70px;
  }

  .component-slot {
    width: 50px;
    height: 50px;
  }

  .component-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 3px;
  }

  .component-count {
    font-size: 11px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  #reactor_copy_paste_modal .modal-content {
    max-width: 98%;
    max-height: 98%;
    margin: 5px;
  }

  #reactor_copy_paste_modal .modal-content > *:not(.modal-header) {
    padding: 12px;
  }

  #reactor_copy_paste_modal .modal-header {
    padding: 10px 12px;
  }

  #reactor_copy_paste_modal .modal-header h3 {
    font-size: 15px;
  }

  #reactor_copy_paste_modal_close_btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.6em;
    padding: 0.08rem;
  }



  #reactor_copy_paste_text {
    display: none !important;
  }

  #reactor_copy_paste_cost {
    margin-bottom: 10px;
    font-size: 13px;
  }

  #reactor_copy_paste_modal button {
    padding: 5px 10px;
    font-size: 12px;
    min-width: 60px;
  }

  .component-summary-section {
    margin-top: 6px;
  }

  .component-header {
    padding: 5px 8px;
    margin-bottom: 0;
  }

  .component-title {
    font-size: 12px;
  }

  .component-info-icon {
    font-size: 13px;
  }

  .component-grid {
    gap: 4px;
    padding: 4px;
    min-height: 60px;
  }

  .component-slot {
    width: 45px;
    height: 45px;
  }

  .component-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
  }

  .component-count {
    font-size: 10px;
  }
}

/* Ultra small mobile devices */
@media (max-width: 360px) {
  .component-summary-section {
    margin-top: 5px;
  }

  .component-header {
    padding: 4px 6px;
    margin-bottom: 0;
  }

  .component-title {
    font-size: 11px;
  }

  .component-info-icon {
    font-size: 12px;
  }

  .component-grid {
    gap: 3px;
    padding: 3px;
    min-height: 50px;
  }

  .component-slot {
    width: 40px;
    height: 40px;
  }

  .component-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }

  .component-count {
    font-size: 9px;
  }
}

#reactor_copy_paste_text {
  min-height: 50px !important;
  font-size: 10px !important;
  padding: 6px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#reactor_copy_paste_modal .levels {
  display: none !important;
}

#reactor_copy_paste_modal_close_btn {
  background: #000;
  border: none;
  color: var(--pico-color, #fff);
  font-size: 0.8em;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  border-radius: 4px;
  width: 28px !important;
  height: 28px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
  position: static;
}

#reactor_copy_paste_modal_close_btn:hover {
  opacity: 1;
}

#reactor_copy_paste_modal_close_btn:hover {
  color: var(--pico-primary-hover, #fff);
}

/* Component summary section styles (replaces part summary table) */
.component-summary-section {
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.component-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #2a2a2a;
  border-bottom: 1px solid #333;
  margin: 0;
}

.component-title {
  color: #d4af37;
  font-weight: bold;
  font-size: 14px;
}

.component-info-icon {
  color: #4a9eff;
  font-size: 16px;
  cursor: help;
}

.component-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: #1a1a1a;
  border: none;
  border-radius: 0;
  min-height: 80px;
}

/* Desktop-specific component grid sizing */
@media (min-width: 901px) {
  .component-grid {
    gap: 12px;
    padding: 12px;
    min-height: 120px;
  }
}

.component-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

/* Desktop-specific component slot sizing */
@media (min-width: 901px) {
  .component-slot {
    width: 70px;
    height: 70px;
  }
}

.component-slot:hover {
  border-color: #4a9eff;
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.component-slot.component-disabled {
  opacity: 0.4;
  filter: grayscale(100%);
  border-color: #666;
}

.component-slot.component-disabled:hover {
  opacity: 0.6;
  filter: grayscale(50%);
  border-color: #888;
}

.component-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* Desktop-specific component icon sizing */
@media (min-width: 901px) {
  .component-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 6px;
  }
}

.component-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.component-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #444;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  border-radius: 4px;
}

.component-count {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

/* Mobile banner height overrides */
@media (max-width: 600px) {
  body.game-paused #pause_banner {
    height: 60px !important;
  }
  body.reactor-meltdown #meltdown_banner {
    height: 60px !important;
  }
}

@media (max-width: 400px) {
  body.game-paused #pause_banner {
    height: 60px !important;
  }
  body.reactor-meltdown #meltdown_banner {
    height: 60px !important;
  }
}

.splash-menu-panel {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border: 4px solid #1e1e1e;
  border-right-color: #5a5a5a;
  border-bottom-color: #5a5a5a;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
}

.splash-btn-google {
  display: none !important;
}

#splash-flavor {
  font-family: 'minecraftfont', "Press Start 2P", cursive, monospace !important;
  color: #ffe082;
  font-size: 1.2rem;
  margin: 0.5rem 0 1.5rem 0;
  text-shadow: 2px 2px 0 #3a3a3a, 0 0 8px #ffe08299;
  animation: splash-flavor-pop 2s infinite;
}

@keyframes splash-flavor-pop {
  0% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.splash-version, .splash-stats {
  position: fixed;
  left: 0;
  right: 0;
  text-align: center;
  font-family: inherit;
  font-size: 0.7em;
  color: #b0b0b0;
  opacity: 0.8;
  z-index: 11;
  pointer-events: none;
}
.splash-version {
  bottom: 2.7em;
}
.splash-stats {
  bottom: 2.1em;
}

.splash-bottom-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2.2em;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2em;
  text-align: center;
  font-family: inherit;
  font-size: 0.7em;
  color: #b0b0b0;
  opacity: 0.8;
  z-index: 11;
  pointer-events: none;
}
.splash-version, .splash-stats {
  position: static;
  display: inline;
  margin: 0;
  padding: 0 0.5em;
}

@media (max-width: 600px) {
  .splash-menu-panel {
    margin-bottom: 7em;
  }
}

@media (max-width: 400px) {
  .splash-menu-panel {
    margin-bottom: 9em;
  }
}

@media (max-width: 600px) {
  #splash-screen {
    padding-bottom: 9em;
  }
  .splash-menu-panel {
    margin-bottom: 8em;
  }
}

@media (max-width: 400px) {
  #splash-screen {
    padding-bottom: 11em;
  }
  .splash-menu-panel {
    margin-bottom: 11em;
  }
}

@media (max-width: 600px) {
  .splash-footer-links {
    bottom: 0 !important;
    padding-bottom: 0.5em;
    font-size: 0.8em;
    display: block;
    width: 100%;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    margin-top: 0.5em;
  }
  .splash-stats {
    bottom: 2em !important;
    font-size: 0.8em;
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 0.2em;
  }
  .splash-version {
    bottom: 3.5em !important;
    font-size: 0.8em;
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 0.2em;
  }
}

/* --- Add this at the end of the file for mobile --- */
@media (max-width: 600px) {
  .splash-bottom-stack {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 20;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
  }
  .splash-version,
  .splash-stats,
  .splash-footer-links {
    position: static !important;
    bottom: auto !important;
    display: block !important;
    width: 100%;
    text-align: center;
    font-size: 0.8em !important;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    background: none;
  }
  .splash-footer-links {
    margin-top: 0.2em;
    margin-bottom: 0.5em;
  }
  
  /* Stack footer links vertically on mobile */
  .splash-footer-links a {
    display: block;
    margin: 0;
    line-height: 1.2;
  }
  
  /* Hide separator pipes on mobile */
  .splash-footer-links {
    white-space: normal;
    font-size: 0;
  }
  
  .splash-footer-links a {
    font-size: 0.8em;
  }
  
  /* Completely hide pipe separators on mobile */
  .splash-footer-links {
    color: transparent;
  }
  
  .splash-footer-links a {
    color: #8fd694;
  }
}

/* --- Tablet breakpoint to hide continue info --- */
@media (max-width: 1024px) {
  .splash-stats {
    display: none !important;
  }
}

/* --- Ensure background animation works on all widths --- */
@media (max-width: 1024px) {
  #splash-screen {
    animation: splash-bg-scroll 120s linear infinite;
    background-size: auto;
  }
  
  /* Ensure objective text scrolling works on tablets */
  #objective_title span {
    animation: scroll-objective-title 8s linear infinite;
  }
}

@media (max-width: 768px) {
  #splash-screen {
    animation: splash-bg-scroll 120s linear infinite;
    background-size: auto;
  }
  
  /* Ensure objective text scrolling works on tablets */
  #objective_title span {
    animation: scroll-objective-title 8s linear infinite;
  }
}

@media (max-width: 600px) {
  #splash-screen {
    animation: splash-bg-scroll 120s linear infinite;
    background-size: auto;
  }
}

@media (max-width: 400px) {
  #splash-screen {
    animation: splash-bg-scroll 120s linear infinite;
    background-size: auto;
  }
}

/* Style for visualizing heat segments */
.segment-highlight {
  outline: 2px solid rgba(0, 255, 255, 0.7);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
  transition: outline 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
  z-index: 5; /* Ensure the highlight is drawn above adjacent tiles */
}

/* Quick Start Modal Styles */
.quick-start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.quick-start-content {
  background-color: #1a1a1a;
  border: 3px solid #333;
  border-radius: 12px;
  padding: 0;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

/* Desktop-specific sizing */
@media (min-width: 901px) {
  .quick-start-content {
    max-width: 800px;
    max-height: 85%;
    min-width: 600px;
    min-height: 500px;
  }
}

.quick-start-page {
  padding: 30px;
}

.quick-start-page.hidden {
  display: none;
}

.quick-start-title {
  color: #4a9eff;
  font-size: 28px;
  margin: 0 0 25px 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.quick-start-section {
  margin-bottom: 25px;
}

.quick-start-section h3 {
  color: #8fd694;
  font-size: 18px;
  margin: 0 0 12px 0;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.quick-start-list {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.quick-start-list li {
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  list-style: none !important;
}

.quick-start-list li:before {
  content: "•";
  color: #4a9eff;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.quick-start-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-start-actions div {
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 0;
}

.quick-start-tutorial-note {
  background-color: #2d4a3d;
  border: 1px solid #4a9eff;
  border-radius: 6px;
  padding: 12px;
  margin: 20px 0;
  text-align: center;
  color: #8fd694;
  font-size: 14px;
}

.quick-start-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.quick-start-buttons .pixel-btn {
  min-width: 120px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: bold;
}

/* Mobile responsive styles */
@media (max-width: 900px) {
  .quick-start-content {
    max-width: 95%;
    max-height: 90%;
    min-width: auto;
    min-height: auto;
  }
  
  .quick-start-page {
    padding: 20px;
  }
  
  .quick-start-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .quick-start-section h3 {
    font-size: 16px;
  }
  
  .quick-start-list li {
    font-size: 13px;
  }
  
  .quick-start-actions div {
    font-size: 13px;
    padding: 10px;
  }
  
  .quick-start-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .quick-start-buttons .pixel-btn {
    width: 100%;
    max-width: 200px;
  }
}

@media (max-width: 600px) {
  .quick-start-content {
    max-width: 98%;
    max-height: 95%;
  }
  
  .quick-start-page {
    padding: 15px;
  }
  
  .quick-start-title {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .quick-start-section {
    margin-bottom: 20px;
  }
  
  .quick-start-section h3 {
    font-size: 15px;
    margin-bottom: 10px;
  }
  
  .quick-start-list li {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .quick-start-actions div {
    font-size: 12px;
    padding: 8px;
  }
  
  .quick-start-tutorial-note {
    padding: 12px;
    font-size: 13px;
    margin: 15px 0;
  }
  
  .quick-start-buttons {
    margin-top: 20px;
    gap: 10px;
  }
  
  .quick-start-buttons .pixel-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .quick-start-content {
    max-width: 99%;
    max-height: 98%;
  }
  
  .quick-start-page {
    padding: 12px;
  }
  
  .quick-start-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .quick-start-section {
    margin-bottom: 15px;
  }
  
  .quick-start-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .quick-start-list li {
    font-size: 11px;
    margin-bottom: 5px;
    padding-left: 15px;
  }
  
  .quick-start-actions div {
    font-size: 11px;
    padding: 6px;
  }
  
  .quick-start-tutorial-note {
    padding: 10px;
    font-size: 12px;
    margin: 12px 0;
  }
  
  .quick-start-buttons {
    margin-top: 15px;
    gap: 8px;
  }
  
  .quick-start-buttons .pixel-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* Desktop EP icon styling to match other icons */
.info-bar-desktop .info-item.ep .icon {
  font-size: 24px;
  line-height: 24px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4em;
  filter: drop-shadow(0 0 2px rgba(0,255,255,0.5));
}

/* Full power and heat animations */
@keyframes full-power-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@keyframes full-power-flash {
  0%, 100% { 
    background: repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(0,255,255,0.4) 2px,
      rgba(0,255,255,0.4) 10px
    );
  }
  50% { 
    background: repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(0,255,255,0.8) 2px,
      rgba(0,255,255,0.8) 10px
    );
  }
}

@keyframes full-heat-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@keyframes full-heat-flash {
  0%, 100% { 
    background: repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(255,100,0,0.4) 2px,
      rgba(255,100,0,0.4) 10px
    );
  }
  50% { 
    background: repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(244,67,54,0.8) 2px,
      rgba(244,67,54,0.8) 10px
    );
  }
}

/* Full power and heat animation classes */

/* When full, flash the striped fill to draw attention */
.info-bar-desktop .info-item.power.full::after {
  animation: full-power-flash 0.9s ease-in-out infinite;
}
.info-bar-desktop .info-item.heat.full::after {
  animation: full-heat-flash 0.9s ease-in-out infinite;
}

/* Mobile full power and heat animation classes */
#info_bar .info-row.info-main .info-item.power.full::after {
  animation: full-power-flash 0.9s ease-in-out infinite;
}
#info_bar .info-row.info-main .info-item.heat.full::after {
  animation: full-heat-flash 0.9s ease-in-out infinite;
}

