/* ============================================
   GAME PAGE LAYOUT
   ============================================ */
.game-page {
    padding: 24px 32px;
}

.game-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar-box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.sidebar-box:hover {
    box-shadow: var(--shadow-md);
}

.sidebar-box strong {
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

#playersList > div.player-item {
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

#playersList > div.player-item:last-child {
    border-bottom: none;
}

#playersList > div.player-item.active {
    color: var(--accent-cyan) !important;
    font-weight: 700;
}

.facilitator-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.facilitator-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Game controls toolbar */
.game-toolbar {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.game-toolbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Timer */
.timer-container {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 14px 20px;
    border-radius: var(--radius-md);
}

.timer-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.timer-display .small {
    color: var(--text-muted);
    font-size: 12px;
}

#remainingTime {
    color: var(--text-light);
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Dice */
.dice-container {
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.dice-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    border-radius: var(--radius-md);
}

.dice-image:hover {
    transform: scale(1.05);
}

.dice-image.rolling {
    animation: diceRoll3D 0.1s infinite;
}

@keyframes diceRoll3D {
    0% { transform: rotateZ(0deg) scale(1); }
    25% { transform: rotateZ(90deg) scale(1.1); }
    50% { transform: rotateZ(180deg) scale(1); }
    75% { transform: rotateZ(270deg) scale(1.1); }
    100% { transform: rotateZ(360deg) scale(1); }
}

/* Settings: Roll Die image management */
.dice-face-manage {
    background: rgba(15, 23, 42, 0.45);
}

.dice-face-preview-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 6px;
}

.dice-face-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.dice-face-delete-btn {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.95;
    transition: background 0.2s, transform 0.2s;
}

.dice-face-delete-btn:hover {
    background: rgba(185, 28, 28, 1);
    transform: scale(1.05);
}

.dice-face-edit-btn {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.95;
    transition: background 0.2s, transform 0.2s;
}

.dice-face-edit-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.dice-face-manage .dice-face-file {
    font-size: 11px;
    padding: 4px;
}

/* Game cards area */
#gameCardsContainer {
    margin-top: 32px;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 32px 16px;
    justify-content: center;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    min-height: 380px;
    align-items: center;
}

#gameCardsContainer .game-card {
    margin-left: 4px;
    margin-right: 4px;
    margin-bottom: 24px;
}

.game-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.trophy {
    width: 70px;
    height: 70px;
    margin: auto;
    filter: drop-shadow(0 5px 15px rgba(251, 191, 36, 0.4));
    transition: var(--transition);
}

.trophy:hover {
    transform: scale(1.1) rotate(5deg);
}

@media (max-width: 768px) {
    .game-page { padding: 16px; }
    .game-toolbar { flex-direction: column; align-items: stretch; }
    .game-toolbar-section { justify-content: center; }
}
