  /* ========== GLOBAL RESET & BODY ========== */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
  }

  html, body {
    height: 100%;
    width: 100%;
  }

  body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(to right, #f8f9fa, #e0eafc);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }

  /* ========== CONTAINER ========== */
  .container {
    background: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 850px;
    max-height: 850px;
    width: 100%;
  }

  /* ========== TITLE ========== */
  h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 30px;
  }

  h1 span {
    color: #f7aa11;
  }

  /* ========== PLAYER SECTION ========== */
  .players {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
  }

  .player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 280px;
  }

  .player h2 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: #222;
  }

  /* ========== DICE STYLE ========== */
  .dice {
    font-size: 90px;
    padding: 30px;
    border-radius: 12px;
    background: #f7f7f7;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease;
    width: 130px;
    height: 180px;
    line-height: 130px;
    text-align: center;
  }

  span {
    color: #f7aa11;
  }

  /* Shake animation when rolling */
  .dice.roll {
    animation: shake 0.4s ease;
  }

  @keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(50deg) translateX(5px); }
    50% { transform: rotate(-30deg) translateX(-5px); }
    75% { transform: rotate(25deg) translateX(3px); }
    100% { transform: rotate(0deg) translateX(0); }
  }

  /* ========== BUTTONS (inside player) ========== */
  .player button {
    padding: 14px 2px;
    font-size: 1.1rem;
    background-color: #fcbf49;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 130px;
  }

  .player button:hover {
    background-color: #333;
    color: #fff;
  }

  /* ========== RESULT MESSAGE ========== */
  .message {
    margin-top: 20px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #006400;
    min-height: 1.5em; /* prevent jump */
  }


@media (max-width: 768px) {
  html, body {
    overflow-y: auto;  /* Allow vertical scrolling */
    overflow-x: hidden;
    height: auto;
    width: 100%;
  }

  .container {
    padding: 15px 10px;
    max-width: 100vw;
    width: 100%;
    height: auto;
    box-shadow: none;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: visible; /* Allow content to be visible */
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-align: center;
  }

  .players {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  .player {
    flex: 1 1 45%;
    min-width: 100px;
    max-width: 45vw;
    gap: 6px;
    padding: 6px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .player h2 {
    font-size: 1rem;
    margin-bottom: 6px;
    text-align: center;
  }

  .dice {
    margin-top: 10px;
    font-size: 45px;
    width: 70px;
    height: 95px;
    line-height: 70px;
    padding: 6px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
  }

  .player button {
    margin-top: 10px;
    width: 100%;
    padding: 7px 0;
    font-size: 0.85rem;
    border-radius: 5px;
  }

  .message {
    font-size: 1rem;
    margin-top: 12px;
    min-height: 1.3em;
    padding: 0 8px;
    color: #006400;
    text-align: center;
    word-break: break-word;
  }
}
