/* ===========================================================
   app.css — สไตล์เสริมที่เขียนมือ (โหลดคู่กับ TailwindCSS CDN)
   Phase 1: ใช้ไฟล์นี้ได้ทันทีโดยไม่ต้อง build
   Phase ถัดไป: รัน `npm run build` เพื่อสร้าง Tailwind ลงไฟล์นี้แทน
   =========================================================== */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* การ์ดยกตัวเล็กน้อยเมื่อชี้เมาส์ */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -12px rgba(79, 70, 229, 0.28);
}

/* ===========================================================
   User Profile Chip & Popover Dropdown Menu Style
   =========================================================== */
.ra-user-menu-container {
    position: relative;
    display: inline-block;
}

.ra-user-profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 5px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 42px;
    cursor: pointer;
    outline: none;
}

.ra-user-profile-chip:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.ra-user-avatar-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ra-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ra-user-info-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ra-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ra-role-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    text-transform: uppercase;
}

.ra-role-admin {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.ra-role-member {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ra-chip-chevron {
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.ra-user-menu-container.active .ra-chip-chevron {
    transform: rotate(180deg);
    color: #4f46e5;
}

.ra-profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 256px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ra-user-menu-container.active .ra-profile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ra-dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 10px;
}

.ra-dropdown-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: #ffffff;
    font-weight: 700;
}

.ra-dropdown-user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ra-dropdown-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ra-dropdown-user-email {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ra-dropdown-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    padding: 8px 8px 4px;
}

.ra-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ra-dropdown-item:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

.ra-dropdown-item i {
    font-size: 16px;
    color: #64748b;
}

.ra-dropdown-item:hover i {
    color: #4f46e5;
}

.ra-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.ra-dropdown-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ra-dropdown-logout-btn:hover {
    background: #fef2f2;
}

/* ===========================================================
   Phaser Game Board Responsive Scaling
   =========================================================== */
#pok9-game {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a3a24;
}

#pok9-game canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}


