:root {
    --rune-normal: #9e9e9e;
    --rune-advanced: #4caf50;
    --rune-rare: #2196f3;
    --rune-heroic: #9c27b0;
    --rune-legendary: #ff9800;
    --rune-mythic: #f44336;
    --rune-bg-dark: #1a1a2e;
    --rune-bg-light: #16213e;
    --rune-gold: #c8a84e;
    --rune-gold-dim: rgba(200, 168, 78, 0.3);
    --rune-text: #e0e0e0;
    --rune-text-dim: #888;
    --rune-panel-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 80px rgba(200, 168, 78, 0.1);
}

.rune-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.rune-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.rune-overlay.active .rune-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.rune-panel {
    position: relative;
    width: 95%;
    max-width: calc(600px * var(--ui-scale-modal-size));
    max-height: 85vh;
    background: linear-gradient(170deg, var(--rune-bg-dark) 0%, var(--rune-bg-light) 50%, var(--rune-bg-dark) 100%);
    border: 1px solid var(--rune-gold-dim);
    border-radius: 16px;
    box-shadow: var(--rune-panel-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.rune-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--rune-gold) 50%, transparent 100%);
    opacity: 0.6;
}

.rune-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(200, 168, 78, 0.15);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.rune-panel-header h2 {
    margin: 0;
    font-size: calc(18px * var(--ui-scale-modal-body));
    color: var(--rune-gold);
    text-shadow: 0 0 12px rgba(200, 168, 78, 0.4);
    letter-spacing: 1.5px;
    font-weight: 700;
}

.rune-panel-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--rune-text-dim);
    font-size: calc(18px * var(--ui-scale-modal-body));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rune-panel-close:hover {
    background: rgba(255, 50, 50, 0.2);
    border-color: rgba(255, 50, 50, 0.4);
    color: #ff5555;
    transform: rotate(90deg);
}

.rune-currency-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(200, 168, 78, 0.1);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.rune-currency-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: calc(13px * var(--ui-scale-modal-body));
    color: var(--rune-text);
}

.rune-currency-item .currency-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(11px * var(--ui-scale-modal-body));
    flex-shrink: 0;
}

.rune-currency-item .currency-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rune-tabs {
    display: flex;
    padding: 0 16px;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(200, 168, 78, 0.1);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.rune-tabs::-webkit-scrollbar {
    display: none;
}

.rune-tab {
    padding: 10px 16px;
    font-size: calc(13px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.rune-tab:hover {
    color: var(--rune-text);
    background: rgba(255, 255, 255, 0.03);
}

.rune-tab.active {
    color: var(--rune-gold);
    border-bottom-color: var(--rune-gold);
    text-shadow: 0 0 8px rgba(200, 168, 78, 0.3);
}

.rune-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.rune-filter-btn {
    padding: 5px 12px;
    font-size: calc(11px * var(--ui-scale-modal-body));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--rune-text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rune-filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--rune-text);
}

.rune-filter-btn.active {
    border-color: var(--rune-gold-dim);
    background: rgba(200, 168, 78, 0.1);
    color: var(--rune-gold);
}

.rune-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 168, 78, 0.2) transparent;
}

.rune-panel-body::-webkit-scrollbar {
    width: 5px;
}

.rune-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.rune-panel-body::-webkit-scrollbar-thumb {
    background: rgba(200, 168, 78, 0.2);
    border-radius: 4px;
}

.rune-board {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.rune-board::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.02), transparent);
    animation: runeShimmerSubtle 4s ease-in-out infinite;
}

.rune-board-label {
    font-size: calc(12px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
    min-width: 50px;
    font-weight: 500;
}

.rune-board-slots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rune-board-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(9px * var(--ui-scale-modal-body));
    transition: all 0.2s ease;
}

.rune-board-mini.filled {
    border-color: var(--rune-gold-dim);
    background: rgba(200, 168, 78, 0.1);
    color: var(--rune-gold);
}

.rune-board.grade-normal {
    border-color: rgba(158, 158, 158, 0.2);
}

.rune-board.grade-advanced {
    border-color: rgba(76, 175, 80, 0.25);
}

