﻿:root {
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    --bg: #f2f7f2;
    --panel: #ffffff;
    --accent: #2f855a;
    --text: #1f2933;
    --grid-border: #cfd8d0;
    --player-0: #2e7d32;
    --player-1: #66bb6a;
    --player-2: #a3be8c;
    --player-3: #d9a441;
    --player-4: #4299e1;
    --player-5: #ed8936;
    --player-6: #9f7aea;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

.layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.intro {
    grid-column: 1 / -1;
    text-align: center;
}

.intro h1 {
    margin-bottom: 0.25rem;
}

.panel {
    background: var(--panel);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.setup-form {
    display: grid;
    gap: 1rem;
}

.setup-form label {
    font-weight: 600;
}

.setup-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--grid-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    color: var(--text);
}

.setup-form button,
.controls button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.setup-form button:disabled,
.controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.controls button:not(:disabled):hover,
.setup-form button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px rgba(47, 133, 90, 0.2);
}

.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 15px rgba(47,133,90,.2); }

.board-panel {
    grid-column: 1 / -1;
}

.start-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--grid-border);
    border-radius: 10px;
    background: rgba(47, 133, 90, 0.08);
}

.start-label {
    font-weight: 700;
    color: var(--accent);
}

.board-container {
    position: relative; 
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.board-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.board-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.token-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    max-width: 90%;
}

.token {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    z-index: 10;
    transition: left 0.3s, top 0.3s;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(15, 23, 42, 0.2);
}

.token.player-0 { background: var(--player-0); }
.token.player-1 { background: var(--player-1); }
.token.player-2 { background: var(--player-2); }
.token.player-3 { background: var(--player-3); }
.token.player-4 { background: var(--player-4); }
.token.player-5 { background: var(--player-5); }
.token.player-6 { background: var(--player-6); }

#player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.player-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(47, 133, 90, 0.08);
}

.player-entry.is-turn {
    background: rgba(47, 133, 90, 0.16);
    outline: 2px solid rgba(47, 133, 90, 0.35);
}

.player-name {
    font-weight: 600;
    color: var(--text);
}

.player-position {
    font-variant-numeric: tabular-nums;
    color: #2f3a33;
}

@media (max-width: 720px) {
    .layout {
        padding: 1rem;
    }
    .board {
        gap: 0.35rem;
        grid-template-columns: repeat(7, minmax(2.5rem, 1fr));
    }
}

.dice-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.dice-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.dice {
    width: 3rem;
    aspect-ratio: 1 / 1;
    border-radius: 0.6rem;
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f6 100%);
    border: 2px solid rgba(31, 41, 51, 0.15);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--text);
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.dice.is-rolling {
    animation: dice-roll 0.4s linear infinite;
}

.dice-total {
    font-weight: 600;
    margin: 0;
}

#empty {
    all: unset;
}

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

.cell-label {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: #1f2933;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.cell--special {
    background: linear-gradient(145deg, #fff7e6 0%, #fde68a 100%);
    border-color: #f6ad55;
}

.cell--goose {
    background: linear-gradient(145deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #68d391;
}

.cell--bridge { box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.35); }
.cell--inn { box-shadow: inset 0 0 0 2px rgba(56, 161, 105, 0.4); }
.cell--well { box-shadow: inset 0 0 0 2px rgba(45, 114, 178, 0.4); }
.cell--labyrinth { box-shadow: inset 0 0 0 2px rgba(214, 158, 46, 0.4); }
.cell--prison { box-shadow: inset 0 0 0 2px rgba(154, 52, 18, 0.4); }
.cell--death { box-shadow: inset 0 0 0 2px rgba(197, 48, 48, 0.45); }

@media (max-width: 720px) {
    .dice {
        width: 2.5rem;
        font-size: 1.25rem;
    }
}


/* Pion flottant utilisé pour l'animation */
.token--anim {
  position: fixed;          /* se déplace en coordonnées écran */
  z-index: 50;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.35), 0 2px 6px rgba(15,23,42,.2);
  transition: left .22s ease, top .22s ease;
}

@media (prefers-reduced-motion: reduce) {
  .token--anim { transition: none; }
}