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

body {
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  overflow-x: hidden;
  max-width: 375px;
  height: 100vh;
}

.game-container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.title {
  text-align: center;
  color: #4a5568;
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 12px;
  color: white;
  font-size: 0.9rem;
}

.player-info {
  text-align: center;
  flex: 1;
}

.player-name {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 3px;
}

.player-position {
  font-size: 0.85rem;
  opacity: 0.9;
}

.dice-section {
  text-align: center;
  margin-bottom: 20px;
}

.dice {
  width: 70px;
  height: 70px;
  background: white;
  border: 3px solid #4a5568;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin: 0 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  touch-action: manipulation;
}

.dice:hover {
  transform: scale(1.05);
}

.roll-button {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin: 15px 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  touch-action: manipulation;
  min-height: 44px;
}

.roll-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.roll-button:active {
  transform: scale(0.95);
}

.roll-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  max-width: 100%;
  margin: 0 auto;
  padding: 15px;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  border-radius: 12px;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.1);
}

.square {
  aspect-ratio: 1;
  border: 2px solid #8b5a3c;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.65rem;
  position: relative;
  background: white;
  transition: all 0.3s ease;
  min-height: 70px;
  text-align: center;
  padding: 3px;
  line-height: 1.1;
}

.square:hover {
  transform: scale(1.02);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.square-number {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 0.6rem;
  color: #666;
  font-weight: bold;
}

.square-content {
  margin-top: 12px;
  font-size: 0.75rem;
  line-height: 1.1;
}

.start {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}
.goal {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.good {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
.bad {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.player {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  right: 3px;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.player1 {
  background: #ff6b6b;
}
.player2 {
  background: #4ecdc4;
}

.message {
  text-align: center;
  margin: 15px 0;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1.3;
}

.message.info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
.message.success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  color: white;
}
.message.warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.reset-button {
  background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 15px 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  touch-action: manipulation;
  min-height: 44px;
}

.reset-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.reset-button:active {
  transform: scale(0.95);
}

@media (max-width: 480px) {
  .game-container {
    padding: 10px;
  }
  .title {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  .game-info {
    padding: 12px;
    font-size: 0.8rem;
  }
  .dice {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  .square {
    min-height: 60px;
    font-size: 0.6rem;
  }
  .square-content {
    font-size: 0.75rem;
  }
  .roll-button,
  .reset-button {
    padding: 10px 18px;
    font-size: 0.85rem;
  }
  .message {
    font-size: 0.8rem;
    padding: 10px;
  }
}

@media (max-width: 320px) {
  .square {
    min-height: 50px;
  }
  .square-content {
    font-size: 0.45rem;
  }
  .dice {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}
