@property --home-chat-reveal-rx {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@property --home-chat-reveal-ry {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

#content .home-feature-chat[data-home-revealing] {
    mask-image: radial-gradient(ellipse var(--home-chat-reveal-rx) var(--home-chat-reveal-ry)
        at var(--home-chat-reveal-x) var(--home-chat-reveal-y), #000 51%, #0008 74%, transparent 100%);
}

#content .unified-home-hero {
    position: relative;
    isolation: isolate;
}

#content .unified-home-hero > :is(.unified-home-intro, .home-feature) {
    position: relative;
    z-index: 1;
}

#content .home-feature-world {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

#content .home-feature-world::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(90deg, #071c27f5 1%, #0c2430e8 25%, #0b232d99 48%, #0a222923 67%, transparent 79%),
        linear-gradient(0deg, #091e29ed 0%, #0a222b7a 16%, transparent 34%);
    content: '';
}

html[data-element-theme='light'] #content .home-feature-world::after {
    background:
        linear-gradient(90deg, #faf4e7fa 1%, #faf4e7f4 24%, #faf4e7c7 47%, #f8f2e74a 67%, transparent 84%),
        linear-gradient(0deg, #f7f0e2f7 0%, #f7f0e2a9 20%, transparent 37%);
}

#content .home-feature {
    --home-feature-height: clamp(208px, 19vw, 278px);
    --home-feature-rule: var(--unified-rule);
    align-content: center;
    min-inline-size: 0;
    min-block-size: var(--home-feature-height);
    color: var(--unified-ink);
}

#content .home-feature-chat {
    --home-chat-mist: color-mix(in srgb, var(--unified-deep) 87%, transparent);
    position: relative;
    isolation: isolate;
    block-size: var(--home-feature-height);
}

html[data-element-theme='light'] #content .home-feature-chat {
    --home-chat-mist: color-mix(in srgb, var(--unified-deep) 91%, transparent);
}

#content .home-feature-world :is([data-home-game-image], [data-home-game-canvas]) {
    position: absolute;
    inset: 0;
    display: block;
    inline-size: 100%;
    block-size: 100%;
}

#content .home-feature-world [data-home-game-image] { object-fit: cover; object-position: center 64%; }
#content .home-feature-world [data-home-game-image][data-home-live] { visibility: hidden; }
#content .home-feature-world [data-home-game-canvas] { pointer-events: none; }

#content .unified-home-intro > .unified-home-hero-logo {
    inline-size: 132px;
}

#content .home-crest-elements {
    position: absolute;
    z-index: 2;
    inset: 0;
}

#content .home-crest-element {
    position: absolute;
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--crest-touch-light);
    cursor: pointer;
    touch-action: manipulation;
}

#content .home-crest-element[data-home-element-key='fire'] {
    inset-block-start: 50%;
    inset-inline-start: 0;
    translate: 0 -50%;
    --crest-touch-shape: polygon(0 52%, 80% 0, 100% 41%, 90% 83%, 41% 100%);
    --crest-touch-light: #ffd092;
}

#content .home-crest-element[data-home-element-key='air'] {
    inset-block-start: 0;
    inset-inline-start: 50%;
    translate: -50% 0;
    --crest-touch-shape: polygon(0 71%, 17% 40%, 53% 3%, 88% 44%, 100% 74%, 49% 100%);
    --crest-touch-light: #e5f8ff;
}

#content .home-crest-element[data-home-element-key='water'] {
    inset-block-start: 50%;
    inset-inline-end: 0;
    translate: 0 -50%;
    --crest-touch-shape: polygon(0 25%, 38% 0, 100% 44%, 70% 82%, 35% 100%, 0 78%);
    --crest-touch-light: #9ee3ff;
}

#content .home-crest-element[data-home-element-key='earth'] {
    inset-block-end: 0;
    inset-inline-start: 50%;
    translate: -50% 0;
    --crest-touch-shape: polygon(0 28%, 49% 0, 100% 46%, 56% 100%, 30% 96%, 0 58%);
    --crest-touch-light: #e9d59c;
}

#content .home-crest-element::before {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse, currentColor 0, transparent 67%);
    clip-path: var(--crest-touch-shape);
    opacity: 0;
    pointer-events: none;
    content: '';
}

