@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
    --bg: #0a0e1a;
    --accent: #e94560;
    --gold: #f6c943;
    --gem: #8b5cf6;
    --text: #e2e8f0;
    --text-dim: #64748b;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 100%;
    max-width: 430px;
    height: 100%;
    max-height: 932px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(180deg, #0d1117, #161b22);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    flex-shrink: 0;
}

.res-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 700;
}

.res-icon {
    font-size: 0.8rem;
}

.res-val {
    color: var(--gold);
}

.res-item:nth-child(2) .res-val {
    color: var(--gem);
}

.level-item {
    margin-left: auto;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.level-item .res-val {
    color: var(--accent);
}

.hero-item {
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.hero-item .res-val {
    color: #60a5fa;
}

.canvas-area {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.placeholder-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-title {
    font-size: 2rem;
    font-weight: 900;
}

.page-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.task-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(40, 30, 15, 0.7);
    border-top: 1px solid rgba(200, 160, 60, 0.15);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
}

.task-bar:hover {
    background: rgba(50, 38, 18, 0.85);
}

.task-bar.completed {
    background: rgba(74, 222, 128, 0.15);
    border-top-color: rgba(74, 222, 128, 0.35);
}

.task-icon {
    font-size: 1.1rem;
}

.task-text {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 600;
}

.task-reward {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
}

.task-btn {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 12px;
    background: rgba(200, 160, 60, 0.1);
    color: rgba(200, 180, 120, 0.6);
    border: 1px solid rgba(200, 160, 60, 0.15);
    transition: all 0.2s;
}

.task-bar.completed .task-btn {
    background: rgba(74, 222, 128, 0.25);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
}

.bottom-nav {
    display: flex;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.7);
    border-top: 1px solid var(--border);
}

.nav-btn {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border-top: 2px solid transparent;
    font-family: inherit;
}

.nav-btn.active {
    color: var(--accent);
    border-top-color: var(--accent);
    background: rgba(233, 69, 96, 0.05);
}

.hidden {
    display: none !important;
}

/* Challenge Button */
.challenge-btn {
    position: absolute;
    bottom: 25px;
    right: 20px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #e94560, #921b31);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    z-index: 50;
    transition: all 0.2s;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0px;
    /* Changed from 100px to cover full screen if needed, adjust if nav is needed */
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    width: 85%;
    max-width: 320px;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    border: 2px solid var(--border);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 15px;
}

.victory .modal-title {
    color: #4ade80;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.defeat .modal-title {
    color: #e94560;
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.4);
}

