* {
    box-sizing: border-box;
}

h1, body {
    margin: 0;
    text-align: center;
}

body {
    padding: 2em 0 0 0;
    font-family: Georgia, 'Times New Roman', Times, serif;
    background: linear-gradient(45deg, #d299c2, #fef9d7);;
    min-height: 100vh;
}

.action-btn {
    margin: 30px 0 0 0;
    width: 200px;
    height: 35px;
    text-transform: uppercase;
    font-size: 16px;
    border-radius: 5px;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 50px auto 0;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.dice {
  width: 180px;
  height: 180px;
  transition: transform 0.6s ease-in-out;
}

/*  Красный кубик — постоянное мерцание */
.dice-red {
  fill: #E98B8B;
  animation: blinkRed 4s ease-in-out infinite;
}

/* Синий кубик — постоянное мерцание */
.dice-blue {
  fill: #449fcc;
  animation: blinkBlue 4s ease-in-out infinite;
}

/*  Анимация вращения при броске */
.dice-red.active {
  animation: spinRight 0.6s ease-in-out, blinkRed 2s ease-in-out infinite;
}
.dice-blue.active {
  animation: spinLeft 0.6s ease-in-out, blinkBlue 2s ease-in-out infinite;
}

/* Вращение */
@keyframes spinRight {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spinLeft {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Мерцание */
@keyframes blinkRed {
  0%, 100% { fill: #E98B8B; }
  50% { fill: #ffb3b3; }
}
@keyframes blinkBlue {
  0%, 100% { fill: #449fcc; }
  50% { fill: #7bd3ff; }
}
