/* Draft Pro Reference — side panel prototype */

.draft-app-layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    gap: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.draft-app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.draft-pro-panel {
    --draft-pro-width: 320px;
    --draft-pro-top-gap: var(--draft-top-gap, 6px);
    --draft-pro-bottom-gap: 16px;
    position: fixed;
    top: calc(var(--ml-header-offset, 70px) + var(--draft-pro-top-gap));
    right: 8px;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    width: var(--draft-pro-width);
    max-width: calc(100vw - 16px);
    border: 1px solid #333;
    border-radius: 10px;
    background: rgba(8, 8, 8, 0.98);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: calc(var(--z-nav, 1100) - 1);
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 16px));
    transition: transform 0.24s ease, opacity 0.22s ease;
}

.draft-pro-panel:not(.is-closed) {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.draft-pro-panel.is-closed {
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 16px));
    border-width: 1px;
}

.draft-pro-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.draft-pro-panel__title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #f0f0f0;
    letter-spacing: 0.03em;
}

.draft-pro-panel__close {
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #444;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.draft-pro-panel__close:hover {
    border-color: #888;
    color: #fff;
}

.draft-pro-panel__meta {
    padding: 8px 12px 6px;
    font-size: 0.68rem;
    color: #999;
    line-height: 1.45;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}

.draft-pro-panel__meta strong {
    color: #ddd;
}

.draft-pro-panel__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px 10px;
}

.draft-pro-panel__empty,
.draft-pro-panel__loading {
    padding: 18px 12px;
    font-size: 0.75rem;
    color: #888;
    line-height: 1.5;
    text-align: center;
}

.draft-pro-row {
    position: relative;
    padding: 7px 8px;
    margin-bottom: 6px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.draft-pro-row__actions {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
}

.draft-pro-use-btn {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #444;
    border-radius: 8px;
    background: rgba(90, 168, 214, 0.12);
    color: #c8e0ff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.draft-pro-use-btn:hover {
    background: rgba(90, 168, 214, 0.22);
    border-color: rgba(140, 190, 255, 0.65);
}

.draft-pro-use-btn:focus-visible {
    outline: 2px solid rgba(140, 190, 255, 0.65);
    outline-offset: 2px;
}

.draft-pro-row__sim {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.draft-pro-sim-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #bbb;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #333;
}

.draft-pro-sim-badge.is-mid {
    color: #ffe08a;
    border-color: rgba(255, 224, 138, 0.35);
    background: rgba(255, 224, 138, 0.08);
}

.draft-pro-sim-badge.is-high {
    color: #9ef0b8;
    border-color: rgba(158, 240, 184, 0.35);
    background: rgba(158, 240, 184, 0.08);
}

.draft-pro-row__teams {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 6px;
}

.draft-pro-team-head {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.draft-pro-team-head.is-blue {
    justify-content: flex-start;
    text-align: left;
}

.draft-pro-team-head.is-red {
    justify-content: flex-end;
    text-align: right;
}

.draft-pro-team-head__logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    padding: 1px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

.draft-pro-team-head__name {
    font-size: 0.68rem;
    font-weight: 700;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 9rem;
}

.draft-pro-team-head.is-blue .draft-pro-team-head__name {
    color: #b8daf0;
}

.draft-pro-team-head.is-red .draft-pro-team-head__name {
    color: #f0b8b8;
}

.draft-pro-row__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 4px;
    min-width: 54px;
    flex-shrink: 0;
}

.draft-pro-row__detail {
    font-size: 0.58rem;
    color: #888;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.draft-pro-row__date {
    font-size: 0.68rem;
    font-weight: 700;
    color: #e8e8e8;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

.dpa-pro-draft .draft-pro-row__date {
    font-size: 0.74rem;
    color: #f0f0f0;
}

.draft-pro-draft-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.draft-pro-draft-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 4px;
    align-items: center;
}

.draft-pro-row__center.is-spacer {
    min-width: 54px;
    padding: 0;
    visibility: hidden;
    pointer-events: none;
}

.draft-pro-score {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(90, 168, 214, 0.22);
    border: 1px solid rgba(90, 168, 214, 0.35);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}

.draft-pro-side {
    display: flex;
    align-items: center;
    min-width: 0;
}

.draft-pro-side.is-blue {
    justify-content: flex-start;
}

.draft-pro-side.is-red {
    justify-content: flex-end;
}

.draft-pro-side.is-red .draft-pro-chips {
    justify-content: flex-end;
}

.draft-pro-line {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 0.62rem;
    line-height: 1.35;
}

.draft-pro-line-label {
    flex: 0 0 14px;
    font-weight: 800;
    color: #7eb8e8;
    align-self: center;
}

.draft-pro-line-label.is-red {
    color: #f0a0a0;
}

.draft-pro-chips {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.draft-pro-chip-group {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.draft-pro-chip-group.is-bans {
    padding-right: 0;
    margin-right: 0;
    border-right: none;
}

.draft-pro-chip {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.draft-pro-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.draft-pro-chip.is-ban img {
    filter: grayscale(100%);
    opacity: 0.62;
}

.draft-pro-chip.is-pick img {
    filter: none;
    opacity: 1;
}

.draft-pro-chip.is-fallback,
.draft-pro-chip.is-empty {
    width: auto;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #bbb;
    white-space: nowrap;
}

.draft-pro-chip.is-ban.is-fallback {
    color: #777;
    text-decoration: line-through;
}

.draft-pro-chip.is-highlight {
    border-color: rgba(134, 239, 172, 0.85);
    box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.45);
}

.draft-nav-btn.draft-pro-ref-btn.is-active {
    border-color: rgba(90, 168, 214, 0.75);
    background: rgba(90, 168, 214, 0.18);
    color: #fff;
}

.draft-pro-hint-wrap {
    position: relative;
    flex-shrink: 0;
}

.draft-pro-ref-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.draft-pro-ref-btn.is-hint-glow {
    border-color: rgba(255, 220, 120, 0.85);
    background: rgba(255, 220, 120, 0.14);
    color: #ffe9a8;
    animation: draft-pro-hint-pulse 1.6s ease-in-out infinite;
}

@keyframes draft-pro-hint-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.3), 0 0 12px rgba(255, 220, 120, 0.35);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(255, 220, 120, 0.5), 0 0 22px rgba(255, 220, 120, 0.55);
    }
}