.modal-body {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Deploy Modal specific */
.modal-content.deploy {
    max-width: 400px;
    padding: 20px;
}

.deploy-slots {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.slot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.slot {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.slot.locked {
    background: rgba(0, 0, 0, 0.4);
    font-size: 1rem;
    opacity: 0.5;
    border-style: dashed;
}

.roster-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dim);
    text-align: left;
}

.hero-roster {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 5px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.roster-item {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.roster-item.selected {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.roster-item:active {
    transform: scale(0.9);
}

.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-btn.primary {
    background: #4ade80;
    color: #0b1520;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.modal-btn.primary:active {
    transform: scale(0.95);
    background: #22c55e;
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.secondary:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

#reward-amount {
    color: var(--gold);
    font-weight: 800;
}

.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--text);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10000;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastIn 0.3s ease-out, toastOut 0.3s 1.7s ease-in forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Summon Bar */
.summon-bar {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
    padding: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.summon-bar.challenge {
    top: auto;
    bottom: 20px;
}

.summon-bar.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.summon-bar.challenge.hidden {
    transform: translateX(-50%) translateY(20px);
}

.skill-item {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.skill-item:hover {
    border-color: #4ade80;
    background: linear-gradient(135deg, #22c55e20, #16213e);
}

.skill-item:active {
    transform: scale(0.9);
}

.skill-icon {
    font-size: 1rem;
}

.skill-key {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e94560;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skill-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0 0 13px 13px;
    transition: height 0.1s linear;
}

.skill-item.cd {
    pointer-events: none;
    filter: grayscale(1);
    opacity: 0.6;
}


/* Weapon Modal Override */
.modal-content.weapon {
    border-color: rgba(233, 69, 96, 0.4);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.15);
    max-width: 360px;
    /* Slightly wider for the two-card result view */
}

/* Equipment Card */
.weapon-main-container,
.comparison-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.weapon-slot {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    /* For hover icon */
    cursor: pointer;
    /* Defaults to pointer */
    transition: all 0.2s;
}

.weapon-slot:hover {
    border-color: rgba(250, 204, 21, 0.5);
    background: rgba(30, 41, 59, 0.6);
}

.slot-name-row {
    font-size: 0.85rem;
    font-weight: bold;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.slot-lv {
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: normal;
}

.slot-icon {
    font-size: 2.2rem;
    margin: 4px 0;
}

.equip-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.equip-card.new-equip {
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.1);
}

.equip-name {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.equip-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.equip-level {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.equip-power {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 10px;
}

.res-val {
    color: var(--gold);
    font-weight: bold;
}

/* Top Progress Bar */
.top-progress-bar-container {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* overflow: hidden removed to allow button to render outside */
    z-index: 100;
    /* Ensure it stays above canvas */
}

.top-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.3s ease-in-out;
}

.top-progress-text {
    position: absolute;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    z-index: 2;
    pointer-events: none;
}

.top-challenge-btn {
    position: absolute;
    left: 50%;
    top: 45px;
    transform: translate(-50%, 0);
    padding: 8px 18px;
    background: #ef4444;
    color: white;
    border: 1px solid #b91c1c;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    z-index: 3;
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.9);
    }

    100% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    }
}

.top-challenge-btn:active {
    transform: translate(-50%, 2px) scale(0.98);
}

.top-challenge-btn.hidden {
    display: none;
}

.equip-stats {
    width: 100%;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.stat-section-title {
    font-size: 0.65rem;
    color: var(--gold);
    border-bottom: 1px solid rgba(250, 204, 21, 0.3);
    padding-bottom: 2px;
    margin-bottom: 4px;
    text-align: left;
    opacity: 0.8;
}

.sub-stat {
    font-size: 0.65rem;
    color: #a1a1aa;
}

.stat-up {
    color: #4ade80;
    font-weight: 700;
}

.stat-down {
    color: #f87171;
    font-weight: 700;
}

/* Item Quality Colors */
.q0 {
    color: #ffffff !important;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.q1 {
    color: #4ade80 !important;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.3);
    border-color: rgba(74, 222, 128, 0.4) !important;
}

.q2 {
    color: #60a5fa !important;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.4) !important;
}

.q3 {
    color: #c084fc !important;
    text-shadow: 0 0 5px rgba(192, 132, 252, 0.3);
    border-color: rgba(192, 132, 252, 0.4) !important;
}

.q4 {
    color: #facc15 !important;
    text-shadow: 0 0 5px rgba(250, 204, 21, 0.3);
    border-color: rgba(250, 204, 21, 0.4) !important;
}

.fruits-machine-wrapper.highlight {
    box-shadow: 0 0 30px #facc15, inset 0 0 50px rgba(250, 204, 21, 0.4);
    border-color: #facc15;
}

@keyframes slotPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
        border-color: rgba(74, 222, 128, 1);
        background: rgba(74, 222, 128, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.5);
    }
}

.weapon-slot.slot-upgrade-pulse {
    animation: slotPulse 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Equipment Inventory List */
.inventory-list {
    width: 140px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 250px;
    overflow-y: auto;
}

.inv-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 5px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.inv-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.inv-item.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.15);
}

.inv-item-active-mark {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e94560;
    color: white;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 900;
}

/* Weapon Quality Colors */
.q-white {
    color: #ffffff;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

.q-green {
    color: #4ade80;
    text-shadow: 0 0 4px rgba(74, 222, 128, 0.2);
}

.q-blue {
    color: #60a5fa;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.4);
}

.q-purple {
    color: #c084fc;
    text-shadow: 0 0 6px rgba(192, 132, 252, 0.5);
}

.q-orange {
    color: #facc15;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.q-red {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.8);
}

.q-supreme {
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 1);
    font-weight: bold;
}

/* Proficiency Bar */
.prof-bar-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
}

