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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1a0d;
  color: #ddd;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  image-rendering: pixelated;
}

/* === Spielfeld === */
#board {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  border: 4px solid #333;
  background: #000;
  image-rendering: pixelated;
}

/* === UI Panel === */
#uiPanel {
  position: fixed;
  top: 10px;
  left: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(20,40,20,0.95);
  border: 4px solid #555;
  border-radius: 0; /* eckig für Pixel-Style */
  max-width: 280px;
  font-size: 10px;
  box-shadow: 0 0 12px #000;
}

/* === Toggle UI Button === */
#toggleUI {
  position: fixed;
  top: 10px;
  right: 10px;
  background: #204520;
  color: #fff;
  border: 3px solid #555;
  padding: 6px 10px;
  border-radius: 0;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  image-rendering: pixelated;
}
#toggleUI:hover {
  background: #306530;
  border-color: #fff;
}

/* === Farbpalette === */
.palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, 20px);
  gap: 4px;
}
.palette button.color {
  width: 20px;
  height: 20px;
  border: 2px solid #333;
  cursor: pointer;
  image-rendering: pixelated;
}
.palette button.selected {
  border: 2px solid #ff0;
}

/* === Chat === */
.chat {
  background: #111;
  padding: 5px;
  border: 3px solid #555;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

#chatBody {
  flex: 1;
  overflow-y: auto;
  background: #000;
  margin-bottom: 4px;
  padding: 4px;
  font-size: 10px;
  color: #0f0; /* Terminal-grün */
}

#chatBody .msg {
  margin: 2px 0;
  line-height: 1.3em;
}

#chatBody .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border: 1px solid #444;
}

#chatBody .name {
  color: #ff0; /* gelb für Usernamen */
  margin-right: 4px;
}

#chatBody .time {
  color: #888;
  margin-left: 6px;
  font-size: 9px;
}

#chatInput {
  flex: 1;
  padding: 2px 4px;
  background: #111;
  border: 2px solid #555;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}

#chatSend {
  margin-left: 4px;
  padding: 2px 6px;
  background: #204520;
  border: 2px solid #555;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
}
#chatSend:hover {
  background: #306530;
}

/* === Regeln Overlay === */
#rulesOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#rulesBox {
  background: #132613;
  padding: 20px;
  border: 4px solid #555;
  color: #fff;
  max-width: 400px;
  text-align: center;
  font-size: 12px;
}

#rulesBox h2 {
  margin-top: 0;
  font-size: 14px;
}

#rulesBox button {
  margin-top: 15px;
  padding: 8px 16px;
  background: #204520;
  border: 3px solid #555;
  color: #fff;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}
#rulesBox button:hover {
  background: #306530;
  border-color: #fff;
}

/* === Online Counter === */
#onlineCount {
  position: fixed;
  top: 44px;
  right: 12px;
  background: rgba(32,69,32,0.95);
  padding: 4px 8px;
  border: 3px solid #555;
  font-weight: bold;
  font-size: 10px;
  color: #0ff;
  border-radius: 0;
  pointer-events: none;
  font-family: 'Press Start 2P', monospace;
}

/* === Announce Overlay === */
.announce-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  color: #fff;
  padding: 20px 40px;
  border: 4px solid #ff0;
  font-size: 14px;
  text-align: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.announce-box.hide {
  animation: fadeOut 1s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to { opacity: 0; transform: translate(-50%, -52%); }
}

.msg.system {
  background: rgba(0, 80, 0, 0.25);
  border: 1px solid #00ff66;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 4px 0;
  color: #00ff66;
  font-family: monospace;
  white-space: pre-line;
}

