/* ===== WP Ludo Game ===== */
.wpludo-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    color: #1f2937;
}
.wpludo-wrap *,
.wpludo-wrap *::before,
.wpludo-wrap *::after {
    box-sizing: border-box;
}

/* Layout */
.wpludo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: linear-gradient(135deg,#4f46e5,#9333ea);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}
.wpludo-header strong {
    font-size: 16px;
    margin-right: 16px;
}
.wpludo-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wpludo-coin-badge {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.wpludo-coin-icon {
    width: 16px; height: 16px;
    background: radial-gradient(circle at 35% 30%, #fde68a 0%, #f59e0b 60%, #b45309 100%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.wpludo-stat { font-size: 13px; opacity: 0.9; }
.wpludo-actions { display: flex; gap: 8px; }

/* Cards */
.wpludo-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.wpludo-card.compact { padding: 14px; }
.wpludo-card h2 { margin: 0 0 6px; font-size: 22px; }
.wpludo-card h3 { margin: 0 0 10px; font-size: 16px; }
.wpludo-card p { color: #4b5563; margin: 0 0 14px; }

/* Tabs */
.wpludo-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.wpludo-tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
}
.wpludo-tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

/* Forms */
.wpludo-form { display: none; }
.wpludo-form.active { display: block; }
.wpludo-field { margin-bottom: 14px; }
.wpludo-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.wpludo-field input,
.wpludo-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}
.wpludo-field input:focus,
.wpludo-field select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.wpludo-hint { font-size: 12px; color: #6b7280; margin-top: 8px; }

/* Buttons */
.wpludo-btn {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s, background .15s;
    text-decoration: none;
    display: inline-block;
}
.wpludo-btn:hover { background: #e5e7eb; }
.wpludo-btn:active { transform: scale(0.98); }
.wpludo-btn.primary {
    background: linear-gradient(135deg,#4f46e5,#9333ea);
    color: #fff;
    border-color: transparent;
}
.wpludo-btn.primary:hover { filter: brightness(1.05); }
.wpludo-btn.ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}
.wpludo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.wpludo-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    min-height: 20px;
}
.wpludo-msg.error { background: #fee2e2; color: #b91c1c; }
.wpludo-msg.success { background: #d1fae5; color: #065f46; }

/* Lobby grid */
.wpludo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}
@media (max-width: 700px) {
    .wpludo-grid { grid-template-columns: 1fr; }
}
.wpludo-panel {
    border: 1px dashed #d1d5db;
    padding: 18px;
    border-radius: 10px;
    background: #f9fafb;
}

/* Screens */
.wpludo-screen { display: none; }
.wpludo-screen.active { display: block; }

/* Room */
.wpludo-room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.wpludo-invite { background: #f3f4f6; padding: 14px; border-radius: 10px; margin-bottom: 16px; }
.wpludo-invite p { margin: 0 0 8px; font-size: 13px; color: #374151; }
.wpludo-invite-row { display: flex; gap: 8px; }
.wpludo-invite-row input {
    flex: 1; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    background: #fff; font-size: 13px;
}

/* Players list */
.wpludo-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.wpludo-player-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 14px;
}
.wpludo-color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}
.wpludo-color-red    { background: #ef4444; }
.wpludo-color-green  { background: #10b981; }
.wpludo-color-yellow { background: #f59e0b; }
.wpludo-color-blue   { background: #3b82f6; }

.wpludo-room-status p { margin: 0 0 12px; color: #4b5563; }

/* Game layout */
.wpludo-game-layout {
    display: grid;
    grid-template-columns: minmax(320px, 600px) 280px;
    gap: 18px;
}
@media (max-width: 900px) {
    .wpludo-game-layout { grid-template-columns: 1fr; }
}
.wpludo-board-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
}
#wpludo-board {
    width: 100%;
    height: auto;
    max-width: 600px;
    cursor: pointer;
    border-radius: 8px;
}
.wpludo-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wpludo-sidebar ul { list-style: none; padding: 0; margin: 0; }
.wpludo-sidebar li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

/* Dice */
.wpludo-dice-area {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}
.wpludo-dice {
    width: 70px; height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(145deg,#fff,#e5e7eb);
    border: 2px solid #d1d5db;
    border-radius: 14px;
    box-shadow: 0 4px 0 #cbd5e1, inset 0 -2px 6px rgba(0,0,0,0.08);
    color: #1f2937;
    user-select: none;
}
.wpludo-dice.rolling {
    animation: wpludo-shake 0.6s ease-in-out;
}
@keyframes wpludo-shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg) scale(1.05); }
    50% { transform: rotate(8deg)  scale(1.05); }
    75% { transform: rotate(-4deg); }
}

/* Toast */
.wpludo-toast {
    position: fixed;
    bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    opacity: 0;
    transition: all .3s ease;
    z-index: 9999;
    pointer-events: none;
}
.wpludo-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Leaderboard */
.wpludo-leaderboard {
    margin-top: 20px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
}
.wpludo-leaderboard table { width: 100%; border-collapse: collapse; }
.wpludo-leaderboard th,
.wpludo-leaderboard td {
    text-align: left; padding: 6px 8px; font-size: 13px;
    border-bottom: 1px solid #e5e7eb;
}
.wpludo-leaderboard th { color: #6b7280; font-weight: 600; }
