@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    /* আধুনিক কালারফুল গ্রাডিয়েন্ট ব্যাকগ্রাউন্ড */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container {
    width: 95%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px); /* গ্লাস ইফেক্ট */
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    margin: 20px auto;
    text-align: center;
}

h1, h2, h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-weight: 800;
}

input[type="text"], input[type="password"], input[type="file"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: #fff;
    padding: 14px 20px;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 114, 255, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #8e9eab 0%, #eef2f3 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #000;
}

.btn:disabled { background: #cbd5e0; cursor: not-allowed; transform: none; box-shadow: none; color: #718096;}

.error { color: #e53e3e; font-weight: 600; background: #fff5f5; padding: 10px; border-radius: 8px;}

/* ====================
   VS Screen Design 
   ==================== */
.vs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 15px 10px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.player-card {
    text-align: center;
    width: 32%;
    padding: 10px 5px;
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid transparent;
}

/* 🟢 ছবি যাতে বড় না হয় তার জন্য ফিক্সড সাইজ */
.avatar, .avatar-game {
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.player-name {
    font-weight: 800;
    margin-top: 8px;
    font-size: 0.85em;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.symbol { font-weight: 800; font-size: 1.2em; color: #a0aec0; margin-top: 2px;}

/* 🟢 টার্ন ইন্ডিকেটর (যার চাল তার ডিজাইন) */
.active-turn {
    border: 3px solid #48bb78;
    background: #f0fff4;
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.4);
    transform: scale(1.05);
}

.vs-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer {
    font-size: 1.4em;
    font-weight: 800;
    color: #dd6b20;
    background: #fffaf0;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #dd6b20;
    margin-top: 5px;
    box-shadow: 0 4px 10px rgba(221, 107, 32, 0.2);
}

.game-info {
    font-size: 1.3em;
    font-weight: 800;
    margin: 15px 0;
    padding: 10px;
    border-radius: 12px;
    background: #edf2f7;
    color: #2d3748;
}

/* ====================
   Tic Tac Toe Board 
   ==================== */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 300px; /* মোবাইলের জন্য পারফেক্ট সাইজ */
    margin: 20px auto;
}

.cell {
    aspect-ratio: 1;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transition: all 0.2s ease-in-out;
    user-select: none;
    border: 2px solid transparent;
}

.cell:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 25px rgba(0,0,0,0.15); 
    border: 2px solid #cbd5e0;
}

/* X এবং O এর স্টাইল (গ্লোয়িং ইফেক্ট) */
.cell.x { 
    color: #ff4757; 
    text-shadow: 0 0 15px rgba(255, 71, 87, 0.4); 
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell.o { 
    color: #1e90ff; 
    text-shadow: 0 0 15px rgba(30, 144, 255, 0.4); 
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* এনিমেশন */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ====================
   Mobile Responsive 
   ==================== */
@media (max-width: 400px) {
    .container { padding: 15px; width: 95%; }
    .avatar, .avatar-game { width: 45px !important; height: 45px !important; }
    .player-name { font-size: 0.75em; }
    .timer { font-size: 1.2em; }
    .board { max-width: 260px; gap: 8px; }
    .cell { font-size: 2.8em; border-radius: 12px; }
    .btn { font-size: 15px; padding: 12px; }
}