/* =========================
   Basic
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        "Noto Sans TC",
        "Microsoft JhengHei",
        sans-serif;

    color: #2d2a24;

    background:
        radial-gradient(circle at 12% 18%,
            rgba(255, 214, 74, 0.22) 0 7px,
            transparent 8px),

        radial-gradient(circle at 88% 12%,
            rgba(129, 195, 255, 0.25) 0 10px,
            transparent 11px),

        radial-gradient(circle at 82% 75%,
            rgba(180, 156, 255, 0.18) 0 8px,
            transparent 9px),

        linear-gradient(
            135deg,
            #fff7cf 0%,
            #fffdf3 45%,
            #edf7ff 100%
        );
}


/* =========================
   Main Container
========================= */

.exchange-page {
    position: relative;

    width: min(1100px, calc(100% - 40px));
    margin: 40px auto;
    padding: 55px 50px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.97),
            rgba(255, 253, 245, 0.97)
        );

    border: 2px solid rgba(255, 210, 69, 0.35);
    border-radius: 30px;

    box-shadow:
        0 15px 40px rgba(102, 79, 12, 0.10);
}

.exchange-page::before {
    content: "✦";

    position: absolute;
    top: 35px;
    left: 45px;

    color: #ffd342;
    font-size: 32px;

    transform: rotate(-15deg);
}

.exchange-page::after {
    content: "✦";

    position: absolute;
    top: 85px;
    right: 55px;

    color: #9edcff;
    font-size: 24px;

    transform: rotate(18deg);
}

/* =========================
   Header
========================= */

.exchange-header {
    text-align: center;
    margin-bottom: 45px;
}

.english-title {
    margin: 0 0 12px;

    color: #c99300;

    font-size: 13px;
    font-weight: 800;

    letter-spacing: 4px;
}

.exchange-header h1 {
    display: inline-block;

    margin: 0;
    padding: 5px 35px;

    color: #302b1f;

    font-size: 38px;
    letter-spacing: 3px;

    background:
        linear-gradient(
            transparent 55%,
            #fff0a7 55%
        );
}

/* =========================
   Background Mascots
========================= */

.mascot {
    position: fixed;
    z-index: 0;

    width: 190px;

    pointer-events: none;
    user-select: none;
}

.mascot-left {
    top: 60px;
    left: -25px;

    transform: rotate(-8deg);
}

.mascot-right {
    right: -20px;
    bottom: -25px;

    transform: rotate(8deg);
}

.exchange-page {
    position: relative;
    z-index: 1;
}

.subtitle {
    margin-top: 16px;

    color: #817965;

    font-size: 15px;
}


/* =========================
   Toolbar
========================= */

.exchange-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid #eee3bc;
}

.category-tabs {
    display: flex;
    gap: 30px;
}

.exchange-tab {
    position: relative;

    padding: 14px 4px;

    border: 0;
    background: transparent;

    color: #5d5749;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.exchange-tab:hover {
    color: #c28a00;
}

.exchange-tab.active {
    color: #a87500;
}

.exchange-tab.active::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 3px;

    border-radius: 10px;

    background: #ffd95a;
}

.exchange-tabs {
    display: flex;
    gap: 30px;
}

/* =========================
   Toolbar Buttons
========================= */

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    padding-bottom: 8px;
}

.secondary-button,
.publish-button {
    padding: 10px 16px;

    border-radius: 10px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}

.secondary-button {
    border: 1px solid #e1d6ad;

    background: #ffffff;
    color: #625b49;
}

.secondary-button:hover {
    background: #fff8dc;
}

.publish-button {
    border: 1px solid #ffd95a;

    background: #ffd95a;
    color: #443500;
}

.publish-button:hover {
    background: #ffcf2f;
}


/* =========================
   Exchange List
========================= */

.exchange-list {
    margin-top: 28px;
}

.exchange-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 25px 5px;

    border-bottom: 1px solid #eee8d5;

    cursor: pointer;

    transition: 0.2s;
}

.exchange-item:hover {
    padding-left: 14px;

    background: #fffdf5;
}

.exchange-main h2 {
    margin: 0 0 14px;

    color: #332e23;

    font-size: 20px;
}

.exchange-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 12px;

    color: #817967;

    font-size: 14px;
}

.category-tag {
    padding: 5px 10px;

    border: 1px solid #f2d66e;
    border-radius: 8px;

    background: #fff8cf;

    color: #967000;

    font-weight: 700;
}

.publish-date {
    flex-shrink: 0;

    color: #938a76;

    font-size: 14px;
}
/* =========================
   Top Header
========================= */

