#inventory-pokemon-content {
    width: 800px;
    position: absolute;
    top: 25px;
    left: max(50%, 720px);
    transform: translateX(-50%);
    background: #F0EEE9d9;
    border-radius: 10px;
    font-size: 1rem;
    padding: 20px;
    box-sizing: border-box;
    min-height: 650px;
}

.inv-title {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 8px 0;
    margin-bottom: 30px;
}

.pokemon-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 240px);
    gap: 20px;
    width: 100%;
    justify-content: start;
    align-content: start;
    min-height: 350px;
}

.pokemon-card {
    position: relative;
    width: 240px;
    height: 100px;
    background: #E7ECF2;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    padding: 8px;
    gap: 8px;
}
/* 모습(일반/샤이니/다크)별 카드 배경색 — 살짝만 다르게, 정보 구분용이라
   시선을 크게 끌지 않는 톤으로 정함. form-0(일반)은 기존 배경색 그대로. */
.pokemon-card.form-1 {
    background: #F1EAD0;
    border-color: #E6D8A8;
}
.pokemon-card.form-2 {
    background: #EDE3F5;
    border-color: #CBB8DE;
}
.pokemon-card:hover {
    outline: 2px solid #4444ff;
}

.pokemon-card .card-left {
    flex: 0 0 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
}
.pokemon-card .sprite {
    width: 60px;
    height: 60px;
    margin-top: 0px;
    image-rendering: pixelated;
}
.pokemon-card .name {
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    margin-top: 0;
}
.pokemon-card .level {
    font-size: 0.8rem;
    color: #000;
}

.pokemon-card .card-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}
.pokemon-card .nickname-row {
    font-size: 0.7rem;
    font-weight: bold;
    color: #000;
    padding-bottom: 1px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pokemon-card .nickname-row .nickname-value {
    font-weight: normal;
    color: #000;
}
.pokemon-card .move-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, auto);
    min-height: 35px;
    gap: 1px 6px;
    width: calc(100% - 5px);
    border-top: 1px solid #C7D2DE;
    border-bottom: 1px solid #C7D2DE;
    padding: 3px 0;
}
.pokemon-card .move-cell {
    font-size: 0.7rem;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}
.pokemon-card .card-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 3px;
}
.pokemon-card .card-action-link {
    position: static;
    width: auto;
    height: auto;
    bottom: auto;
    right: auto;
    display: block;
    flex: 1 1 0;
    text-align: left;
    font-size: 0.7rem;
    color: #4444ff;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
    white-space: nowrap;
    /* 버튼 박스 자체는 배치(균등 분할)만 담당하고 클릭은 받지 않습니다.
       실제 클릭은 안의 .link-text(텍스트 크기만큼)에서만 반응하도록
       분리합니다 — 박스가 넓어도 글자 밖 여백은 클릭되지 않게 하기 위함. */
    pointer-events: none;
}
.pokemon-card .card-action-link .link-text {
    pointer-events: auto;
    cursor: pointer;
}
.pokemon-card .card-action-link .link-text:hover {
    text-decoration: underline;
}
.pokemon-card .card-action-link:nth-child(2) {
    padding-left: 1px;
}
.pokemon-card .status-icon {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 14px;
    height: 14px;
    image-rendering: pixelated;
}

.pagination {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination button {
    position: static;
    min-width: 32px;
    width: auto;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #C7D2DE;
    background: #F0EEE9;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.pagination button:hover {
    background: #E7ECF2;
}

.pagination button.active {
    background: #4444ff;
    border-color: #4444ff;
    color: #fff;
    font-weight: bold;
    cursor: default;
}

.pagination button:disabled {
    color: #aaa;
    cursor: default;
    background: #F0EEE9;
}

.pokemon-toolbar {
    position: absolute;
    top: 60px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

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

.sort-button {
    position: static;
    width: auto;
    height: auto;
    padding: 4px 2px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-family: inherit;
    color: #000;
    cursor: pointer;
}
.sort-button:hover {
    text-decoration: underline;
}
.sort-button.active {
    font-weight: bold;
    color: #000;
}

.filter-wrap {
    position: relative;
}

.filter-button {
    position: static;
    width: auto;
    height: auto;
    padding: 6px 14px 4px;
    border: 1px solid #C7D2DE;
    background: #E7ECF2;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}
.filter-button:hover {
    background: #DCE4EE;
}

.filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    display: grid;
    grid-template-columns: 110px 110px;
    gap: 8px 0px;
    z-index: 10;
    box-sizing: border-box
}

.filter-panel label {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
    white-space: nowrap;
    cursor: pointer;
}
.filter-panel label span {
    display: inline-block;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 0;
}
.filter-panel label input {
    flex: 0 0 auto;
    height: 14px;
}

.filter-panel label.filter-all {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 110px 110px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid #C7D2DE;
    align-items: center;
    width: calc(100% - 45px);
}

.filter-panel label.filter-all span {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 2px;
}

.filter-panel label.filter-all input {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin-left: auto;
    transform: translateX(2px);
}

.nickname-popup {
    position: absolute;
    bottom: 30px;
    left: 65%;
    transform: translateX(-50%);
    width: 160px;
    background: #ffffff;
    border: 1px solid #C7D2DE;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
    box-sizing: border-box;
}
.nickname-input {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid #C7D2DE;
    border-radius: 4px;
    margin-bottom: 10px;
}
/* 모달 확인 실패 시 에러 문구는 base.css의 .modal-error 공용 스타일을 씁니다. */
.nickname-popup-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}
.nickname-popup-actions button {
    position: static;
    width: auto;
    height: auto;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid #C7D2DE;
    border-radius: 4px;
    background: #E7ECF2;
    cursor: pointer;
}
.nickname-popup-actions button:hover {
    background: #DCE4EE;
}
.nickname-popup-actions button:first-child {
    background: #4444ff;
    border-color: #4444ff;
    color: #fff;
}
.nickname-popup-actions button:first-child:hover {
    background: #3333cc;
}

.trade-confirm-popup {
    width: 170px;
}
.trade-confirm-message {
    font-size: 0.8rem;
    color: #000;
    line-height: 1.4;
    text-align: center;
}
/* 확인 팝업의 보조 버튼(취소)을 강조색과 구분되는 회색으로 표시 */
.modal-secondary {
    background: #E7ECF2 !important;
    border-color: #C7D2DE !important;
    color: #000 !important;
}
.modal-secondary:hover {
    background: #DCE4EE !important;
}
.modal-actions {
    gap: 10px;
}