body {
  background-color: #232323;
  color: #f1f1f1;
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

#siteHeader {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* Rectangular, retina-optimized logo for 320x160px */
#siteLogo {
  width: 320px;
  height: 160px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  background: none;
  box-shadow: none;
  border-radius: 16px;
  display: block;
  margin: 0 auto 0.5rem auto;
}

@media 
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  #siteLogo {
    width: 320px;
    height: 160px;
    background-size: 320px 160px;
    /* If you have a 2x logo, swap src via JS or use:
       background-image: url('logo@2x.png');
    */
  }
}

@keyframes flicker {
  0% { filter: brightness(1.1); }
  20% { filter: brightness(1.35); }
  40% { filter: brightness(0.95); }
  60% { filter: brightness(1.2); }
  80% { filter: brightness(1.15); }
  100% { filter: brightness(1.3); }
}

.flicker-start {
  animation: flicker 1.5s infinite alternate;
}

.calculatorBox {
  background: #191919;
  border-radius: 14px;
  box-shadow: 0 4px 28px #0002;
  margin: 2rem auto 2rem auto;
  width: 100%;
  max-width: 440px;
  padding: 2rem 2rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.calculatorBox h2 {
  font-family: 'Lilita One', cursive;
  color: #d4af7f;
  margin-bottom: 0.5rem;
}

input[type="text"], input[type="number"], select {
  font-size: 1.05rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #272727;
  color: #f1f1f1;
  margin-bottom: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

input[type="number"]:focus, input[type="text"]:focus {
  outline: 2px solid #d4af7f;
}

.styled-btn, .calculatorBox button, .popupBox button {
  font-family: 'Lilita One', cursive;
  background: #d4af7f;
  color: #232323;
  border-radius: 8px;
  border: none;
  padding: 0.65rem 1.2rem;
  font-size: 1.05rem;
  cursor: pointer;
  margin: 0.2rem 0;
  transition: background 0.2s;
}

.styled-btn:active,
.calculatorBox button:active,
.popupBox button:active {
  background: #a68c5c;
}

.styled-btn:disabled {
  background: #777;
  color: #ccc;
  cursor: not-allowed;
}

.dimOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: #191919dd;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.popupBox {
  background: #232323;
  border-radius: 12px;
  box-shadow: 0 4px 28px #0002;
  padding: 2rem 1.2rem 1.5rem 1.2rem;
  min-width: 300px;
  max-width: 90vw;
  color: #f1f1f1;
  text-align: center;
}

.popupBox button {
  margin: 0.8rem 0.3rem 0 0.3rem;
}

#globalClockContainer {
  text-align: center;
  margin: 0 auto 1rem auto;
  font-size: 1.25rem;
  width: 100%;
  max-width: 440px;
  /* Do NOT set display: none here! JS will control visibility */
}

#playerTimer {
  font-family: 'Lilita One', cursive;
  font-size: 2.2rem;
  color: #d4af7f;
  margin-top: 0.2rem;
}

#mainGameContainer {
  min-height: 150px;
}

#siteFooter {
  text-align: center;
  font-size: 0.92rem;
  color: #bbbbbb;
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
}

/* Endgame blocks */
.playerEndgameBlock {
  background: #232323;
  border-radius: 7px;
  padding: 1rem;
  margin: 0.8rem 0;
  box-shadow: 0 2px 12px #0001;
}

.sideInputs {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  margin-top: 0.7rem;
}

/* 📱 Smartphone Optimization */
@media screen and (max-width: 600px) {
  body {
    padding: 1rem;
    box-sizing: border-box;
  }

  #siteHeader, #siteFooter, .calculatorBox, .popupBox {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    margin: 0 auto;
    box-sizing: border-box;
  }

  h1, h2, h3 {
    font-size: 1.4rem;
    text-align: center;
  }

  p, label {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  input[type="text"],
  input[type="number"],
  select {
    font-size: 1rem;
    padding: 0.6rem;
    margin: 0.4rem 0;
  }

  button,
  .popupBox button,
  button.styled-btn {
    font-size: 1rem;
    width: 100%;
    margin: 0.5rem 0;
    padding: 0.75rem;
  }

  #siteLogo {
    width: 80vw;
    max-width: 320px;
    height: 64px;
    min-height: 40px;
  }

  .sideInputs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .popupBox input {
    width: 100%;
  }
}

/* Player Name Styling */
.player-name {
  font-family: 'Lilita One', cursive;
  color: #d4af7f !important;
  font-weight: normal !important;
}