.mini-prof {
    margin-top: 10px;
    margin-bottom: 0;
    width: 100%;
    padding: 8px;
}

.prof-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 5px;
    color: var(--text-dim);
}

.prof-track {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 7px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prof-fill {
    height: 100%;
    background: linear-gradient(90deg, #d97706, #fbbf24);
    transition: width 0.3s;
}

.prof-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 0.65rem;
    line-height: 14px;
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Material Cost */
.material-cost {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.mat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Forging Minigame */
.forge-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.forge-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.forge-clicks {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dim);
}

.action-btn {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #e94560, #921b31);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.action-btn:active {
    transform: scale(0.9);
}

.forge-progress-container {
    width: 40px;
    height: 100%;
    padding-right: 10px;
}

.forge-track {
    width: 20px;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

.forge-target-zone {
    position: absolute;
    width: 100%;
    background: rgba(250, 204, 21, 0.3);
    border-top: 2px solid #facc15;
    border-bottom: 2px solid #facc15;
    /* values will be set via JS, e.g. top: 20%; height: 30%; */
}

.forge-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, #ef4444, #f97316);
    border-radius: 8px;
    transition: height 0.1s linear;
}

.forge-cursor {
    position: absolute;
    left: -10px;
    width: 40px;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 5px #fff;
    border-radius: 2px;
    transition: bottom 0.1s linear;
    z-index: 2;
}

/* Result Modal */
.select-btn {
    margin-top: 15px;
    font-size: 0.8rem;
    padding: 6px 0;
    width: 100%;
    border-radius: 8px;
}

.result-prof {
    margin: 10px 0;
}

.recycle-info {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 10px;
}

/* Existing Steel Mill Modals */
.modal-content.steelmill {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.15);
}

.bld-stats {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin: 10px 0;
}

.refine-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.refine-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 5px;
}

.refine-item button {
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.upgrade-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-upgrade {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(233, 69, 96, 0.2);
    margin: 10px 0;
}

.upgrade-info {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.resource-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    text-align: left;
}

/* Bestiary Styles */
.pet-container {
    width: 100%;
    margin-top: 10px;
}

.pet-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
}

.pet-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.pet-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.pet-item.active {
    border-color: var(--gold);
    background: rgba(250, 204, 21, 0.1);
}

.pet-item.active::after {
    content: "已出战";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    background: var(--gold);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.pet-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.pet-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-base);
}

.pet-info {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 5px;
}

/* Capture Phase Styles */
#page-capture {
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    position: relative;
}

.capture-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px;
    text-align: center;
    z-index: 100;
}

.capture-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.capture-prob,
.capture-count {
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: white;
}

.capture-prob span {
    color: var(--gold);
    font-size: 1.5rem;
}

.capture-count span {
    color: #60a5fa;
    font-size: 1.5rem;
}

.capture-btn-main {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border: none;
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.capture-btn-main:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.capture-btn-main:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Mana Bar */
.mana-bar-container {
    height: 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    margin: 0 10px;
    min-width: 80px;
}

.mana-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #818cf8);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.mana-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}



.skill-item.cd .skill-cooldown {
    background: rgba(0, 0, 0, 0.6);
}

.skill-item:not(.active):not(.cd) {
    cursor: pointer;
}

.skill-item.active {
    border-color: #facc15;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.5);
}

.skill-item.no-mana {
    filter: grayscale(1);
    opacity: 0.6;
}

/* Capture Phase Overlay */
#capture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 100px 0 150px 0;
    z-index: 100;
    pointer-events: none;
}

.capture-ui * {
    pointer-events: auto;
}

