.page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-wrapper {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.app {
    position: relative;
    width: 100%;
    min-height: 860px;
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        radial-gradient(circle at 50% 30%, rgba(145, 88, 255, 0.13), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        rgba(6, 4, 12, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow);
}

.app::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.18) 78%, rgba(0, 0, 0, 0.5) 100%);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 8px;
    position: relative;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
}

.brand__logo {
    height: 60px;
    width: auto;
    display: block;
}

.header__right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chip {
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(141, 76, 255, 0.18), rgba(141, 76, 255, 0.05));
    border: 1px solid rgba(185, 124, 255, 0.25);
    color: var(--text);
    font-size: 14px;
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 12px rgba(141, 76, 255, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.04);
}

.layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 340px minmax(320px, 1fr) 300px;
    gap: 18px;
    padding: 12px 24px 92px;
    align-items: center;
}

.panel {
    background: rgba(18, 10, 28, 0.72);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(24px, 2.4vw, 36px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    max-width: 8ch;
}

.desc {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

button {
    appearance: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    font-family: inherit;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.75;
    cursor: default;
}

.btn-main {
    padding: 15px 18px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #6d2df2);
    box-shadow: 0 12px 30px rgba(125, 57, 246, 0.38);
}

.btn-copy {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.scene {
    position: relative;
    min-height: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(780px, 100%);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 76, 255, 0.22) 0%, rgba(126, 76, 255, 0.1) 38%, rgba(126, 76, 255, 0.04) 56%, transparent 72%);
    filter: blur(34px);
    z-index: 0;
    pointer-events: none;
}

.portal {
    position: relative;
    width: min(100%, 760px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(177, 119, 255, 0.18);
    background: radial-gradient(circle at center, rgba(88, 44, 160, 0.18), rgba(12, 6, 20, 0.1));
    box-shadow:
        0 0 35px rgba(126, 76, 255, 0.14),
        0 0 80px rgba(126, 76, 255, 0.1),
        inset 0 0 25px rgba(255, 255, 255, 0.02);
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.portal::before {
    content: "";
    position: absolute;
    inset: -10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140, 80, 255, 0.22) 0%, rgba(140, 80, 255, 0.08) 40%, transparent 70%);
    filter: blur(28px);
    z-index: 0;
    pointer-events: none;
}

.portal:hover {
    box-shadow:
        0 0 45px rgba(126, 76, 255, 0.2),
        0 0 100px rgba(126, 76, 255, 0.14),
        inset 0 0 30px rgba(255, 255, 255, 0.03);
}

.portal:active {
    transform: scale(0.995);
}

.portal::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, transparent 62%, rgba(0, 0, 0, 0.18) 82%, rgba(0, 0, 0, 0.34) 100%);
    z-index: 4;
}

.cat-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.speech {
    position: absolute;
    left: 50%;
    top: 3%;
    transform: translateX(-50%) translateY(-10px);
    width: min(72%, 420px);
    max-width: calc(100% - 28px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    z-index: 7;
    pointer-events: none;
}

.speech.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.speech__inner {
    position: relative;
    padding: 16px 18px;
    border-radius: 20px;
    text-align: center;
    font-size: 15px;
    line-height: 1.45;
    color: #fff7ff;
    background: linear-gradient(180deg, rgba(34, 20, 52, 0.94), rgba(20, 12, 34, 0.97));
    border: 1px solid rgba(227, 190, 255, 0.18);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.35),
        0 0 22px rgba(162, 96, 255, 0.18);
    backdrop-filter: blur(12px);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.12);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
}

.speech__inner::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%) rotate(45deg);
    width: 18px;
    height: 18px;
    background: rgba(23, 13, 37, 0.97);
    border-right: 1px solid rgba(227, 190, 255, 0.18);
    border-bottom: 1px solid rgba(227, 190, 255, 0.18);
    box-shadow: 6px 6px 16px rgba(0, 0, 0, 0.16);
}

.ball-fire {
    position: absolute;
    left: calc(50% + 3px);
    top: 61%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    filter: blur(0.5px);
}

