body {
  background-color: #0e1a2b;
  color: #fff;
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
}

.container {
  margin-top: 80px;
}

h1 {
  color: #3bb0ff;
  font-size: 2.5rem;
}

.coin-container {
  perspective: 1000px;
  margin: 40px auto;
  width: 150px;
  height: 150px;
}

.coin {
  width: 150px;
  height: 150px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 2s;
}

.side {
  width: 150px;
  height: 150px;
  position: absolute;
  border-radius: 50%;
  line-height: 150px;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  backface-visibility: hidden;
  box-shadow: 0 0 20px #3bb0ffaa;
  user-select: none;
}

.red {
  background-color: red;
  transform: rotateY(0deg);
}

.blue {
  background-color: blue;
  transform: rotateY(180deg);
}

button {
  padding: 12px 25px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  background-color: #3bb0ff;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
  user-select: none;
}

button:hover {
  background-color: #2898e0;
}

#result {
  margin-top: 20px;
  font-size: 1.8rem;
  font-weight: bold;
}

.rig-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #222a44dd;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 0 10px #3bb0ffbb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.rig-notification.show {
  opacity: 1;
  pointer-events: auto;
}

.rig-notification.red {
  background-color: #a83232dd;
  box-shadow: 0 0 15px #ff4c4ccc;
}

.rig-notification.blue {
  background-color: #3254a8dd;
  box-shadow: 0 0 15px #4c88ffcc;
}

#closeHistoryBtn, #exportHistoryBtn {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: #3bb0ff;
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s;
}

#closeHistoryBtn:hover, #exportHistoryBtn:hover {
  background-color: #2898e0;
}

/* Password screen styling */
#password-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #0e1a2b;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#password-screen input {
  padding: 12px 20px;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  margin-bottom: 15px;
  background: #1c2f4a;
  color: #fff;
  outline: none;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
}

#password-screen input.error {
  border-color: red;
  animation: shake 0.3s;
}

#password-screen button {
  background-color: #3bb0ff;
  color: white;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* --- Fancy Flip History Modal --- */
.history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 26, 43, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.history-content {
  background: linear-gradient(135deg, #122b45, #0e1a2b);
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
  color: #fff;
  text-align: left;
  position: relative;
}

.history-content h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #4da6ff;
  text-align: center;
}

#historyList {
  max-height: 350px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#historyList li {
  font-size: 2rem;
  user-select: none;
  cursor: default;
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 0 10px #4da6ff88;
  transition: transform 0.3s ease;
}

#historyList li.red {
  color: #ff4c4c;
  text-shadow: 0 0 8px #ff4c4caa;
}

#historyList li.blue {
  color: #4c88ff;
  text-shadow: 0 0 8px #4c88ffaa;
}

#historyList li:hover {
  transform: scale(1.2);
  filter: brightness(1.1);
}

/* Custom Scrollbar */
#historyList::-webkit-scrollbar {
  width: 8px;
}
#historyList::-webkit-scrollbar-thumb {
  background-color: #4da6ff;
  border-radius: 4px;
}
#historyList::-webkit-scrollbar-track {
  background: transparent;
}