/* Weapon Shop Redesign - Full-Screen Premium Version */
.modal-overlay {
    position: absolute;
    /* Changed from fixed to absolute to stay within game-container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.shop-redesign-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 430px;
    padding: 20px;
    position: relative;
    background: transparent;
    transition: max-width 0.3s ease;
}

/* Consolidated Weapon Shop block starting at line 1619 */

/* Redundant block removed (v5 Cleanup) */

.back-arrow-btn {
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px;
    z-index: 100;
    position: relative;
    line-height: 1;
}

.back-arrow-btn:hover {
    color: #fff;
    transform: translateX(-3px);
}

.shop-title {
    color: white;
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    flex: 1;
}

.fullscreen-top-row {
    display: flex;
    gap: 10px;
}

.shop-res-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 800;
    color: white;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.shop-footer.centered {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    height: 50px;
}

.shop-back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 20px;
    color: white;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.shop-upgrade-btn-primary {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #4ade80;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 0;
    width: 220px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
    font-size: 1rem;
    transition: all 0.2s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-upgrade-btn-primary:hover {
    transform: translate(-50%, calc(-50% - 2px));
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6);
    background: #22c55e;
}

.shop-upgrade-btn-primary:active {
    transform: translate(-50%, calc(-50% + 1px)) scale(0.98);
}

.spacer-side {
    width: 80px;
    /* balance the back button on the left */
}

/* === WEAPON SHOP V3 CONSOLIDATED (v4 REFINED) === */
#modal-weapon .shop-redesign-container {
    max-width: 430px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    overflow: hidden !important;
    background: #0f172a;
    position: relative;
    user-select: none;
}

.shop-fixed-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 42px;
    padding: 10px 10px 0 10px;
    gap: 10px;
    flex-shrink: 0;
}

.shop-layout-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    padding: 0 10px;
    overflow: hidden;
}

#modal-weapon .shop-box {
    flex: none !important;
    width: 100% !important;
    display: block !important;
    padding: 8px 10px !important;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 12px;
}

/* Forging Area */
.weapon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.weapon-slot {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.slot-change-btn {
    background: rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #93c5fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.slot-change-btn:hover {
    background: rgba(96, 165, 250, 0.4);
    border-color: #60a5fa;
    color: #ffffff;
}

/* Smith Grid Area */
.smith-grid-box {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
}

.prob-row-container {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 2px;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    margin-top: 8px;
    /* Move down slightly as requested */
    margin-bottom: 6px;
}

.prob-segmented-container.compact {
    flex: 1;
    height: 24px;
    /* Increased from 18px to prevent clipping */
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: visible;
    /* Allow labels to breathe */
    display: flex;
    align-items: center;
}

.prob-info-btn {
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Header V6/V7 Styles */
.shop-header-v3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 8px 15px;
    width: 100%;
}

.prob-info-btn.header-btn {
    margin: 0;
    padding: 4px 10px;
    font-size: 0.75rem;
    height: auto;
    width: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-title-v3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f1f5f9;
}

.shop-lv-tag {
    font-size: 1.2rem;
    /* Larger font */
    font-weight: 800;
    color: #fbbf24;
    /* Golden color for prestige */
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 16px;
    /* More padding */
    border-radius: 8px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
    letter-spacing: 1px;
}

.fruits-machine-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.fruits-machine-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 6px;
    width: 95%;
    margin: 0 auto;
    aspect-ratio: 1/1;
}

.slot-item {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: all 0.2s;
    overflow: hidden;
}

.slot-item.active {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #451a03, #78350f);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    transform: scale(1.05);
    z-index: 10;
}

.slot-item .card-icon {
    font-size: 1.2rem;
    margin-bottom: 1px;
}

.slot-item .card-name {
    font-size: 0.6rem;
    color: #94a3b8;
    text-transform: uppercase;
    transform: scale(0.9);
}

.slot-item .card-val {
    font-size: 0.85rem;
    font-weight: 800;
    color: #4ade80;
}

