/**
 * FunGame Header News — KA frontend only.
 * Does not restyle .header-soon-btn globally (Auth stays disabled).
 */

.header-soon-btn.header-soon-btn--news.fg-news-trigger {
    position: relative;
    overflow: visible;
    opacity: 1;
    cursor: pointer;
    color: #111827;
}

.header-soon-btn.header-soon-btn--news.fg-news-trigger svg {
    color: inherit;
    opacity: 1;
}

.header-soon-btn.header-soon-btn--news.fg-news-trigger:hover,
.header-soon-btn.header-soon-btn--news.fg-news-trigger:focus,
.header-soon-btn.header-soon-btn--news.fg-news-trigger:focus-visible {
    background: #ffffff;
    border-color: #ff7a00;
    color: #111827;
    box-shadow: 0 12px 26px rgba(255, 122, 0, 0.14);
    outline: none;
}

.header-soon-btn.header-soon-btn--news.fg-news-trigger:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.55);
    outline-offset: 2px;
}

.header-soon-btn.header-soon-btn--news.fg-news-trigger[aria-expanded="true"] {
    border-color: #ff7a00;
    box-shadow: 0 12px 26px rgba(255, 122, 0, 0.14);
}

.header-soon-btn.header-soon-btn--news.fg-news-trigger.has-unread,
.header-soon-btn.header-soon-btn--news.fg-news-trigger.has-unread:hover,
.header-soon-btn.header-soon-btn--news.fg-news-trigger.has-unread:focus,
.header-soon-btn.header-soon-btn--news.fg-news-trigger.has-unread:focus-visible,
.header-soon-btn.header-soon-btn--news.fg-news-trigger.has-unread[aria-expanded="true"] {
    color: #ff7a00;
    border-color: #ff7a00;
}

.fg-news-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 2;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #ff7a00;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

.fg-news-unread-badge[hidden] {
    display: none !important;
}

.fg-news-dropdown {
    position: fixed;
    z-index: 2500;
    box-sizing: border-box;
    width: min(380px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(60vh, 420px);
    max-height: min(60dvh, 420px);
    margin: 0;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border: 1px solid #dfe7f1;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(17, 17, 17, 0.14), 0 4px 10px rgba(17, 17, 17, 0.06);
}

.fg-news-dropdown[hidden] {
    display: none !important;
}

.fg-news-dropdown__empty {
    margin: 0;
    padding: 18px 14px;
    color: #6e8098;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.fg-news-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fg-news-item {
    padding: 12px 10px 14px;
}

.fg-news-item + .fg-news-item {
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.fg-news-item__date {
    display: block;
    margin: 0 0 4px;
    color: rgba(17, 17, 17, 0.48);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.fg-news-item__title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 6px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.fg-news-item__title-text {
    min-width: 0;
    flex: 1 1 auto;
}

.fg-news-item__unread-dot {
    display: none;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: #ff7a00;
}

.fg-news-item.is-unread .fg-news-item__unread-dot {
    display: block;
}

.fg-news-item__preview {
    margin: 0 0 10px;
    color: rgba(17, 17, 17, 0.68);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

.fg-news-item__more {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #e85d04;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    appearance: none;
}

.fg-news-item__more:hover,
.fg-news-item__more:focus-visible {
    color: #c2410c;
    outline: none;
    text-decoration: underline;
}

html.fg-news-modal-open,
body.fg-news-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.fg-news-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.fg-news-modal[hidden] {
    display: none !important;
}

.fg-news-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.fg-news-modal__card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(640px, calc(100vw - 32px));
    max-height: calc(88vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.fg-news-modal__close {
    position: absolute;
    top: 20px;
    right: 28px;
    z-index: 3;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    appearance: none;
}

.fg-news-modal__close::after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='black' d='M14 1.41 12.59 0 7 5.59 1.41 0 0 1.41 5.59 7 0 12.59 1.41 14 7 8.41 12.59 14 14 12.59 8.41 7z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='black' d='M14 1.41 12.59 0 7 5.59 1.41 0 0 1.41 5.59 7 0 12.59 1.41 14 7 8.41 12.59 14 14 12.59 8.41 7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fg-news-modal__close:hover,
.fg-news-modal__close:focus-visible {
    background: #e5e7eb;
    outline: none;
}

.fg-news-modal__content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 26px 20px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.fg-news-article__date {
    display: block;
    margin: 0 0 8px;
    padding-right: 70px;
    color: rgba(17, 17, 17, 0.48);
    font-size: 13px;
    font-weight: 600;
}

.fg-news-article__title {
    margin: 0 0 16px;
    padding-right: 70px;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.fg-news-article__body {
    color: #111827;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.fg-news-article__body > *:first-child {
    margin-top: 0;
}

.fg-news-article__body > *:last-child {
    margin-bottom: 0;
}

.fg-news-article__body p {
    margin: 0 0 14px;
}

.fg-news-article__body h2,
.fg-news-article__body h3,
.fg-news-article__body h4 {
    margin: 20px 0 10px;
    line-height: 1.3;
}

.fg-news-article__body ul,
.fg-news-article__body ol {
    margin: 0 0 14px;
    padding-left: 1.25em;
}

.fg-news-article__body a {
    color: #e85d04;
}

@media (max-width: 640px) {
    .fg-news-modal__card {
        width: calc(100vw - 24px);
        border-radius: 20px;
    }

    .fg-news-modal__close {
        top: 16px;
        right: 24px;
    }

    .fg-news-modal__content {
        padding: 22px 16px 16px;
    }

    .fg-news-article__date,
    .fg-news-article__title {
        padding-right: 64px;
    }

    .fg-news-article__title {
        font-size: 19px;
    }

    .fg-news-article__body {
        font-size: 15px;
    }
}