.rune-board.grade-rare {
    border-color: rgba(33, 150, 243, 0.25);
}

.rune-board.grade-heroic {
    border-color: rgba(156, 39, 176, 0.25);
}

.rune-board.grade-legendary {
    border-color: rgba(255, 152, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.08);
}

.rune-board.grade-mythic {
    border-color: rgba(244, 67, 54, 0.3);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.08);
}

.rune-slot-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0;
}

.rune-slot {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    animation: runeSlotPulse 3s ease-in-out infinite;
}

.rune-slot:hover {
    transform: scale(1.12);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.rune-slot .slot-label {
    font-size: calc(10px * var(--ui-scale-modal-body));
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rune-slot.filled {
    border-style: solid;
    animation: none;
}

.rune-slot.filled .rune-slot-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(22px * var(--ui-scale-modal-body));
}

.rune-slot.grade-normal {
    border-color: var(--rune-normal);
}

.rune-slot.grade-advanced {
    border-color: var(--rune-advanced);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.25), inset 0 0 8px rgba(76, 175, 80, 0.08);
}

.rune-slot.grade-rare {
    border-color: var(--rune-rare);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.3), inset 0 0 10px rgba(33, 150, 243, 0.1);
    animation: runeGlowRare 2.5s ease-in-out infinite;
}

.rune-slot.grade-heroic {
    border-color: var(--rune-heroic);
    box-shadow: 0 0 14px rgba(156, 39, 176, 0.35), inset 0 0 12px rgba(156, 39, 176, 0.1);
    animation: runeGlowHeroic 2.2s ease-in-out infinite;
}

.rune-slot.grade-legendary {
    border-color: var(--rune-legendary);
    box-shadow: 0 0 18px rgba(255, 152, 0, 0.4), inset 0 0 14px rgba(255, 152, 0, 0.1);
    animation: runeGlowLegendary 2s ease-in-out infinite;
}

.rune-slot.grade-mythic {
    border-color: var(--rune-mythic);
    box-shadow: 0 0 22px rgba(244, 67, 54, 0.45), inset 0 0 16px rgba(244, 67, 54, 0.12);
    animation: runeGlowMythic 1.8s ease-in-out infinite, runeShimmer 3s linear infinite;
}

.rune-slot.grade-mythic::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: conic-gradient(
        var(--rune-mythic),
        #ff9800,
        #ffeb3b,
        #4caf50,
        #2196f3,
        #9c27b0,
        var(--rune-mythic)
    );
    opacity: 0.3;
    z-index: -1;
    animation: runeShimmer 3s linear infinite;
}

.rune-slot.grade-mythic::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    top: 5px;
    right: 8px;
    box-shadow: 0 0 4px 1px white;
    animation: runeSparkle 1.5s ease-in-out infinite;
}

.rune-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

.rune-card {
    position: relative;
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.rune-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.rune-card.selected {
    border-color: var(--rune-gold);
    background: rgba(200, 168, 78, 0.08);
    box-shadow: 0 0 16px rgba(200, 168, 78, 0.2);
}

.rune-card .rune-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(20px * var(--ui-scale-modal-body));
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.rune-card .rune-name {
    font-size: calc(12px * var(--ui-scale-modal-body));
    font-weight: 600;
    color: var(--rune-text);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rune-card .rune-level-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--rune-text);
    font-size: calc(10px * var(--ui-scale-modal-body));
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.rune-card.grade-normal {
    border-color: rgba(158, 158, 158, 0.3);
}

.rune-card.grade-normal .rune-icon {
    border-color: var(--rune-normal);
}

.rune-card.grade-advanced {
    border-color: rgba(76, 175, 80, 0.35);
}

.rune-card.grade-advanced .rune-icon {
    border-color: var(--rune-advanced);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

.rune-card.grade-rare {
    border-color: rgba(33, 150, 243, 0.35);
}

.rune-card.grade-rare .rune-icon {
    border-color: var(--rune-rare);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.25);
    animation: runeGlow 2.5s ease-in-out infinite;
}

.rune-card.grade-heroic {
    border-color: rgba(156, 39, 176, 0.35);
}

.rune-card.grade-heroic .rune-icon {
    border-color: var(--rune-heroic);
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.3);
    animation: runeGlow 2.2s ease-in-out infinite;
}

