/* Game Portrait Display Styles */

.game-portrait-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 512 / 640;
    max-width: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.15), transparent 55%), #020617;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-portrait-canvas {
    width: 100%;
    height: 100%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    cursor: pointer;
    transition: border-color 0.2s ease;
    display: block;
}

.game-portrait-canvas:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.game-portrait-loader {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.game-portrait-loader.hidden {
    display: none;
}

.game-portrait-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: game-portrait-spin 1s linear infinite;
}

@keyframes game-portrait-spin {
    to { transform: rotate(360deg); }
}

.game-portrait-loader-text {
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}

.game-portrait-error {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    z-index: 10;
    text-align: center;
}

.game-portrait-error.hidden {
    display: none;
}

.game-portrait-error-text {
    color: #f87171;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.game-portrait-retry-btn {
    padding: 0.5rem 1rem;
    background: #38bdf8;
    color: #041023;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 0.9rem;
}

.game-portrait-retry-btn:hover {
    opacity: 0.9;
}

.game-portrait-retry-btn:active {
    opacity: 0.8;
}

/* Responsive sizing */
@media (max-width: 768px) {
    .game-portrait-wrapper {
        max-width: 100%;
    }

    .game-portrait-canvas {
        width: 100%;
        height: auto;
    }
}

/* Integration with profile page */
.profile-portrait-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.profile-portrait-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.55));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 25px 40px rgba(15, 23, 42, 0.45);
}

.profile-portrait-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
}

.profile-portrait-metadata {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.profile-portrait-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.profile-portrait-meta-label {
    font-weight: 500;
    color: #cbd5e1;
}

.profile-portrait-meta-value {
    color: #94a3b8;
}

/* Integration with game sessions */
.game-session-portrait {
    max-width: 300px;
    margin: 0 auto 1.5rem;
}

.game-session-portrait-caption {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Loading states */
.portrait-skeleton {
    background: linear-gradient(
        90deg,
        rgba(100, 116, 139, 0.2) 0%,
        rgba(100, 116, 139, 0.3) 50%,
        rgba(100, 116, 139, 0.2) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
