:root {
    --gs-destructive-color: #b91c1c;
    --gs-destructive-bg: rgba(239, 68, 68, 0.08);
    --gs-destructive-bg-dark: rgba(239, 68, 68, 0.14);
    --gs-destructive-bg-strong: rgba(239, 68, 68, 0.16);
    --gs-destructive-text-dark: #fee2e2;
}

.game-subscribe-link .cnt {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 8px;
    height: 18px;
    line-height: 15px;
    padding: 0 4px;
    background-color: #f44336;
    color: var(--text-white);
    font-size: 11px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-card);
    text-align: center;
}

.game-subscribe-link [data-game-subscribe-count][hidden] {
    display: none !important;
}

@media (max-width: 960px) {
    .game-subscribe-link .cnt {
        top: 6px;
        right: 4px;
    }
}

.game-subscribe-box {
    display: grid;
    gap: 8px;
}

.game-subscribe-box__meta {
    color: rgba(113, 113, 122, 0.92);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.game-subscribe-box__action {
    display: block;
}

.game-subscribe-box .game-subscribe-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--text-main);
    color: var(--text-white);
    font-family: inherit;
    cursor: pointer;
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base), opacity var(--transition-base), transform var(--transition-base);
}

.game-subscribe-box .game-subscribe-cta:hover {
    background: var(--text-black);
}

.game-subscribe-box .game-subscribe-cta:active {
    transform: scale(0.98);
}

.game-subscribe-box .game-subscribe-cta:focus-visible {
    outline: 2px solid rgba(245, 158, 11, 0.45);
    outline-offset: 2px;
}

.game-subscribe-box .game-subscribe-cta:disabled {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.game-subscribe-box .game-subscribe-cta--active {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-main);
}

.game-subscribe-box .game-subscribe-cta--active:hover {
    background: var(--bg-secondary);
}

.dark .game-subscribe-box {
    border-color: var(--border-medium);
    background: var(--bg-card);
    box-shadow: none;
}

.dark .game-subscribe-box .game-subscribe-cta {
    background: rgba(255, 255, 255, 0.1);
}

.dark .game-subscribe-box .game-subscribe-cta:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dark .game-subscribe-box .game-subscribe-cta--active:hover {
    background: rgba(255, 255, 255, 0.06);
}

.game-subscribe-cta {
    width: 100%;
}

.game-subscribe-panel[hidden] {
    display: none !important;
}

.game-subscribe-panel__clear[hidden] {
    display: none !important;
}

.game-subscribe-anchor {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.game-subscribe-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: var(--z-modal);
    width: min(calc(100vw - 24px), 280px);
    max-width: calc(100vw - 24px);
    transform-origin: top right;
    animation: panel-fade-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes panel-fade-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.98) translateY(12px);
    }
}

.game-subscribe-panel--closing {
    animation: panel-fade-out 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.game-subscribe-panel__dialog {
    width: 100%;
    max-height: min(72vh, 560px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    box-shadow: rgba(15, 23, 42, 0.22) 0 18px 38px -12px, rgba(15, 23, 42, 0.18) 0 8px 18px -14px, rgba(15, 23, 42, 0.03) 0 0 0 1px;
    overflow: hidden;
    outline: none;
}

.dark .game-subscribe-panel__dialog {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: rgba(0, 0, 0, 0.42) 0 20px 42px -12px, rgba(0, 0, 0, 0.32) 0 10px 24px -16px, rgba(255, 255, 255, 0.05) 0 0 0 1px;
}

.game-subscribe-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(244, 244, 245, 1);
}

.dark .game-subscribe-panel__header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(39, 39, 42, 0.94);
}

.game-subscribe-panel__title {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.game-subscribe-panel__clear {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(71, 85, 105, 0.9);
    cursor: pointer;
    transition: background-color var(--transition-base), color var(--transition-base), opacity var(--transition-base);
}

.dark .game-subscribe-panel__clear {
    color: rgba(212, 212, 216, 0.86);
}

.game-subscribe-panel__clear:hover {
    background: var(--gs-destructive-bg);
    color: var(--gs-destructive-color);
}

.game-subscribe-panel__clear[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.game-subscribe-panel__clear svg {
    width: 16px;
    height: 16px;
}

.game-subscribe-panel__content {
    --game-subscribe-panel-scrollbar-size: 6px;
    --game-subscribe-panel-scrollbar-space: 6px;
    --game-subscribe-panel-scrollbar-thumb: rgba(15, 23, 42, 0.28);
    --game-subscribe-panel-scrollbar-track: rgba(148, 163, 184, 0.08);
    --game-subscribe-panel-content-max-height: min(52vh, 420px);
    min-height: 120px;
    max-height: var(--game-subscribe-panel-content-max-height);
    padding: 6px 8px;
    padding-right: calc(8px + var(--game-subscribe-panel-scrollbar-space));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.game-subscribe-panel__content::-webkit-scrollbar {
    width: var(--game-subscribe-panel-scrollbar-size);
}

.game-subscribe-panel__content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--radius-full);
}

.game-subscribe-panel__content::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
    min-height: 28px;
}

