:root{
  --bg-1:#fff8fc;
  --bg-2:#f6f4ff;
  --card:rgba(255,255,255,.92);
  --text:#2f2440;
  --muted:#786d8a;
  --pink:#ff78b2;
  --pink-dark:#e05597;
  --purple:#9f7dff;
  --blue:#79d0ff;
  --shadow:0 18px 46px rgba(86,53,116,.14);
  --shadow-soft:0 10px 24px rgba(86,53,116,.10);
}

*{box-sizing:border-box}

html{direction:rtl}

body{
  margin:0;
  min-height:100vh;
  font-family:Tahoma, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top right, rgba(255,203,227,.55), transparent 28%),
    radial-gradient(circle at bottom left, rgba(215,223,255,.72), transparent 34%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

a{
  color:inherit;
  text-decoration:none;
}

button{
  font-family:inherit;
}

.game-page{
  min-height:100vh;
  padding:20px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.game-shell{
  width:min(100%, 760px);
}

.game-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.back-link,
.brand-badge{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border-radius:999px;
  background:rgba(255,255,255,.85);
  box-shadow:var(--shadow-soft);
  font-weight:700;
}

.back-link{
  color:var(--muted);
}

.brand-badge{
  background:linear-gradient(135deg,var(--pink),var(--purple));
  color:#fff;
}

.game-card{
  background:var(--card);
  box-shadow:var(--shadow);
  border-radius:32px;
  padding:24px;
  text-align:center;
}

.game-kicker{
  margin:0 0 8px;
  color:var(--pink-dark);
  font-size:14px;
  font-weight:800;
}

h1{
  margin:0 0 10px;
  font-size:clamp(32px, 6vw, 56px);
  line-height:1.1;
}

.game-desc{
  margin:0 auto 22px;
  color:var(--muted);
  line-height:1.9;
  font-size:15px;
  max-width:600px;
}

.dice-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:150px;
}

.dice{
  font-size:7rem;
  margin:5px;
  animation-duration:1s;
  animation-fill-mode:forwards;
  color:#5a4c73;
  text-shadow:0 10px 24px rgba(86,53,116,.12);
}

.roll-animation{
  animation-name:roll;
}

@keyframes roll{
  0%{
    transform:rotateY(0deg) rotateX(0deg);
  }
  100%{
    transform:rotateY(720deg) rotateX(720deg);
  }
}

.actions{
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
  margin-bottom:22px;
}

button{
  background:linear-gradient(135deg,var(--pink),var(--purple));
  color:#fff;
  font-size:1.05rem;
  font-weight:800;
  padding:0.95rem 1.4rem;
  border:none;
  border-radius:1rem;
  cursor:pointer;
  transition:transform .2s ease, opacity .2s ease;
  box-shadow:var(--shadow-soft);
}

button:hover{
  transform:translateY(-1px);
}

.ghost-btn{
  background:#fff;
  color:var(--text);
  border:1px solid rgba(120,109,138,.2);
}

.history-card{
  background:rgba(255,255,255,.62);
  border-radius:24px;
  padding:18px;
  text-align:right;
}

.history-card h2{
  margin:0 0 12px;
  font-size:22px;
  text-align:center;
}

ul{
  list-style:none;
  padding:0;
  max-width:600px;
  margin:0 auto;
}

li{
  font-size:1.05rem;
  padding:0.8rem 1rem;
  margin:0.6rem 0;
  background-color:#f7f3ff;
  border-radius:0.8rem;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

li span{
  font-size:2.5rem;
  line-height:1;
}

.empty-state{
  color:var(--muted);
  text-align:center;
  padding:10px 0;
}

@media (max-width: 560px){
  .game-page{
    padding:14px 10px;
    align-items:flex-start;
  }

  .game-card{
    padding:16px;
    border-radius:24px;
  }

  .dice{
    font-size:5.5rem;
  }

  .history-card{
    padding:14px;
    border-radius:18px;
  }

  li{
    font-size:0.95rem;
    padding:0.75rem 0.85rem;
  }

  li span{
    font-size:2rem;
  }

  button{
    width:100%;
  }
}