.forge-spin-btn {
    grid-column: 2 / span 3;
    grid-row: 2 / span 3;
    background: radial-gradient(circle at center, #f59e0b, #b45309);
    border: 3px solid #78350f;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(180, 83, 9, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2);
    transition: all 0.15s;
    user-select: none;
    z-index: 20;
}

.forge-spin-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.forge-spin-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(180, 83, 9, 0.5);
}

.forge-spin-btn .spin-text {
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: -2px;
}

.forge-spin-btn .spin-subtext {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 700;
}

.forge-spin-btn.disabled {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
    pointer-events: none;
}

/* Footer V3 - Three Column Layout */
.shop-footer-bar.v3 {
    height: 64px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background: rgba(15, 23, 42, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.footer-left,
.footer-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.footer-center {
    flex: none;
    display: flex;
    justify-content: center;
    width: 160px;
}

.footer-right {
    justify-content: flex-end;
}

.auto-flip-btn-v3 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.shop-upgrade-cost-v3 {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

/* === END CONSOLIDATED === */


/* Blueprint Selection UI */
#modal-blueprint {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.blueprint-container {
    max-width: 360px;
    height: 75%;
    margin-top: 50px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 24px;
    border: 2px solid rgba(233, 69, 96, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(233, 69, 96, 0.1);
    overflow: hidden;
}

.blueprint-box {
    height: calc(100% - 90px);
    gap: 15px;
}

.smith-grid-desc {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* Rogue styles removed */

/* Rogue hover rules removed */


.blueprint-scroll-view {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

.blueprint-footer {
    height: 80px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    bottom: 0 !important;
}

.bp-close-btn {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background: rgba(233, 69, 96, 0.2);
    border: 2px solid rgba(233, 69, 96, 0.5);
    color: #e94560;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.bp-close-btn:hover {
    background: #e94560;
    color: white;
    transform: scale(1.1);
}

.bp-close-btn:active {
    transform: scale(0.9);
}

/* Custom Scrollbar */
.blueprint-scroll-view::-webkit-scrollbar {
    width: 6px;
}

.blueprint-scroll-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.blueprint-scroll-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.blueprint-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 20px;
    /* Increased height */
    min-height: 90px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.blueprint-item:hover:not(.bp-locked) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateX(4px);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
}

/* slot-change-icon moved to weapon-slot related logic */
.weapon-slot {
    position: relative;
    /* Ensure icon is positioned relative to slot */
}

.bp-icon-box {
    width: 60px;
    /* Larger icon box */
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-right: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bp-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.bp-stats {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    gap: 10px;
}

.bp-cost {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
}

.bp-locked {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
}

.bp-locked .bp-info {
    padding-right: 120px;
}

.bp-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.2) 10px, rgba(0, 0, 0, 0.2) 20px);
}

.bp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.bp-name {
    flex-shrink: 0;
    /* Never squeeze the name */
    white-space: nowrap;
    /* Keep name on one line */
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin-right: 15px;
}

.bp-unlock-text {
    flex: 1;
    /* Take up remaining space and push name left */
    font-size: 0.75rem;
    font-weight: 800;
    color: #f87171;
    text-shadow: 0 1px 2px #000;
    text-align: right;
    white-space: nowrap;
}

.slot-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: width 0.1s linear;
}

.slot-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.prob-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
}

.prob-panel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.prob-panel:active {
    transform: translateY(0);
}

