/* css/resourceExchangeShop.css */

.resource-exchange-shop {
    position: fixed;
    inset: 0;
    z-index: 9500;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 44px);
    font-family: "Oxanium", "Roboto", sans-serif;
    color: #f7fbff;
}

.resource-exchange-shop.hidden {
    display: none !important;
}

.rx-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 25%, rgba(49, 130, 206, 0.20), transparent 36%),
        rgba(3, 7, 18, 0.74);
    backdrop-filter: blur(8px);
}

.rx-panel {
    position: relative;
    width: min(1180px, 100%);
    max-height: min(760px, 92vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 203, 255, 0.28);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(12, 24, 43, 0.98), rgba(5, 11, 24, 0.98)),
        radial-gradient(circle at 30% 0%, rgba(79, 196, 255, 0.16), transparent 36%);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.62),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rx-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.16), transparent),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 10px);
    opacity: 0.62;
}

.rx-header,
.rx-body {
    position: relative;
    z-index: 1;
}

.rx-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid rgba(148, 203, 255, 0.18);
}

.rx-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    margin-bottom: 8px;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.32);
    background: rgba(250, 204, 21, 0.10);
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rx-titlebox h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.3vw, 2.25rem);
    line-height: 1.05;
    color: #ffffff;
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.24);
}

.rx-titlebox p {
    max-width: 720px;
    margin: 8px 0 0;
    color: rgba(226, 239, 255, 0.74);
    font-size: 0.98rem;
}

.rx-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.rx-close:hover,
.rx-close:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(125, 211, 252, 0.15);
    outline: none;
}

.rx-body {
    display: grid;
    grid-template-columns: 320px minmax(390px, 1fr) 340px;
    gap: 16px;
    padding: 18px;
    overflow: auto;
}

.rx-column {
    min-height: 0;
    border: 1px solid rgba(148, 203, 255, 0.17);
    border-radius: 18px;
    background: rgba(6, 13, 28, 0.68);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.rx-column--materials,
.rx-column--summary {
    padding: 16px;
}

.rx-column--exchange {
    padding: 16px;
}

.rx-section-title {
    margin-bottom: 12px;
    color: #bfdbfe;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rx-material-list {
    display: grid;
    gap: 10px;
}

.rx-material {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px;
    border: 1px solid rgba(148, 203, 255, 0.24);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(19, 34, 58, 0.94), rgba(7, 14, 30, 0.92)),
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.16), transparent 62%);
    color: #f8fbff;
    text-align: left;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        0 10px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.rx-material:hover,
.rx-material:focus-visible,
.rx-material.active {
    transform: translateY(-1px);
    border-color: rgba(103, 232, 249, 0.82);
    background:
        linear-gradient(135deg, rgba(20, 83, 115, 0.54), rgba(15, 23, 42, 0.94)),
        radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.30), transparent 66%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.055),
        0 0 26px rgba(34, 211, 238, 0.16),
        0 10px 24px rgba(0, 0, 0, 0.24);
    outline: none;
}

.rx-material-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(125, 211, 252, 0.34);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 38%, rgba(125, 211, 252, 0.22), transparent 58%),
        linear-gradient(135deg, rgba(7, 16, 36, 0.96), rgba(2, 6, 23, 0.98));
    box-shadow:
        inset 0 0 18px rgba(125, 211, 252, 0.08),
        0 0 18px rgba(14, 165, 233, 0.11);
}

.rx-material-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: brightness(1.18) contrast(1.08) drop-shadow(0 0 8px rgba(125, 211, 252, 0.28));
}

.rx-material-texts {
    display: grid;
    gap: 3px;
}

.rx-material-texts strong {
    color: #ffffff;
    font-size: 1.04rem;
    line-height: 1.15;
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.15);
}

.rx-material-texts small {
    color: rgba(226, 239, 255, 0.78);
    font-weight: 800;
}

.rx-rarity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.rx-rarity {
    min-height: 78px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--rx-rarity-color) 36%, rgba(255,255,255,0.12));
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rx-rarity-color) 18%, transparent), transparent 64%),
        rgba(15, 23, 42, 0.72);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.rx-rarity:hover,