#content .home-crest-element::after {
    position: relative;
    inline-size: 5px;
    block-size: 5px;
    border-radius: 50%;
    background: #fff1d6;
    box-shadow: 0 1px 5px currentColor;
    opacity: 0;
    pointer-events: none;
    content: '';
}

#content .home-crest-element[data-discovered]::before { opacity: .21; }
#content .home-crest-element[data-discovered]::after { opacity: .91; }
#content .home-crest-element:is(:hover, :focus-visible)::before { opacity: .38; }

#content .home-crest-element:focus-visible::after {
    inline-size: 20px;
    block-size: 20px;
    border: 2px solid #fff3d6;
    background: transparent;
    box-shadow: 0 1px 4px #091921;
    opacity: 1;
}

#content .home-feature .chat-feed:focus-visible {
    outline: 2px solid var(--unified-gold);
    outline-offset: -3px;
}

#content .home-feature-chat .chat-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-auto-rows: auto;
    gap: 0;
    block-size: 100%;
    min-block-size: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--unified-ink);
    box-shadow: none;
}

#content .home-feature-chat-haze {
    display: block;
    position: absolute;
    z-index: 0;
    inset: -22px 0 -16px -21px;
    background: radial-gradient(ellipse at 51% 51%, var(--home-chat-mist) 61%, transparent 100%);
    pointer-events: none;
}

@supports (mask-composite: intersect) {
    #content .home-feature-chat-haze {
        background: var(--home-chat-mist);
        mask-image:
            linear-gradient(90deg, transparent, #000 23px, #000 calc(100% - 7px), transparent),
            linear-gradient(180deg, transparent, #000 31px, #000 calc(100% - 20px), transparent);
        mask-composite: intersect;
    }
}

#content .home-feature-chat .chat-panel > :is(.panel-head, .chat-feed, .chat-recovery, .chat-form, .chat-hint) {
    grid-column: 1 / -1;
    min-inline-size: 0;
}

#content .home-feature-chat .panel-head {
    min-block-size: 34px;
    margin: 0;
    padding: 5px 10px;
    border-block-end: 1px solid color-mix(in srgb, var(--home-feature-rule) 62%, transparent);
    background: transparent;
    color: var(--unified-ink);
}

#content .home-feature-chat .panel-head h2 {
    gap: 6px;
    margin: 0;
    color: inherit;
    font-size: 1rem;
}

#content .home-feature-chat .panel-head .icon { inline-size: 15px; block-size: 15px; }
#content .home-feature-chat .online-label { color: var(--unified-muted); font-size: .72rem; white-space: nowrap; }

#content .home-feature-chat .chat-feed {
    min-block-size: 0;
    block-size: auto;
    padding: 4px 10px;
    overflow: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-color: var(--unified-rule) var(--unified-deep);
    background: transparent;
    color: var(--unified-ink);
}

#content .home-feature-chat .chat-day { padding-block: 3px; color: var(--unified-muted); font-size: .72rem; }

#content .home-feature-chat .message {
    gap: 7px;
    margin: 0;
    padding: 5px 0;
    border-color: color-mix(in srgb, var(--home-feature-rule) 65%, transparent);
    background: transparent;
}

#content .home-feature-chat .message > img { inline-size: 24px; block-size: 27px; object-fit: cover; }
#content .home-feature-chat .message > div { min-inline-size: 0; }
#content .home-feature-chat .message-head { gap: 6px; }
#content .home-feature-chat .message-name { color: var(--unified-gold); font-size: .81rem; }
#content .home-feature-chat .message-time { color: var(--unified-muted); font-size: .72rem; }

#content .home-feature-chat .message-body {
    margin: 2px 0 0;
    color: var(--unified-ink);
    font-size: .89rem;
    line-height: 1.46;
    overflow-wrap: anywhere;
}

#content .home-feature-chat :is(.chat-login, .chat-expand, .chat-form) {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

#content .home-feature-chat .chat-login { padding: 0 8px; text-align: start; }

body.element-site.element-unified.page-home #content .home-feature-chat :is(.chat-login .button, .chat-expand) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-block-size: 44px;
    margin: 0;
    padding: 5px 3px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--unified-gold);
    font-size: .76rem;
    line-height: 1.25;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: .18em;
}

