/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Roboto:wght@400;500&display=swap');

:root {
  --primary-color: #4e54c8;
  --secondary-color: #8f94fb;
  --background: #121212;
  --dice-size: 100px;
  --dot-size: 14px;
  --transition-speed: 0.6s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #121212; /* Dark background */
  color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.watermark {
  position: absolute;
  content: "Hansel";
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: 100px;
  font-family: 'Times New Roman', Times, serif;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
  user-select: none;
}

.name {
  font-family: 'Montserrat', sans-serif;
}

/* Main Container */
.container {
  max-width: 600px;
  background: #1e1e1e;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  color: #fff;
}

/* Dice */
.dice-container {
  perspective: 1000px;
  margin: 2rem auto;
  width: var(--dice-size);
  height: var(--dice-size);
  position: relative;
}

.dice {
  width: var(--dice-size);
  height: var(--dice-size);
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--transition-speed) ease-in-out;
}

.side {
  width: var(--dice-size);
  height: var(--dice-size);
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 12px;
  position: absolute;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  display: block;
}

.side .dot {
  position: absolute;
  width: var(--dot-size);
  height: var(--dot-size);
  background: #000;
  border-radius: 50%;
}

/* Dot positions */
.top-left     { top: 20%; left: 20%; }
.top-right    { top: 20%; right: 20%; }
.center       { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.bottom-left  { bottom: 20%; left: 20%; }
.bottom-right { bottom: 20%; right: 20%; }
.center-left  { top: 50%; left: 20%; transform: translateY(-50%); }
.center-right { top: 50%; right: 20%; transform: translateY(-50%); }

/* Dice Face Positions */
.front   { transform: rotateY(0deg) translateZ(50px); }
.back    { transform: rotateY(180deg) translateZ(50px); }
.left    { transform: rotateY(-90deg) translateZ(50px); }
.right   { transform: rotateY(90deg) translateZ(50px); }
.top     { transform: rotateX(90deg) translateZ(50px); }
.bottom  { transform: rotateX(-90deg) translateZ(50px); }

/* Roll Button */
.roll-button {
  background: var(--primary-color);
  color: #fff;
  font-size: 1.1rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.roll-button:hover {
  background: var(--secondary-color);
}

/* Modal */
.custom-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.custom-modal-content {
  background: #2b2b2b;
  color: #fff;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-actions button {
  margin: 1rem 0.5rem 0;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.modal-actions button:hover {
  background: var(--secondary-color);
}

/* ==== Footer ==== */
.footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: orangered;
  background-color: rgba(0, 0, 0, 0.6);
  border-top-left-radius: 10px;
  z-index: 3;
}

.footer a {
  color: orangered;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 1.5rem;
    margin: 1rem;
    max-width: 90%;
  }

  .dice-container {
    width: 80px;
    height: 80px;
  }

  .dice {
    --dice-size: 80px;
  }

  .roll-button {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }

  .watermark {
    font-size: 60px;
  }

  .custom-modal-content {
    padding: 1.5rem;
    font-size: 0.95rem;
  }

  .modal-actions button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
    margin: 1rem;
  }

  .dice-container {
    width: 60px;
    height: 60px;
  }

  .dice {
    --dice-size: 60px;
  }

  .roll-button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .watermark {
    font-size: 40px;
  }

  .footer {
    font-size: 12px;
    padding: 8px 12px;
  }
}
