/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette inspiree du plateau La Bonne Paye */
  --bg: #0e8a8a;
  --bg-dark: #0a6e6e;
  --bg-card: rgba(255,255,255,0.12);
  --bg-card-solid: #0c7878;
  --surface: rgba(0,0,0,0.2);
  --surface-solid: #0b7272;
  --border: rgba(255,255,255,0.15);
  --text: #fff;
  --text-muted: rgba(255,255,255,0.7);
  --primary: #f5c518;
  --primary-dark: #d4a90e;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --gold: #f5c518;
  --silver: #bdc3c7;
  --bronze: #cd7f32;
  --savings: #1abc9c;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, #0e8a8a 0%, #0a6e6e 50%, #086060 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === SCREENS === */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* === HOME === */
.home-container {
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 440px;
  width: 100%;
}

.logo h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 2px 3px 0 rgba(0,0,0,0.3);
  margin-bottom: 0.2rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group { text-align: left; }
.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.25);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus { border-color: var(--primary); }
input::placeholder { color: var(--text-muted); opacity: 0.6; }

.separator {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.85rem; margin: 0.5rem 0;
}
.separator::before, .separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* === BUTTONS === */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.btn-primary { background: var(--primary); color: #1a1a2e; }
.btn-secondary { background: rgba(255,255,255,0.15); color: var(--text); border: 1px solid var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #1a1a2e; }
.btn-info { background: var(--info); color: #fff; }
.btn-savings { background: var(--savings); color: #fff; }
.btn-savings-out { background: #16a085; color: #fff; }
.btn-large { padding: 1rem 2rem; font-size: 1.2rem; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: 0.25rem; vertical-align: middle;
}

/* === LOBBY === */
.lobby-container {
  margin: auto; text-align: center; padding: 2rem; max-width: 500px; width: 100%;
}
.lobby-container h2 {
  font-family: var(--font-display); font-size: 2rem; margin-bottom: 1.5rem;
}

.lobby-code {
  font-family: var(--font-display);
  font-size: 1.8rem;
  background: rgba(0,0,0,0.25);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  letter-spacing: 6px;
  border: 2px solid var(--border);
}
.lobby-code span { color: var(--primary); font-weight: 700; }

.lobby-settings { margin-bottom: 1.5rem; }
.lobby-settings select { width: auto; display: inline-block; min-width: 150px; }

.lobby-players {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: center; margin-bottom: 1.5rem;
}
.lobby-player {
  background: rgba(0,0,0,0.2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 500; min-width: 140px;
}
.lobby-player .animal-icon { font-size: 1.5rem; }
.lobby-player.host { border-color: var(--gold); }
.lobby-player.disconnected { opacity: 0.4; }
.lobby-wait { color: var(--text-muted); font-style: italic; }

/* === GAME LAYOUT === */
.game-layout {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "players board inventory"
    "actions actions actions";
  min-height: 100vh;
  gap: 0;
}

.game-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 2px solid var(--border);
}
.month-display, .turn-display, .game-code {
  font-family: var(--font-display);
  font-size: 1rem;
}
.game-code span {
  color: var(--primary); font-weight: 700; letter-spacing: 3px; cursor: pointer;
}
.game-code span:hover { text-decoration: underline; }
.turn-display span { color: var(--primary); font-weight: 600; }

/* === BOARD (spirale 7x5) === */
.board-wrapper {
  grid-area: board;
  padding: 0.75rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 7/5;
}

.board-space {
  border-radius: 6px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.65rem;
  min-height: 56px;
  border: 2px solid rgba(0,0,0,0.2);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.board-space:hover { transform: scale(1.04); z-index: 2; }

.board-space.board-center {
  background: rgba(0,0,0,0.25) !important;
  border: 2px solid rgba(155,89,182,0.4);
  box-shadow: inset 0 0 20px rgba(155,89,182,0.15);
  cursor: default !important;
}
.board-space.board-center:hover { transform: none; }

.caisse-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 4px;
}
.caisse-icon { font-size: 1.6rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.caisse-label {
  font-family: var(--font-display); font-size: 0.55rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.6);
}
.caisse-value {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--gold); text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.caisse-dice-hint {
  font-family: var(--font-display); font-size: 0.65rem; font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 4px;
}

.board-space .day-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  position: absolute;
  top: 2px;
  left: 4px;
}

.board-space .day-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.board-space .space-type {
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.9;
  margin-top: 0px;
}
.board-space .space-icon {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

/* Depart styling */
.board-space.type-depart {
  background: #e74c3c !important;
  border: 3px solid #c0392b;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2), 0 2px 6px rgba(231,76,60,0.4);
}
.board-space.type-depart .space-type { font-size: 0.65rem; font-weight: 700; }

/* Sunday styling */
.board-space.sunday {
  background: repeating-linear-gradient(
    45deg,
    #2ecc71,
    #2ecc71 4px,
    #27ae60 4px,
    #27ae60 8px
  ) !important;
}

/* Badge nombre courriers */
.board-space .mail-count {
  position: absolute;
  top: 1px;
  right: 3px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6rem;
  background: rgba(0,0,0,0.4);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Pions */
.board-space .pawns {
  display: flex; gap: 1px; flex-wrap: wrap; justify-content: center;
  position: absolute; bottom: 1px; left: 1px; right: 1px;
}
.pawn {
  font-size: 1.25rem; line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  transition: transform 0.3s ease;
}
.pawn.active { animation: pawn-bounce 0.6s ease infinite; }

@keyframes pawn-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* === PLAYERS PANEL (gauche) === */
.players-panel {
  grid-area: players;
  background: rgba(0,0,0,0.2);
  border-right: 2px solid var(--border);
  padding: 0.6rem;
  overflow-y: auto;
}
.players-panel h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.player-card {
  background: rgba(0,0,0,0.2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  margin-bottom: 0.35rem;
  transition: all 0.2s;
}
.player-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.3);
}
.player-card.disconnected { opacity: 0.4; }
.player-card .player-name {
  font-weight: 600; font-size: 0.8rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.player-card .player-stats {
  font-size: 0.65rem; color: var(--text-muted);
  margin-top: 0.15rem; line-height: 1.3;
}
.player-card .player-stats .cash { color: var(--success); font-weight: 600; }
.player-card .player-stats .loans { color: var(--danger); font-weight: 600; }
.player-card .player-stats .bills-pending { color: var(--warning); font-weight: 600; }
.player-card .player-stats .savings-val { color: var(--savings); font-weight: 600; }

/* === INVENTORY PANEL (droite) === */
.inventory-panel {
  grid-area: inventory;
  background: rgba(0,0,0,0.2);
  border-left: 2px solid var(--border);
  padding: 0.6rem;
  overflow-y: auto;
}
.inventory-panel h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.inventory-section { margin-bottom: 0.6rem; }
.inventory-section-title {
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.25rem; padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.3rem;
}
.inventory-section-title .section-count {
  background: rgba(255,255,255,0.15);
  font-size: 0.6rem; padding: 1px 5px; border-radius: 8px;
}

.inventory-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.2rem;
  font-size: 0.65rem;
}
.inventory-card .inv-title { font-weight: 600; font-size: 0.7rem; }
.inventory-card .inv-amount { font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; }

.inventory-card.inv-bill { border-color: rgba(231,76,60,0.4); }
.inventory-card.inv-bill .inv-amount { color: var(--danger); }
.inventory-card.inv-bill .inv-due { font-size: 0.55rem; color: var(--warning); font-style: italic; }

.inventory-card.inv-deal { border-color: rgba(46,204,113,0.4); }
.inventory-card.inv-deal .inv-values {
  display: flex; justify-content: space-between; margin-top: 1px; font-size: 0.6rem;
}
.inventory-card.inv-deal .inv-cost { color: var(--text-muted); }
.inventory-card.inv-deal .inv-value { color: var(--success); font-weight: 600; }

.inventory-card.clickable { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.inventory-card.clickable:hover { border-color: var(--primary); transform: translateX(2px); }

.inventory-empty {
  font-size: 0.65rem; color: var(--text-muted); font-style: italic; padding: 0.2rem 0;
}

/* Savings section */
.inventory-card.inv-savings {
  border-color: rgba(26,188,156,0.4);
  background: rgba(26,188,156,0.1);
}
.inventory-card.inv-savings .inv-amount { color: var(--savings); }

/* === ACTION PANEL === */
.action-panel {
  grid-area: actions;
  background: rgba(0,0,0,0.3);
  border-top: 2px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.dice-display { text-align: center; }
.dice-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.dice-value.rolling {
  animation: dice-spin 0.3s ease infinite;
}

@keyframes dice-spin {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(90deg) scale(1.1); }
  50%  { transform: rotate(180deg) scale(1); }
  75%  { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.dice-value.reveal {
  animation: dice-reveal 0.4s ease;
}

@keyframes dice-reveal {
  0%   { transform: scale(1.3); }
  50%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Pawn highlight during animation */
.board-space.pawn-here {
  box-shadow: 0 0 12px 3px var(--primary) !important;
  z-index: 5;
}

/* Envelope overlay */
.envelope-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.envelope-icon {
  font-size: 5rem;
  animation: envelope-bounce 0.8s ease infinite alternate;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}
@keyframes envelope-bounce {
  from { transform: translateY(0) rotate(-3deg); }
  to   { transform: translateY(-8px) rotate(3deg); }
}
.envelope-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.action-buttons {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}

.waiting-message {
  color: var(--text-muted); font-style: italic; font-size: 0.9rem;
}

/* === CARD OVERLAY === */
.card-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.card-overlay.visible { display: flex; animation: overlay-in 0.25s ease; }
.card-overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.card-overlay-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; padding: 1rem;
}

.overlay-card {
  background: linear-gradient(145deg, #1a5c5c, #0e4a4a);
  border: 3px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: card-pop 0.3s ease;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.overlay-card-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.overlay-card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  margin-bottom: 0.5rem; text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.overlay-card-desc {
  font-size: 1rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.4;
}
.overlay-card-amount {
  font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; margin-bottom: 0.5rem;
}
.overlay-card-amount.positive { color: var(--success); }
.overlay-card-amount.negative { color: var(--danger); }
.overlay-card-amount.pending { color: var(--warning); }
.overlay-card-extra { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.overlay-card-remaining { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; }
.overlay-card-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* Card type borders */
.overlay-card.card-deal    { border-color: var(--success); }
.overlay-card.card-bill    { border-color: var(--danger); }
.overlay-card.card-gain    { border-color: var(--success); }
.overlay-card.card-special { border-color: var(--warning); }
.overlay-card.card-payday  { border-color: var(--gold); }
.overlay-card.card-repos   { border-color: var(--success); }

.overlay-deal-values {
  display: flex; justify-content: center; gap: 2rem; margin: 0.75rem 0; font-size: 1rem;
}
.overlay-deal-values .deal-label {
  font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.overlay-deal-values .deal-cost-val { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--danger); }
.overlay-deal-values .deal-value-val { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--success); }

/* === END SCREEN === */
.end-container {
  margin: auto; text-align: center; padding: 2rem; max-width: 500px; width: 100%;
}
.end-container h2 {
  font-family: var(--font-display); font-size: 2.5rem; margin-bottom: 2rem;
  color: var(--gold); text-shadow: 2px 3px 0 rgba(0,0,0,0.3);
}

.ranking-item {
  display: flex; align-items: center; gap: 1rem; padding: 1rem;
  background: rgba(0,0,0,0.2); border: 2px solid var(--border);
  border-radius: var(--radius); margin-bottom: 0.5rem;
}
.ranking-item .rank { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; width: 40px; }
.ranking-item:nth-child(1) .rank { color: var(--gold); }
.ranking-item:nth-child(2) .rank { color: var(--silver); }
.ranking-item:nth-child(3) .rank { color: var(--bronze); }
.ranking-item .rank-name { flex: 1; text-align: left; font-weight: 600; }
.ranking-item .rank-cash { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.ranking-item .rank-cash.positive { color: var(--success); }
.ranking-item .rank-cash.negative { color: var(--danger); }

/* === TOAST === */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0,0,0,0.7);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem; opacity: 0;
  transition: all 0.3s ease;
  z-index: 300; pointer-events: none; max-width: 90%;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas: "header" "players" "board" "actions" "inventory";
    min-height: 100dvh;
  }

  /* Header compact */
  .game-header {
    padding: 0.4rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.85rem;
  }
  .month-display, .turn-display, .game-code { font-size: 0.8rem; }
  #btn-leave-game { padding: 0.3rem 0.6rem; font-size: 0.65rem; }

  /* Joueurs: barre horizontale une seule ligne */
  .players-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
    padding: 0.35rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .players-panel h3 { display: none; }
  .player-card {
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 0;
    padding: 0.3rem 0.4rem;
    text-align: center;
  }
  .player-card .player-name {
    font-size: 0.65rem;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .player-card .player-stats {
    font-size: 0.6rem;
    line-height: 1.2;
  }

  /* Plateau: occupe toute la largeur, pas de scroll horizontal */
  .board-wrapper {
    padding: 0.4rem;
    overflow: hidden;
  }
  .board {
    gap: 2px;
    max-width: 100%;
    width: 100%;
    aspect-ratio: 7/5;
  }
  .board-space {
    min-height: 0;
    padding: 2px;
    font-size: 0.5rem;
    border-width: 1.5px;
    border-radius: 4px;
  }
  .board-space .space-icon { font-size: 0.85rem; }
  .board-space .day-number { font-size: 0.7rem; }
  .board-space .day-name { font-size: 0.4rem; top: 1px; left: 2px; }
  .board-space .space-type { font-size: 0.35rem; letter-spacing: 0; }
  .board-space .mail-count { font-size: 0.45rem; width: 12px; height: 12px; top: 0; right: 1px; }
  .pawn { font-size: 0.9rem; }
  .board-space .pawns { bottom: 0; left: 0; right: 0; }

  /* Caisse centre */
  .caisse-icon { font-size: 1rem; }
  .caisse-label { font-size: 0.4rem; }
  .caisse-value { font-size: 0.7rem; }
  .caisse-dice-hint { font-size: 0.45rem; padding: 1px 3px; }

  /* Actions: barre fixe en bas, bien accessible */
  .action-panel {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    gap: 0.4rem;
    min-height: auto;
    border-top: 2px solid var(--border);
  }
  .action-buttons {
    justify-content: center;
    gap: 0.35rem;
  }
  .action-buttons .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  .action-buttons .btn-large {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
  }
  .dice-value {
    width: 40px; height: 40px; font-size: 1.5rem;
  }
  .waiting-message { font-size: 0.8rem; text-align: center; width: 100%; }

  /* Inventaire: panneau horizontal scrollable en bas */
  .inventory-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .inventory-panel h3 { display: none; }
  .inventory-section { min-width: 140px; flex-shrink: 0; }

  /* Home */
  .logo h1 { font-size: 2.2rem; }
}

/* Extra small screens (< 400px) */
@media (max-width: 400px) {
  .board-space .space-type { display: none; }
  .board-space .day-name { display: none; }
  .board-space .space-icon { font-size: 0.7rem; }
  .board-space .day-number { font-size: 0.6rem; }
  .pawn { font-size: 0.75rem; }
  .player-card { padding: 0.2rem 0.3rem; }
  .player-card .player-name { font-size: 0.55rem; }
  .player-card .player-stats { font-size: 0.5rem; }
  .action-buttons .btn { padding: 0.4rem 0.6rem; font-size: 0.7rem; }
}