.draft-pro-hint-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(248px, 72vw);
    padding: 10px 12px 8px;
    background: #222;
    border: 1px solid rgba(255, 220, 120, 0.45);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    z-index: 220;
    text-align: center;
}

.draft-pro-hint-popover::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #222;
    border-right: 1px solid rgba(255, 220, 120, 0.45);
    border-bottom: 1px solid rgba(255, 220, 120, 0.45);
}

.draft-pro-hint-popover.is-closed {
    display: none;
}

.draft-pro-hint-popover__text {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    color: #f5f5f5;
}

.draft-pro-hint-popover__close {
    min-height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #eee;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.draft-pro-hint-popover__close:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #fff;
}

.draft-pro-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--ml-header-offset, 70px);
    z-index: calc(var(--z-nav, 1100) - 2);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.draft-pro-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

body.draft-pro-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (max-width: 1100px) {
    .draft-pro-backdrop {
        display: block;
    }

    .draft-pro-panel__head {
        flex-shrink: 0;
    }

    .draft-pro-panel__close {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.35rem;
        border-color: #666;
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 768px) {
    .draft-app-layout {
        display: block;
    }

    .draft-app-main {
        width: 100%;
    }

    .draft-pro-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: translateY(16px);
    }

    .draft-pro-panel:not(.is-closed) {
        transform: translateY(0);
    }

    .draft-pro-panel.is-closed {
        transform: translateY(16px);
    }

    .draft-pro-panel__title {
        font-size: 0.92rem;
    }

    .draft-pro-panel__meta {
        font-size: 0.74rem;
        flex-shrink: 0;
    }

    .draft-pro-chip {
        width: 30px;
        height: 30px;
    }

    .draft-pro-hint-popover {
        bottom: auto;
        top: calc(100% + 10px);
        left: auto;
        right: 0;
        transform: none;
        max-width: min(260px, calc(100vw - 24px));
    }

    .draft-pro-hint-popover::after {
        bottom: auto;
        top: -6px;
        left: var(--hint-arrow-left, calc(100% - 28px));
        right: auto;
        transform: translateX(-50%) rotate(45deg);
        border-right: none;
        border-bottom: none;
        border-left: 1px solid rgba(255, 220, 120, 0.45);
        border-top: 1px solid rgba(255, 220, 120, 0.45);
    }

    .draft-toolbar-row {
        overflow: visible;
    }

    .draft-pro-hint-wrap {
        overflow: visible;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .draft-app-layout {
        display: block;
        position: relative;
    }

    .draft-app-main {
        width: 100%;
    }

    .draft-pro-panel {
        left: auto;
        right: 12px;
        width: min(360px, calc(100vw - 24px));
        max-width: min(360px, calc(100vw - 24px));
        transform: translateX(calc(100% + 16px));
    }

    .draft-pro-panel:not(.is-closed) {
        transform: translateX(0);
    }

    .draft-pro-panel.is-closed {
        transform: translateX(calc(100% + 16px));
    }
}
