.gl-library {
    max-width: 960px;
    margin: 20px auto;
    background: rgba(12, 10, 10, 0.92);
    border: 1px solid #8b2e2e;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 25px rgba(139, 46, 46, 0.35), inset 0 0 40px rgba(0,0,0,0.6);
    color: #e6e0e0;
    font-family: 'Segoe UI', sans-serif;
    position: relative;
}

.gl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid #5a1a1a;
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.gl-title {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 2px;
    color: #c9302c;
    text-shadow: 0 0 8px rgba(201, 48, 44, 0.7), 0 0 2px #000;
}

.gl-connect-btn {
    background: rgba(0,0,0,0.4);
    border: 1px solid #8b2e2e;
    color: #e6e0e0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.gl-connect-btn:hover {
    background: #c9302c;
}

.gl-connected-as {
    font-size: 12px;
    color: #a08d8d;
}

.gl-empty {
    text-align: center;
    color: #a08d8d;
}

.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.gl-card {
    background: rgba(0,0,0,0.35);
    border: 1px solid #5a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}

.gl-card:hover {
    box-shadow: 0 0 14px rgba(201, 48, 44, 0.5);
}

.gl-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #1a1414;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gl-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gl-cover-placeholder {
    font-size: 40px;
    opacity: .5;
}

.gl-info {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.gl-book-title {
    font-weight: bold;
    color: #e6e0e0;
    font-size: 14px;
}

.gl-book-author {
    font-size: 12px;
    color: #a08d8d;
}

.gl-book-desc {
    font-size: 12px;
    color: #c9bdbd;
    margin-top: 4px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
}

.gl-action {
    margin-top: auto;
    padding-top: 8px;
}

.gl-action a,
.gl-action button {
    display: inline-block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #ff4d4d;
    color: #fff;
    background: linear-gradient(180deg, #c9302c, #7a1a1a);
    box-shadow: 0 0 10px rgba(201, 48, 44, 0.5);
}

.gl-action a:hover,
.gl-action button:hover {
    box-shadow: 0 0 16px rgba(255, 77, 77, 0.8);
}

.gl-action .gl-free-tag {
    background: linear-gradient(180deg, #2e7d32, #1b5e20);
    border-color: #4caf50;
}

.gl-pay-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.gl-pay-overlay.active {
    display: flex;
}

.gl-pay-box {
    background: rgba(12, 10, 10, 0.98);
    border: 1px solid #8b2e2e;
    border-radius: 10px;
    padding: 26px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 30px rgba(201, 48, 44, 0.5);
}

.gl-pay-label {
    font-family: 'Cinzel Decorative', serif;
    letter-spacing: 2px;
    font-size: 14px;
    text-transform: uppercase;
    color: #c9302c;
    margin-bottom: 12px;
}

.gl-pay-info {
    font-size: 14px;
    margin-bottom: 16px;
}

.gl-pay-btn {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #c9302c, #7a1a1a);
    border: 1px solid #ff4d4d;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(201, 48, 44, 0.6);
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.gl-pay-btn:disabled {
    opacity: .5;
    cursor: wait;
}

.gl-pay-close {
    background: none;
    border: 1px solid #5a1a1a;
    color: #a08d8d;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.gl-pay-status {
    margin-top: 12px;
    font-size: 12px;
    color: #a08d8d;
    min-height: 16px;
}