.top-header {
    position: relative;
    z-index: 10;

    width: 100%;
    height: 90px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 55px;

    background:
        linear-gradient(
            90deg,
            #ffe89a 0%,
            #fff2b9 55%,
            #ffe694 100%
        );

    border-bottom: 1px solid rgba(213, 169, 38, 0.18);

    box-shadow:
        0 4px 18px rgba(116, 89, 16, 0.06);
}


/* =========================
   Brand
========================= */

.brand-area {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 16px;
}

.header-chimera {
    width: 105px;
    max-height: 115px;

    object-fit: contain;

    align-self: flex-end;

    /* 讓奇美拉稍微探出 Header */
    transform: translateY(12px);

    pointer-events: none;
    user-select: none;
}

.brand-text {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.brand-en {
    color: #a87500;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 2.5px;
}

.brand-name {
    color: #302a1e;

    font-size: 21px;
    font-weight: 800;

    letter-spacing: 1px;
}


/* =========================
   Header Actions
========================= */

.header-actions {
    display: flex;
    align-items: center;

    gap: 14px;
}

.header-rule-button,
.header-publish-button {
    height: 42px;

    border: 0;
    border-radius: 10px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s,
        background 0.2s;
}

.header-rule-button {
    padding: 0 18px;

    background: #3d3b37;
    color: #ffffff;
}

.header-publish-button {
    width: 70px;

    background: #ffd447;
    color: #382d00;

    font-size: 18px;
}

.header-rule-button:hover,
.header-publish-button:hover {
    transform: translateY(-2px);
}

.header-rule-button:hover {
    background: #292825;
}

.header-publish-button:hover {
    background: #ffc928;
}
/* =========================
   Modal
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(45, 40, 28, 0.35);
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}


/* =========================
   Publish Modal
========================= */

.publish-modal {
    position: relative;

    width: min(720px, calc(100% - 32px));
    max-height: 90vh;
    overflow-y: auto;

    padding: 38px 42px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffdf5 100%
        );

    border: 2px solid #f5dfa0;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(80, 61, 10, 0.18);
}


/* =========================
   Stars
========================= */

.modal-star {
    position: absolute;

    pointer-events: none;
}

.star-pink {
    top: 24px;
    left: 25px;

    color: #f4a6c8;

    font-size: 18px;

    transform: rotate(-15deg);
}

.star-blue {
    top: 80px;
    right: 35px;

    color: #8fcff3;

    font-size: 22px;

    transform: rotate(12deg);
}


/* =========================
   Modal Header
========================= */

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;
    padding-bottom: 22px;

    border-bottom: 1px solid #eee3bd;
}

.modal-en-title {
    margin: 0 0 5px;

    color: #c58b00;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 3px;
}

.modal-header h2 {
    margin: 0;

    color: #332d21;

    font-size: 26px;
}

.modal-header p:not(.modal-en-title) {
    margin: 8px 0 0;

    color: #8a816d;

    font-size: 13px;
}

.modal-close {
    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: #fff3bd;

    color: #6e5920;

    font-size: 22px;

    cursor: pointer;
}


/* =========================
   Form
========================= */

.form-row {
    display: flex;
    align-items: flex-start;

    gap: 18px;
}

.form-group {
    flex: 1;

    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #403a2e;

    font-size: 14px;
    font-weight: 700;
}

.required {
    color: #e7954e;
}

.optional {
    color: #a29a88;

    font-size: 12px;
    font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #ded7c5;
    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #403a2e;

    font-family: inherit;
    font-size: 14px;

    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #e9bd38;

    box-shadow:
        0 0 0 3px rgba(255, 215, 82, 0.18);
}

.form-group textarea {
    min-height: 90px;

    resize: vertical;
}

.form-group small {
    display: block;

    margin-top: 7px;

    color: #9a927f;

    font-size: 11px;
}


/* =========================
   Exchange Section
========================= */

.exchange-form-section {
    margin: 5px 0 20px;

    padding: 22px;

    background: #fffaf0;

    border: 1px solid #f2e2ad;
    border-radius: 16px;
}

.section-title {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 20px;
}

.section-title span {
    flex: 1;

    height: 1px;

    background: #eadcae;
}

.section-title h3 {
    margin: 0;

    color: #8d6900;

    font-size: 14px;
}

.exchange-arrow {
    align-self: center;

    margin-top: 25px;

    color: #d9a719;

    font-size: 24px;
}

/* 發布交換：左側多選區較寬、右側想要區較窄 */
.pet-exchange-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) 44px minmax(0, 2fr);
    align-items: start;
    gap: 12px;
}

.pet-exchange-row .owned-pets-group,
.pet-exchange-row .wanted-pet-group {
    width: 100%;
    min-width: 0;
}

.pet-exchange-row .exchange-arrow {
    width: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 55px;
}


/* =========================
   Pet Preview
========================= */

.pet-preview {
    min-height: 120px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    margin-top: 10px;

    border: 1px dashed #e1cf93;
    border-radius: 12px;

    background: #ffffff;
    
    color: #b1a78e;

    font-size: 12px;
}


