/* ========================================
   ListGame Page — Premium Glassmorphism
   ======================================== */

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}
.header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #38bdf8, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}
.header .subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Notifications / Messages */
.message {
    padding: 0.9rem 1.4rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    transition: opacity 0.3s;
}
.message.success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.4);
    color: #34d399;
}
.message.error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
}

/* Login Form */
.login-form {
    max-width: 420px;
    margin: 1.5rem auto;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.login-form h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-form .form-group {
    margin-bottom: 1rem;
}
.login-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 500;
}
.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="url"] {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.login-form input:focus {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}
.login-form .btn {
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
}

/* User Card */
.user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.4);
    object-fit: cover;
    flex-shrink: 0;
}
.user-info {
    flex: 1;
    min-width: 0;
}
.user-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.2rem;
}
.user-info p {
    font-size: 0.88rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

/* Avatar Actions */
.avatar-actions {
    width: 100%;
    margin-top: 0.5rem;
}
.avatar-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.avatar-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.avatar-input-icon {
    color: #64748b;
    font-size: 1rem;
}
.avatar-input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.avatar-input:focus {
    border-color: rgba(56, 189, 248, 0.5);
}
.avatar-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
}
.avatar-preview-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.avatar-preview-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.3);
    object-fit: cover;
}
.avatar-preview-meta {
    flex: 1;
    min-width: 0;
}
.avatar-preview-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.avatar-preview-status {
    font-size: 0.78rem;
    line-height: 1.3;
    word-break: break-word;
}
.avatar-preview-status.ok { color: #34d399; }
.avatar-preview-status.bad { color: #f59e0b; }
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0 2rem;
}

/* Game Card */
.game-card {
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardFadeIn 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
}
@keyframes cardFadeIn {
    to { opacity: 1; transform: translateY(0); }
}
.game-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 16px 40px rgba(56, 189, 248, 0.12), 0 4px 12px rgba(0,0,0,0.3);
}

/* Game Thumbnail */
.game-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(167, 139, 250, 0.15));
    display: block;
}

/* Game Info */
.game-info {
    padding: 1rem 1.2rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.game-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.4rem;
    letter-spacing: 0.5px;
}
.game-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 auto;
    padding-bottom: 0.8rem;
}

/* Score */
.score-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.score-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}
.score-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fbbf24;
}

/* Play Button */
.play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}
.play-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}
.play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #475569;
}

/* Daily Rewards Card */
.daily-rewards-card {
    border-color: rgba(250, 204, 21, 0.25) !important;
}
.daily-rewards-card:hover {
    border-color: rgba(250, 204, 21, 0.5) !important;
    box-shadow: 0 16px 40px rgba(250, 204, 21, 0.1), 0 4px 12px rgba(0,0,0,0.3) !important;
}
.daily-rewards-header {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.12), rgba(251, 191, 36, 0.08));
    padding: 1.5rem 1.2rem;
    text-align: center;
    border-bottom: 1px solid rgba(250, 204, 21, 0.15);
}
.daily-rewards-icon {
    font-size: 2rem;
    color: #fbbf24;
    margin-bottom: 0.4rem;
}
.daily-rewards-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fbbf24;
    margin: 0;
}
.daily-rewards-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0.2rem 0 0;
}

/* Special Cards */
.game-card.special {
    border-color: rgba(255, 215, 0, 0.2);
}
.game-card.special:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 16px 40px rgba(255, 215, 0, 0.1), 0 4px 12px rgba(0,0,0,0.3);
}

/* Container override for listgame */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* Small phones */
@media (max-width: 480px) {
    .header h1 { font-size: 1.6rem; }
    .header .subtitle { font-size: 0.88rem; }
    .game-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .game-thumbnail { height: 130px; }
    .login-form { margin: 1rem 0.5rem; padding: 1.5rem; }
    .user-card { flex-direction: column; text-align: center; padding: 1rem; }
    .user-avatar { width: 64px; height: 64px; }
    .avatar-input-group { flex-direction: column; }
    .avatar-input-group .btn { width: 100%; }
    .container { padding: 0 0.6rem; }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    .game-thumbnail { height: 140px; }
}

/* Desktop */
@media (min-width: 769px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .container { max-width: 1300px; }
}