.rune-card.grade-legendary {
    border-color: rgba(255, 152, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.1);
}

.rune-card.grade-legendary .rune-icon {
    border-color: var(--rune-legendary);
    box-shadow: 0 0 16px rgba(255, 152, 0, 0.35);
    animation: runeGlowLegendary 2s ease-in-out infinite;
}

.rune-card.grade-legendary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent 30%, rgba(255, 152, 0, 0.06) 50%, transparent 70%);
    animation: runeCardSheen 3s ease-in-out infinite;
}

.rune-card.grade-mythic {
    border-color: rgba(244, 67, 54, 0.45);
    box-shadow: 0 0 14px rgba(244, 67, 54, 0.15);
}

.rune-card.grade-mythic .rune-icon {
    border-color: var(--rune-mythic);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
    animation: runeGlowMythic 1.8s ease-in-out infinite;
}

.rune-card.grade-mythic::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(135deg,
        rgba(244, 67, 54, 0.08),
        rgba(255, 152, 0, 0.06),
        rgba(255, 235, 59, 0.06),
        rgba(76, 175, 80, 0.06),
        rgba(33, 150, 243, 0.06),
        rgba(156, 39, 176, 0.08)
    );
    background-size: 300% 300%;
    animation: runeShimmer 3s linear infinite;
}

.rune-card.grade-mythic::after {
    content: "";
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    top: 10px;
    right: 12px;
    box-shadow: 0 0 3px 1px white;
    animation: runeSparkle 1.2s ease-in-out infinite;
}

.rune-detail {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(200, 168, 78, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.rune-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.rune-detail-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(26px * var(--ui-scale-modal-body));
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    animation: runeFloat 3s ease-in-out infinite;
}

.rune-detail-info {
    flex: 1;
    min-width: 0;
}

.rune-detail-name {
    font-size: calc(16px * var(--ui-scale-modal-body));
    font-weight: 700;
    margin-bottom: 2px;
}

.rune-detail-grade {
    font-size: calc(11px * var(--ui-scale-modal-body));
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.rune-detail-level {
    font-size: calc(12px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
}

.rune-exp-bar-container {
    margin: 10px 0;
}

.rune-exp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: calc(11px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
    margin-bottom: 4px;
}

.rune-exp-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.rune-exp-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #c8a84e, #f0d080);
    position: relative;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.rune-exp-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent);
    border-radius: 4px 4px 0 0;
}

.rune-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}

.rune-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: calc(13px * var(--ui-scale-modal-body));
}

.rune-stat-name {
    color: var(--rune-text-dim);
}

.rune-stat-value {
    color: var(--rune-text);
    font-weight: 600;
}

.rune-stat-value.positive {
    color: #4caf50;
}

.rune-detail-set-bonus {
    padding: 8px 10px;
    background: rgba(200, 168, 78, 0.06);
    border: 1px solid rgba(200, 168, 78, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

.rune-detail-set-bonus .set-title {
    font-size: calc(12px * var(--ui-scale-modal-body));
    color: var(--rune-gold);
    font-weight: 600;
    margin-bottom: 4px;
}

.rune-detail-set-bonus .set-desc {
    font-size: calc(11px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
    line-height: 1.4;
}

.rune-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.rune-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--rune-text);
    font-size: calc(13px * var(--ui-scale-modal-body));
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.rune-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.rune-btn:active {
    transform: translateY(0);
}

.rune-btn-equip {
    border-color: rgba(76, 175, 80, 0.4);
    background: rgba(76, 175, 80, 0.1);
    color: #81c784;
}

.rune-btn-equip:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.2);
}

.rune-btn-enhance {
    border-color: rgba(33, 150, 243, 0.4);
    background: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
}

.rune-btn-enhance:hover {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.6);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.2);
}

.rune-btn-upgrade {
    border-color: rgba(200, 168, 78, 0.4);
    background: rgba(200, 168, 78, 0.1);
    color: var(--rune-gold);
}

