body {
    font-family: 'Inter', sans-serif, 'Noto Sans JP';
    background-color: #1a202c;
}

#game-table {
    background-color: #059669; /* 濃い緑のテーブル */
    border: 16px solid #78350f; /* 木目調の枠 */
    box-shadow: 0 0 20px rgba(0,0,0,0.5) inset;
}

/* 牌の基本スタイル */
.tile {
    width: 50px;
    height: 75px;
    border: 1px solid #4A5568;
    border-radius: 4px;
    background-color: #F7FAFC;
    color: #2D3748;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    overflow: hidden;
}
.tile:hover {
    transform: translateY(-8px);
    box-shadow: 4px 10px 12px rgba(0,0,0,0.4);
}

.tile-back {
    background-color: #15803d; /* 深い緑色 */
    cursor: default;
}
.tile-back:hover {
    transform: none;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 捨て牌 */
.river-tile {
    width: 36px;
    height: 54px;
    cursor: default;
}
.river-tile:hover {
    transform: none;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.river-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 248px;
    padding: 4px;
    border-radius: 6px;
}
.river-grid-v {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-auto-flow: column;
    gap: 4px;
    height: 360px;
    padding: 4px;
    border-radius: 6px;
}

/* ドラ表示牌 */
.tile-small {
    width: 32px;
    height: 48px;
}

/* 横向きの牌 */
.side-tile {
    width: 75px !important;
    height: 50px !important;
}

/* 牌のデザイン */
.tile.red .number, .tile.red .kanji { color: #C53030; }

/* 萬子 (Manzu) */
.tile-face .kanji { font-size: 24px; }
.tile-face .number { font-size: 14px; position: absolute; top: 2px; right: 4px; }
.tile.z .kanji { font-size: 32px; color: #1a202c; }
.tile.z.red .kanji { color: #C53030; }
.tile.z[data-char="白"] .kanji {
    border: 3px solid #a0aec0;
    width: 80%;
    height: 90%;
    color: transparent;
}

/* 筒子 (Pinzu) */
.p .tile-face { display: grid; width: 100%; height: 100%; padding: 4px; }
.p .pin { width: 10px; height: 10px; border-radius: 50%; background-color: #2C5282;}
.p.red .pin { background-color: #C53030; }
.p[data-num="1"] .tile-face { justify-items: center; align-items: center; }
.p[data-num="2"] .tile-face { grid-template-rows: 1fr 1fr; justify-items: center; align-items: center;}
.p[data-num="3"] .tile-face { grid-template-rows: 1fr 1fr 1fr; justify-items: center; align-items: center; }
.p[data-num="4"] .tile-face { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; justify-items: center; align-items: center; }
.p[data-num="5"] .tile-face { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; justify-items: center; align-items: center; }
.p[data-num="5"] .pin:nth-child(3) { grid-column: 1 / 3; }
.p[data-num="6"] .tile-face { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; justify-items: center; align-items: center; }
.p[data-num="7"] .tile-face { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; justify-items: center; align-items: center; }
.p[data-num="7"] .pin:nth-child(1) { grid-column: 1 / 4; }
.p[data-num="8"] .tile-face { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); justify-items: center; align-items: center; }
.p[data-num="9"] .tile-face { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; justify-items: center; align-items: center; }

/* 索子 (Souzu) */
.s .tile-face { display: flex; flex-direction: column; justify-content: space-around; align-items: center; width: 100%; height: 100%; padding: 6px 12px; }
.s .sou { width: 8px; height: 100%; background-color: #2F855A; border-radius: 4px; border: 1px solid #2D3748;}
.s.red .sou { background-color: #C53030; }
.s .sou-group { display: flex; justify-content: center; gap: 4px; width: 100%; height: 100%; }
.s[data-num="1"] .sou { background-color: transparent; border: 3px solid #2F855A; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,5 Q60,20 70,15 Q80,10 90,25 L95,50 Q90,75 80,90 Q70,95 50,95 Q30,95 20,90 Q10,75 5,50 L10,25 Q20,10 30,15 Q40,20 50,5 Z' fill='%232F855A'/%3E%3C/svg%3E"); background-size: contain; background-repeat: no-repeat; background-position: center;}
.s[data-num="5"] .sou-group:nth-child(2) .sou { background-color: #C53030; }
.s[data-num="7"] .sou-group:nth-child(1) .sou { background-color: #C53030; }
