.tier-container {
    max-width: 1200px;
}

.tier-intro {
    margin-bottom: 1rem;
}

.tool-description--highlight {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-weight: 500;
    color: #92400e;
}

.tool-description--highlight i {
    color: #f59e0b;
    margin-right: 0.3rem;
}

.tool-description--highlight strong {
    color: #b45309;
    text-decoration: underline;
    text-decoration-color: #fbbf24;
    text-underline-offset: 2px;
}

.tier-controls {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tier-controls .tag-btn {
    min-height: 42px;
    border-width: 1.5px;
    border-radius: 12px;
    padding: 0.55rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.tier-title-control {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.tier-title-control label {
    font-size: 0.92rem;
    color: var(--text-color);
    font-weight: 600;
}

.tier-title-input {
    width: min(420px, 62vw);
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    color: var(--text-color);
    background: #fff;
}

.tier-title-input:focus {
    outline: none;
    border-color: var(--teal-mid);
    box-shadow: 0 0 0 2px rgba(67, 180, 170, 0.15);
}

.tier-controls .tag-btn.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

#shareOnTwitter {
    justify-content: center;
    text-align: center;
    gap: 0;
}

.tier-capture-area {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: white;
    border-radius: 14px;
    overflow: visible;
    box-shadow: var(--shadow);
    border: 0;
    padding: 0.85rem 0.85rem 0.4rem;
    margin-bottom: 1.5rem;
}

.tier-capture-area.is-exporting-capture {
    padding: 16px;
    width: fit-content;
    max-width: none;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: 0;
    gap: 0.6rem;
}

.tier-capture-title {
    margin: 0;
    text-align: center;
    font-size: 1.45rem;
    line-height: 1.25;
    color: var(--text-color);
    font-weight: 700;
    white-space: pre-wrap;
    word-break: break-word;
}

.tier-capture-area.is-exporting-capture .tier-capture-title {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.tier-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.tier-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    background: transparent;
    border-radius: 0;
    padding: 0.5rem;
    box-shadow: none;
}

.tier-label {
    --tier-label-width: 120px;
    width: var(--tier-label-width);
    min-width: var(--tier-label-width);
    border-radius: 10px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.45rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: width 0.16s ease, min-width 0.16s ease;
}

.tier-name-input {
    display: block;
    width: 100%;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    color: white;
    text-align: center;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    padding: 0.35rem 0.4rem;
    outline: none;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
}

.tier-name-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.tier-name-input:focus {
    border-color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.2);
}

.tier-order-controls {
    display: flex;
    gap: 0.35rem;
}

.tier-color-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 32px;
    padding: 0.3rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.tier-color-control > i {
    flex: 0 0 auto;
    color: #fff;
    font-size: 0.9rem;
}

.tier-color-input {
    flex: none;
}

.tier-color-control__swatch {
    flex: 1;
    min-width: 22px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: var(--tier-color, #546e7a);
}

.tier-order-btn {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.tier-order-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.7);
}

.tier-order-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tier-delete-btn {
    color: #ffd5d5;
    border-color: rgba(255, 160, 160, 0.65);
}

.tier-delete-btn:hover {
    background: rgba(255, 120, 120, 0.22);
    border-color: rgba(255, 180, 180, 0.9);
}

.tier-dropzone {
    flex: 1;
    min-height: 104px;
    border: 2px dashed var(--tier-zone-border-color, var(--border-color));
    border-radius: 10px;
    background: var(--tier-zone-bg-color, #f8fcfb);
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tier-dropzone.is-empty::before {
    content: attr(data-empty-text);
    color: var(--text-light);
    font-size: 0.85rem;
    margin: auto;
}

.tier-dropzone.drop-target {
    border-color: var(--tier-zone-active-border-color, var(--teal-mid));
    background: var(--tier-zone-active-bg-color, #edf8f6);
}

.tier-item {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    cursor: grab;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 40, 40, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tier-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 70, 60, 0.24);
}

.tier-item:active {
    cursor: grabbing;
}

.tier-item img:not(.tier-item-overlay) {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.song-tier-item-name {
    display: block;
    overflow: hidden;
    width: 100%;
    padding: 0.3rem 0.35rem;
    background: #fff;
    color: var(--text-color);
    font: 700 0.68rem/1.25 "Noto Sans JP", sans-serif;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.game-song-tier-page .tier-item.has-song-name {
    height: 122px;
}

.game-song-tier-page .tier-item.has-song-name img:not(.tier-item-overlay) {
    height: 96px;
    flex: 0 0 96px;
}

.game-song-tier-page .tier-board.is-exporting .tier-item.has-song-name {
    height: 122px;
}

@media (max-width: 768px) {
    .game-song-tier-page .tier-item.has-song-name {
        height: 110px;
    }

    .game-song-tier-page .tier-item.has-song-name img:not(.tier-item-overlay) {
        height: 84px;
        flex-basis: 84px;
    }
}

.gam-character-tier-page .tier-item {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.gam-character-tier-page .tier-item img {
    width: 96px;
    height: 96px;
    background: transparent;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 3px 8px rgba(0, 30, 30, 0.28));
}

.gam-character-tier-page .tier-item:hover {
    box-shadow: none;
}

.gam-character-tier-page .tier-item.drop-stack-target {
    outline: none;
    filter: brightness(1.1) drop-shadow(0 0 6px rgba(47, 142, 129, 0.8));
}

.gam-character-tier-page .tier-item.drop-insert-before {
    box-shadow: -4px 0 0 #147367 !important;
}

.gam-character-tier-page .tier-item.drop-insert-after {
    box-shadow: 4px 0 0 #147367 !important;
}

.gam-character-tier-page .tier-item.is-selected {
    outline: none;
    filter: brightness(1.05) drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.game-song-tier-page .tier-item.is-selected {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.game-song-tier-page .tier-item,
.game-song-tier-page .tier-mobile-add,
.song-tier-picker-item {
    touch-action: manipulation;
}

.gam-character-tier-page .tier-dropzone.has-slot-lines {
    display: block;
}

.gam-character-tier-page .tier-slot-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.gam-character-tier-page .tier-slot-line + .tier-slot-line {
    margin-top: 0.5rem;
}

.gam-character-tier-page .tier-item.tier-item-stack {
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.gam-character-tier-page .tier-stack-frame {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gam-character-tier-page .tier-item .tier-stack-icon {
    position: absolute;
    width: 96px;
    height: 96px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 30, 30, 0.24));
}

.gam-character-tier-page .tier-board.is-exporting .tier-slot-line {
    gap: 8px;
}

.gam-character-tier-page .tier-board.is-exporting .tier-dropzone.has-slot-lines {
    display: block;
}

.gam-character-tier-page .tier-board.is-exporting .tier-slot-line + .tier-slot-line {
    margin-top: 8px;
}

.tier-item.is-dragging {
    opacity: 0.45;
}

.tier-item.drop-before {
    outline: 3px solid var(--teal-mid);
    outline-offset: 2px;
}

.tier-board.is-exporting .tier-color-control,
.tier-board.is-exporting .tier-color-input,
.tier-board.is-exporting .tier-order-controls {
    display: none !important;
}

.tier-board.is-exporting .tier-label {
    width: var(--tier-label-width);
    min-width: var(--tier-label-width);
    max-width: none;
    padding: 0.45rem;
    justify-content: center;
    gap: 0;
}

.tier-board.is-exporting {
    gap: 6px;
    width: fit-content;
    align-items: flex-start;
    margin-bottom: 0;
}

.tier-board.is-exporting .tier-name-input {
    display: none !important;
}

.tier-board.is-exporting .tier-row {
    width: fit-content;
    flex-direction: row;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.tier-board.is-exporting .tier-dropzone {
    border-width: 0;
    border-color: transparent;
    width: var(--export-tier-zone-width, auto);
    max-width: var(--export-tier-zone-width, none);
    flex: 0 0 var(--export-tier-zone-width, auto);
    gap: 8px;
    padding: 8px;
    flex-wrap: nowrap;
}

.tier-board.is-exporting .tier-dropzone.export-wrap {
    flex-wrap: wrap;
}

.tier-board.is-exporting .tier-dropzone.is-empty {
    justify-content: center;
}

.tier-board.is-exporting .tier-dropzone.is-empty::before {
    content: '';
    display: none;
}

.tier-board.is-exporting .tier-item {
    width: 96px;
    height: 96px;
}

.tier-name-export {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    padding: 0.35rem 0.45rem;
}

.tier-pool-section .tool-body {
    padding-top: 1rem;
}

.tier-pool-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.song-tier-search {
    display: flex;
    align-items: center;
    margin: 0.5rem 0 0.7rem;
    border: 1px solid var(--border-color, #dbe7e4);
    border-radius: 999px;
    background: #fff;
}

.song-tier-search:focus-within {
    border-color: var(--teal-mid);
    box-shadow: 0 0 0 2px rgba(20, 115, 103, 0.12);
}

.song-tier-search input {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 0.45rem 0.8rem 0.45rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-color);
    font: inherit;
}

.song-tier-search-button {
    order: -1;
    display: grid;
    place-items: center;
    width: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
}

.song-tier-search-button:hover {
    color: var(--teal-dark);
}

.song-tier-search-results:not(:empty) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    max-height: 320px;
    margin-bottom: 0.75rem;
    padding: 0.55rem;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f8fcfb;
}

.song-tier-search-result {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem;
    border: 1px solid #dbe7e4;
    border-radius: 8px;
    background: #fff;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
}

.song-tier-search-result img {
    width: 54px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
}

.song-tier-search-result b,
.song-tier-search-result small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-tier-search-result small {
    color: var(--text-light);
}

.song-tier-search-message {
    grid-column: 1 / -1;
    margin: 0.5rem;
    color: var(--text-light);
    text-align: center;
}

.acacia-character-tier-page .acacia-game-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
    margin-bottom: 0.95rem;
}

.acacia-character-tier-page .acacia-game-tab {
    border: 1px solid #9cc7bf;
    border-radius: 999px;
    background: #eef7f5;
    color: #25514b;
    padding: 0.32rem 0.72rem;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.acacia-character-tier-page .acacia-game-tab:hover {
    background: #dff1ed;
    border-color: #78b7ab;
}

.acacia-character-tier-page .acacia-game-tab.is-active {
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
    border-color: #0f6b60;
    color: #ffffff;
}

.tier-pool-display-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #25514b;
    user-select: none;
    cursor: pointer;
}

.tier-pool-display-toggle input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #1f8a7b;
    cursor: pointer;
}

.acacia-character-tier-page #iconPool.song-pool {
    margin-top: 0.35rem;
}

.song-pool {
    min-height: 196px;
    max-height: min(420px, 45vh);
    overflow-y: auto;
}

.tier-mobile-add {
    display: none;
}

.song-tier-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.52);
}

.song-tier-picker-modal.is-open {
    display: flex;
}

.song-tier-picker-panel {
    width: min(620px, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}

.song-tier-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.song-tier-picker-head h3 {
    margin: 0;
}

.song-tier-picker-head button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #fff;
    color: var(--text-color);
    cursor: pointer;
}

#songTierPickerSearch {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    font: inherit;
}

.song-tier-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.65rem;
    max-height: calc(100dvh - 12rem);
    overflow-y: auto;
}