/* =========================
   Buttons
========================= */

.form-actions {
    display: flex;
    justify-content: flex-end;

    gap: 12px;

    margin-top: 10px;
}

.cancel-button,
.submit-button {
    padding: 11px 22px;

    border-radius: 9px;

    font-family: inherit;
    font-weight: 700;

    cursor: pointer;
}

.cancel-button {
    border: 1px solid #ddd4bc;

    background: #ffffff;

    color: #6c6556;
}

.submit-button {
    border: 1px solid #ffd34c;

    background: #ffd95a;

    color: #463700;
}

.submit-button:hover {
    background: #ffcf2f;
}

.pet-preview-image {
    width: 110px;
    height: 110px;

    object-fit: contain;
}

.pet-preview-name {
    margin-top: 8px;

    color: #66542a;

    font-size: 13px;
    font-weight: 700;
}


/* =========================
   Exchange List
========================= */

.exchange-item {
    padding: 24px 4px;

    border-bottom: 1px solid #eee3bd;

    cursor: pointer;

    transition: 0.2s;
}

.exchange-item:hover {
    background: #fffaf0;
}


.exchange-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}


.exchange-item-content h3 {
    margin: 0 0 12px;

    color: #332d21;

    font-size: 18px;
}


.exchange-word {
    margin: 0 4px;

    color: #d49a00;
}


.exchange-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    color: #817865;

    font-size: 13px;
}


.exchange-tag {
    padding: 5px 10px;

    border: 1px solid #f1ce65;
    border-radius: 7px;

    background: #fff6d6;

    color: #9b7100;

    font-weight: 700;
}


.exchange-date {
    flex-shrink: 0;

    color: #9b927e;

    font-size: 13px;
}
/* =========================
   Exchange Detail Modal
========================= */

.exchange-detail-modal {
    position: relative;

    width: min(620px, calc(100% - 32px));
    max-height: 90vh;
    overflow-y: auto;

    padding: 36px 40px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffdf6 100%
        );

    border: 2px solid #f1d57a;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(80, 61, 10, 0.18);
}


.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 24px;
    padding-bottom: 20px;

    border-bottom: 1px solid #eee1b7;
}

.detail-header h2 {
    margin: 0;

    color: #332d21;

    font-size: 24px;
}


/* Player */

.detail-player {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 26px;
}

.detail-player > div {
    padding: 13px;

    background: #fff9e8;

    border: 1px solid #f0dda0;
    border-radius: 10px;
}

.detail-label {
    display: block;

    margin-bottom: 5px;

    color: #9b8d69;

    font-size: 11px;
}

.detail-player strong {
    color: #4c4434;

    font-size: 13px;
}


/* Pets */

.detail-pets {
    display: flex;
    align-items: flex-start;
    justify-content: center;

    gap: 24px;

    padding: 25px 20px;

    background: #fffaf0;

    border: 1px solid #efd686;
    border-radius: 16px;
}

.detail-pet {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 8px;
}

.detail-pet-label {
    color: #b18100;

    font-size: 12px;
    font-weight: 700;
}

.detail-pet-image-box {
    width: 150px;
    height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    border: 1px dashed #e6ca70;
    border-radius: 14px;
}

.detail-pet-image-box img {
    width: 140px;
    height: 140px;

    object-fit: contain;
}

.detail-pet strong {
    color: #544725;

    font-size: 14px;
}

.detail-exchange-arrow {
    align-self: center;

    color: #dca600;
    font-size: 28px;
}


/* Note */

.detail-section {
    margin-top: 22px;
    padding: 16px;

    background: #ffffff;

    border: 1px solid #eee1ba;
    border-radius: 12px;
}

.detail-section p {
    margin: 0;

    color: #5e5748;

    font-size: 13px;

    line-height: 1.8;

    white-space: pre-wrap;
}


/* Social */

.detail-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 20px;
}

.detail-social-button {
    display: inline-flex;
    align-items: center;

    padding: 11px 18px;

    border-radius: 9px;

    background: #ffd754;

    color: #4b3b00;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition: 0.2s;
}

.detail-social-button:hover {
    background: #ffcb28;

    transform: translateY(-2px);
}


/* Decorations */

.detail-star {
    position: absolute;

    pointer-events: none;
}

.detail-star-pink {
    top: 18px;
    left: 20px;

    color: #f3a6c7;
}

.detail-star-blue {
    right: 25px;
    bottom: 25px;

    color: #8fd1f3;
}


.filter-wrapper {
    position: relative;
}


.server-filter-menu {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 150px;

    padding: 8px;

    background: #ffffff;

    border: 1px solid #ead28a;
    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(90, 70, 20, 0.12);

    display: none;

    z-index: 20;
}


