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

body {
  font-family: 'Raleway', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: #1a0533;
  overflow: hidden;
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 55%;
  background: linear-gradient(180deg, #0d0221 0%, #2d0b5a 50%, #ff6ec7 100%);
  z-index: -3;
  pointer-events: none;
}

body::before {
  content: '';
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; height: 50%;
  background: linear-gradient(0deg, #0d0221 0%, #2d0b5a 50%, #ff6ec7 100%);
  opacity: 0.6;
  z-index: -1;
  pointer-events: none;
}


#stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 50%;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 8%,  rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 20%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 6%,  rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 18%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 22%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 35%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 30%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 30% 15%, rgba(185,103,255,0.9) 0%, transparent 100%),
    radial-gradient(2px 2px at 72% 28%, rgba(1,205,254,0.8)   0%, transparent 100%),
    radial-gradient(2px 2px at 88% 5%,  rgba(255,113,206,0.7) 0%, transparent 100%);
  animation: twinkle 4s ease-in-out infinite alternate;
  z-index: -2;
  pointer-events: none;
}

@keyframes twinkle {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

#sun {
  position: fixed;
  width: 220px;
  height: 110px;
  left: 50%;
  bottom: 50%;
  transform: translateX(-50%) translateY(80px);
  border-radius: 110px 110px 0 0;
  background: repeating-linear-gradient(
    to bottom,
    #ff6ec7 0px, #ff6ec7 10px,
    #ff9f55 10px, #ff9f55 20px
  );
  z-index: -1;
  animation: sunRise 3s ease-out forwards;
  pointer-events: none;
}

@keyframes sunRise {
  0%   { transform: translateX(-50%) translateY(120px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0px);   opacity: 1; }
}


.diamond {
  position: fixed;
  width: 18px; height: 18px;
  background: rgba(255, 113, 206, 0.3);
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 0;
}

.d1 { top: 15%; left: 8%;  background: rgba(185,103,255,0.35); animation: floatDiamond 9s  ease-in-out infinite alternate; }
.d2 { top: 25%; right: 10%; background: rgba(1,205,254,0.3);   animation: floatDiamond 12s ease-in-out infinite alternate-reverse; }
.d3 { top: 10%; right: 25%; background: rgba(255,113,206,0.3); animation: floatDiamond 7s  ease-in-out infinite alternate; width: 12px; height: 12px; }

@keyframes floatDiamond {
  0%   { transform: rotate(45deg) translateY(0); }
  100% { transform: rotate(45deg) translateY(30px); }
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 30px;
  text-align: center;
  background: linear-gradient(90deg, #ff71ce, #01cdfe, #b967ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(255, 113, 206, 0.6));
  position: relative;
  z-index: 1;
}

#round-selector, #game-area, #game-over {
  background: rgba(30, 5, 60, 0.8);
  border: 1px solid rgba(255, 113, 206, 0.4);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 0 30px rgba(255, 113, 206, 0.15);
  position: relative;
  z-index: 1;
}

#round-selector p {
  font-size: 1rem;
  color: #01cdfe;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

#round-btns { display: flex; justify-content: center; gap: 12px; }

#round-btns button {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid #b967ff;
  background: transparent;
  color: #b967ff;
  font-size: 1.1rem;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#round-btns button:hover {
  background: #b967ff;
  color: #fff;
  box-shadow: 0 0 16px rgba(185,103,255,0.6);
  transform: translateY(-2px);
}

#round-info {
  font-size: 0.85rem;
  color: #01cdfe;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

#choices { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; }

#choices button {
  padding: 14px 18px;
  font-size: 0.95rem;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  border: 2px solid #ff71ce;
  border-radius: 12px;
  background: transparent;
  color: #ff71ce;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

#choices button:hover {
  background: #ff71ce;
  color: #1a0533;
  box-shadow: 0 0 20px rgba(255,113,206,0.6);
  transform: translateY(-3px);
  animation: btnGlitch 0.3s steps(2) infinite;
}

#choices button:active { transform: translateY(1px); box-shadow: none; animation: none; }

@keyframes btnGlitch {
  0%   { text-shadow: 2px 0 #01cdfe, -2px 0 #b967ff; }
  50%  { text-shadow: -2px 0 #01cdfe, 2px 0 #b967ff; transform: translateY(-3px) translateX(-1px); }
  100% { text-shadow: 2px 0 #b967ff, -2px 0 #01cdfe; transform: translateY(-3px) translateX(1px); }
}

#match-result {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: 2px; min-height: 2rem;
  margin-bottom: 8px; text-transform: uppercase;
}

#match-detail {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.5);
  min-height: 1.5rem;
  margin-bottom: 24px;
}

#match-result.win  { color: #00ffb3; text-shadow: 0 0 12px rgba(0,255,179,0.6); }
#match-result.tie  { color: #fffb96; text-shadow: 0 0 12px rgba(255,251,150,0.6); }
#match-result.lose { color: #ff71ce; text-shadow: 0 0 12px rgba(255,113,206,0.6); }

#scoreboard {
  display: flex; justify-content: center; gap: 30px;
  font-size: 0.9rem; color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,113,206,0.2);
  padding-top: 20px; letter-spacing: 1px; text-transform: uppercase;
}

#scoreboard span { font-weight: 800; color: #01cdfe; font-size: 1.1rem; text-shadow: 0 0 8px rgba(1,205,254,0.5); }

#game-result { font-size: 1.4rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }

#game-result.win  { color: #00ffb3; text-shadow: 0 0 12px rgba(0,255,179,0.6); }
#game-result.tie  { color: #fffb96; text-shadow: 0 0 12px rgba(255,251,150,0.6); }
#game-result.lose { color: #ff71ce; text-shadow: 0 0 12px rgba(255,113,206,0.6); }

#play-again-btn {
  padding: 12px 32px; font-size: 0.95rem;
  font-family: 'Raleway', sans-serif; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  border: 2px solid #b967ff; border-radius: 12px;
  background: transparent; color: #b967ff;
  cursor: pointer; transition: all 0.2s ease;
}

#play-again-btn:hover { background: #b967ff; color: #fff; box-shadow: 0 0 20px rgba(185,103,255,0.6); }

#history {
  background: rgba(30, 5, 60, 0.8);
  border: 1px solid rgba(1,205,254,0.3);
  border-radius: 14px; padding: 20px;
  width: 100%; max-width: 420px;
  max-height: 200px; overflow-y: auto;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(1,205,254,0.1);
  position: relative; z-index: 1;
}

#history-header {
  display: flex; justify-content: space-between; align-items: center;
  color: #01cdfe; font-weight: 700; font-size: 0.85rem;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px;
}

#clear-history-btn {
  padding: 4px 12px; font-size: 0.7rem;
  font-family: 'Raleway', sans-serif; font-weight: 700;
  letter-spacing: 1px; border: 1px solid rgba(1,205,254,0.4);
  border-radius: 6px; background: transparent;
  color: #01cdfe; cursor: pointer; transition: all 0.15s ease;
}

#clear-history-btn:hover { background: #01cdfe; color: #1a0533; }

#history-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

#history-list li {
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
  padding: 6px 10px; background: rgba(255,113,206,0.07);
  border-radius: 6px; border-left: 2px solid #b967ff;
}

#empty-history { text-align: center; font-style: italic; background: transparent !important; border: none !important; }

#keyboard-hint { font-size: 0.6rem; color: rgba(255,255,255,0.25); letter-spacing: 2px; text-transform: uppercase; position: relative; z-index: 1; }

.hidden { display: none; }