.song-tier-picker-item {
    border: 0;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.song-tier-picker-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 40, 40, 0.16);
}

.song-tier-picker-item span {
    display: block;
    margin-top: 0.3rem;
    overflow: hidden;
    font-size: 0.7rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-tier-picker-empty {
    grid-column: 1 / -1;
    margin: 1rem;
    color: var(--text-light);
    text-align: center;
}

/* モーダル土台・ボタンは css/style.css に集約済み */

@media (max-width: 768px) {
    .tier-controls {
        justify-content: flex-start;
    }

    .tier-title-control {
        width: 100%;
        margin-right: 0;
    }

    .tier-title-input {
        width: 100%;
    }

    .tier-row {
        flex-direction: column;
    }

    .tier-label {
        width: 100%;
        min-width: 0;
        max-width: 220px;
        padding: 0.55rem 0.8rem;
    }

    .tier-item {
        width: 84px;
        height: 84px;
    }

    .gam-character-tier-page .tier-item img,
    .acacia-character-tier-page .tier-item img {
        width: 84px;
        height: 84px;
    }

    .gam-character-tier-page .tier-item .tier-stack-icon,
    .acacia-character-tier-page .tier-item .tier-stack-icon {
        width: 84px;
        height: 84px;
    }

    .tier-dropzone {
        gap: 0.35rem;
        padding: 0.35rem;
    }

    .acacia-character-tier-page .acacia-game-tab {
        font-size: 0.82rem;
        padding: 0.28rem 0.6rem;
    }

}

.tier-board.is-exporting .tier-mobile-add {
    display: none !important;
}

/* ─── 学マス スキルカードTier表 ─── */

.gam-skill-card-tier-page .tier-item {
    border-radius: 8px;
    overflow: visible;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 40, 40, 0.14);
    position: relative;
}

