/* Shanghai Specific Styles */
.game-surface {
    flex: 0 0 auto; /* Prevent stretching */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    min-height: 0;
    width: 100%;
    position: relative;
}

.board {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Keep square for better mobile fit */
    max-width: 500px;
    max-height: 55vh; /* Standard compact height */
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin: 0 auto;
}

.effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.tile {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    box-shadow: 
        0 2px 0 #9ca3af,
        2px 4px 6px rgba(0,0,0,0.15);
    transition: transform 0.1s;
    cursor: pointer;
}

[data-theme='dark'] .tile {
    background: #334155;
    border-color: #1e293b;
    box-shadow: 
        0 2px 0 #0f172a,
        2px 4px 6px rgba(0,0,0,0.4);
    color: #fff;
}

.tile-face {
    user-select: none;
    line-height: 1;
}

.tile.selected {
    border-color: var(--game-accent);
    box-shadow: 0 0 0 2px var(--game-accent), 4px 10px 15px rgba(0,0,0,0.2);
}

.tile.blocked {
    filter: brightness(0.8) grayscale(0.2);
    cursor: not-allowed;
}

.tile.hint { animation: pulse-hint 1s infinite; }

@keyframes pulse-hint {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

.tile-burst {
    position: absolute; width: 40px; height: 40px; pointer-events: none;
    display: grid; place-items: center; animation: explode 0.5s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.toast {
    position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9); color: #fff; padding: 10px 18px;
    border-radius: 999px; opacity: 0; pointer-events: none;
    transition: opacity 0.2s; z-index: 3000;
}
.toast.show { opacity: 1; }

.record-list p {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.record-list p:last-child {
    border-bottom: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title.small {
    font-size: 14px;
    margin-bottom: 8px;
}
