/* ============ Главная страница игр — в стиле портала Billing Support ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, 'Roboto', Arial, sans-serif;
    position: relative;
    min-height: 100vh;
    background: linear-gradient(145deg, #0a2f44 0%, #0b3b2f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* --- Слой с буквами t2 и мастями (задний фон) --- */
.t2-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.35;
}

.t2-pattern {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        repeating-linear-gradient(transparent, transparent 70px, rgba(255,245,200,0.15) 70px, rgba(255,235,180,0.08) 72px),
        repeating-linear-gradient(95deg,
            rgba(255, 235, 190, 0.2) 0px,
            rgba(255, 235, 190, 0.2) 2px,
            transparent 2px,
            transparent 120px);
    transform: rotate(-7deg);
    animation: subtleShift 28s infinite alternate ease-in-out;
}

.letters-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-content: space-between;
    gap: 2rem 4rem;
    padding: 5vh 8vw;
}

.letter-item {
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 700;
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    letter-spacing: 6px;
    color: rgba(255, 248, 225, 0.5);
    text-shadow: 0px 4px 18px rgba(0,0,0,0.3), 2px 2px 0px rgba(255,215,130,0.6);
    transform: rotate(var(--rot, 0deg));
    transition: all 0.2s ease;
    white-space: nowrap;
    animation: floatGlow 6s infinite alternate;
    animation-delay: calc(var(--delay, 0) * 0.2s);
}

.letter-item:nth-child(odd) {
    font-family: 'Courier New', 'Fira Code', monospace;
    font-weight: 900;
    text-transform: uppercase;
    color: rgba(230, 210, 150, 0.6);
    text-shadow: 0px 0px 12px #ffd966, 1px 1px 0px #3a2c1a;
    transform: skewX(-3deg) rotate(var(--rot, 0deg));
}

.letter-item:nth-child(3n) {
    font-style: italic;
    font-weight: 600;
    letter-spacing: 10px;
    background: linear-gradient(135deg, rgba(255,220,120,0.3), rgba(255,200,90,0.1));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: none;
}

@keyframes floatGlow {
    0% {
        transform: translateY(0px) rotate(var(--rot, 0deg)) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-12px) rotate(calc(var(--rot, 0deg) + 1deg)) scale(1.02);
        opacity: 0.85;
    }
}

@keyframes subtleShift {
    0% {
        transform: rotate(-7deg) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: rotate(-4deg) scale(1.03);
        opacity: 0.85;
    }
}

/* --- Контейнер --- */
.container {
    position: relative;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(3px);
    border-radius: 42px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,200,0.2);
    width: 100%;
    max-width: 1300px;
    padding: 40px 36px;
    transition: all 0.3s;
    border: 1px solid rgba(255,245,200,0.6);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9e0cf;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    text-align: center;
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(125deg, #2b4b3c, #5d3a1a, #2c5e6b);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-pill {
    color: #4a7c5c;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(210, 180, 140, 0.15);
    font-size: 14px;
}

/* --- Приветствие --- */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(210, 180, 140, 0.15);
    border-radius: 30px;
    margin-bottom: 20px;
}

.user-info .welcome {
    color: #3a2c1a;
    font-size: 14px;
}

.user-info .welcome strong {
    color: #2b4b3c;
    font-size: 16px;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(74, 124, 92, 0.12);
    color: #2f6b45;
    font-weight: 600;
    font-size: 13px;
}

/* --- Карточки игр --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-top: 28px;
}

.project-card {
    position: relative;
    background: rgba(255, 255, 245, 0.9);
    backdrop-filter: blur(2px);
    border-radius: 28px;
    padding: 28px 18px 24px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(210, 180, 140, 0.5);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 35px -12px rgba(0, 0, 0, 0.25);
    background: #fffef7;
    border-color: #e4c48b;
}

.project-card.soon {
    cursor: default;
    opacity: 0.8;
}

.project-card.soon:hover {
    transform: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 245, 0.9);
    border-color: rgba(210, 180, 140, 0.5);
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 12px;
    border-radius: 20px;
    background-color: #ff9800;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-badge.grey {
    background-color: #a89a85;
}

.project-icon {
    font-size: 54px;
    margin-bottom: 18px;
    display: inline-block;
    line-height: 1.1;
    filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.15));
}

.project-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3a2b;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.project-description {
    font-size: 0.85rem;
    color: #6b5a47;
    margin-top: 8px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 14px 0 12px;
}

.tags span {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(210, 180, 140, 0.18);
    color: #5d4a33;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 20px;
    font-size: 12.5px;
    color: #7e6a51;
    margin-bottom: 14px;
}

.live i, .status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b9ab95;
    display: inline-block;
}

.live i, .status i.on {
    background: #3aa76d;
    animation: pulse 1.8s infinite;
}

.status i.off {
    background: #d9534f;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(58, 167, 109, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(58, 167, 109, 0); }
    100% { box-shadow: 0 0 0 0 rgba(58, 167, 109, 0); }
}

.play-btn {
    display: inline-block;
    padding: 10px 26px;
    background: linear-gradient(135deg, #4a7c5c, #3a6b4c);
    color: white;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.project-card:hover .play-btn {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(74, 124, 92, 0.3);
}

.project-card.soon .play-btn {
    background: #d8cdbb;
    color: #6b5a47;
    box-shadow: none;
    transform: none;
}

.footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid rgba(160, 130, 90, 0.25);
    color: #7e6a51;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    body {
        padding: 20px 12px;
        align-items: flex-start;
    }
    .container {
        padding: 28px 20px;
        border-radius: 32px;
    }
    h1 {
        font-size: 1.8rem;
    }
    .projects-grid {
        gap: 18px;
    }
    .project-card {
        padding: 22px 14px;
    }
    .project-title {
        font-size: 1.3rem;
    }
    .user-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        border-radius: 22px;
    }
    .header {
        justify-content: center;
    }
}

@media (min-width: 1400px) {
    .letters-canvas {
        gap: 3rem 6rem;
    }
    .letter-item {
        font-size: 6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .t2-pattern, .letter-item, .live i, .status i { animation: none !important; }
}

/* --- Кнопка «Выйти» в шапке --- */
.logout-form {
    display: inline;
}

.logout-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    color: #8a5a2b;
}

.logout-btn:hover {
    background: rgba(210, 180, 140, 0.3);
}
