body { background: var(--bg-deep); color: var(--text); font-family: 'Manrope', sans-serif; margin: 0; }
.hidden { display: none !important; }
.screen { min-height: 100vh; }

.lobby-box {
  background: var(--bg-panel);
  border: 3px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
  margin: 20px auto;
}
.lobby-box input, .lobby-box button {
  padding: 10px;
  border: 2px solid var(--line);
  font-size: 15px;
  font-family: 'Manrope', sans-serif;
  background: var(--bg-panel-raised);
  color: var(--text);
}
.lobby-box button { background: var(--gold); color: var(--on-accent); font-weight: 800; cursor: pointer; text-transform: uppercase; }
.or { text-align: center; opacity: 0.7; font-size: 13px; }

.mp-topbar {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-panel);
  border-bottom: 3px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.mp-waiting { text-align: center; padding: 30px 20px; }
.mp-waiting button {
  background: var(--gold);
  color: var(--on-accent);
  border: 2px solid var(--line);
  padding: 10px 20px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  margin: 6px;
}

.mp-layout {
  display: flex;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.mp-board {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 92px));
  grid-template-rows: repeat(11, minmax(0, 92px));
  gap: 0;
  background: #eef0e2;
  border: 4px solid #111111;
  width: fit-content;
}

.mp-square {
  background: #fbf8ee;
  color: #111111;
  font-size: 12px;
  padding: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid #111111;
}
.sq-rotate {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
}
.grp-bar { height: 18px; width: 100%; flex-shrink: 0; border-bottom: 2px solid #111111; }
.mp-square .sq-body { padding: 5px 6px; display: flex; flex-direction: column; flex: 1; min-height: 0; }

.mp-square .sq-name {
  font-weight: 800;
  line-height: 1.15;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: #111111;
}
.mp-square .sq-price {
  color: #ffffff;
  background: #111111;
  display: inline-block;
  font-weight: 800;
  font-size: 11px;
  padding: 1px 5px;
  margin-top: auto;
  align-self: flex-start;
}
.mp-square .tokens { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 3px; }
.mp-token {
  width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #000;
  border: 2px solid #000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
}
.mp-square.owned-me { box-shadow: inset 0 0 0 3px var(--gold); }

.mp-square.corner {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fbf8ee;
}
.mp-square.corner .sq-body { align-items: center; justify-content: center; text-align: center; margin: 0; }
.mp-square.corner .sq-icon { font-size: 24px; margin-bottom: 2px; }
.mp-square.corner .sq-name { font-size: 9px; color: #4a4a4a; text-transform: uppercase; letter-spacing: 0.04em; }

.mp-square.center-info {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #111111;
  background: #fdfcf7;
  position: relative;
  overflow: hidden;
}
.mp-square.center-info .badge {
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
  color: #111111;
  letter-spacing: 0.01em;
}
.mp-square.center-info .subtitle {
  font-size: 13px;
  color: #8a8a8a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 6px;
}

.mp-sidebar { width: 280px; }
.mp-players { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mp-player-card {
  background: var(--bg-panel);
  border: 2px solid var(--line);
  padding: 8px 10px;
  font-size: 13px;
}
.mp-player-card.active-turn { border-color: var(--gold); border-width: 3px; }
.mp-player-card .name { font-weight: 700; }
.mp-player-card .money { color: var(--gold); font-weight: 800; }
.mp-player-card.bankrupt { opacity: 0.4; text-decoration: line-through; }

.mp-event {
  background: var(--bg-panel-raised);
  border: 2px solid var(--line);
  padding: 10px;
  font-size: 13px;
  min-height: 40px;
  margin-bottom: 10px;
}

.mp-history {
  background: var(--bg-panel-raised);
  border: 2px solid var(--line);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-faint);
  max-height: 110px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.mp-history div { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mp-history div:last-child { border-bottom: none; }

.mp-controls {
  background: var(--bg-panel);
  border: 2px solid var(--gold);
  padding: 12px;
  text-align: center;
  margin-bottom: 10px;
}
.mp-controls button {
  background: var(--gold);
  color: var(--on-accent);
  border: 2px solid var(--line);
  padding: 8px 16px;
  font-weight: 800;
  cursor: pointer;
  margin: 4px;
  text-transform: uppercase;
}
.mp-lastroll { margin-top: 8px; font-size: 20px; font-weight: 800; }

.property-card {
  background: #fdfcf7;
  border: 3px solid #111111;
  color: #111111;
  max-width: 220px;
  margin: 0 auto 12px;
  text-align: left;
}
.property-card .pc-header {
  height: 26px;
  border-bottom: 2px solid #111111;
}
.property-card .pc-body { padding: 10px 12px; }
.property-card .pc-name { font-weight: 800; font-size: 16px; text-align: center; margin-bottom: 8px; }
.property-card .pc-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; border-top: 1px solid #ddd; }
.property-card .pc-row:first-of-type { border-top: none; }

.mp-win-banner {
  background: var(--gold);
  color: var(--on-accent);
  padding: 14px;
  text-align: center;
  font-weight: 800;
  border: 3px solid var(--line);
  text-transform: uppercase;
}

.mp-error { text-align: center; color: #ff5b5b; min-height: 20px; font-size: 13px; }

/* ---------- 3D-Würfel (reines CSS) ---------- */
.dice-board {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 20px 0 30px;
  perspective: 1000px;
}
.cube-container {
  width: 60px;
  height: 60px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.1s ease-out;
}
.cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid #ccc;
  background: #fdfcf7;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.3);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 6px;
  box-sizing: border-box;
}
.cube-face .pip {
  background-color: #111;
  border-radius: 50%;
  width: 9px;
  height: 9px;
  justify-self: center;
  align-self: center;
}
.face-1 { transform: translateZ(30px); }
.face-6 { transform: rotateY(180deg) translateZ(30px); }
.face-2 { transform: rotateY(90deg) translateZ(30px); }
.face-5 { transform: rotateY(-90deg) translateZ(30px); }
.face-3 { transform: rotateX(90deg) translateZ(30px); }
.face-4 { transform: rotateX(-90deg) translateZ(30px); }

.face-1 .pip:nth-child(1) { grid-area: 2 / 2; }
.face-2 .pip:nth-child(1) { grid-area: 1 / 1; }
.face-2 .pip:nth-child(2) { grid-area: 3 / 3; }
.face-3 .pip:nth-child(1) { grid-area: 1 / 1; }
.face-3 .pip:nth-child(2) { grid-area: 2 / 2; }
.face-3 .pip:nth-child(3) { grid-area: 3 / 3; }
.face-4 .pip:nth-child(1) { grid-area: 1 / 1; }
.face-4 .pip:nth-child(2) { grid-area: 1 / 3; }
.face-4 .pip:nth-child(3) { grid-area: 3 / 1; }
.face-4 .pip:nth-child(4) { grid-area: 3 / 3; }
.face-5 .pip:nth-child(1) { grid-area: 1 / 1; }
.face-5 .pip:nth-child(2) { grid-area: 1 / 3; }
.face-5 .pip:nth-child(3) { grid-area: 2 / 2; }
.face-5 .pip:nth-child(4) { grid-area: 3 / 1; }
.face-5 .pip:nth-child(5) { grid-area: 3 / 3; }
.face-6 .pip:nth-child(1) { grid-area: 1 / 1; }
.face-6 .pip:nth-child(2) { grid-area: 1 / 3; }
.face-6 .pip:nth-child(3) { grid-area: 2 / 1; }
.face-6 .pip:nth-child(4) { grid-area: 2 / 3; }
.face-6 .pip:nth-child(5) { grid-area: 3 / 1; }
.face-6 .pip:nth-child(6) { grid-area: 3 / 3; }

/* ---------- Popup-Modal (Ereignis/Steuer/Gefaengnis) ---------- */
.mp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.mp-modal-card {
  background: var(--bg-panel);
  border: 3px solid var(--gold);
  padding: 24px;
  max-width: 340px;
  width: 90vw;
  text-align: center;
  animation: modalPop 0.25s ease;
}
.mp-modal-card.wide { max-width: 500px; }
@keyframes modalPop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mp-modal-eyebrow { font-size: 11px; letter-spacing: 0.1em; color: var(--gold); font-weight: 800; margin-bottom: 10px; text-transform: uppercase; }
.mp-modal-icon { font-size: 40px; margin-bottom: 10px; }
.mp-modal-title { font-size: 15px; margin-bottom: 16px; line-height: 1.4; }
.mp-modal-btn {
  background: var(--gold);
  color: var(--on-accent);
  border: 2px solid var(--line);
  padding: 10px 24px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Meine Grundstuecke ---------- */
.owned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  margin: 14px 0;
}
.mini-prop-card {
  background: #fdfcf7;
  color: #111;
  border: 1px solid #111;
  overflow: hidden;
  font-size: 11px;
  text-align: left;
}
.mini-prop-card .mpc-header { height: 14px; }
.mini-prop-card .mpc-body { padding: 6px 8px; }
.mini-prop-card .mpc-name { font-weight: 800; margin-bottom: 3px; }
.mini-prop-card .mpc-price { color: #555; }
.owned-empty { color: var(--text-faint); font-size: 13px; padding: 20px 0; }

/* Chat */
.chat-panel { position: fixed; bottom: 0; right: 20px; width: 280px; z-index: 60; }
.chat-toggle { background: var(--bg-panel); border: 2px solid var(--line); border-bottom: none; color: var(--text); padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 700; }
.chat-body { background: var(--bg-panel); border: 2px solid var(--line); display: flex; flex-direction: column; height: 240px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 10px; font-size: 13px; }
.chat-messages .msg { margin-bottom: 6px; line-height: 1.4; }
.chat-messages .msg .who { color: var(--gold); font-weight: 700; margin-right: 4px; }
.chat-input-row { display: flex; border-top: 2px solid var(--line); }
.chat-input-row input { flex: 1; padding: 10px; border: none; background: var(--bg-panel-raised); color: var(--text); font-size: 13px; }
.chat-input-row button { background: var(--gold); color: var(--on-accent); border: none; padding: 0 14px; font-weight: 800; cursor: pointer; font-size: 13px; }
.chat-quick-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-top: 2px solid var(--line); }
.quick-btn { background: var(--bg-panel-raised); border: 1px solid var(--line); color: var(--text); padding: 4px 9px; font-size: 11px; cursor: pointer; }
.quick-btn:hover { background: var(--gold); color: var(--on-accent); }

@media (max-width: 900px) {
  .mp-board {
    grid-template-columns: repeat(11, minmax(0, 40px));
    grid-template-rows: repeat(11, minmax(0, 40px));
  }
  .mp-square { font-size: 7px; }
  .mp-square .sq-body { padding: 2px 3px; }
  .mp-square .sq-name { font-size: 7px; }
  .mp-square .sq-price { display: none; }
  .grp-bar { height: 8px; }
  .mp-token { width: 12px; height: 12px; font-size: 7px; border-width: 1px; }
  .mp-square.corner .sq-icon { font-size: 16px; }
  .mp-square.corner .sq-name { font-size: 6px; }
  .mp-square.center-info .badge { font-size: 11px; padding: 3px 8px; box-shadow: 2px 2px 0 #111111; }
  .mp-square.center-info .subtitle { font-size: 7px; }
  .mp-square.center-info .group-swatch { width: 10px; height: 10px; }
  .chat-panel { right: 8px; width: calc(100vw - 16px); max-width: 300px; }
}
