/* ==========================================================
   Cosmic-Glass Side Controls & Help / Feedback / Donation Modals
   ========================================================== */

.lobby-side-controls .help-button {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 162px;
    min-height: 40px;
    padding: 8px 12px;
    background: linear-gradient(145deg, rgba(11, 17, 32, 0.92), rgba(15, 23, 42, 0.95));
    color: #f8fafc;
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: center;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.lobby-side-controls .help-button:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#help-button::before {
    content: '❓';
    font-size: 0.98rem;
    line-height: 1;
}

#help-button {
    border-color: rgba(56, 189, 248, 0.62);
}

#feedback-button::before {
    content: '💬';
    font-size: 0.95rem;
    line-height: 1;
}

#feedback-button {
    border-color: rgba(168, 85, 247, 0.52);
}

#donation-button::before {
    content: '💛';
    font-size: 0.92rem;
    line-height: 1;
}

#donation-button {
    border-color: rgba(251, 191, 36, 0.55);
    color: #fef3c7;
}

#tutorial-toggle-button::before {
    content: '🧭';
    font-size: 0.95rem;
    line-height: 1;
}

/* ==========================================================
   Cosmic-Glass Modals (Help, Help Details, Feedback, Donation)
   ========================================================== */

.help-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(3, 6, 16, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.help-modal-content {
    position: relative;
    margin: auto;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 24px 22px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(11, 17, 32, 0.97), rgba(15, 23, 42, 0.98));
    border: 1.5px solid rgba(56, 189, 248, 0.52);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.82), 0 0 34px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    box-sizing: border-box;
    text-align: left;
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.help-modal-content h2 {
    margin: 0;
    font-size: 1.38rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: 0.3px;
}

.help-modal-subtitle {
    margin: 0 0 16px 0;
    font-size: 0.92rem;
    color: #94a3b8;
    line-height: 1.45;
}

.help-modal-close,
.help-details-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.78);
    color: #cbd5e1;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.help-modal-close:hover,
.help-modal-close:focus,
.help-details-modal-close:hover,
.help-details-modal-close:focus {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(248, 113, 113, 0.6);
    color: #ffffff;
    text-decoration: none;
}

/* Topic Grid inside Help Overview */
#help-menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.help-topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 88px;
    padding: 12px 10px;
    margin: 0 !important;
    border-radius: 13px;
    border: 1.5px solid rgba(56, 189, 248, 0.42);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(11, 17, 32, 0.96));
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.25;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.help-topic-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 10px 22px rgba(56, 189, 248, 0.24);
}