.gam-skill-card-tier-page .tier-item img:not(.tier-item-overlay) {
    pointer-events: none;
    border-radius: 8px;
}

@font-face {
    font-family: 'GakNum';
    src: url('../../assets/fonts/GakNumBold.otf') format('opentype');
    font-weight: bold;
    font-display: swap;
}

.tier-item-overlay {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

.tier-item-badge-container {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    pointer-events: none;
    z-index: 2;
}

.tier-item-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fefefe;
    font-family: 'GakNum', sans-serif;
    font-weight: 600;
    font-size: 14px;
    pointer-events: none;
}

/* ─── オーバーレイモーダル ─── */
.overlay-modal {
    position: fixed;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 0.5rem 0.65rem;
    min-width: 120px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.overlay-modal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.overlay-modal__title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.overlay-modal__options {
    display: flex;
    gap: 0.35rem;
}

.overlay-modal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    padding: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
}

.overlay-modal__btn:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.overlay-modal__btn.is-active {
    border-color: #147367;
    background: #ecfdf5;
}

.overlay-modal__btn--wide {
    width: 100%;
    font-size: 0.7rem;
}

.overlay-modal__badge-section.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.overlay-modal__row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.overlay-modal__row-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #6b7280;
    min-width: 38px;
}

.overlay-modal__badge-section {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.overlay-modal__badge-preview {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fefefe;
    font-family: 'GakNum', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

.overlay-modal__btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gam-skill-card-tier-page .tier-item.is-selected {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.gam-skill-card-tier-page .tier-item.drop-before {
    outline: 3px solid var(--teal-mid);
    outline-offset: 2px;
}

.skill-card-filter-tabs {
    margin-bottom: 0.75rem;
}

.skill-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.skill-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #5a7a74;
    min-width: 4.5em;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}


.skill-filter-tab {
    border: 1px solid #9cc7bf;
    border-radius: 999px;
    background: #eef7f5;
    color: #25514b;
    padding: 0.32rem 0.72rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.skill-filter-tab:hover {
    background: #dff1ed;
    border-color: #78b7ab;
}

.skill-filter-tab.is-active {
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
    border-color: #0f6b60;
    color: #ffffff;
}

.skill-filter-tab--sub {
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
    font-weight: 600;
}

.skill-filter-tab--rarity {
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
    font-weight: 600;
    border-color: #b0a8c7;
    background: #f3f0f8;
    color: #3e3558;
}

.skill-filter-tab--rarity:hover {
    background: #e8e2f3;
    border-color: #9588b5;
}

.skill-filter-tab--rarity.is-active {
    background: linear-gradient(135deg, #5c4b8a 0%, #7b68b6 100%);
    border-color: #4a3a78;
    color: #ffffff;
}

.skill-filter-row--idol {
    gap: 0.35rem;
}

.skill-filter-tab--idol {
    font-size: 0.78rem;
    padding: 0.22rem 0.55rem;
    font-weight: 600;
    border-color: #d4a8b8;
    background: #fdf2f6;
    color: #5a2d42;
}

.skill-filter-tab--idol:hover {
    background: #f8e0ea;
    border-color: #c78da3;
}

.skill-filter-tab--idol.is-active {
    background: linear-gradient(135deg, #a04468 0%, #c25a80 100%);
    border-color: #8a3858;
    color: #ffffff;
}

.skill-filter-count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.15rem;
}

@media (max-width: 768px) {
    .skill-filter-tab {
        font-size: 0.82rem;
        padding: 0.28rem 0.6rem;
    }

    .skill-filter-tab--sub,
    .skill-filter-tab--rarity {
        font-size: 0.78rem;
        padding: 0.22rem 0.5rem;
    }

    .skill-filter-tab--idol {
        font-size: 0.72rem;
        padding: 0.2rem 0.45rem;
    }

    .skill-filter-label {
        font-size: 0.72rem;
        min-width: 4em;
    }
}

/* ─── 学マス サポートカードTier表 ─── */

/* ティア行の高さを16:9カード（72px）に合わせてコンパクトに */
.gam-support-card-tier-page .tier-label {
    padding: 0.3rem;
    gap: 0.22rem;
}

.gam-support-card-tier-page .tier-name-input {
    min-height: 28px;
    font-size: 0.95rem;
    padding: 0.18rem 0.35rem;
}

.gam-support-card-tier-page .tier-color-input {
    height: 20px;
}

.gam-support-card-tier-page .tier-order-btn {
    padding: 0.12rem 0;
}

.gam-support-card-tier-page .tier-dropzone {
    min-height: 88px;
}

/* プールをPC8行分 (72px × 8 + gap × 7 + padding) */
.gam-support-card-tier-page .song-pool {
    max-height: 660px;
}

.gam-support-card-tier-page .tier-item {
    width: 128px;
    height: 72px;
    background: transparent;
    box-shadow: none;
}

.gam-support-card-tier-page .tier-item.is-selected {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.gam-support-card-tier-page .tier-item.drop-before {
    outline: 3px solid var(--teal-mid);
    outline-offset: 2px;
}

.gam-support-card-tier-page .tier-board.is-exporting .tier-item {
    width: 128px;
    height: 72px;
}

@media (max-width: 768px) {
    .gam-support-card-tier-page .tier-dropzone {
        min-height: 70px;
    }

    .gam-support-card-tier-page .song-pool {
        max-height: min(496px, 55vh);
    }

    .gam-support-card-tier-page .tier-item {
        width: 96px;
        height: 54px;
    }
}

/* ─── キャラクターアイコンフィルター (スキルカード・サポカ共通) ─── */

.char-icon-filter-row {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.char-icon-filter-row > .skill-filter-label {
    flex: 0 0 auto;
    padding-top: 0.7rem;
}

.char-icon-filter-options {
    display: flex;
    flex: 1 1 0%;
    flex-wrap: wrap;
    align-items: center;
    width: 0;
    max-width: 100%;
    min-width: 0;
    gap: 0.4rem;
}

.char-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s, filter 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}

.char-icon-btn:hover {
    transform: scale(1.1);
}

.char-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    pointer-events: none;
}

.char-icon-btn--all {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #25514b;
    background: #eef7f5;
    border: 1.5px solid #9cc7bf;
    display: flex;
    align-items: center;
    justify-content: center;
}

.char-icon-btn--all.is-active {
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
    border-color: #0f6b60;
    color: #fff;
    transform: none;
}

.char-icon-filter-row.has-selection .char-icon-btn:not(.is-active) {
    opacity: 0.32;
    filter: grayscale(0.3);
    transform: none;
}

.char-icon-filter-row.has-selection .char-icon-btn:not(.is-active):hover {
    opacity: 0.55;
}

@media (max-width: 768px) {
    .char-icon-btn {
        width: 38px;
        height: 38px;
    }
}

/* ─── ブルーアーカイブ キャラクターTier表 ─── */

.ba-character-tier-page .tier-item {
    width: 96px;
    height: 96px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.ba-character-tier-page .tier-item:hover {
    box-shadow: none;
    transform: scale(1.08);
}

.ba-character-tier-page .tier-item.drop-stack-target {
    outline: none;
    filter: brightness(1.1) drop-shadow(0 0 6px rgba(47, 142, 129, 0.8));
}

.ba-character-tier-page .tier-item.is-selected {
    outline: none;
    filter: brightness(1.05) drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.ba-character-tier-page .tier-item.drop-before {
    outline: none;
    filter: drop-shadow(0 0 5px var(--teal-mid));
}

.ba-character-tier-page .tier-board.is-exporting .tier-item {
    width: 96px;
    height: 96px;
}

.ba-character-tier-page .tier-item.tier-item-stack {
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.ba-character-tier-page .tier-stack-frame {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ba-character-tier-page .tier-item .tier-stack-icon {
    position: absolute;
    width: 96px;
    height: 96px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 30, 30, 0.24));
}

.ba-character-tier-page .tier-dropzone.has-slot-lines {
    display: block;
}

.ba-character-tier-page .tier-slot-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.ba-character-tier-page .tier-slot-line + .tier-slot-line {
    margin-top: 0.5rem;
}

.ba-character-tier-page .tier-board.is-exporting .tier-slot-line {
    gap: 8px;
}

.ba-character-tier-page .tier-board.is-exporting .tier-dropzone.has-slot-lines {
    display: block;
}

.ba-character-tier-page .tier-board.is-exporting .tier-slot-line + .tier-slot-line {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .ba-character-tier-page .tier-item {
        width: 84px;
        height: 84px;
    }

    .ba-character-tier-page .tier-board.is-exporting .tier-item {
        width: 84px;
        height: 84px;
    }

    .ba-character-tier-page .tier-item .tier-stack-icon {
        width: 84px;
        height: 84px;
    }
}

/* ─── プロジェクトセカイ キャラクターTier表（faceRectで丸アイコン化・BAと同仕様） ─── */
:is(.pjsk-character-tier-page, .enstars-character-tier-page) .tier-item {
    width: 96px;
    height: 96px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

:is(.pjsk-character-tier-page, .enstars-character-tier-page) .tier-item:hover {
    box-shadow: none;
    transform: scale(1.08);
}

.pjsk-character-tier-page .tier-item.drop-stack-target {
    outline: none;
    filter: brightness(1.1) drop-shadow(0 0 6px rgba(47, 142, 129, 0.8));
}

.pjsk-character-tier-page .tier-item.is-selected {
    outline: none;
    filter: brightness(1.05) drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.pjsk-character-tier-page .tier-item.drop-before {
    outline: none;
    filter: drop-shadow(0 0 5px var(--teal-mid));
}

.pjsk-character-tier-page .tier-board.is-exporting .tier-item {
    width: 96px;
    height: 96px;
}

.pjsk-character-tier-page .tier-item.tier-item-stack {
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.pjsk-character-tier-page .tier-stack-frame {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pjsk-character-tier-page .tier-item .tier-stack-icon {
    position: absolute;
    width: 96px;
    height: 96px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 30, 30, 0.24));
}

.pjsk-character-tier-page .tier-dropzone.has-slot-lines {
    display: block;
}

.pjsk-character-tier-page .tier-slot-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.pjsk-character-tier-page .tier-slot-line + .tier-slot-line {
    margin-top: 0.5rem;
}

.pjsk-character-tier-page .tier-board.is-exporting .tier-slot-line {
    gap: 8px;
}

.pjsk-character-tier-page .tier-board.is-exporting .tier-dropzone.has-slot-lines {
    display: block;
}

.pjsk-character-tier-page .tier-board.is-exporting .tier-slot-line + .tier-slot-line {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .pjsk-character-tier-page .tier-item {
        width: 84px;
        height: 84px;
    }

    .pjsk-character-tier-page .tier-board.is-exporting .tier-item {
        width: 84px;
        height: 84px;
    }

    .pjsk-character-tier-page .tier-item .tier-stack-icon {
        width: 84px;
        height: 84px;
    }
}

/* ─── ウマ娘 キャラクターTier表 ─── */

.uma-character-tier-page .tier-item .generated-icon {
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 30, 10, 0.28));
}

/* キャラ画像がないフォールバック（色円）アイコンをプール内で20%大きく表示 */
.uma-character-tier-page .tier-dropzone[data-zone="pool"] .tier-item img.fallback-icon {
    width: 115px;
    height: 115px;
}

.uma-character-tier-page .tier-item {
    width: 96px;
    height: 96px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.uma-character-tier-page .tier-item:hover {
    box-shadow: none;
    transform: scale(1.08);
}

.uma-character-tier-page .tier-item.drop-stack-target {
    outline: none;
    filter: brightness(1.1) drop-shadow(0 0 6px rgba(139, 195, 74, 0.8));
}

.uma-character-tier-page .tier-item.is-selected {
    outline: none;
    filter: brightness(1.05) drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.uma-character-tier-page .tier-item.drop-before {
    outline: none;
    filter: drop-shadow(0 0 5px #8bc34a);
}

.uma-character-tier-page .tier-board.is-exporting .tier-item {
    width: 96px;
    height: 96px;
}

.uma-character-tier-page .tier-item.tier-item-stack {
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.uma-character-tier-page .tier-stack-frame {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.uma-character-tier-page .tier-item .tier-stack-icon {
    position: absolute;
    width: 96px;
    height: 96px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 30, 10, 0.24));
}

.uma-character-tier-page .tier-dropzone.has-slot-lines {
    display: block;
}

.uma-character-tier-page .tier-slot-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.uma-character-tier-page .tier-slot-line + .tier-slot-line {
    margin-top: 0.5rem;
}

.uma-character-tier-page .tier-board.is-exporting .tier-slot-line {
    gap: 8px;
}

.uma-character-tier-page .tier-board.is-exporting .tier-dropzone.has-slot-lines {
    display: block;
}

.uma-character-tier-page .tier-board.is-exporting .tier-slot-line + .tier-slot-line {
    margin-top: 8px;
}

/* プールのフィルタータブ */
.uma-pool-filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 3px;
    margin-bottom: 0.6rem;
    touch-action: pan-x;
}

.uma-pool-filter-tab {
    padding: 5px 9px 6px;
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    opacity: 0.55;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
    min-width: 36px;
    min-height: 34px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1b5e20;
}

.uma-pool-filter-tab:hover { opacity: 1; }
.uma-pool-filter-tab.is-active {
    opacity: 1;
    color: #2e7d32;
    border-top: 3px solid #8bc34a;
    padding-top: 3px;
}

@media (max-width: 768px) {
    .uma-character-tier-page .tier-item {
        width: 84px;
        height: 84px;
    }

    .uma-character-tier-page .tier-board.is-exporting .tier-item {
        width: 84px;
        height: 84px;
    }

    .uma-character-tier-page .tier-item .tier-stack-icon {
        width: 84px;
        height: 84px;
    }
}

/* ─── 汎用 Tier表ツール ─── */
.tier-pool-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tier-x-user-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.tier-x-user-modal.is-open {
    display: flex;
}

.tier-x-user-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 32, 40, 0.28);
}

.tier-x-user-modal__panel {
    position: relative;
    width: min(430px, calc(100vw - 2rem));
    padding: 10px;
    border: 1px solid rgba(156, 199, 191, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 56px rgba(0, 32, 40, 0.24);
}

.tier-x-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-x-user-input {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--teal-mid);
    border-radius: 8px;
    margin: 0;
    padding: 0 14px;
    background: #fff;
    color: var(--text-dark);
    font: inherit;
    font-size: 0.9rem;
    line-height: normal;
}

.tier-x-user-input:focus {
    outline: none;
    border-color: var(--teal-mid);
    box-shadow: 0 0 0 2px rgba(0, 121, 107, 0.14);
}

.tier-x-user-search {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    min-width: 78px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    background: var(--teal-mid);
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
}

.tier-x-user-search:hover {
    background: var(--teal-dark);
}

.tier-x-user-candidates {
    display: grid;
    gap: 0.25rem;
    margin-top: 8px;
}

.tier-x-user-candidate {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    background: #eef7f5;
    color: var(--text-dark);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.tier-x-user-candidate img {
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    padding: 3px;
    border-radius: 50%;
    object-fit: contain;
    flex: 0 0 24px;
}

.custom-tier-page .tier-item img[data-x-user-avatar="1"] {
    box-sizing: border-box;
    border: 0.5px solid rgba(148, 163, 184, 0.75);
}

.tier-x-user-hint {
    margin-top: 0.3rem;
    padding: 0 0.2rem;
    color: var(--text-light);
    font-size: 0.74rem;
    line-height: 1.35;
}

.tier-x-user-hint-break {
    display: none;
}

@media (max-width: 560px) {
    .tier-x-user-hint-break {
        display: block;
    }
}

.tier-x-user-note {
    border-top: 1px solid rgba(156, 199, 191, 0.55);
    margin-top: 0.15rem;
    padding: 0.45rem 0.2rem 0.05rem;
    color: var(--text-light);
    font-size: 0.74rem;
    line-height: 1.35;
}

.custom-tier-page #iconPool.song-pool {
    margin-top: 1rem;
}

.pool-item-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.pool-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    border: 2px solid #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.pool-item-wrapper:hover .pool-delete-btn,
.pool-item-wrapper:focus-within .pool-delete-btn {
    display: flex;
}

@media (hover: none) {
    .pool-delete-btn {
        display: flex;
    }
}

.tier-dropzone.is-file-drag-over {
    outline: 3px dashed #38bdf8;
    outline-offset: -3px;
    background: rgba(56, 189, 248, 0.07) !important;
}

.custom-tier-page .tier-dropzone.has-slot-lines {
    display: block;
}

.custom-tier-page .tier-slot-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.custom-tier-page .tier-slot-line + .tier-slot-line {
    margin-top: 0.5rem;
}

.custom-tier-page .tier-board.is-exporting .tier-slot-line {
    gap: 8px;
}

.custom-tier-page .tier-board.is-exporting .tier-dropzone.has-slot-lines {
    display: block;
}

.custom-tier-page .tier-board.is-exporting .tier-slot-line + .tier-slot-line {
    margin-top: 8px;
}

.custom-tier-page .tier-item.tier-item-stack {
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
}

.custom-tier-page .tier-stack-frame {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.custom-tier-page .tier-item .tier-stack-icon {
    position: absolute;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    pointer-events: none;
}

@media (max-width: 768px) {
    .custom-tier-page .tier-item {
        width: 84px;
        height: 84px;
    }

    .custom-tier-page .tier-board.is-exporting .tier-item {
        width: 84px;
        height: 84px;
    }

    .custom-tier-page .tier-item .tier-stack-icon {
        width: 84px;
        height: 84px;
    }
}

/* Compact tier board shared by character and song tools. */
.tier-board--compact {
    --board-icon-size: 96px;
    --tier-row-size: 124px;
}

@media (max-width: 768px) {
    .tier-board--compact:not(.is-exporting) {
        --board-icon-size: 46px;
    }
}
.tier-board--compact:not(.is-exporting) .tier-row {
    flex-direction: row;
    gap: 0;
    padding: 0;
    border-top: 1px solid var(--border-color, #dbe7e4);
}
.tier-board--compact:not(.is-exporting) .tier-row:last-child {
    border-bottom: 1px solid var(--border-color, #dbe7e4);
}
.tier-board--compact:not(.is-exporting) .tier-label {
    flex: 0 0 auto;
    width: clamp(54px, 18vw, 64px);
    min-width: 0;
    max-width: none;
    padding: 0.3rem;
    position: relative;
    gap: 0.25rem;
    border-radius: 0;
    justify-content: center;
}
.tier-board--compact:not(.is-exporting) .tier-name-input {
    font-size: 0.95rem;
    padding-inline: 0.2rem;
}
.tier-board--compact:not(.is-exporting) .tier-row:not(.is-editing-tier) .tier-name-input {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}
.tier-board--compact:not(.is-exporting) .tier-row:not(.is-editing-tier) :is(.tier-color-control, .tier-order-controls) {
    display: none;
}
.tier-board--compact:not(.is-exporting) .is-editing-tier .tier-label {
    width: clamp(84px, 29vw, 126px);
    padding-top: 1.25rem;
}
.tier-board--compact:not(.is-exporting) .tier-row-edit {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: start end;
    width: 35px;
    height: 30px;
    padding: 0.3rem;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 0.65rem;
}
.tier-capture-area:has(.tier-board--compact):not(.is-exporting-capture) {
    padding-inline: 0.65rem;
}
.tier-board--compact:not(.is-exporting) .tier-color-control {
    min-height: 26px;
    gap: 0.25rem;
    padding: 0.2rem 0.25rem;
}
.tier-board--compact:not(.is-exporting) .tier-color-control__swatch {
    min-width: 0;
    height: 12px;
}
.tier-board--compact:not(.is-exporting) .tier-order-controls { gap: 0.2rem; }
.tier-board--compact:not(.is-exporting) .tier-order-btn { min-height: 26px; }
.tier-board--compact:not(.is-exporting) .tier-dropzone {
    min-height: 62px;
    border: 0;
    border-radius: 0;
}
.tier-board--compact .tier-mobile-add,
.tier-add-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 9999;
    width: var(--board-icon-size);
    height: var(--board-icon-size);
    flex: 0 0 var(--board-icon-size);
    margin: 0;
    border: 2px dashed #aeb0b8;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    color: #6f7178;
    box-shadow: none;
    font-size: 1.35rem;
    cursor: pointer;
}
.tier-board--compact .tier-mobile-add:hover,
.tier-board--compact .tier-mobile-add:focus-visible,
.tier-add-tile:hover,
.tier-add-tile:focus-visible {
    border-color: var(--teal-mid);
    color: var(--teal-dark);
    background: #fff;
    outline: none;
}

.tier-board--compact .tier-dropzone.is-empty:has(.tier-mobile-add)::before {
    display: none;
}

@media (min-width: 769px) {
    .tier-board--compact:not(.is-exporting) .tier-row-edit {
        font-size: 0.85rem;
    }
    .tier-board--compact:not(.is-exporting) .tier-row:not(.is-editing-tier) .tier-label {
        width: var(--tier-row-size);
    }
    .tier-board--compact:not(.is-exporting) .tier-dropzone {
        min-height: var(--tier-row-size);
    }
}

.tier-board--compact.is-exporting {
    gap: 0;
}
.tier-board--compact.is-exporting :is(.tier-mobile-add, .tier-row-edit) {
    display: none;
}
.tier-board--compact.is-exporting .tier-row {
    gap: 0;
    min-height: var(--tier-row-size);
}
.tier-board--compact.is-exporting .tier-label {
    flex: 0 0 var(--tier-row-size);
    width: var(--tier-row-size);
    min-width: 0;
    border-radius: 0;
}
.tier-board--compact.is-exporting .tier-dropzone {
    border-radius: 0;
}
.tier-board--compact.is-exporting .tier-name-export {
    display: block;
    min-height: 0;
    padding: 0.25rem;
    word-break: break-all;
    font-size: 0.95rem;
}

/* Mobile tier pool shared by character and song tools. */
body:has(> .tier-pool-dock) {
    padding-bottom: var(--tier-pool-height, 8.5rem);
}
body > .tier-pool-dock {
    --pool-icon-size: 60px;
    position: fixed;
    z-index: 1500;
    inset: auto 0 0;
    width: auto;
    max-width: none;
    height: var(--tier-dock-height, auto);
    max-height: 58dvh;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    border-radius: 0.85rem 0.85rem 0 0;
    background: #f7fbfb;
    box-shadow: 0 -4px 18px #0f172a26;
    transform: none;
    transition: height 180ms ease-out;
}
body > .tier-pool-dock .tool-body {
    flex: none;
    padding: 0.55rem 0.7rem max(0.55rem, env(safe-area-inset-bottom));
}
@media (prefers-reduced-motion: reduce) {
    body > .tier-pool-dock { transition: none; }
}
.tier-pool-dock .tier-pool-header { margin: 0; }
.tier-pool-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.25rem 0.45rem;
    border: 0;
    background: transparent;
    color: var(--teal-dark);
    font: inherit;
    font-weight: 700;
    margin-inline-start: auto;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
}

.tier-pool-action.tier-pool-dock-toggle { display: none; }
body > .tier-pool-dock .tier-pool-dock-toggle { display: inline-flex; }

.tier-pool-heading {
    margin: 0 0 0.65rem;
    color: var(--teal-dark);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
}

.tier-action-popover:not([hidden]) {
    position: fixed;
    z-index: 1502;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.25rem 0.2rem 0.55rem;
    border: 1px solid #a7c9c3;
    border-radius: 0.7rem;
    background: #fff;
    color: var(--teal-dark);
    box-shadow: 0 5px 18px #0f172a30;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 750;
}
.tier-action-popover::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: var(--tier-popover-arrow, 50%);
    width: 8px;
    height: 8px;
    border: solid #a7c9c3;
    border-width: 0 1px 1px 0;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
    pointer-events: none;
}
.tier-action-popover.is-below::after {
    top: -5px;
    bottom: auto;
    border-width: 1px 0 0 1px;
}
.tier-action-popover button {
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #d5e6e3;
    border-radius: 50%;
    background: #f5f9f8;
    color: inherit;
}