.server-filter-menu.show {
    display: block;
}


.server-filter-option {
    width: 100%;

    padding: 10px 12px;

    background: transparent;
    border: none;
    border-radius: 8px;

    color: #665b42;

    text-align: left;

    cursor: pointer;
}


.server-filter-option:hover,
.server-filter-option.active {
    background: #fff4c8;

    color: #a97500;

    font-weight: 700;
}
/* =========================
   Filter Button
========================= */

.filter-button {
    padding: 10px 16px;

    border: 1px solid #e1d6ad;
    border-radius: 10px;

    background: #ffffff;
    color: #625b49;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.filter-button:hover {
    background: #fff8dc;
    border-color: #e7c75f;

    transform: translateY(-1px);
}
.filter-button.active {
    background: #fff3bd;
    border-color: #e8c44e;
    color: #9a7000;
}
.exchange-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    width: 100%;
    gap: 24px;
}

.exchange-item-content {
    flex: 1;
    min-width: 0;
}

.exchange-date {
    flex-shrink: 0;

    margin-left: auto;
    padding-top: 4px;

    color: #9b927e;
    font-size: 13px;

    text-align: right;
}
/* =========================
   Exchange Rules Modal
========================= */

.rules-modal {
    position: relative;

    width: min(620px, calc(100% - 32px));
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;

    padding: 42px 48px 36px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffdf5 100%
        );

    border: 2px solid #f1d57a;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(80, 61, 10, 0.18);
}


/* =========================
   Header
========================= */

.rules-heading {
    text-align: center;

    margin-bottom: 28px;
    padding-bottom: 24px;

    border-bottom: 1px solid #eee1b7;
}

.rules-en {
    display: block;

    margin-bottom: 8px;

    color: #c28a00;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
}

.rules-heading h2 {
    display: inline-block;

    margin: 0;

    padding: 2px 18px;

    color: #332d21;

    font-size: 26px;

    background:
        linear-gradient(
            transparent 55%,
            #fff0a8 55%
        );
}

.rules-heading p {
    margin: 12px 0 0;

    color: #91866e;

    font-size: 13px;
}


/* =========================
   Rules
========================= */

.rules-list {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: flex-start;

    gap: 16px;

    padding: 16px 18px;

    background: #fffaf0;

    border: 1px solid #f0dda0;
    border-radius: 14px;

    transition: 0.2s;
}

.rule-item:hover {
    transform: translateY(-2px);

    background: #fff7dc;
}


/* 01 / 02 / 03 / 04 */

.rule-number {
    flex-shrink: 0;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffd95a;

    border-radius: 50%;

    color: #624900;

    font-size: 12px;
    font-weight: 800;
}


.rule-item strong {
    display: block;

    margin-bottom: 5px;

    color: #4e4533;

    font-size: 14px;
}


.rule-item p {
    margin: 0;

    color: #817865;

    font-size: 13px;
    line-height: 1.7;
}


/* =========================
   Warning
========================= */

.rules-warning {
    margin-top: 20px;
    padding: 12px 15px;

    background: #fff5f7;

    border: 1px solid #f3cad5;
    border-radius: 10px;

    color: #a56778;

    font-size: 12px;

    text-align: center;
}


/* =========================
   Confirm Button
========================= */

.rules-confirm {
    display: block;

    margin: 22px auto 0;

    padding: 11px 28px;

    border: 0;
    border-radius: 10px;

    background: #ffd754;

    color: #4b3b00;

    font-family: inherit;
    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition: 0.2s;
}

.rules-confirm:hover {
    background: #ffca28;

    transform: translateY(-2px);
}
.rules-chimera {
    position: absolute;

    z-index: 2;

    width: 120px;

    pointer-events: none;
    user-select: none;
}


/* 右上 */
.rules-chimera-top {
    top: -18px;
    right: -10px;

    transform: rotate(7deg);
}


/* 左下 */
.rules-chimera-bottom {
    left: -12px;
    bottom: -10px;

    transform: rotate(-8deg);
}
/* =========================
   Mobile Header + Toolbar
========================= */

/* Header 保證可以點擊 */
.top-header {
    position: relative;
    z-index: 100;
}

.header-actions {
    position: relative;
    z-index: 101;
}

.header-rule-button,
.header-publish-button {
    position: relative;
    z-index: 102;
    pointer-events: auto;
}
/* =========================
   Search Filter Modal
========================= */

.filter-modal {

    width: min(700px, calc(100% - 32px));


    padding: 38px 42px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffdf5 100%
        );

    border: 2px solid #f1d57a;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(80, 61, 10, 0.18);
}


/* =========================
   Filter Section
========================= */

.filter-section {
    margin-bottom: 22px;
}

.filter-section h3 {
    margin: 0 0 12px;

    color: #514733;

    font-size: 14px;
}