.game-subscribe-panel__content--scrollable:hover,
.game-subscribe-panel__content--scrollable:focus-within,
.game-subscribe-panel__content--scrolling {
    scrollbar-color: var(--game-subscribe-panel-scrollbar-thumb) var(--game-subscribe-panel-scrollbar-track);
}

.game-subscribe-panel__content--scrollable:hover::-webkit-scrollbar-track,
.game-subscribe-panel__content--scrollable:focus-within::-webkit-scrollbar-track,
.game-subscribe-panel__content--scrolling::-webkit-scrollbar-track {
    background: var(--game-subscribe-panel-scrollbar-track);
}

.game-subscribe-panel__content--scrollable:hover::-webkit-scrollbar-thumb,
.game-subscribe-panel__content--scrollable:focus-within::-webkit-scrollbar-thumb,
.game-subscribe-panel__content--scrolling::-webkit-scrollbar-thumb {
    background: var(--game-subscribe-panel-scrollbar-thumb);
}

.dark .game-subscribe-panel__content {
    --game-subscribe-panel-scrollbar-thumb: rgba(244, 244, 245, 0.24);
    --game-subscribe-panel-scrollbar-track: rgba(255, 255, 255, 0.08);
}

.game-subscribe-panel__footer {
    padding: 0;
}

.game-subscribe-panel__footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 12px;
    border-top: 1px solid rgba(161, 161, 170, 0.2);
    background: rgba(244, 244, 245, 0.38);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.dark .game-subscribe-panel__footer-link {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
}

.game-subscribe-panel__footer-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dark .game-subscribe-panel__footer-link:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.game-subscribe-panel__empty {
    display: grid;
    gap: 20px;
    padding: 24px 16px;
    text-align: center;
    justify-items: center;
}

.game-subscribe-panel__empty-text {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.game-subscribe-panel__empty strong {
    font-weight: 600;
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.game-subscribe-panel__empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(113, 113, 122, 0.92);
}

.game-subscribe-panel__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(161, 161, 170, 0.12);
    color: rgba(107, 114, 128, 0.9);
}

.dark .game-subscribe-panel__empty-icon {
    color: rgba(161, 161, 170, 0.72);
    background: rgba(255, 255, 255, 0.06);
}

.game-subscribe-panel__empty-icon svg {
    width: 22px;
    height: 22px;
}

.game-subscribe-panel__list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-subscribe-panel__item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background-color var(--transition-base), background-image var(--transition-base);
}

.game-subscribe-panel__item + .game-subscribe-panel__item {
    margin-top: 2px;
    padding-top: 10px;
    background-image: linear-gradient(rgba(161, 161, 170, 0.10), rgba(161, 161, 170, 0.10));
    background-size: calc(100% - 16px) 1px;
    background-position: center top 0;
    background-repeat: no-repeat;
}

.game-subscribe-panel__item:hover,
.game-subscribe-panel__item:hover + .game-subscribe-panel__item {
    background-image: none;
}

.game-subscribe-panel__item:hover {
    background-color: rgba(63, 63, 70, 0.06);
}

.game-subscribe-panel__item:hover .game-subscribe-panel__item-link {
    opacity: 0.8;
}

.game-subscribe-panel__item:focus-visible {
    outline: 2px solid rgba(245, 158, 11, 0.45);
    outline-offset: 2px;
}

.game-subscribe-panel__item-poster-link {
    display: block;
    flex-shrink: 0;
}

.game-subscribe-panel__item-poster {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    object-position: center top;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .game-subscribe-panel__item-poster {
    border-color: rgba(255, 255, 255, 0.08);
}

.game-subscribe-panel__item-main {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.game-subscribe-panel__item-link {
    display: block;
    min-width: 0;
    color: var(--text-black);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-base), opacity var(--transition-base);
}

.dark .game-subscribe-panel__item-link {
    color: var(--text-white);
}

.dark .game-subscribe-panel__item:hover .game-subscribe-panel__item-link,
.dark .game-subscribe-panel__item:focus-within .game-subscribe-panel__item-link {
    opacity: 0.85;
}

.game-subscribe-panel__item-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(113, 113, 122, 0.92);
    font-size: 12px;
    line-height: 1.2;
}

.dark .game-subscribe-panel__item-status {
    color: rgba(113, 113, 122, 0.92);
}

.game-subscribe-panel__item-status::before {
    content: "";
    width: 5px;
    height: 5px;
    opacity: 0.4;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: currentColor;
}

.dark .game-subscribe-panel__item {
    background: transparent;
}

.dark .game-subscribe-panel__item + .game-subscribe-panel__item {
    background-image: linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04));
}

.dark .game-subscribe-panel__item:hover,
.dark .game-subscribe-panel__item:hover + .game-subscribe-panel__item {
    background-image: none;
}

.dark .game-subscribe-panel__item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

@media (max-width: 760px) {
    .game-subscribe-box {
        padding: 14px;
    }

    .game-subscribe-panel__item-form {
        min-width: 28px;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .game-subscribe-panel__dialog {
        max-height: min(68vh, 520px);
    }

    .game-subscribe-panel {
        position: fixed;
        top: 63px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .game-subscribe-panel__content {
        --game-subscribe-panel-content-max-height: min(48vh, 360px);
    }

    .game-subscribe-panel__item {
        padding: 10px;
    }
}
