* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body {
  background: #0b0b0b;
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
}

h1 {
  margin-bottom: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.subtitle {
  margin-bottom: 18px;
  color: #ccc;
  font-size: 0.9rem;
}

.game-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  width: 100%;
}

.board-wrapper {
  background: #111;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(0,0,0,0.8);
  position: relative;
}

/* BOARD IMAGE */
.board {
  width: 520px;
  height: 520px;
  border-radius: 4px;
  overflow: hidden;
  border: 3px solid #333;
  position: relative;

  background-image: url("board.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* TOKEN LAYER */
.token-layer {
  position: absolute;
  inset: 10px; /* match board padding */
  pointer-events: none;
  z-index: 10;
}

.token-visual {
  position: absolute;
  width: 6%;
  height: 6%;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.token {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #000;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.token.red { background: #ffebee; border-color: #b71c1c; }
.token.green { background: #e8f5e9; border-color: #1b5e20; }
.token.yellow { background: #fffde7; border-color: #f9a825; }
.token.blue { background: #e3f2fd; border-color: #0d47a1; }

.token.highlight {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255,235,59,0.9);
}

/* SIDEBAR */
.sidebar {
  min-width: 260px;
  max-width: 320px;
  background: #111;
  border-radius: 8px;
  padding: 14px 16px 16px;
  box-shadow: 0 0 18px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  margin-bottom: 4px;
}

.players-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.player-input {
  background: #181818;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #262626;
}

.player-label {
  font-size: 0.75rem;
  color: #bbb;
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.color-dot.red { background: #c62828; }
.color-dot.green { background: #2e7d32; }
.color-dot.yellow { background: #f9a825; }
.color-dot.blue { background: #1565c0; }

.player-input input {
  width: 100%;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #101010;
  color: #eee;
  font-size: 0.8rem;
}

.player-input input:focus {
  outline: none;
  border-color: #4caf50;
}

/* BUTTONS */
.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn {
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.btn-primary {
  background: #f57c00;
  color: #fff;
  box-shadow: 0 0 10px rgba(245,124,0,0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(245,124,0,0.7);
}

.btn-secondary {
  background: #222;
  color: #ddd;
  border: 1px solid #333;
}

.btn-secondary:hover {
  background: #2b2b2b;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* STATUS + LOG */
.status {
  background: #181818;
  border-radius: 8px;
  padding: 8px 10px 8px;
  border: 1px solid #262626;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-label {
  color: #aaa;
  font-size: 0.8rem;
}

.status-value {
  font-weight: 600;
}

.log {
  margin-top: 4px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.78rem;
  padding-right: 4px;
}

.log-entry {
  color: #ccc;
  margin-bottom: 2px;
}

.log-entry span {
  color: #ff9800;
}

.hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

/* DICE */
.dice-container {
  perspective: 600px;
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.dice {
  width: 60px;
  height: 60px;
  transform-style: preserve-3d;
  transition: transform 1s ease-in-out;
}

.face {
  position: absolute;
  width: 60px;
  height: 60px;
  background: #f57c00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 8px;
  border: 2px solid #fff;
}

.face1 { transform: rotateY(0deg) translateZ(30px); }
.face2 { transform: rotateY(180deg) translateZ(30px); }
.face3 { transform: rotateX(90deg) translateZ(30px); }
.face4 { transform: rotateX(-90deg) translateZ(30px); }
.face5 { transform: rotateY(90deg) translateZ(30px); }
.face6 { transform: rotateY(-90deg) translateZ(30px); }

/* RESPONSIVE */
@media(max-width:900px){
  .board { width:360px; height:360px; }
}

@media(max-width:720px){
  .game-container {
    flex-direction: column;
    align-items: center;
  }
}