/* =========================
   Server Choice
========================= */

.filter-choice-row {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}

.filter-choice input {
    display: none;
}

.filter-choice span {
    display: inline-block;

    padding: 9px 15px;

    border: 1px solid #ded5bc;
    border-radius: 9px;

    background: #ffffff;
    color: #6b6251;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}

.filter-choice input:checked + span {
    background: #fff1b3;

    border-color: #e7bd36;

    color: #8b6700;
}

.filter-choice span:hover {
    background: #fff8dd;
}


/* =========================
   Type / Collection
========================= */

.filter-form-row {
    display: flex;

    gap: 18px;

    margin-bottom: 22px;
}

.filter-field {
    flex: 1;
}

.filter-field label,
.filter-pet-field label {
    display: block;

    margin-bottom: 8px;

    color: #403a2e;

    font-size: 14px;
    font-weight: 700;
}

.filter-field select,
.filter-pet-field select {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #ded7c5;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #403a2e;

    font-family: inherit;
    font-size: 14px;
}

.filter-field select:focus,
.filter-pet-field select:focus {
    border-color: #e9bd38;

    box-shadow:
        0 0 0 3px rgba(255, 215, 82, 0.18);
}


/* =========================
   Pet Filter
========================= */

.filter-exchange-section {
    padding: 22px;

    background: #fffaf0;

    border: 1px solid #f2e2ad;
    border-radius: 16px;
}

.filter-pet-row {
    display: flex;
    align-items: flex-start;

    gap: 18px;
}

.filter-pet-field {
    flex: 1;
}

.filter-exchange-arrow {
    align-self: center;

    margin-top: 45px;

    color: #d9a719;

    font-size: 24px;
}


/* =========================
   Filter Actions
========================= */

.filter-actions {
    display: flex;
    justify-content: flex-end;

    gap: 12px;

    margin-top: 24px;
}


/* =========================
   Mobile
========================= */

@media (max-width: 650px) {

     .publish-modal {
        padding: 32px 22px;
    }

    .form-row {
        flex-direction: column;

        gap: 0;
    }

    .form-group {
        width: 100%;
    }

    .exchange-arrow {
        margin: -5px auto 15px;

        transform: rotate(90deg);
    }

    .filter-modal {
        padding: 32px 22px;
    }

    .filter-form-row,
    .filter-pet-row {
        flex-direction: column;

        gap: 14px;
    }

    .filter-field,
    .filter-pet-field {
        width: 100%;
    }

    .filter-exchange-arrow {
        margin: 0 auto;

        transform: rotate(90deg);
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions button {
        flex: 1;
    }

    .pet-exchange-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pet-exchange-row .exchange-arrow {
        width: auto;
        margin: 0 auto 12px;

        transform: rotate(90deg);
    }
}
/* =========================
   Filter Chimera Decoration
========================= */
.filter-chimera {
    position: absolute;
    z-index: 2;

    object-fit: contain;

    pointer-events: none;
    user-select: none;
}

/* 右上角 */
.filter-chimera-top {
    width: 150px;

    top: 35px;
    right: 95px;
}

/* 左下角 */
.filter-chimera-bottom {
    width: 150px;

    left: -15px;
    bottom: -15px;
}
/* =========================
   Message Modal
========================= */

.message-modal {
    position: relative;

    width: min(460px, calc(100% - 40px));

    padding: 38px 36px 30px;

    background: #fffdf8;

    border: 1px solid #f0d48b;
    border-radius: 24px;

    text-align: center;

    box-shadow:
        0 18px 45px rgba(80, 60, 20, 0.12);

    overflow: visible;
}


/* 警告內容 */
.message-content {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 18px;

    margin-bottom: 26px;
}


/* 驚嘆號 */
.message-modal-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    border-radius: 50%;

    background: #fff0b8;

    color: #b88400;

    font-size: 28px;
    font-weight: 700;
}


/* 文字區 */
.message-text-area {
    text-align: left;
}

.message-text-area h2 {
    margin: 0 0 7px;

    font-size: 21px;
    color: #3f382d;
}

.message-text-area p {
    margin: 0;

    color: #807567;
    line-height: 1.7;
}


/* 警告旁邊的奇美拉 */
.message-chimera {
    position: absolute;

    width: 115px;

    right: -35px;
    top: -55px;

    object-fit: contain;

    pointer-events: none;
    user-select: none;
}

/* =========================
   Filter Modal - Final
========================= */

#filterModal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(45, 40, 28, 0.35);
    backdrop-filter: blur(4px);
}

#filterModal.show {
    display: flex;
}