.rx-rarity:focus-visible,
.rx-rarity.active {
    transform: translateY(-1px);
    border-color: var(--rx-rarity-color);
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rx-rarity-color) 32%, transparent), transparent 68%),
        rgba(15, 23, 42, 0.88);
    outline: none;
}

.rx-rarity strong {
    color: var(--rx-rarity-color);
    font-size: 0.95rem;
}

.rx-rarity small {
    color: rgba(235, 244, 255, 0.78);
    font-weight: 800;
}

.rx-direction-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.rx-direction {
    display: grid;
    gap: 5px;
    min-height: 96px;
    padding: 14px;
    border: 1px solid rgba(148, 203, 255, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    color: #eef6ff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.rx-direction span {
    font-size: 1.05rem;
    font-weight: 900;
}

.rx-direction small {
    color: rgba(226, 239, 255, 0.64);
    line-height: 1.25;
}

.rx-direction:hover,
.rx-direction:focus-visible,
.rx-direction.active {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.66);
    background: rgba(8, 47, 73, 0.62);
    outline: none;
}

.rx-direction:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.rx-amount-card {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(148, 203, 255, 0.15);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.62);
}

.rx-amount-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.rx-amount-card label {
    display: block;
    color: #dbeafe;
    font-size: 0.92rem;
    font-weight: 800;
}

.rx-amount-head small {
    color: rgba(191, 219, 254, 0.76);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rx-amount-row {
    display: grid;
    gap: 14px;
}

.rx-slider-shell {
    --rx-slider-progress: 0%;
    position: relative;
    width: 100%;
    height: 38px;
    display: block;
    box-sizing: border-box;
    border-radius: 999px;
}

.rx-slider-visual {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

.rx-slider-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.30);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(3, 9, 22, 0.98), rgba(9, 22, 46, 0.98));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        inset 0 0 12px rgba(0, 0, 0, 0.72),
        0 0 16px rgba(34, 211, 238, 0.08);
    transform: translateY(-50%);
}

.rx-slider-fill {
    width: var(--rx-slider-progress);
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(34, 211, 238, 0.98), rgba(96, 165, 250, 0.95));
    box-shadow:
        0 0 16px rgba(34, 211, 238, 0.40),
        inset 0 0 8px rgba(255, 255, 255, 0.14);
}

.rx-slider-knob {
    position: absolute;
    left: var(--rx-slider-progress);
    top: 50%;
    width: 26px;
    height: 26px;
    border: 2px solid rgba(232, 252, 255, 0.96);
    border-radius: 50%;
    background:
        linear-gradient(135deg, #67e8f9 0%, #22d3ee 42%, #2563eb 100%);
    box-shadow:
        0 0 0 5px rgba(34, 211, 238, 0.12),
        0 0 20px rgba(34, 211, 238, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -4px 8px rgba(15, 23, 42, 0.28),
        0 6px 14px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%);
}

.rx-slider-shell:hover .rx-slider-rail,
.rx-slider-shell:focus-within .rx-slider-rail {
    border-color: rgba(103, 232, 249, 0.62);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.055),
        inset 0 0 12px rgba(0, 0, 0, 0.70),
        0 0 24px rgba(34, 211, 238, 0.18);
}

.rx-slider-shell:hover .rx-slider-knob,
.rx-slider-shell:focus-within .rx-slider-knob {
    box-shadow:
        0 0 0 6px rgba(34, 211, 238, 0.14),
        0 0 26px rgba(34, 211, 238, 0.68),
        0 6px 14px rgba(0, 0, 0, 0.45);
}

.rx-slider-shell.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.rx-amount-slider {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 0;
    bottom: 0;
    width: calc(100% - 28px);
    height: 38px;
    margin: 0;
    display: block;
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    opacity: 0;
    cursor: pointer;
}

.rx-amount-slider::-webkit-slider-runnable-track {
    height: 38px;
    border: 0;
    background: transparent;
}

.rx-amount-slider::-webkit-slider-thumb {
    width: 28px;
    height: 38px;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    box-shadow: none !important;
}

.rx-amount-slider::-moz-range-track {
    height: 38px;
    border: 0;
    background: transparent;
}