.rune-btn-upgrade:hover {
    background: rgba(200, 168, 78, 0.2);
    border-color: rgba(200, 168, 78, 0.6);
    box-shadow: 0 0 12px rgba(200, 168, 78, 0.2);
}

.rune-btn-unequip {
    border-color: rgba(255, 82, 82, 0.4);
    background: rgba(255, 82, 82, 0.1);
    color: #ef5350;
}

.rune-btn-unequip:hover {
    background: rgba(255, 82, 82, 0.2);
    border-color: rgba(255, 82, 82, 0.6);
    box-shadow: 0 0 12px rgba(255, 82, 82, 0.2);
}

.rune-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rune-levelup-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rune-levelup-effect .levelup-burst {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 168, 78, 0.6) 0%, rgba(200, 168, 78, 0) 70%);
    animation: runeLevelUp 0.8s ease-out forwards;
}

.rune-levelup-effect .levelup-text {
    position: absolute;
    font-size: calc(28px * var(--ui-scale-modal-body));
    font-weight: 800;
    color: var(--rune-gold);
    text-shadow: 0 0 20px rgba(200, 168, 78, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: runeLevelUpText 1s ease-out forwards;
}

.rune-upgrade-success-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}

.rune-upgrade-success-effect .success-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 3px solid var(--rune-gold);
    transform: translate(-50%, -50%);
    animation: runeUpgradeSuccess 1s ease-out forwards;
}

.rune-upgrade-success-effect .success-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: runeParticleBurst 0.8s ease-out forwards;
}

.rune-upgrade-fail-effect {
    animation: runeUpgradeFail 0.5s ease-in-out;
}

.rune-upgrade-fail-effect .rune-detail {
    filter: grayscale(0.6);
    transition: filter 0.5s ease;
}

.rune-buff-indicator {
    padding: 5px 10px;
    font-weight: bold;
    border-radius: 6px;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rune-buff-indicator .buff-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.rune-buff-madness {
    background-color: #CF2222;
    color: #fff;
    box-shadow: 0 0 8px #CF2222;
    animation: pulse-predator 1.5s infinite;
}

.rune-buff-bulletproof {
    background-color: #4D94FF;
    color: #fff;
    box-shadow: 0 0 8px #4D94FF;
    animation: pulse-orange 1.5s infinite;
}

.rune-buff-poison {
    background-color: #4caf50;
    color: #fff;
    box-shadow: 0 0 8px #4caf50;
    animation: pulse-orange 1.5s infinite;
}

.rune-mini-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1.5px solid var(--rune-gold-dim);
    color: var(--rune-gold);
    font-size: calc(9px * var(--ui-scale-modal-body));
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    z-index: 5;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.rune-mini-badge:empty {
    display: none;
}

.rune-proc-madness {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(circle at center, transparent 30%, rgba(244, 67, 54, 0.25) 100%);
    animation: procFlash 0.4s ease-out forwards;
}

.rune-proc-madness::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(244, 67, 54, 0.5);
    box-sizing: border-box;
    animation: procBorderFlash 0.5s ease-out forwards;
}

.rune-proc-bulletproof {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(circle at center, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.2) 50%, transparent 70%);
    animation: procFlash 0.5s ease-out forwards;
}

.rune-proc-bulletproof::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 3px solid rgba(33, 150, 243, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: procShieldExpand 0.6s ease-out forwards;
}

.rune-proc-bulletproof::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: procShieldExpand 0.6s ease-out 0.1s forwards;
}

.rune-proc-poison {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    animation: procFlash 0.6s ease-out forwards;
}

.rune-proc-poison::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(76, 175, 80, 0.2), transparent);
    animation: procPoisonMist 0.8s ease-out forwards;
}

.rune-proc-poison::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%;
    background: linear-gradient(to top, rgba(76, 175, 80, 0.15), transparent);
    animation: procPoisonMist 0.8s ease-out 0.15s forwards;
}

.rune-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--rune-text-dim);
}

.rune-empty-state .empty-icon {
    font-size: calc(40px * var(--ui-scale-modal-body));
    opacity: 0.3;
    margin-bottom: 10px;
}

.rune-empty-state .empty-text {
    font-size: calc(14px * var(--ui-scale-modal-body));
}