.filter-modal {
    position: relative;

    width: min(700px, calc(100% - 32px));
    max-height: 88vh;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 38px 42px;

    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #fffdf5 100%
    );

    border: 2px solid #f1d57a;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(80, 61, 10, 0.18);
}
/* =========================
   Pagination
========================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;

    margin-top: 32px;
}

.page-button {
    padding: 9px 16px;

    border: 1px solid #e1d6ad;
    border-radius: 9px;

    background: #ffffff;
    color: #625b49;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.page-button:hover:not(:disabled) {
    background: #fff4c8;
    border-color: #e7c75f;
}

.page-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.page-info {
    color: #817865;

    font-size: 13px;
    font-weight: 700;
}
/* =========================
   多選萌寵
========================= */

.pet-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.multi-pet-button {
    border: 1px solid #e6c96e;
    background: #fff8df;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.multi-pet-modal-content {
    position: relative;

    width: min(560px, 100%);
    max-height: 85vh;
    overflow-y: auto;

    padding: 28px;
    box-sizing: border-box;

    background: #fffdf7;
    border: 1px solid #ead7a1;
    border-radius: 20px;

    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.multi-pet-header {
    margin-bottom: 22px;
}

.multi-pet-header h2 {
    margin: 4px 0 6px;
}

.multi-pet-header p {
    margin: 0;
}

.multi-pet-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.multi-pet-filter-group > span {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.multi-pet-filter-buttons {
    display: flex;
    gap: 8px;
}

.multi-filter {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid #ead7a1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.multi-filter.active {
    background: #fff2b8;
    border-color: #e7b928;
    font-weight: 700;
}

.multi-pet-count {
    margin-bottom: 12px;
    text-align: right;
    font-size: 14px;
}

.multi-pet-grid {
    min-height: 180px;
    border: 1px dashed #e4c975;
    border-radius: 14px;
    padding: 16px;
}

.multi-pet-placeholder {
    text-align: center;
    margin: 60px 0;
}

.multi-pet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}


/* 多選萌寵 Modal 背景 */
#multiPetModal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.35);
}

/* 開啟多選 Modal */
#multiPetModal.show {
    display: flex;
}

.owned-pet-placeholder {
    grid-column: 1 / -1;

    min-height: 170px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: #b5a98e;
    font-size: 14px;
    line-height: 1.7;
}
/* =========================
   持有萌寵圖片選擇區
========================= */

.multi-pet-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
    padding: 14px;

    border: 1px dashed #e9bd55;
    border-radius: 18px;

    box-sizing: border-box;
}


/* 卡片不要再固定 110px */
.multi-pet-card {
    position: relative;

    width: 100%;
    min-width: 0;
    min-height: 120px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;
    padding: 9px 5px;

    box-sizing: border-box;

    background: #fffdf8;

    border: 1px solid #e8c978;
    border-radius: 15px;

    cursor: pointer;
}


/* 圖片也稍微縮小 */
.multi-pet-card img {
    width: 72px;
    height: 72px;

    display: block;
    flex-shrink: 0;

    object-fit: cover;
    border-radius: 7px;
}