.rx-amount-slider::-moz-range-progress {
    height: 38px;
    background: transparent;
}

.rx-amount-slider::-moz-range-thumb {
    width: 28px;
    height: 38px;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
}

.rx-amount-slider:focus-visible {
    outline: none;
}

.rx-amount-slider:disabled {
    cursor: not-allowed;
}

.rx-amount-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    align-items: stretch;
    gap: 14px;
}

.rx-amount-input-row button,
.rx-amount-input-row input {
    min-width: 0;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid rgba(148, 203, 255, 0.24);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(8, 16, 34, 0.92), rgba(2, 6, 23, 0.96));
    color: #ffffff;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.rx-amount-input-row button {
    cursor: pointer;
    background:
        linear-gradient(135deg, rgba(15, 45, 76, 0.95), rgba(5, 15, 34, 0.98));
}

.rx-amount-input-row button:hover,
.rx-amount-input-row button:focus-visible {
    border-color: rgba(103, 232, 249, 0.78);
    background:
        linear-gradient(135deg, rgba(14, 116, 144, 0.62), rgba(30, 64, 175, 0.42));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.055),
        0 0 18px rgba(34, 211, 238, 0.14);
    outline: none;
}

.rx-amount-input-row input {
    width: 100%;
    padding: 0 18px;
    text-align: center;
    font-size: 1.08rem;
    appearance: textfield;
    -moz-appearance: textfield;
}

.rx-amount-input-row input::-webkit-outer-spin-button,
.rx-amount-input-row input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.rx-amount-input-row input:focus-visible {
    border-color: rgba(103, 232, 249, 0.78);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.055),
        0 0 18px rgba(34, 211, 238, 0.14);
    outline: none;
}

.rx-amount-input-row input:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.rx-summary {
    min-height: 260px;
}

.rx-summary-card,
.rx-empty-summary {
    border: 1px solid rgba(148, 203, 255, 0.17);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.64);
    padding: 14px;
}

.rx-empty-summary {
    color: rgba(226, 239, 255, 0.72);
    line-height: 1.35;
}

.rx-summary-mode {
    width: fit-content;
    padding: 4px 9px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #bae6fd;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rx-summary-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.rx-summary-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: rgba(2, 6, 23, 0.52);
}

.rx-summary-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.rx-summary-item strong {
    display: block;
    margin-bottom: 3px;
}

.rx-summary-item small {
    color: rgba(226, 239, 255, 0.66);
    line-height: 1.25;
}

.rx-conversion-line {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.rx-conversion-line span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--rx-chip-color) 48%, rgba(255,255,255,0.10));
    border-radius: 13px;
    background: color-mix(in srgb, var(--rx-chip-color) 14%, rgba(2,6,23,0.70));
    color: #ffffff;
    font-size: 0.90rem;
    font-weight: 900;
    text-align: center;
}

.rx-conversion-line.is-missing span:first-child {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(127, 29, 29, 0.32);
}

.rx-conversion-line b {
    color: #93c5fd;
}

.rx-stock-line {
    margin-top: 12px;
    color: rgba(226, 239, 255, 0.70);
    font-size: 0.9rem;
}

.rx-stock-line b {
    color: #ffffff;
}

.rx-confirm {
    width: 100%;
    min-height: 52px;
    margin-top: 14px;
    border: 1px solid rgba(74, 222, 128, 0.38);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.86), rgba(20, 83, 45, 0.94));
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.rx-confirm:hover,
.rx-confirm:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.08);
    outline: none;
}

.rx-confirm.is-disabled,
.rx-confirm:disabled {
    opacity: 0.44;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.25);
}

@media (max-width: 980px) {
    .rx-body {
        grid-template-columns: 1fr;
    }

    .rx-panel {
        max-height: 94vh;
    }
}

@media (max-width: 620px) {
    .resource-exchange-shop {
        padding: 8px;
    }

    .rx-header {
        padding: 18px;
    }

    .rx-body {
        padding: 12px;
    }

    .rx-rarity-grid,
    .rx-direction-card {
        grid-template-columns: 1fr;
    }
}