.rune-enhance-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: calc(13px * var(--ui-scale-modal-body));
    color: var(--rune-text-dim);
}

.rune-enhance-cost .cost-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rune-enhance-cost .cost-item.insufficient {
    color: #ef5350;
}

.rune-upgrade-chance {
    text-align: center;
    font-size: calc(14px * var(--ui-scale-modal-body));
    font-weight: 700;
    padding: 6px;
    color: var(--rune-gold);
}

.rune-upgrade-chance .chance-value {
    font-size: calc(20px * var(--ui-scale-modal-body));
}

.rune-section-title {
    font-size: calc(14px * var(--ui-scale-modal-body));
    font-weight: 600;
    color: var(--rune-text);
    padding: 8px 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.rune-tooltip {
    position: absolute;
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(200, 168, 78, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    max-width: 220px;
    z-index: 10002;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    font-size: calc(12px * var(--ui-scale-modal-body));
    color: var(--rune-text);
}

.rune-tooltip .tooltip-name {
    font-weight: 700;
    font-size: calc(13px * var(--ui-scale-modal-body));
    margin-bottom: 4px;
}

.rune-tooltip .tooltip-grade {
    font-size: calc(10px * var(--ui-scale-modal-body));
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    opacity: 0.7;
}

.rune-tooltip .tooltip-stats {
    font-size: calc(11px * var(--ui-scale-modal-body));
    line-height: 1.5;
    color: var(--rune-text-dim);
}

@keyframes runeGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(200, 168, 78, 0.2);
    }
    50% {
        box-shadow: 0 0 16px rgba(200, 168, 78, 0.4);
    }
}

@keyframes runeGlowRare {
    0%, 100% {
        box-shadow: 0 0 10px rgba(33, 150, 243, 0.25), inset 0 0 8px rgba(33, 150, 243, 0.08);
    }
    50% {
        box-shadow: 0 0 20px rgba(33, 150, 243, 0.45), inset 0 0 14px rgba(33, 150, 243, 0.15);
    }
}

@keyframes runeGlowHeroic {
    0%, 100% {
        box-shadow: 0 0 12px rgba(156, 39, 176, 0.3), inset 0 0 10px rgba(156, 39, 176, 0.08);
    }
    50% {
        box-shadow: 0 0 24px rgba(156, 39, 176, 0.5), inset 0 0 16px rgba(156, 39, 176, 0.15);
    }
}

@keyframes runeGlowLegendary {
    0%, 100% {
        box-shadow: 0 0 16px rgba(255, 152, 0, 0.35), inset 0 0 12px rgba(255, 152, 0, 0.08);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 152, 0, 0.6), inset 0 0 20px rgba(255, 152, 0, 0.18);
    }
}

@keyframes runeGlowMythic {
    0%, 100% {
        box-shadow: 0 0 20px rgba(244, 67, 54, 0.4), inset 0 0 14px rgba(244, 67, 54, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(244, 67, 54, 0.65), inset 0 0 24px rgba(244, 67, 54, 0.2);
    }
}

@keyframes runeShimmer {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes runeShimmerSubtle {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes runeLevelUp {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes runeLevelUpText {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    30% {
        transform: scale(1.15);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-20px);
        opacity: 0;
    }
}

@keyframes runeUpgradeSuccess {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
        border-width: 3px;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes runeParticleBurst {
    0% {
        transform: translate(-50%, -50%) translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translateX(var(--px, 80px)) translateY(var(--py, -80px));
        opacity: 0;
    }
}

@keyframes runeUpgradeFail {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 50%, 90% {
        transform: translateX(-6px);
    }
    30%, 70% {
        transform: translateX(6px);
    }
}

@keyframes runeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes runeSlotPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

@keyframes procFlash {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes procBorderFlash {
    0% {
        opacity: 1;
        border-width: 4px;
    }
    100% {
        opacity: 0;
        border-width: 12px;
    }
}

@keyframes procShieldExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

@keyframes procPoisonMist {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes buffPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.75;
    }
}

@keyframes runeSparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes runeCardSheen {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(100%);
    }
}