.multi-pet-card-name {
    width: 100%;

    text-align: center;

    font-size: 13px;
    line-height: 1.35;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* 所有圖片統一尺寸 */
.multi-pet-card img {
    width: 88px;
    height: 88px;

    display: block;
    flex-shrink: 0;

    object-fit: cover;

    border-radius: 8px;
}


/* 所有名字統一 */
.multi-pet-card-name {
    width: 100%;

    text-align: center;

    font-size: 14px;
    line-height: 1.4;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-pet-card {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 10px 6px;

    background: #fffdf8;

    border: 1px solid #e8c978;
    border-radius: 14px;

    cursor: pointer;
}

.multi-pet-card img {
    width: 64px;
    height: 64px;

    object-fit: cover;
    border-radius: 8px;
}

.multi-pet-card img {
    display: block;

    width: 100%;
    aspect-ratio: 1 / 1;

    object-fit: contain;
    border-radius: 8px;
}

.multi-pet-card-name {
    width: 100%;

    font-size: 12px;
    text-align: center;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* 被選中的卡片 */
.multi-pet-card.selected {
    background: #fff5c9;
    border-color: #e8b522;
}


/* 右上角 ✓ */
.multi-pet-check {
    position: absolute;

    top: 5px;
    right: 5px;

    display: none;

    width: 21px;
    height: 21px;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f2bd24;
    font-size: 13px;
    font-weight: 800;
}


/* 只有選中才出現 */
.multi-pet-card.selected .multi-pet-check {
    display: flex;
}

.multi-pet-confirm-button {
    min-width: 110px;
    padding: 12px 20px;

    border: 1px solid #e8b522;
    border-radius: 12px;

    background: #fff0ad;

    color: #3c321e;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.multi-pet-confirm-button:hover {
    background: #ffe483;
    transform: translateY(-1px);
}
.pet-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pet-label-row label {
    margin-bottom: 0;
}


/* 手機 */
@media (max-width: 600px) {

    .update-log-chimera {
        width: 90px;
        height: 90px;

        top: 18px;
        left: 14px;
    }

    .update-log-close {
        top: 16px;
        right: 16px;
    }

    .header-update-button {
        padding: 10px 12px;

        font-size: 12px;
    }

    .update-log-modal {
        padding:
            34px
            22px
            26px;
    }

    .update-contact {
        align-items: stretch;
        flex-direction: column;
    }

    .update-contact-button {
        justify-content: center;

        display: flex;
    }

    .multi-pet-filters {
        grid-template-columns: 1fr;
    }

    #filterModal {
        padding: 8px;
    }

    .filter-modal {
        width: calc(100% - 8px);
        max-height: calc(100dvh - 16px);

        padding: 32px 22px;
    
    }
     .detail-player {
        grid-template-columns: 1fr;
    }

    .detail-pets {
        flex-direction: column;
    }

    .detail-exchange-arrow {
        transform: rotate(90deg);
    }

    /* ===== Header ===== */

    .top-header {
         height: 70px;
        padding: 0 8px;

        gap: 5px;
    }

    .brand-area {
        flex: 1;
        min-width: 0;

        gap: 4px;
    }

    .header-chimera {
        width: 52px;
        max-height: 68px;

        flex-shrink: 0;

        transform: translateY(5px);
    }

    .brand-text {
        min-width: 0;

        gap: 0;
    }

    .brand-en {
        font-size: 6px;
        letter-spacing: 1px;

        white-space: nowrap;
    }

    .brand-name {
        font-size: 14px;
        letter-spacing: 0;

        white-space: nowrap;
    }


/* ===== Header Buttons ===== */

    .header-actions {
        display: flex;

        gap: 4px;

        flex-shrink: 0;
    }

    .header-rule-button,
    .header-publish-button {
        height: 36px;

        padding: 0 8px;

        font-size: 10px;

        white-space: nowrap;

        flex-shrink: 0;
    }

    .header-publish-button {
        min-width: 48px;
    }

    


    /* ===== Main Card ===== */

    .exchange-player {
        margin-top: 8px;
        font-size: 13px;
    }

    .exchange-page {
        width: 100%;
        max-width: none;

        margin: 0;

        padding: 36px 22px 26px;

        border-left: none;
        border-right: none;
        border-radius: 0;

        box-sizing: border-box;
    }


    /* ===== Main Title ===== */

    .exchange-header {
        margin-bottom: 45px;
    }

    .english-title {
        font-size: 10px;
        letter-spacing: 3px;

        white-space: nowrap;
    }

    .exchange-header h1 {
        padding: 4px 25px;

        font-size: 32px;
    }

    .subtitle {
        font-size: 13px;
    }


    /* ===== Tabs + Filter ===== */

    .exchange-toolbar {
        display: flex;
        flex-wrap: wrap;

        align-items: center;

        gap: 6px;

        width: 100%;
    }

    .exchange-tabs {
        display: flex;
        align-items: center;

        gap: 14px;

        width: 100%;

        flex: none;
    }

    .exchange-tab {
        padding: 11px 0;

        font-size: 12px;

        white-space: nowrap;
        word-break: keep-all;

        flex-shrink: 0;
    }
    .exchange-player {
        margin-top: 10px;

        font-size: 14px;
        color: #8b8172;

        line-height: 1.6;
    }

    .filter-wrapper {
        width: 100%;

        display: flex;
        justify-content: flex-end;
    }

    .filter-button {
        padding: 9px 10px;

        font-size: 12px;

        white-space: nowrap;
    }

    .filter-chimera-top {
        width: 100px;
        right: 65px;
        top: 45px;
    }

    .filter-chimera-bottom {
        width: 100px;
        left: -10px;
        bottom: -10px;
    }

    .message-modal {
        padding: 32px 24px 26px;
    }

    .message-chimera {
        width: 85px;
        right: -15px;
        top: -45px;
    }

    .multi-pet-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}    /* 手機：持有萌寵改成兩個一排 */
    .multi-pet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;

        padding: 10px;
    }

    .multi-pet-card {
        width: 100%;
        min-width: 0;
        min-height: 105px;

        padding: 8px 4px;
    }

    .multi-pet-card img {
        width: 58px;
        height: 58px;
    }

    .multi-pet-card-name {
        font-size: 12px;
    }
    .exchange-multi-hint {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #a09682;
    white-space: nowrap;
}
/* =========================
   Detail Owned Pets Grid
   ========================= */

.detail-owned-grid {
    width: 200px;
    height: 160px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);

    overflow: hidden;

    border: 1px dashed #e7bd5c;
    border-radius: 12px;

    background: #fffaf0;
}