.prob-lv {
    text-align: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: #60a5fa;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.lv-info-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.shop-level-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

.shop-level-item.active {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.shop-level-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.shop-level-num {
    color: #94a3b8;
}

.shop-level-num.active {
    color: #60a5fa;
}

.bonus-info {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bonus-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
    font-weight: 800;
}

.bonus-item.q1 {
    color: #3b82f6;
}

.bonus-item.q3 {
    color: #a855f7;
}

.bonus-item span:last-child {
    font-size: 0.85rem;
    filter: brightness(1.2);
}



.prob-segmented-container {
    width: 100%;
}

.prob-segmented-bar {
    width: 100%;
    height: 40px;
    /* Further increased thickness */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.prob-seg {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.seg-label {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: center;
    gap: 2px;
    font-size: 0.6rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    line-height: 1.1;
}

.seg-label span:first-child {
    font-size: 0.75rem;
    /* Quality name slightly larger */
    opacity: 0.9;
}

.seg-common {
    background: #64748b;
}

.seg-rare {
    background: #3b82f6;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.seg-epic {
    background: #a855f7;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Refresh Animation */
.refresh-flash {
    animation: refreshFlash 0.6s ease-out;
}

@keyframes refreshFlash {
    0% {
        filter: brightness(2.5);
        background: rgba(255, 255, 255, 0.2);
    }

    100% {
        filter: brightness(1);
        background: transparent;
    }
}

.shop-upgrade-btn-large {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 12px;
    width: 100%;
    padding: 12px;
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px #1e3a8a, 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shop-upgrade-btn-large:active {
    transform: translateY(2px);
    box-shadow: 0 4px #1e3a8a, 0 5px 10px rgba(0, 0, 0, 0.3);
}

.upgrade-cost {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.upgrade-text {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-close-btn-bottom {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 40px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-close-btn-bottom:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

@keyframes grid-refresh-flash {
    0% {
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }

    30% {
        transform: scale(0.98);
        filter: brightness(1.8) saturate(1.5);
    }

    100% {
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
}

.grid-refresh-animate {
    animation: grid-refresh-flash 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bar-refresh-pulse {
    0% {
        filter: brightness(1);
        box-shadow: 0 0 0px #fff;
        transform: scale(1);
    }

    30% {
        filter: brightness(2.5);
        box-shadow: 0 0 30px #fff;
        transform: scale(1.03);
    }

    100% {
        filter: brightness(1);
        box-shadow: 0 0 0px #fff;
        transform: scale(1);
    }
}

.bar-refresh-pulse {
    animation: bar-refresh-pulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes icon-refresh-pulse {
    0% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 0px #fbbf24);
    }

    50% {
        transform: scale(1.6);
        filter: brightness(2) drop-shadow(0 0 20px #fbbf24);
    }

    100% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 0px #fbbf24);
    }
}

.icon-refresh-pulse {
    animation: icon-refresh-pulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Weapon Shop V9.1 Refresh Animations */
@keyframes barRefreshPulse {
    0% {
        box-shadow: 0 0 0 rgba(250, 204, 21, 0);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px rgba(250, 204, 21, 0.8);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 rgba(250, 204, 21, 0);
        transform: scale(1);
    }
}

.bar-refresh-pulse {
    animation: barRefreshPulse 0.8s ease-out;
}

@keyframes iconRefreshPulse {
    0% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
        transform: scale(1.2);
        background: rgba(74, 222, 128, 0.4);
    }

    100% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
}

.icon-refresh-pulse {
    animation: iconRefreshPulse 0.8s ease-out;
}

@keyframes gridRefreshAnimate {
    0% {
        filter: brightness(1) saturate(1);
        transform: scale(1);
        opacity: 1;
    }

    50% {
        filter: brightness(2) saturate(2);
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        filter: brightness(1) saturate(1);
        transform: scale(0.9);
        opacity: 0;
    }
}

.grid-refresh-animate {
    animation: gridRefreshAnimate 0.8s forwards;
}

@keyframes slotRefreshPulse {
    0% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(1);
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
        transform: scale(1.03);
        background: rgba(74, 222, 128, 0.3);
        border-color: #4ade80;
    }

    100% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(1);
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(255, 255, 255, 0.05);
    }
}

.slot-refresh-pulse {
    animation: slotRefreshPulse 0.8s ease-out;
}

/* Shop Progress Bar */
.shop-lv-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-exp-bar {
    width: 60px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.shop-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #facc15, #fbbf24);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.fruits-machine-wrapper.highlight {
    animation: highlightPulse 2s infinite;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
    }

    50% {
        box-shadow: 0 0 30px rgba(250, 204, 21, 0.6);
    }

    100% {
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
    }
}

.highlight .forge-spin-btn {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.card-icon {
    font-size: 1.1rem !important;
    font-weight: 900;
    color: #fca5a5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}