.ball-fire.active {
    opacity: 1;
    animation: firePulse 0.9s ease-in-out infinite;
}

.ball-fire::before,
.ball-fire::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.ball-fire::before {
    background: radial-gradient(circle, rgba(255, 230, 170, 0.96) 0%, rgba(216, 148, 255, 0.82) 34%, rgba(130, 60, 255, 0.14) 74%, transparent 100%);
    box-shadow:
        0 0 18px rgba(255, 210, 120, 0.55),
        0 0 36px rgba(169, 95, 255, 0.42);
}

.ball-fire::after {
    inset: 8px;
    background: radial-gradient(circle, rgba(255, 250, 245, 0.94) 0%, rgba(255, 219, 158, 0.76) 36%, rgba(190, 105, 255, 0.15) 82%, transparent 100%);
    filter: blur(2px);
}

@keyframes firePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.92);
        filter: blur(0.5px);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.18);
        filter: blur(1.4px);
    }
}

.modes {
    display: grid;
    gap: 10px;
}

.mode-btn {
    width: 100%;
    text-align: left;
    padding: 14px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.mode-btn.active {
    background: rgba(141, 76, 255, 0.16);
    border-color: rgba(199, 149, 255, 0.3);
    box-shadow: 0 0 0 1px rgba(199, 149, 255, 0.08) inset;
}

.mode-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.mode-desc {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.sound-toggle {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: auto;
}

.sound-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    pointer-events: auto;
}

.label-left,
.label-right {
    opacity: 0.6;
    transition: 0.2s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex: 0 0 auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    transition: 0.2s;
    cursor: pointer;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked+.slider {
    background: var(--accent);
}

.switch input:checked+.slider::before {
    transform: translateX(20px);
}

.privacy-link {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    opacity: 0.75;
    transition: 0.2s;
    pointer-events: auto;
}

.privacy-link:hover {
    opacity: 1;
    color: var(--text);
}

.notice-box {
    width: fit-content;
    max-width: 90%;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
}

.notice-box.show {
    opacity: 1;
    transform: translateY(0);
}

.notice-box__inner {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(18, 10, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    color: var(--muted);
    max-width: 100%;
}

.notice-box__inner span {
    white-space: normal;
}

.notice-box__inner a {
    color: var(--accent);
    text-decoration: none;
}

.notice-box__inner a:hover {
    color: var(--text);
}

.notice-box__inner button {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.site-footer {
    width: 100%;
    max-width: 1120px;
    margin: 4px auto 0;
    text-align: center;
    font-size: 12px;
    opacity: 0.65;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text);
    opacity: 1;
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .scene {
        min-height: 620px;
        order: 2;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 12px;
    }

    .app {
        min-height: auto;
        border-radius: 26px;
    }

    .header {
        padding: 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .brand {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .brand__logo,
    .brand img {
        display: block;
        max-width: 180px;
        width: auto;
        height: auto;
    }

    .header__right {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .chip {
        width: 100%;
        min-height: 44px;
        padding: 12px 14px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 13px;
        line-height: 1.3;
    }

    .layout {
        padding: 8px 16px 82px;
        gap: 14px;
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    h1 {
        margin: 0 0 14px;
        font-size: clamp(22px, 6vw, 30px);
        line-height: 1.08;
        letter-spacing: -0.02em;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .scene {
        min-height: 430px;
        padding-top: 42px;
        order: 2;
    }

    .speech {
        top: 0;
        width: 88%;
        max-width: calc(100% - 20px);
    }

    .speech__inner {
        font-size: 14px;
        padding: 14px;
        border-radius: 18px;
    }

    .ball-fire {
        width: 32px;
        height: 32px;
        top: 61.5%;
    }

    .sound-toggle {
        left: 16px;
        right: 16px;
        bottom: 16px;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .sound-switch {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        flex-wrap: wrap;
    }

    .privacy-link {
        font-size: 12px;
        white-space: nowrap;
    }

    .notice-box {
        width: 100%;
        max-width: 100%;
    }

    .notice-box__inner {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .notice-box__inner button {
        align-self: flex-end;
    }
}