body.element-site.element-unified.page-home #content .home-feature-chat .chat-login .button:is(:hover, :focus-visible) {
    background: transparent;
    color: var(--unified-ink);
    box-shadow: none;
}

#content .home-feature-chat :is(.chat-expand, .chat-login .button) .icon { inline-size: 13px; block-size: 13px; }
#content .home-feature-chat .chat-expand { justify-self: end; padding-inline-end: 8px; }
#content .home-feature-chat .chat-form { padding: 6px; }
#content .home-feature-chat .chat-form textarea { min-block-size: 38px; padding: 6px 8px; }
#content .home-feature-chat .chat-form button { min-block-size: 40px; min-inline-size: 40px; }
#content .home-feature-chat .chat-hint {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#content .home-feature-chat .chat-panel:has(.chat-form) .panel-head { grid-column: 1; }
#content .home-feature-chat .chat-panel:has(.chat-form) .chat-expand { grid-row: 1; grid-column: 2; min-block-size: 34px; }
#content .home-feature-chat .chat-error { margin: 0; color: var(--unified-ink); font-size: .81rem; }
#content .home-feature-chat .chat-recovery { margin: 0; padding: 5px 8px; background: var(--unified-panel); }
#content .home-feature-chat .chat-recovery .button { min-block-size: 34px; }

#content .home-feature > [hidden],
#content .home-crest-elements[hidden],
#content .home-feature .chat-recovery[hidden],
#content .home-feature [data-chat-refresh][hidden] { display: none; }

@media (max-width: 780px) {
    #content .home-feature { --home-feature-height: clamp(224px, 61vw, 272px); }
    #content .home-feature-world [data-home-game-image] { object-position: 66% center; }

    #content .home-feature-world::after {
        background:
            linear-gradient(180deg, #071c27f5 0%, #0a2230e6 26%, #0b202aba 44%, #0b202a3d 65%, transparent 81%),
            linear-gradient(0deg, #091e29f4 0%, #0a222b80 18%, transparent 34%);
    }

    html[data-element-theme='light'] #content .home-feature-world::after {
        background:
            linear-gradient(180deg, #faf4e7fc 0%, #faf4e7ef 28%, #faf4e7da 44%, #f8f2e753 65%, transparent 80%),
            linear-gradient(0deg, #f7f0e2fa 0%, #f7f0e2ad 19%, transparent 36%);
    }

    #content .home-feature-chat {
        --home-chat-mist: color-mix(in srgb, var(--unified-deep) 93%, transparent);
    }

    html[data-element-theme='light'] #content .home-feature-chat {
        --home-chat-mist: color-mix(in srgb, var(--unified-deep) 95%, transparent);
    }

    #content .home-feature-chat .chat-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    #content .home-feature-chat-haze { inset-inline-start: 0; }

    @supports (mask-composite: intersect) {
        #content .home-feature-chat-haze {
            mask-image:
                linear-gradient(90deg, transparent, #000 11px, #000 calc(100% - 7px), transparent),
                linear-gradient(180deg, transparent, #000 31px, #000 calc(100% - 20px), transparent);
        }
    }

    #content .home-feature-chat .message-body { font-size: .95rem; line-height: 1.48; }
    #content .home-feature-chat .message-name { font-size: .87rem; }
    #content .home-feature-chat .chat-expand { justify-self: stretch; justify-content: end; }

    body.element-site.element-unified.page-home #content .home-feature-chat :is(.chat-login .button, .chat-expand) {
        max-inline-size: 100%;
        min-block-size: 44px;
        font-size: .84rem;
    }

    #content .home-feature-chat .chat-panel:has(.chat-form) .online-label { display: none; }
}

@media (max-width: 365px) {
    #content .unified-home-hero > .unified-home-intro { grid-template-columns: minmax(0, 1fr); }
    #content .unified-home-intro > .unified-home-hero-logo { grid-row: auto; margin-block-end: 9px; }
    #content .unified-home-intro > :is(h1, p, .unified-home-actions) { grid-column: 1; }
}

@media (forced-colors: active) {
    #content .home-crest-element:focus-visible::after { border-color: Highlight; }
    #content .home-feature-chat-haze { inset: 0; background: Canvas; mask-image: none; }
}
