@import url('https://fonts.googleapis.com/css2?family=Bubblegum+Sans&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a0a3e;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a0a3e;
  font-family: 'Bubblegum Sans', 'Comic Sans MS', cursive, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
}

#game-root {
  width: 1024px;
  height: 768px;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.screen {
  position: absolute;
  inset: 0;
  width: 1024px;
  height: 768px;
  display: none;
}

.screen.active {
  display: flex;
}

/* ── Game screen layout ── */
#screen-game {
  position: relative;
}

#board-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 155px;
  height: auto;
  z-index: 5;
  pointer-events: none;
  filter: saturate(0.92);
}

/* ── Board area — full screen, sidebar overlays on top ── */
#board-container {
  position: absolute;
  inset: 0;
  width: 1024px;
  height: 768px;
  overflow: hidden;
}

#board-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  filter: saturate(0.92);
}

#spaces-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

#pieces-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ── Sidebar — grid cluster at bottom-right ── */
#sidebar {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: auto;
  height: auto;
  background: transparent;
  display: grid;
  grid-template-areas:
    ".       label"
    "players deck ";
  grid-template-columns: auto auto;
  gap: 6px 14px;
  align-items: end;
  z-index: 10;
}

/* ── Turn indicator — above the card ── */
#current-player-display {
  grid-area: label;
  width: auto;
  background: rgba(0,0,0,0.50);
  border-radius: 10px;
  padding: 4px 10px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#current-player-name {
  display: block;
  font-size: 15px;
  color: #ffd700;
}

.turn-label {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
}

/* ── Player list — horizontal row to the left of the card ── */
#player-list {
  grid-area: players;
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: flex-end;
  width: auto;
  overflow: visible;
}

.player-list-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(0,0,0,0.45);
  border: 1.5px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.player-list-item.current-turn {
  border-color: #ffd700;
  background: rgba(0,0,0,0.60);
}

.player-piece-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.45);
}

.player-info-text {
  flex: none;
  overflow: hidden;
}

.player-name-label {
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  display: block;
}

.player-pos-label {
  display: none;
}

.player-skip-badge {
  font-size: 9px;
  background: #ff6b6b;
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
}

/* ── Winner screen base ── */
#screen-winner {
  align-items: center;
  justify-content: center;
}
