*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: #595461;
    background: linear-gradient(180deg, #FFCAD6 0%, #E3FFF9 100%);
}

.page-keyword {
    min-height: 100vh;
    min-height: 1024px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 24px 56px;
    display: flex;
    flex-direction: column;
}

.keyword-header,
.bubble-wall,
.keyword-form-panel {
    width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.keyword-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}

.keyword-back {
    width: fit-content;
    color: #ED688D;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
}

.keyword-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.keyword-title-icon {
    width: 58px;
    height: 58px;
}

.keyword-title {
    margin: 0;
    font-size: clamp(34px, 3.2vw, 46px);
    color: #ED688D;
}

.keyword-subtitle {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 500;
    color: #757575;
}

.bubble-wall {
    position: relative;
    min-height: 420px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    flex: 1 1 auto;
}

.bubble-item {
    position: absolute;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: bubbleBreath 2.4s ease-in-out infinite;
    color: #fff;
    touch-action: none;
    user-select: none;
}

.bubble-item:hover {
    transform: scale(1.05);
}

.bubble-item--boy {
    background: #A5E1D4;
    box-shadow: 0 14px 28px rgba(77, 163, 159, 0.28);
}

.bubble-item--girl {
    background: #FFCAD6;
    box-shadow: 0 14px 28px rgba(237, 104, 141, 0.2);
}

.bubble-text {
    max-width: 70%;
    word-break: break-word;
}

.keyword-form-panel {
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 24px rgba(148, 124, 137, 0.1);
    position: sticky;
    bottom: 16px;
    z-index: 10;
}

.keyword-form-title {
    margin: 0 0 12px;
    font-size: 24px;
    color: #ED688D;
}

.keyword-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 110px;
    gap: 10px;
}

.keyword-input,
.keyword-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(237, 104, 141, 0.2);
    border-radius: 12px;
    font: inherit;
    color: #544e59;
    background: #fff;
    outline: none;
}

.keyword-submit {
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    color: #4DA39F;
    background: #A5E1D4;
    cursor: pointer;
}

.keyword-tip {
    margin: 10px 0 0;
    color: #757575;
}

@keyframes bubbleBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); }
}

@media (max-width: 900px) {
    .keyword-subtitle {
        font-size: 16px;
    }

    .bubble-wall {
        min-height: 360px;
    }

    .bubble-item {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .page-keyword {
        padding: 20px 16px 40px;
    }

    .keyword-form {
        grid-template-columns: 1fr;
    }
}