.detail-owned-grid-cell {
    min-width: 0;
    min-height: 0;

    overflow: hidden;
}

/* 中間分隔線 */
.detail-owned-grid-cell:nth-child(1),
.detail-owned-grid-cell:nth-child(3) {
    border-right: 1px solid #ead7a5;
}

.detail-owned-grid-cell:nth-child(1),
.detail-owned-grid-cell:nth-child(2) {
    border-bottom: 1px solid #ead7a5;
}

/* 每張萌寵圖片塞進自己的格子 */
.detail-owned-grid-cell img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}
#detailOwnedName {
    max-width: 260px;

    margin-top: 14px;

    text-align: center;
    line-height: 1.7;

    font-size: 14px;
}
.detail-owned-grid {
    margin-top: 0px;
}

.detail-owned,
.detail-wanted {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
/* Detail 左右萌寵對齊 */
.detail-pet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* 「我有 / 我想要」標題高度固定 */
.detail-pet-label {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;
    margin-bottom: 10px;
}
/* =========================
   Update Log Button
========================= */

.header-update-button {
    position: relative;

    padding: 10px 10px;

    border: 2px solid #2f2b25;
    border-radius: 12px;

    background: #fffaf0;
    color: #3c352b;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.header-update-button:hover {
    transform: translateY(-2px);

    background: #fff3c4;

    box-shadow:
        0 5px 14px rgba(80, 65, 30, 0.12);
}


/* 新更新小黃點 */

.update-new-dot {
    position: absolute;

    top: -5px;
    right: -5px;

    width: 11px;
    height: 11px;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #ffbd22;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.15);
}


/* =========================
   Update Log Modal
========================= */

.update-log-modal {
    position: relative;

    width: min(560px, calc(100vw - 32px));
    max-height: 82vh;

    padding: 38px 42px 32px;

    overflow-y: auto;

    border-radius: 28px;

    background: #fffdf8;

    box-shadow:
        0 22px 60px rgba(67, 55, 28, 0.18);

    border: 1px solid #f1d98d;
}


/* =========================
   Decoration
========================= */

.update-star {
    position: absolute;

    pointer-events: none;
}

.update-star-yellow {
    top: 28px;
    left: 30px;

    color: #ffc433;

    font-size: 24px;
}

.update-star-blue {
    right: 70px;
    top: 95px;

    color: #8ed5f7;

    font-size: 15px;
}


/* =========================
   Heading
========================= */

.update-log-heading {
    text-align: center;

    margin-bottom: 30px;
}

.update-log-en {
    display: block;

    margin-bottom: 8px;

    color: #c78a00;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 3px;
}

.update-log-heading h2 {
    margin: 0 0 8px;

    color: #332e26;

    font-size: 28px;
}

.update-log-heading p {
    margin: 0;

    color: #918675;

    font-size: 14px;
}


/* =========================
   Update List
========================= */

.update-log-list {
    position: relative;

    display: flex;
    flex-direction: column;

    gap: 24px;

    padding-left: 8px;
}

.update-log-item {
    position: relative;

    padding: 20px 22px;

    border: 1px solid #f1dfaa;
    border-radius: 18px;

    background: #fffaf0;
}

.update-log-date {
    display: flex;
    align-items: center;

    gap: 9px;

    margin-bottom: 12px;

    color: #6c5730;

    font-weight: 800;
}

.update-log-dot {
    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #ffc536;
}

.update-latest-tag {
    padding: 3px 7px;

    border-radius: 999px;

    background: #ffd65d;

    color: #66501c;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1px;
}

.update-log-item ul {
    margin: 0;

    padding-left: 22px;

    color: #655d50;

    line-height: 1.9;

    font-size: 14px;
}

.update-log-item li::marker {
    color: #e5a91e;
}


/* =========================
   Contact
========================= */

.update-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-top: 30px;
    padding-top: 22px;

    border-top: 1px solid #ead9aa;
}

.update-contact-text {
    display: flex;
    flex-direction: column;

    gap: 3px;

    color: #6d6354;

    font-size: 13px;
}

.update-contact-text strong {
    color: #39332b;

    font-size: 14px;
}

.update-contact-button {
    flex-shrink: 0;

    padding: 10px 17px;

    border-radius: 12px;

    background: #35322d;

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.update-contact-button:hover {
    transform: translateY(-2px);

    background: #d39a18;
}
/* 更新日誌關閉按鈕 */
.update-log-close {
    position: absolute;

    top: 20px;
    right: 22px;
    left: auto;

    z-index: 10;
}
/* =========================
   Update Log Chimera
========================= */

.update-log-chimera {
    position: absolute;

    top: 18px;
    left: 22px;

    width: 125px;
    height: 125px;

    object-fit: contain;

    z-index: 2;

    pointer-events: none;
}
