/* ========== MAHJONG PAGE ========== */

#mahjongMain {
    width: 100%;
    background-color: var(--burgundy);
    padding: 2rem 1rem;
}

#mahjongGame {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,215,0,0.18);
    border-radius: 8px;
}

#mahjongGame h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
}

#mahjongGame h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6rem;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    border-radius: 2px;
}

#mahjongGame > p {
    font-size: 2.2rem;
    color: rgba(255,255,255,0.85);
    max-width: 65ch;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Info bar */
#mahjongInfo {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    font-family: var(--body-fonts);
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 1rem;
}

/* Status message */
#mahjongMsg {
    font-size: 2.4rem;
    font-weight: bold;
    min-height: 2em;
    margin-bottom: 1rem;
    color: var(--white);
}

/* Board */
#mahjongBoardWrap {
    width: 100%;
    overflow-x: auto;
    text-align: center;
    padding-bottom: 1rem;
}

#mahjongBoard {
    position: relative;
    display: inline-block;
    text-align: left;
}

/* Individual tile */
.mj-tile {
    position: absolute;
    width: 48px;
    height: 60px;
    box-sizing: border-box;
    border-radius: 5px;
    background: linear-gradient(145deg, #ffffff, #e8e8e8);
    border: 1px solid #aaaaaa;
    box-shadow: 2px 2px 0 #888888, 3px 3px 4px rgba(0,0,0,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-family: var(--body-fonts);
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    padding: 2px;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.mj-tile:hover:not(.mj-blocked) {
    background: linear-gradient(145deg, #ffffff, #d0e8ff);
    box-shadow: 3px 3px 0 #888888, 4px 4px 6px rgba(0,0,0,0.4);
    transform: translate(-1px, -1px);
}

.mj-tile.mj-selected {
    background: linear-gradient(145deg, #ffe000, #ffb700);
    border: 2px solid #7B113A;
    box-shadow: 0 0 0 3px #7B113A, 2px 2px 6px rgba(0,0,0,0.5);
    transform: translate(-1px, -2px);
}

.mj-tile.mj-blocked {
    background: linear-gradient(145deg, #cccccc, #b0b0b0);
    cursor: not-allowed;
    filter: brightness(0.8);
}

.mj-tile.mj-hint {
    animation: hintPulse 0.6s ease 2;
}

@keyframes hintPulse {
    0%, 100% { background: linear-gradient(145deg, #ffffff, #e8e8e8); }
    50%       { background: linear-gradient(145deg, #b0ffb0, #60d060); border-color: #2a8a40; border-width: 2px; }
}

.mj-tile.mj-removing {
    animation: tileRemove 0.3s ease forwards;
}

@keyframes tileRemove {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.6); }
}

/* Buttons inherit from styles.css, just ensure spacing */
#mahjongGame .game-btns button {
    min-width: 12rem;
}