.help-topic-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(9, 13, 24, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.help-topic-card.theme-char { border-color: rgba(192, 132, 252, 0.62); background: linear-gradient(145deg, rgba(88, 28, 135, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-talents { border-color: rgba(96, 165, 250, 0.62); background: linear-gradient(145deg, rgba(30, 64, 175, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-inventory { border-color: rgba(52, 211, 153, 0.62); background: linear-gradient(145deg, rgba(6, 95, 70, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-skills { border-color: rgba(244, 114, 182, 0.62); background: linear-gradient(145deg, rgba(157, 23, 77, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-story { border-color: rgba(56, 189, 248, 0.68); background: linear-gradient(145deg, rgba(3, 105, 161, 0.52), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-dungeons { border-color: rgba(248, 113, 113, 0.65); background: linear-gradient(145deg, rgba(153, 27, 27, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-auto { border-color: rgba(251, 191, 36, 0.65); background: linear-gradient(145deg, rgba(146, 64, 14, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-workshop { border-color: rgba(245, 158, 11, 0.62); background: linear-gradient(145deg, rgba(120, 53, 15, 0.52), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-enchant { border-color: rgba(232, 121, 249, 0.65); background: linear-gradient(145deg, rgba(107, 33, 168, 0.52), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-gs { border-color: rgba(250, 204, 21, 0.72); background: linear-gradient(145deg, rgba(161, 98, 7, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-extras { border-color: rgba(45, 212, 191, 0.62); background: linear-gradient(145deg, rgba(17, 94, 89, 0.5), rgba(15, 23, 42, 0.95)); }
.help-topic-card.theme-settings { border-color: rgba(148, 163, 184, 0.68); background: linear-gradient(145deg, rgba(51, 65, 85, 0.58), rgba(15, 23, 42, 0.95)); }

/* Help Details Reading View */
#help-details-modal .help-modal-content {
    max-width: 620px;
}

#help-details-text {
    white-space: normal;
    line-height: 1.58;
    text-align: left;
    margin: 0;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.help-detail-block {
    background: rgba(9, 13, 24, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.help-detail-block:last-child {
    margin-bottom: 0;
}

.help-detail-heading {
    margin: 0 0 6px 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.2px;
}

.help-detail-paragraph {
    margin: 0;
    color: #cbd5e1;
}

.help-detail-list {
    margin: 6px 0 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.help-detail-list li {
    color: #e2e8f0;
}

.help-inline-strong {
    color: #fde68a;
    font-weight: 800;
}

.help-details-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.help-back-btn,
.help-close-footer-btn {
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 11px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.help-back-btn {
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(30, 41, 59, 0.9));
    color: #e0f2fe;
}

.help-close-footer-btn {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.85);
    color: #f1f5f9;
}

.help-back-btn:hover,
.help-close-footer-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Feedback & Donation Cosmic Overrides */
#feedback-modal .help-modal-content {
    max-width: 520px;
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.82), 0 0 34px rgba(168, 85, 247, 0.2);
}

#feedback-text {
    width: 100%;
    min-height: 130px;
    padding: 12px 14px;
    margin: 4px 0 14px 0;
    border-radius: 12px;
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    background: rgba(9, 13, 24, 0.88);
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

#feedback-text:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

#send-feedback-btn {
    width: 100%;
    min-height: 44px;
    border-radius: 11px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #059669, #0d9488) !important;
    border: 1px solid rgba(52, 211, 153, 0.65) !important;
    color: #ffffff !important;
    margin: 0 !important;
}

#donation-modal .help-modal-content {
    max-width: 500px;
    background: linear-gradient(160deg, rgba(17, 24, 39, 0.98), rgba(28, 22, 10, 0.98)) !important;
    border: 1.5px solid rgba(251, 191, 36, 0.65) !important;
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.85), 0 0 34px rgba(251, 191, 36, 0.22) !important;
    color: #f8fafc !important;
}

#donation-modal .help-modal-content h2 {
    color: #fde68a !important;
}

#donation-modal .help-modal-content p {
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

#donation-modal .help-modal-content a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 18px;
    margin: 6px 0 12px 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #d97706, #b45309);
    border: 1px solid rgba(253, 224, 71, 0.65);
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 768px) {
    .help-modal-content {
        max-width: 95vw;
        padding: 18px 16px 16px;
    }
    #help-menu-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .help-topic-card {
        min-height: 78px;
        padding: 10px 8px;
        font-size: 0.82rem;
    }
    .help-details-footer {
        flex-direction: column;
    }
    .help-back-btn,
    .help-close-footer-btn {
        width: 100%;
    }
}

/* ==========================================================
   Public Spiel-Info Standalone Page Container & 4x3 Grid
   ========================================================== */

.spiel-info-container {
    width: calc(100% - 4rem);
    max-width: 1136px;
    margin: 0 auto 2.5rem auto;
    padding: 1.75rem 2rem;
    box-sizing: border-box;
    background: radial-gradient(circle at top, rgba(16, 36, 68, 0.72) 0%, rgba(9, 14, 28, 0.92) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52), inset 0 0 24px rgba(56, 189, 248, 0.06);
}

.spiel-info-intro {
    margin: 0 auto 1.5rem auto;
    max-width: 720px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.spiel-info-container #help-menu-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 0;
}

.spiel-info-container .help-topic-card {
    min-height: 106px;
    padding: 16px 12px;
    font-size: 0.94rem;
}

@media (max-width: 960px) {
    .spiel-info-container #help-menu-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .spiel-info-container {
        width: calc(100% - 2rem);
        padding: 1.25rem 1rem;
    }
    .spiel-info-intro {
        font-size: 0.92rem;
        margin-bottom: 1.15rem;
    }
}

@media (max-width: 600px) {
    .spiel-info-container #help-menu-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .spiel-info-container .help-topic-card {
        min-height: 88px;
        padding: 12px 8px;
        font-size: 0.85rem;
    }
}
