:root {
    --primary: #4a90e2;
    --secondary: #f5f7fa;
    --accent: #ff6f61;
    --bg: #e3eaf2;
    --white: #fff;
  }

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background: var(--bg);
    color: #333;
    text-align: center;
}

h1 {
    margin-top: 20px;
    color: var(--primary);
    font-size: 28px;
}
  
/* Добавляем новые стили для старта и финиша */
.cell.start {
	background: #e8f5e9;
	border-color: #66bb6a;
}
    
.cell.start::after {
	content: 'Старт';
	display: block;
	font-size: 10px;
	color: #2e7d32;
	margin-top: 2px;
}

.cell.finish {
	background: #ffebee;
	border-color: #ef5350;
}

.cell.finish::after {
	content: 'Финиш';
	display: block;
	font-size: 10px;
	color: #c62828;
	margin-top: 2px;
}

/* Стартовый экран */
#startScreen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

#startForm {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 320px;
}

#startForm h2 {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 20px;
}

#startForm input {
    padding: 12px;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
}

#startForm button {
    padding: 12px 30px;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

#startForm button:hover {
    background: #357ac9;
}

/* Игровое поле */
#game {
    margin: 30px auto 10px;
    display: grid;
    grid-template-columns: repeat(6, 70px);
    grid-gap: 6px;
    width: max-content;
}

.cell {
    width: 70px;
    height: 70px;
    background: var(--white);
    border: 2px solid #d0d7e4;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #888;
}
.cell small {
	font-size: 14px;
	color: #666;
	display: block;
	margin-top: -5px;
}

.player {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	position: absolute;
	transition: all 0.4s ease;
	border: 2px solid #fff;
	box-shadow: 0 0 6px rgba(0,0,0,0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	color: white;
	font-size: 16px;
}

.player1 { 
	background: var(--accent); 
	top: 6px; 
	left: 6px; 
}
    
.player2 { 
	background: var(--primary); 
	bottom: 6px; 
	right: 6px; 
}

/* Контролы */
#controls {
    margin-top: 20px;
    padding: 15px;
    background: var(--white);
    width: 90%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;          /* Добавляем flex-контейнер */
    flex-direction: column; /* Вертикальное выравнивание */
    align-items: center;    /* Центрирование по горизонтали */
    text-align: center;     /* Центрирование текста */
}

#dice {
    font-size: 60px;
    margin: 10px 40%;
    animation: roll 0.5s ease-in-out;
    width: 80px;           /* Фиксированная ширина */
    height: 80px;          /* Фиксированная высота */
    display: flex;         /* Для центрирования содержимого */
    justify-content: center;
    align-items: center;
}

#controls button {
    padding: 10px 25px;
    font-size: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 10px;
}

#controls button:hover {
    background: #357ac9;
}

/* Модальное окно с заданием */
.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.task-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.task-content h3 {
    color: var(--accent);
    margin-top: 0;
}

.task-content button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 16px;
}

.task-content h4 {
  margin: 10px 0;
  color: var(--primary);
  font-size: 1.2em;
}

.task-content p {
  color: #666;
  line-height: 1.5;
}

@keyframes roll {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}
