    body {
      margin: 0;
      min-height: 100vh;
      background: radial-gradient(circle at 50% 0%, #2f3e46, #151b1f 70%);
      color: #f1f5f4;
      font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
    }

    div {
      margin: 10px;
    }

    #main {
      width: 100%;
      box-sizing: border-box;
      padding: 24px 0 40px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    /* ---------- 標題 ---------- */
    .biaoti {
      margin: 0;
      font-size: 32px;
      letter-spacing: 8px;
      text-shadow: 0 2px 10px rgba(255, 154, 68, 0.5);
    }

    .fubiaoti {
      margin: 4px 0 8px;
      font-size: 14px;
      color: #9fb0ad;
      letter-spacing: 2px;
    }

    /* ---------- 骰子區塊（賭桌絨布 + 木框） ---------- */
    #tshai {
      background: radial-gradient(ellipse at center, #1f8a5b 0%, #0f5a3b 100%);
      border: 8px solid #6b4423;
      border-radius: 28px;
      box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 12px 30px rgba(0, 0, 0, 0.5);
      width: 90%;
      max-width: 720px;
      height: 260px;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
    }

    .point_box {
      perspective: 800px;
      position: relative;
    }

    /* 骰子底下的地面陰影 */
    .point_box::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -26px;
      width: 60px;
      height: 12px;
      transform: translateX(-50%);
      background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45), transparent 70%);
    }

    .dice {
      width: 70px;
      height: 70px;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 1.2s cubic-bezier(0.3, 1.4, 0.4, 1);
    }

    /* 骰子的六個面 */
    .face {
      margin: 0;
      position: absolute;
      width: 70px;
      height: 70px;
      background: linear-gradient(145deg, #ffffff, #e6e6e6);
      border: 2px solid #333;
      border-radius: 10px;
      box-sizing: border-box;
      display: grid;
      grid-template: repeat(3, 1fr) / repeat(3, 1fr);
      padding: 8px;
      box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
    }

    .pip {
      margin: 0;
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 30%, #555, #111);
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
      align-self: center;
      justify-self: center;
    }

    /* 一點用紅色大點（傳統骰子樣式） */
    .face[data-p="1"] .pip {
      width: 18px;
      height: 18px;
      background: radial-gradient(circle at 35% 30%, #ff6b6b, #c0141c);
    }

    /* 用 grid 擺放點數 */
    .face[data-p="1"] .pip {
      grid-area: 2 / 2;
    }

    .face[data-p="2"] .pip:nth-child(1) {
      grid-area: 1 / 1;
    }

    .face[data-p="2"] .pip:nth-child(2) {
      grid-area: 3 / 3;
    }

    .face[data-p="3"] .pip:nth-child(1) {
      grid-area: 1 / 1;
    }

    .face[data-p="3"] .pip:nth-child(2) {
      grid-area: 2 / 2;
    }

    .face[data-p="3"] .pip:nth-child(3) {
      grid-area: 3 / 3;
    }

    .face[data-p="4"] .pip:nth-child(1) {
      grid-area: 1 / 1;
    }

    .face[data-p="4"] .pip:nth-child(2) {
      grid-area: 1 / 3;
    }

    .face[data-p="4"] .pip:nth-child(3) {
      grid-area: 3 / 1;
    }

    .face[data-p="4"] .pip:nth-child(4) {
      grid-area: 3 / 3;
    }

    .face[data-p="5"] .pip:nth-child(1) {
      grid-area: 1 / 1;
    }

    .face[data-p="5"] .pip:nth-child(2) {
      grid-area: 1 / 3;
    }

    .face[data-p="5"] .pip:nth-child(3) {
      grid-area: 2 / 2;
    }

    .face[data-p="5"] .pip:nth-child(4) {
      grid-area: 3 / 1;
    }

    .face[data-p="5"] .pip:nth-child(5) {
      grid-area: 3 / 3;
    }

    .face[data-p="6"] .pip:nth-child(1) {
      grid-area: 1 / 1;
    }

    .face[data-p="6"] .pip:nth-child(2) {
      grid-area: 1 / 3;
    }

    .face[data-p="6"] .pip:nth-child(3) {
      grid-area: 2 / 1;
    }

    .face[data-p="6"] .pip:nth-child(4) {
      grid-area: 2 / 3;
    }

    .face[data-p="6"] .pip:nth-child(5) {
      grid-area: 3 / 1;
    }

    .face[data-p="6"] .pip:nth-child(6) {
      grid-area: 3 / 3;
    }

    /* 各面在立方體上的位置(1=正面, 2=右, 3=背面, 4=左, 5=上, 6=下) */
    .face[data-p="1"] {
      transform: rotateY(0deg) translateZ(35px);
    }

    .face[data-p="2"] {
      transform: rotateY(90deg) translateZ(35px);
    }

    .face[data-p="3"] {
      transform: rotateY(180deg) translateZ(35px);
    }

    .face[data-p="4"] {
      transform: rotateY(-90deg) translateZ(35px);
    }

    .face[data-p="5"] {
      transform: rotateX(90deg) translateZ(35px);
    }

    .face[data-p="6"] {
      transform: rotateX(-90deg) translateZ(35px);
    }

    /* 骰動中持續旋轉的動畫 */
    .dice.rolling {
      animation: tumble 0.3s linear infinite;
    }

    @keyframes tumble {
      from {
        transform: rotateX(0deg) rotateY(0deg);
      }

      to {
        transform: rotateX(360deg) rotateY(360deg);
      }
    }

    /* ---------- 結果清單 ---------- */
    #showjieguo {
      background-color: #f4f6f6;
      color: #222;
      width: 90%;
      max-width: 360px;
      min-height: 120px;
      box-sizing: border-box;
      padding: 10px;
      border-radius: 16px;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      font-size: 18px;
      font-weight: bold;
      font-variant-numeric: tabular-nums;
    }

    /* 還沒骰的時候顯示提示（純 CSS，不動 JS） */
    #showjieguo:empty {
      justify-content: center;
      align-items: center;
    }

    #showjieguo:empty::before {
      content: "按下「骰骰子」開始，會連骰 15 次";
      font-size: 15px;
      font-weight: normal;
      color: #7a8886;
    }

    #showjieguo p {
      margin: 2px 0;
      padding: 6px 12px;
      border-radius: 8px;
      text-align: center;
    }

    #showjieguo p:nth-child(even) {
      background: #e6eceb;
    }

    /* 最新一筆醒目標示 */
    #showjieguo p:last-child {
      background: #fff1bd;
      box-shadow: inset 4px 0 0 #fc6076;
    }

    #showjieguo p.same {
      color: green;
      background: #dcf5e4;
    }

    #showjieguo p.same::after {
      content: "　★ 三顆相同";
      font-size: 13px;
    }

    /* ---------- 按鈕 ---------- */
    #go {
      margin-top: 18px;
    }

    .goshai {
      position: relative;
      overflow: hidden;
      border: none;
      border-radius: 30px;
      background: linear-gradient(135deg, #ff9a44, #fc6076);
      color: #fff;
      font-size: 18px;
      font-weight: bold;
      letter-spacing: 4px;
      width: 160px;
      height: 52px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(252, 96, 118, 0.45);
      transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    }

    /* 光澤掃過特效 */
    .goshai::after {
      content: "";
      position: absolute;
      top: 0;
      left: -120%;
      width: 60%;
      height: 100%;
      background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.5), transparent);
      transform: skewX(-25deg);
      animation: shine 2.5s infinite;
    }

    @keyframes shine {
      0% {
        left: -120%;
      }

      60% {
        left: 150%;
      }

      100% {
        left: 150%;
      }
    }

    /* 滑入浮起 */
    .goshai:hover {
      transform: translateY(-3px) scale(1.05);
      box-shadow: 0 8px 20px rgba(252, 96, 118, 0.6);
    }

    /* 按下縮小 */
    .goshai:active {
      transform: translateY(1px) scale(0.95);
      box-shadow: 0 2px 6px rgba(252, 96, 118, 0.5);
    }

    /* 鍵盤操作的焦點框 */
    .goshai:focus-visible {
      outline: 3px solid #fff;
      outline-offset: 3px;
    }

    /* 骰動中（按鈕被 disabled）：變灰、不可點、無特效 */
    .goshai:disabled {
      cursor: not-allowed;
      filter: grayscale(0.85) brightness(0.8);
      transform: none;
      box-shadow: none;
    }

    .goshai:disabled::after {
      display: none;
    }

    /* 手機版 */
    @media (max-width: 480px) {
      .biaoti {
        font-size: 26px;
      }

      #tshai {
        height: 220px;
        border-width: 6px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .goshai::after {
        animation: none;
      }
    }