@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --bg-color-dark: #12141d;
    --bg-color-light: #1c1f2d;
    --surface-color: rgba(44, 45, 62, .6);
    --primary-color: #007aff;
    --secondary-color: #ff9500;
    --border-color: rgba(142, 142, 147, .4);
    --text-color: #f5f5f7;
    --text-muted: #8a8a8e;
    --success-color: #34c759;
    --fail-color: #ff3b30;
    --damage-color: #ffcc00;
    --common-color: #fff;
    --rare-color: #007aff;
    --legendary-color: #ff9500;
    --epic-color: #af52de;
    --mystic-color: #ff2d55;
    --gold-color: #ffd700;
    --primal-color: #00e6d2; 
	--cosmic-color: #a35ddf;
    --ui-scale-floor: 1;
    --ui-scale-resources: 1;
    --ui-scale-top-menu: 1;
    --ui-scale-stats: 1;
    --ui-scale-stat-btns: 1;
    --ui-scale-combat-info: 1;
    --ui-scale-combat-log: 1;
    --ui-scale-equip: 1;
    --ui-scale-inventory: 1;
    --ui-scale-enhance: 1;
    --ui-scale-chat: 1;
    --ui-scale-tabs: 1;
    --ui-scale-action-btns: 1;
    --ui-scale-modal-title: 1;
    --ui-scale-modal-body: 1;
    --ui-scale-modal-size: 1;
    --ui-scale-zoom: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-color);
    background: var(--bg-color-dark);
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.auth-view {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-app-container {
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
flex-grow: 1;
    min-height: 0;
    box-sizing: border-box;
}

.game-container {
    position: relative;
    width: 100%;
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column; 
    gap: 15px; 
    padding: 15px;
}

.main-content-wrapper {
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.left-sector, .right-sector {
    background: rgba(44, 45, 62, 0.6);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.left-sector {
    gap: 15px;
}

.character-panel {
    background: transparent;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: none;
    transition: transform .1s, box-shadow .1s;
}

.character-panel.hit-flash {
    animation: hit-flash-anim 0.15s ease-in-out infinite;
}
@keyframes hit-flash-anim {
    0%, 100% { transform: scale(1); box-shadow: none; }
    50% { transform: scale(1.01); box-shadow: 0 0 15px var(--fail-color); }
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.character-header h2 {
    font-size: calc(1.8em * var(--ui-scale-floor));
    border: none;
}

.resource-display {
    font-size: calc(1.4em * var(--ui-scale-resources));
    font-weight: 500;
    color: var(--secondary-color);
}

#gold.flash {
    animation: flash .3s ease-in-out
}

@keyframes flash {
    50% {
        color: #fff;
        transform: scale(1.1)
    }
}

.hp-bar {
    width: 100%;
    height: calc(40px * var(--ui-scale-combat-info));
    background-color: rgba(0, 0, 0, .3);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid #000
}

.hp-bar-inner {
    height: 100%;
    transition: width .2s linear
}

.player-panel .hp-bar-inner {
    background: linear-gradient(to right, #28b485, #7ed56f)
}

.monster-panel .hp-bar-inner {
    background: linear-gradient(to right, #c0392b, #e74c3c)
}

.hp-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    font-size: calc(1.2em * var(--ui-scale-combat-info))
}

.stat-info-combined,
.stat-info-monster {
    display: flex;
    flex-direction: column;
    gap: calc(15px * var(--ui-scale-stats));
}

.stat-row,
.stat-row-monster {
    display: grid;
    align-items: center;
    font-size: calc(1.2em * var(--ui-scale-stats));
}

.stat-row {
    grid-template-columns: 1fr auto 1fr;
    gap: calc(10px * var(--ui-scale-stat-btns));
}

.stat-row-monster {
    grid-template-columns: 1fr auto;
    padding: 0 calc(10px * var(--ui-scale-stats))
}

.stat-value {
    text-align: center;
    font-weight: 700
}

.stat-row-monster span:last-child {
    text-align: right;
    font-weight: 700
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: calc(8px * var(--ui-scale-stat-btns));
}

.upgrade-btn {
    background-color: rgba(255, 255, 255, .1);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: calc(6px * var(--ui-scale-stat-btns)) calc(12px * var(--ui-scale-stat-btns));
    border-radius: 6px;
    cursor: pointer;
    font-size: calc(14px * var(--ui-scale-stat-btns));
    transition: all .2s
}

.upgrade-btn:hover {
    background-color: rgba(255, 255, 255, .2);
    color: #fff
}

.upgrade-btn.affordable {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 8px var(--primary-color);
    border-color: var(--primary-color)
}

.equipment-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto
}

.equipment-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: calc(15px * var(--ui-scale-equip));
}

.slot {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: calc(10px * var(--ui-scale-equip));
    height: calc(120px * var(--ui-scale-equip));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    font-size: calc(0.8em * var(--ui-scale-equip));
    overflow: hidden;
}

.slot.drag-over {
    border-style: solid;
    border-color: var(--success-color);
    background-color: rgba(52, 199, 89, .2)
}

.character-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.artifact-socket {
    width: 75px; 
    height: 75px; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all .3s;
    cursor: help;
    position: relative;
    border: 2px solid #111;
    background: radial-gradient(ellipse at center, #555 0%, #222 100%);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
}

.artifact-socket img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.artifact-socket.unlocked {
    border-style: solid;
    box-shadow: 0 0 10px var(--legendary-color)
}

.management-panel {
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, .2);
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow-x: auto
}

.tab-button {
    flex: 1 0 auto;
    padding: calc(18px * var(--ui-scale-tabs)) calc(10px * var(--ui-scale-tabs));
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: calc(1.3em * var(--ui-scale-tabs));
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    border-bottom: 4px solid transparent;
    white-space: nowrap
}

.tab-button.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color)
}

.tab-content {
    display: none;
    flex-grow: 1;
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column
}

#chat-tab,
#log-tab,
#incubator-tab {
    padding: 0
}

.inventory-header,
.enhancement-anvil,
#chat-form {
    flex-shrink: 0
}

.inventory-grid,
#chat-messages,
#game-log,
#pet-inventory {
    flex-grow: 1;
    overflow-y: auto
}

.inventory-tip {
    font-size: calc(1.1em * var(--ui-scale-inventory));
    color: var(--text-muted);
    padding: calc(10px * var(--ui-scale-inventory));
    text-align: center
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(120px * var(--ui-scale-inventory)), 1fr));
    gap: calc(15px * var(--ui-scale-inventory));
    align-content: flex-start;
    padding-bottom: 15px;
}

.inventory-item,
.enhancement-slot {
    border-radius: 8px;
    padding: calc(12px * var(--ui-scale-inventory));
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, .4);
    cursor: pointer;
    transition: all .2s;
    position: relative;
    border: 2px solid var(--border-color);
    font-size: calc(1em * var(--ui-scale-inventory));
}

.inventory-item {
    padding-bottom: 2.2em;
}

.inventory-item.dragging {
    opacity: .4
}

.item-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    flex-shrink: 0
}

.item-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
    pointer-events: none
}

.item-info {
    text-align: center;
    padding-top: 8px;
    flex-shrink: 0;
    word-break: break-word;
    overflow: hidden
}

.item-quantity {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: calc(1.4em * var(--ui-scale-inventory));
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    z-index: 2
}

.item-enhancement-level {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: calc(1em * var(--ui-scale-inventory));
    font-weight: 700;
    background: rgba(0, 0, 0, .7);
    padding: calc(3px * var(--ui-scale-inventory)) calc(6px * var(--ui-scale-inventory));
    border-radius: 4px
}

.inventory-item:hover {
    transform: translateY(-5px)
}

.inventory-item.selected {
    border-color: var(--secondary-color) !important;
    box-shadow: 0 0 15px var(--secondary-color) !important
}

.item-name {
    font-weight: 700;
    font-size: calc(1.1em * var(--ui-scale-inventory));
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis
}

.Common { color: var(--common-color) }
.Rare { color: var(--rare-color) }
.Legendary { color: var(--legendary-color) }
.Epic { color: var(--epic-color) }
.Mystic { color: var(--mystic-color) }
.Primal { color: var(--primal-color); }

@keyframes cosmic-pulse {
    0% { filter: drop-shadow(0 0 2px var(--cosmic-color)); }
    100% { filter: drop-shadow(0 0 8px var(--cosmic-color)) hue-rotate(30deg); }
}

.item-effect {
    font-size: calc(1em * var(--ui-scale-inventory));
    color: var(--text-muted);
    margin-top: 8px
}

.item-enchantments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.item-enchantment-text {
    font-size: calc(0.85em * var(--ui-scale-inventory));
}

.item-cosmic-enhance {
    font-size: calc(0.9em * var(--ui-scale-inventory));
    background: rgba(0,0,0,0.8);
}

.item-inherited-section {
    border-top: 1px dashed #a35ddf;
    margin-top: 4px;
    padding-top: 4px;
}

.item-inherited-label {
    font-size: calc(0.8em * var(--ui-scale-inventory));
    color: #a35ddf;
    font-weight: bold;
    margin-bottom: 2px;
}

.item-scroll-stats,
.item-soulstone-stats {
    margin-top: 4px;
    padding-top: 6px;
    font-size: calc(0.75em * var(--ui-scale-inventory));
}

.slot .inventory-item {
    width: 100%;
    height: 100%;
    position: relative;
    background: none;
    border: none;
    padding: 0;
}

.slot .item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}

.slot .item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slot .item-info {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
    text-align: center;
    font-size: calc(0.9em * var(--ui-scale-inventory));
    font-weight: bold;
    color: white;
    line-height: 1.2;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    pointer-events: none;
}

.slot .item-enhancement-level {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: calc(0.9em * var(--ui-scale-inventory));
    font-weight: 700;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 4px;
    pointer-events: none;
}

.enhancement-slot .inventory-item {
    width: 100%;
    height: 100%;
    position: relative;
    background: none;
    border: none;
    padding: 0;
}
.enhancement-slot .item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}
.enhancement-slot .item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px; 
}

.enhancement-slot .item-info { 
    display: none; 
}

.enhancement-slot .item-enhancement-level,
.enhancement-slot .item-refinement-level {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.1em;
}

.interaction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: calc(10px * var(--ui-scale-action-btns));
    justify-content: center;
    margin-top: calc(15px * var(--ui-scale-action-btns))
}

.action-btn {
    background-color: var(--success-color);
    color: #fff;
    border: none;
    padding: calc(8px * var(--ui-scale-action-btns)) calc(12px * var(--ui-scale-action-btns));
    border-radius: 6px;
    cursor: pointer;
    font-size: calc(14px * var(--ui-scale-action-btns));
    transition: background-color .2s;
    font-weight: 500
}

.action-btn.sell-btn:hover {
    background-color: #2ca04c
}

.action-btn.list-auction-btn {
    background-color: var(--primary-color)
}

.action-btn.list-auction-btn:hover {
    background-color: #0056b3
}

.action-btn.use-item-btn {
    background-color: var(--secondary-color);
}

.action-btn.use-item-btn:hover {
    background-color: #d47d00;
}

#game-log {
    list-style-type: none;
    padding: 20px
}

#game-log li {
    padding: calc(5px * var(--ui-scale-combat-log)) 0;
    font-size: calc(1.1em * var(--ui-scale-combat-log));
    color: var(--text-muted);
    border-bottom: 1px solid #333
}

#game-log li:first-child {
    color: #fff;
    font-weight: 500
}

.enhancement-anvil {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 20px;
    align-items: center;
    padding: 15px;
}

.enhancement-slot-wrapper {
    grid-column: 1/3;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative
}

.enhancement-slot {
    width: calc(180px * var(--ui-scale-enhance));
    height: calc(180px * var(--ui-scale-enhance));
    border: 3px dashed var(--border-color);
    transition: all .3s;
    font-size: calc(1.2em * var(--ui-scale-enhance));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center
}

.enhancement-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    text-align: center;
    font-size: calc(5em * var(--ui-scale-enhance));
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0
}

.enhancement-animation.success {
    animation: result-pop-improved 1.2s cubic-bezier(.25, .46, .45, .94) forwards;
    color: #ffd700;
    text-shadow: 0 0 5px #fff, 0 0 10px #ffd700, 0 0 20px var(--legendary-color)
}

@keyframes result-pop-improved {
    0% { transform: scale(.5) rotate(-15deg); opacity: 0 }
    40% { transform: scale(1.3) rotate(5deg); opacity: 1 }
    60% { transform: scale(1.1) rotate(-3deg); opacity: 1 }
    80% { transform: scale(1.2) rotate(0); opacity: 1 }
    to { transform: scale(1.2); opacity: 0 }
}

.enhancement-animation.fail,
.enhancement-animation.destroy {
    animation: result-shake .5s ease-in-out forwards;
    color: var(--fail-color)
}

.enhancement-animation.maintain {
    animation: result-fade 1.5s ease-out forwards;
    color: var(--text-muted)
}

@keyframes result-shake {
    0%, to { transform: translateX(0) }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px) }
    20%, 40%, 60%, 80% { transform: translateX(10px) }
}

@keyframes result-fade {
    0% { opacity: 1 }
    to { opacity: 0 }
}

.enhancement-details {
    grid-column: 1;
    text-align: center;
    font-size: calc(1.5em * var(--ui-scale-enhance));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px
}

.arrow {
    font-size: calc(2.2em * var(--ui-scale-enhance));
    color: var(--primary-color)
}

.enhancement-info {
    grid-column: 2;
    text-align: left;
    font-size: calc(1.2em * var(--ui-scale-enhance));
    line-height: 1.6
}

.enhance-execute-btn {
    grid-column: 1/3;
    width: 60%;
    margin: 10px auto;
    padding: calc(20px * var(--ui-scale-enhance));
    border-radius: 10px;
    border: none;
    font-size: calc(1.5em * var(--ui-scale-enhance));
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    background: var(--secondary-color);
    color: #fff
}

.enhance-execute-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed
}

.enhancement-checkboxes-wrapper {
    grid-column: 1/3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 0 auto
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px
}

.checkbox-wrapper label {
    font-size: calc(1.2em * var(--ui-scale-enhance));
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding-left: 5px;
}

#rift-enchant-options .item-info {
    text-align: left;
    padding-left: 10px; 
}

.checkbox-wrapper input {
    width: 20px;
    height: 20px;
    cursor: pointer
}

.checkbox-wrapper input:disabled+label {
    color: var(--text-muted);
    cursor: not-allowed
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 25px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color)
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary-color), var(--success-color));
    transition: width 1s linear
}

::-webkit-scrollbar { width: 8px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: #555; border-radius: 4px }
::-webkit-scrollbar-thumb:hover { background: #666 }

.enhance-1 { border-color: #4caf50; box-shadow: 0 0 5px #4caf50 }
.enhance-2 { border-color: #66bb6a; box-shadow: 0 0 8px #66bb6a }
.enhance-3 { border-color: #81c784; box-shadow: 0 0 12px #81c784; animation: pulse-green 3s infinite }
.enhance-4 { border-color: #29b6f6; box-shadow: 0 0 8px #29b6f6 }
.enhance-5 { border-color: #4fc3f7; box-shadow: 0 0 12px #4fc3f7 }
.enhance-6 { border-color: #81d4fa; box-shadow: 0 0 15px #81d4fa; animation: pulse-blue 2.5s infinite }
.enhance-7 { border-color: #7e57c2; box-shadow: 0 0 12px #7e57c2 }
.enhance-8 { border-color: #9575cd; box-shadow: 0 0 15px #9575cd }
.enhance-9 { border-color: #b39ddb; box-shadow: 0 0 20px #b39ddb; animation: pulse-purple 2s infinite }
.enhance-10 { border-color: var(--legendary-color); box-shadow: 0 0 25px var(--legendary-color); animation: pulse-orange 1.5s infinite }
.enhance-11 { animation: sparkle-rainbow-11 5s linear infinite }
.enhance-12 { animation: sparkle-rainbow-12 4.5s linear infinite }
.enhance-13 { animation: sparkle-rainbow-13 4s linear infinite }
.enhance-14 { animation: sparkle-rainbow-14 3.5s linear infinite }
.enhance-15 { animation: sparkle-rainbow-15 4s linear infinite, lightning 2s linear infinite }
.enhance-16 { animation: sparkle-rainbow-16 3.5s linear infinite, lightning 1.8s linear infinite }
.enhance-17 { animation: sparkle-rainbow-17 3s linear infinite, lightning 1.6s linear infinite }
.enhance-18 { animation: sparkle-rainbow-18 2.5s linear infinite, lightning 1.4s linear infinite }
.enhance-19 { animation: sparkle-rainbow-19 2s linear infinite, lightning 1.2s linear infinite }
.enhance-20 { animation: lens-flare 2s ease-in-out infinite; border-color: #fff }

@keyframes pulse-green { 50% { box-shadow: 0 0 18px #a5d6a7 } }
@keyframes pulse-blue { 50% { box-shadow: 0 0 22px #b3e5fc } }
@keyframes pulse-purple { 50% { box-shadow: 0 0 30px #ce93d8 } }
@keyframes pulse-orange { 50% { box-shadow: 0 0 35px #ffd54f } }
@keyframes sparkle-rainbow-11 { 25% { border-color: #c4f0c4; box-shadow: 0 0 15px #c4f0c4 } 50% { border-color: #a0c4ff; box-shadow: 0 0 15px #a0c4ff } 75% { border-color: #f0c4f0; box-shadow: 0 0 15px #f0c4f0 } }
@keyframes sparkle-rainbow-12 { 25% { border-color: #c4f0c4; box-shadow: 0 0 18px #c4f0c4 } 50% { border-color: #a0c4ff; box-shadow: 0 0 18px #a0c4ff } 75% { border-color: #f0c4f0; box-shadow: 0 0 18px #f0c4f0 } }
@keyframes sparkle-rainbow-13 { 25% { border-color: #a8e6cf; box-shadow: 0 0 20px #a8e6cf } 50% { border-color: #8fd3f4; box-shadow: 0 0 20px #8fd3f4 } 75% { border-color: #e4c4f0; box-shadow: 0 0 20px #e4c4f0 } }
@keyframes sparkle-rainbow-14 { 25% { border-color: #a8e6cf; box-shadow: 0 0 22px #a8e6cf } 50% { border-color: #8fd3f4; box-shadow: 0 0 22px #8fd3f4 } 75% { border-color: #e4c4f0; box-shadow: 0 0 22px #e4c4f0 } }
@keyframes sparkle-rainbow-15 { 16% { border-color: orange } 33% { border-color: #ff0 } 50% { border-color: green } 66% { border-color: blue } 83% { border-color: indigo } }
@keyframes sparkle-rainbow-16 { 16% { border-color: orange } 33% { border-color: #ff0 } 50% { border-color: green } 66% { border-color: blue } 83% { border-color: indigo } }
@keyframes sparkle-rainbow-17 { 16% { border-color: orange } 33% { border-color: #ff0 } 50% { border-color: green } 66% { border-color: blue } 83% { border-color: indigo } }
@keyframes sparkle-rainbow-18 { 16% { border-color: orange } 33% { border-color: #ff0 } 50% { border-color: green } 66% { border-color: blue } 83% { border-color: indigo } }
@keyframes sparkle-rainbow-19 { 16% { border-color: orange } 33% { border-color: #ff0 } 50% { border-color: green } 66% { border-color: blue } 83% { border-color: indigo } }
@keyframes lightning { to { box-shadow: 0 0 30px #fff, 0 0 40px #ff0, 0 0 50px var(--legendary-color) } }
@keyframes lens-flare { 50% { box-shadow: 0 0 2em .5em #ff0, 0 0 4em 1.5em #f0f inset } }

#auth-container, #kakao-register-container, #kakao-link-container, #google-register-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
}

.auth-box {
    background: var(--bg-color-light);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    text-align: center;
    width: 400px
}

#auth-form input, #kakao-register-form input, #kakao-link-form input, #google-register-form input {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color-dark);
    color: var(--text-color);
    font-size: 1em;
}

#auth-form button, #kakao-register-form button, #kakao-link-form button, #google-register-form button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

#auth-form button:hover, #kakao-register-form button:hover, #kakao-link-form button:hover, #google-register-form button:hover {
    background: #0056b3;
}

#auth-message {
    min-height: 24px;
    color: var(--fail-color);
    margin-bottom: 15px
}

#toggle-auth {
    margin-top: 25px;
    color: var(--text-muted)
}

#toggle-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px clamp(8px, 2vw, 20px);
    background: var(--bg-color-light);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
}

#user-info {
    font-weight: 700;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#welcome-username {}

#logout-button {
    padding: calc(8px * var(--ui-scale-top-menu)) calc(15px * var(--ui-scale-top-menu));
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: calc(1em * var(--ui-scale-top-menu));
    border-radius: 6px;
    cursor: pointer
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002; 
}

.modal-content {
    background: var(--bg-color-light);
    padding: clamp(12px, 3vw, 30px);
    border-radius: 12px;
    width: 90%;
    max-width: calc(800px * var(--ui-scale-modal-size));
    box-shadow: 0 5px 25px rgba(0, 0, 0, .5);
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-size: calc(1em * var(--ui-scale-modal-body));
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-muted)
}

.close-button:hover {
    color: var(--text-color)
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    flex-shrink: 0;
    font-size: calc(1.5em * var(--ui-scale-modal-title));
}

.top-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-grow: 1
}

.top-buttons button {
    padding: calc(8px * var(--ui-scale-top-menu)) calc(15px * var(--ui-scale-top-menu));
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: calc(1em * var(--ui-scale-top-menu));
    transition: all .2s
}

#ranking-button { background: var(--secondary-color); color: #fff }
#loot-record-button { background: #4caf50; color: #fff }
#enhancement-record-button { background: #2196f3; color: #fff }
#online-users-button { background: #9c27b0; color: #fff }

.top-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3)
}

#ranking-list, .feed-list, #loot-record-display, #enhancement-record-display {
    list-style-type: none;
    padding: 0;
    flex-grow: 1;
    overflow-y: auto;
}

#ranking-list h3, #loot-record-display h3, #enhancement-record-display h3 {
    font-size: calc(1.4em * var(--ui-scale-modal-body));
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin: 25px 0 15px
}

#ranking-list h3:first-of-type, #loot-record-display h3:first-of-type, #enhancement-record-display h3:first-of-type {
    margin-top: 0
}

#ranking-list li, .feed-list li, .record-item {
    padding: calc(12px * var(--ui-scale-modal-body)) 5px;
    font-size: calc(1.2em * var(--ui-scale-modal-body));
    border-bottom: 1px solid var(--bg-color-dark);
    line-height: 1.8;
    display: flex;
    align-items: center;
    transition: background-color .3s;
    overflow: visible;
}

.record-item {
    font-size: calc(1.3em * var(--ui-scale-modal-body));
    justify-content: center;
    background: rgba(0, 0, 0, .1);
    border-radius: 8px
}

#ranking-list li:last-child, .feed-list li:last-child, .record-item:last-of-type {
    border-bottom: none
}

.feed-list li:hover {
    background-color: rgba(255, 255, 255, .05)
}

#ranking-list .rank-badge {
    flex-shrink: 0;
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    margin-right: 15px;
    font-size: .9em
}

#ranking-list .rank-1 { background: var(--gold-color); color: #333 }
#ranking-list .rank-2 { background: #c0c0c0; color: #333 }
#ranking-list .rank-3 { background: #cd7f32; color: #fff }

.rank-name {
    font-weight: 700;
    margin-right: 4px
}

.rank-value {
    font-weight: 700;
    color: var(--text-color);
    margin: 0 4px
}

.enhance-level-highlight {
    font-weight: 700;
    color: var(--damage-color);
    text-shadow: 0 0 5px var(--damage-color);
    margin: 0 4px
}

.user-item-name {
    font-style: italic;
    margin: 0 4px;
    padding-right: 3px;
}

.user-item-none {
    color: var(--text-muted);
    font-style: italic;
    margin: 0 4px
}

.no-record {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 1;
    min-width: 0;
}

#zoom-controls {
    display: flex;
}

.monster-header-controls {
    display: flex;
    align-items: center;
    gap: 15px
}

#exploration-button {
    padding: calc(8px * var(--ui-scale-action-btns)) calc(15px * var(--ui-scale-action-btns));
    border-radius: 6px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    font-size: calc(1em * var(--ui-scale-action-btns))
}

#exploration-button.explore {
    background-color: var(--success-color);
    color: #fff
}

#exploration-button.climb {
    background-color: var(--secondary-color);
    color: #fff
}

#chat-messages {
    list-style-type: none;
    padding: 10px;
    margin: 0
}

#chat-messages li {
    padding: calc(6px * var(--ui-scale-chat)) calc(10px * var(--ui-scale-chat));
    line-height: 1.5;
    font-size: calc(1.1em * var(--ui-scale-chat));
    word-break: break-all;
    border-radius: 4px;
    margin-bottom: 4px
}

#chat-messages li .username {
    font-weight: 700;
    color: var(--secondary-color);
    margin-right: 8px;
    cursor: default;
    user-select: none
}

#chat-messages li.system-message {
    background: 0 0 !important;
    text-align: center;
    border: none;
    font-style: italic;
    color: var(--text-muted)
}

#chat-messages li.admin-message .username {
    color: gold;
    text-shadow: 0 0 5px gold
}

#chat-messages li.announcement-message {
    background-color: rgba(255, 99, 71, .15);
    border-left: 3px solid tomato
}

#chat-messages li.announcement-message .username {
    color: tomato
}

#chat-form {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, .2)
}

#chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-color-dark);
    color: var(--text-color);
    padding: 12px;
    border-radius: 6px;
    font-size: calc(1em * var(--ui-scale-chat))
}

#chat-form button {
    padding: 0 25px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color .2s
}

#chat-form button:hover {
    background-color: #0056b3
}

#announcement-banner {
    position: absolute; 
    display: flex;
    align-items: center;
    justify-content: center;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    transition: all .5s cubic-bezier(.25, .8, .25, 1);
    padding: 15px 60px 15px 20px;
    width: 80%;
    max-width: 1200px;
    background: linear-gradient(45deg, var(--secondary-color), gold);
    color: #000;
    font-size: 1.5em;
    font-weight: 700;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .5);
    border-radius: 0 0 12px 12px;
    opacity: 0;
}

#announcement-banner.active {
    top: 0;
    opacity: 1;
}

#announcement-close-btn {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: #000;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#announcement-close-btn:hover {
    opacity: 1;
}

#announcement-banner.active {
    opacity: 1;
    top: 0
}

#auction-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    min-height: 0;
    flex-grow: 1;
    overflow-y: auto
}

.auction-grid-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(0, 0, 0, .2);
    padding: 10px;
    border-radius: 8px
}

#auction-grid {
    height: 100%;
    overflow-y: auto
}

#auction-item-detail {
    flex: 2;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto
}

#auction-item-detail h3 {
    width: 100%;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    flex-shrink: 0
}

.auction-detail-item {
    width: 180px;
    height: auto;
    margin-bottom: 20px
}

#auction-item-detail p {
    font-size: calc(1.2em * var(--ui-scale-modal-body));
    line-height: 1.8
}

.gold-text {
    color: var(--gold-color);
    font-weight: 700
}

.auction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0
}

#auction-refresh-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer
}

#auction-modal .inventory-item.auction-item .item-info {
    font-size: .9em
}

.world-boss-panel {
    flex-shrink: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 2px solid var(--fail-color);
    box-shadow: 0 0 20px var(--fail-color)
}

.world-boss-panel .hp-bar-inner {
    background: linear-gradient(to right, var(--fail-color), #ff6b6b)
}

#world-boss-name {
    color: var(--fail-color);
    font-weight: bold;
    animation: pulse-red 1.5s infinite
}

#world-boss-contribution {
    text-align: center;
    font-size: calc(1.1em * var(--ui-scale-modal-body));
    color: var(--text-muted);
    margin-top: 5px
}

@keyframes pulse-red {
    50% {
        text-shadow: 0 0 15px var(--fail-color)
    }
}

.inventory-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-grow: 1;
    min-height: 0
}

.interaction-panel {
    flex-basis: 300px;
    flex-shrink: 0;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: calc(15px * var(--ui-scale-inventory));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(15px * var(--ui-scale-inventory));
    font-size: calc(1em * var(--ui-scale-inventory));
}

.interaction-item-display {
    width: 150px;
    height: auto
}

#fame-icon { margin-right: 8px; font-size: 1.2em; vertical-align: middle; }
.fame-bronze { color: #cd7f32; font-weight: bold; }
.fame-silver { color: #c0c0c0; font-weight: bold; text-shadow: 0 0 3px rgba(192, 192, 192, 0.5); }
.fame-gold { color: #ffd700; font-weight: bold; text-shadow: 0 0 5px rgba(255, 215, 0, 0.6); }
.fame-diamond { background: linear-gradient(45deg, #b9f2ff, #a9c9ff, #d3baff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: bold; animation: fame-diamond-shine 3s infinite; }

@keyframes fame-diamond-shine { 0%, 100% { text-shadow: 0 0 6px #a9c9ff; } 50% { text-shadow: 0 0 12px #ffffff; } }

#fusion-container { display: flex; flex-direction: column; align-items: center; justify-content: space-around; height: 100%; padding: 20px; gap: 20px; }
#fusion-process-ui { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; }
.fusion-slot-wrapper { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fusion-slot { width: 160px; height: 160px; border: 3px dashed var(--border-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; background-color: rgba(0,0,0,0.2); }
.fusion-slot.filled { border-style: solid; border-color: var(--epic-color); }
.fusion-slot:hover { background-color: rgba(255,255,255,0.05); }
.fusion-slot .inventory-item { border: none; background: transparent; cursor: grab; width: 100%; height: 100%; }
.fusion-slot-placeholder { color: var(--text-muted); text-align: center; font-size: 1.1em; }
.fusion-pet-info { font-size: 1em; color: var(--text-color); text-align: center; height: 2em; }
.fusion-indicator { font-size: calc(3em * var(--ui-scale-modal-body)); font-weight: bold; color: var(--primary-color); }
#fusion-timer-ui { display: flex; flex-direction: column; align-items: center; gap: 15px; text-align: center; }
.fusion-result-preview { width: 180px; height: 180px; animation: pulse-orange 2s infinite; }
.fusion-result-preview img { width: 100%; height: 100%; object-fit: contain; }
#fusion-timer-ui h3 { font-size: calc(1.8em * var(--ui-scale-modal-body)); }
#fusion-timer { font-size: calc(2.2em * var(--ui-scale-modal-body)); font-weight: bold; color: var(--success-color); }
.fusion-controls { text-align: center; }
#fusion-rules { color: var(--text-muted); margin-bottom: 15px; line-height: 1.6; }

.board-modal-content { max-width: calc(1500px * var(--ui-scale-modal-size)); width: 95%; flex-direction: column; }
#board-main-container { flex-grow: 1; min-height: 0; display: flex; flex-direction: column; }
.board-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-shrink: 0; }
.board-tabs { display: flex; gap: 10px; }
.board-tab-button { padding: calc(8px * var(--ui-scale-tabs)) calc(16px * var(--ui-scale-tabs)); border: none; background: none; color: var(--text-muted); font-size: calc(1.1em * var(--ui-scale-tabs)); font-weight: 500; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; }
.board-tab-button.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.board-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.board-table th, .board-table td { padding: 12px; text-align: center; border-bottom: 1px solid var(--border-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-table th { background-color: rgba(0,0,0,0.2); }
.board-table tbody tr { cursor: pointer; transition: background-color 0.2s; }
.board-table tbody tr:hover { background-color: rgba(255, 255, 255, 0.05); }
.board-table .col-category { width: 10%; }
.board-table .col-title { width: 50%; text-align: left; }
.board-table .col-author { width: 15%; }
.board-table .col-likes { width: 10%; }
.board-table .col-date { width: 15%; }
.post-title-content.notice { font-weight: bold; color: var(--success-color); animation: fame-diamond-shine 2.5s infinite; }
.post-title-content .comment-count { color: var(--text-muted); font-size: 0.9em; margin-left: 8px; }
.pagination { display: flex; justify-content: center; align-items: center; margin-top: 20px; gap: 8px; flex-shrink: 0; }
.pagination button { background: var(--bg-color-dark); border: 1px solid var(--border-color); color: var(--text-color); padding: 5px 10px; border-radius: 4px; cursor: pointer; }
.pagination button.active { background: var(--primary-color); border-color: var(--primary-color); font-weight: bold; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
#board-detail-view, #board-write-view { display: none; flex-direction: column; height: 100%; }
#post-content-area { padding: 20px; background-color: rgba(0,0,0,0.1); border-radius: 8px; margin-bottom: 20px; flex-grow: 1; overflow-y: auto; min-height: 0; }
#post-content-area .post-header h3 { font-size: 1.8em; margin-bottom: 10px; }
#post-content-area .post-meta { color: var(--text-muted); margin-bottom: 20px; }
#post-content-area .post-body { font-size: calc(1.1em * var(--ui-scale-modal-body)); line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
#post-content-area .post-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }
#post-like-btn { background: var(--success-color); }
#post-comment-area { margin-top: auto; flex-shrink: 0; max-height: 35%; display: flex; flex-direction: column; }
#comment-list { overflow-y: auto; flex-grow: 1; margin-bottom: 10px; }
.comment-item { display: flex; flex-direction: column; padding: 10px; border-bottom: 1px solid var(--bg-color-dark); }
.comment-author { font-weight: bold; margin-bottom: 5px; }
.comment-content { flex-grow: 1; }
.comment-actions { display: flex; align-items: center; gap: 15px; margin-top: 5px; font-size: 0.9em; }
.comment-actions .like-btn { cursor: pointer; }
.comment-actions .delete-btn { color: var(--fail-color); cursor: pointer; margin-left: auto; }
#comment-form { flex-shrink: 0; }
#comment-form textarea { flex-grow: 1; height: 80px; background-color: #2c2f3b; border: 1px solid var(--border-color); color: var(--text-color); padding: 10px; border-radius: 4px; resize: vertical; font-size: 1em; line-height: 1.5; }
#comment-form textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 5px var(--primary-color); }
#comment-form button { flex-shrink: 0; width: 100px; font-weight: bold; background-color: var(--primary-color); border: none; border-radius: 4px; color: white; cursor: pointer; transition: background-color 0.2s; }
#comment-form button:hover { background-color: #0056b3; }
#board-write-view h3 { text-align: center; margin-bottom: 20px; }
#post-form { display: flex; flex-direction: column; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { padding: 10px; border: 1px solid var(--border-color); background: var(--bg-color-dark); color: var(--text-color); border-radius: 4px; font-size: calc(1em * var(--ui-scale-modal-body)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
#comment-form { display: flex; align-items: stretch; gap: 10px; }
#comment-form textarea { flex-grow: 1; resize: none; padding: 10px; height: 60px; line-height: 1.5; }
#comment-form button { flex-shrink: 0; padding: 0 25px; font-weight: bold; background-color: var(--success-color); transition: background-color 0.2s; }
#comment-form button:hover { background-color: #2ca04c; }
.main-content-wrapper { display: flex; flex-direction: row; gap: 15px; flex-grow: 1; min-height: 0; }
.post-view-body { padding: 25px 20px; font-size: calc(1.1em * var(--ui-scale-modal-body)); line-height: 1.8; min-height: 200px; border-bottom: 1px solid var(--border-color); background-color: var(--bg-color-dark); }
.post-comments-section { padding: 20px; overflow-y: auto; flex-shrink: 0; min-height: 100px; }
.post-view-actions { padding: 15px 20px; display: flex; gap: 10px; justify-content: center; background-color: var(--bg-color-dark); }
.post-view-container { padding: 20px; overflow-y: auto; flex-grow: 1; border-bottom: 1px solid var(--border-color); position: relative; }
#post-comment-area { background-color: #1a1c23; padding: 15px; display: flex; flex-direction: column; flex-shrink: 0; }
#comment-list { margin: 0; }
.comment-item-new { padding: 15px; border-bottom: 1px solid var(--border-color); background-color: rgba(0, 0, 0, 0.1); }
.comment-main-content { display: flex; align-items: flex-start; gap: 8px; line-height: 1.6; word-break: break-word; }
.comment-author-new { font-weight: bold; flex-shrink: 0; }
.comment-meta-new { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-left: 10px; }
.comment-date-new { font-size: 0.85em; color: var(--text-muted); }
.comment-actions-new { display: flex; gap: 15px; font-size: 0.9em; }
.comment-actions-new .like-btn, .comment-actions-new .delete-btn { color: var(--text-muted); transition: color 0.2s; }
.comment-actions-new .like-btn:hover, .comment-actions-new .delete-btn:hover { color: var(--text-color); }
.detail-view-controls { display: flex; justify-content: space-between; margin-bottom: 15px; }
#board-back-arrow-btn { background-color: var(--surface-color); }
.post-title-content.notice { font-weight: bold; color: var(--success-color); text-shadow: 0 0 8px var(--success-color); }
.editor-mode-toggle { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.html-editor { height: 300px; background-color: #1a1c23; border: 1px solid var(--border-color); color: #f5f5f7; font-family: monospace; font-size: calc(1em * var(--ui-scale-modal-body)); padding: 10px; resize: vertical; }
.action-btn.equip-btn { background-color: var(--success-color); }
.action-btn.equip-btn:hover { background-color: #2ca04c; }
#online-users-list .user-item-name.Common, #ranking-list .Common, .record-item .Common { color: var(--common-color) !important; }
#online-users-list .user-item-name.Rare, #ranking-list .Rare, .record-item .Rare { color: var(--rare-color) !important; }
#online-users-list .user-item-name.Legendary, #ranking-list .Legendary, .record-item .Legendary { color: var(--legendary-color) !important; }
#online-users-list .user-item-name.Epic, #ranking-list .Epic, .record-item .Epic { color: var(--epic-color) !important; }
#online-users-list .user-item-name.Mystic, #ranking-list .Mystic, .record-item .Mystic { color: var(--mystic-color) !important; }
#ranking-list .rank-name, .record-item .rank-name { font-weight: 700; }
.post-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 10px; }
#player-buffs-container { display: flex; justify-content: center; gap: 10px; margin-top: 10px; min-height: 28px; }
.buff-icon { padding: calc(5px * var(--ui-scale-combat-info)) calc(10px * var(--ui-scale-combat-info)); background-color: var(--gold-color); color: #000; font-weight: bold; border-radius: 6px; box-shadow: 0 0 8px var(--gold-color); animation: pulse-orange 1.5s infinite; font-size: calc(1.1em * var(--ui-scale-combat-info)); }
.explore, .climb {
    padding: calc(8px * var(--ui-scale-action-btns)) calc(15px * var(--ui-scale-action-btns));
    border-radius: 6px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    font-size: calc(1.1em * var(--ui-scale-action-btns));
}
.climb {
    background-color: var(--secondary-color);
    color: #fff;
}
#attack-target-toggle-btn.explore {
    background: linear-gradient(-45deg, #e74c3c, #c0392b, #ff6b6b, #e74c3c);
    background-size: 400% 400%;
    color: #ffffff;
    border: 2px solid #ffdddd;
    box-shadow: 0 0 10px 2px rgba(255, 59, 48, 0.6), 
                inset 0 0 8px 1px rgba(255, 255, 255, 0.5);
    animation: world-boss-button-flow 3s ease infinite;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

@keyframes world-boss-button-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.auction-modal-content { max-width: calc(1600px * var(--ui-scale-modal-size)); width: 95%; height: 95vh; }
#auction-container { display: flex; flex-direction: row; gap: 20px; flex-grow: 1; min-height: 0; overflow-y: hidden; }
.auction-list-panel, .auction-detail-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: rgba(0, 0, 0, .2); padding: 10px; border-radius: 8px; }
#auction-grouped-grid, #auction-detail-list { overflow-y: auto; padding-right: 5px; }
.auction-list-panel .inventory-item:hover { transform: none; background-color: rgba(255, 255, 255, 0.1); }
.auction-detail-entry { display: flex; align-items: center; padding: 8px; border-bottom: 1px solid var(--border-color); }
.auction-detail-entry .seller-info { display: 0 0 15%; max-width: 15%; min-width: 0; white-space: nowrap; }
.auction-detail-item-image { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; }
.seller-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.auction-detail-entry .item-price-info { flex: 0 0 65%; max-width: 65%; min-width: 0; padding: 0 20px; white-space: nowrap; }
.auction-detail-entry .price { font-size: 1.1em; font-weight: bold; color: var(--gold-color); }
.auction-detail-entry .quantity { font-size: 0.9em; color: var(--text-muted); margin-left: 5px; }
.auction-detail-entry .auction-actions { flex: 0 0 20%; max-width: 20%; display: flex; justify-content: flex-end; gap: 8px; }
.my-listing-highlight { background-color: rgba(0, 122, 255, 0.15); }
.auction-controls { display: flex; gap: 15px; align-items: center; margin-bottom: 15px; flex-shrink: 0; }
#auction-search-input { flex-grow: 1; padding: 10px; border: 1px solid var(--border-color); background: var(--bg-color-dark); color: var(--text-color); border-radius: 6px; font-size: 1em; }
#auction-grade-filter { padding: 10px; border: 1px solid var(--border-color); background: var(--bg-color-dark); color: var(--text-color); border-radius: 6px; }
@keyframes glitter { 0%, 100% { box-shadow: 0 0 5px #ffd700; transform: scale(1); } 50% { box-shadow: 0 0 15px #fff, 0 0 25px #ffd700; transform: scale(1.05); } }
#mailbox-button { background: #8e44ad; color: #fff; transition: all 0.3s ease; }
#mailbox-button.new-mail { animation: glitter 1.5s infinite; }
#cash-shop-button.special-product-available {
    animation: glitter 1.5s infinite;
    border: 1px solid #ffd700;
    box-shadow: 0 0 5px #ffd700;
}
.mail-item { display: flex; align-items: center; gap: 15px; padding: 10px; border-bottom: 1px solid var(--border-color); }
.mail-item-icon .inventory-item { width: 60px; height: 60px; background: rgba(0,0,0,0.3); border-radius: 8px; cursor: default; }
.mail-item-info { flex-grow: 1; }
.mail-item-info h4 { margin: 0; font-size: 1.1em; }
.mail-item-info p { margin: 5px 0 0; color: var(--text-muted); font-size: 0.9em; }
.mail-item-icon-placeholder { width: 100px; height: 100px; flex-shrink: 0; }
.mail-item-info h4 .gold-text { font-weight: bold; }
.top-buttons #discord-button { background: #5865F2; color: #fff; padding: calc(8px * var(--ui-scale-top-menu)) calc(15px * var(--ui-scale-top-menu)); border: none; border-radius: 6px; cursor: pointer; font-weight: 700; transition: all .2s; text-decoration: none; display: inline-flex; align-items: center; font-size: calc(14px * var(--ui-scale-top-menu)); }
.top-buttons #discord-button:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; padding: 15px 0; }
#codex-content h3 { font-size: 1.6em; color: var(--secondary-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-top: 20px; }
#codex-content h3:first-child { margin-top: 0; }
.item-image.undiscovered img { opacity: 0.3; filter: grayscale(90%); }
.codex-completion-full { color: #ffd700; font-weight: bold; animation: blink 1.5s infinite alternate; text-shadow: 0 0 5px #ffeb3b; }
@keyframes blink { from { opacity: 1; } to { opacity: 0.8; } }
#item-action-modal .modal-content, #primal-choice-modal .modal-content { max-width: calc(450px * var(--ui-scale-modal-size)); text-align: center; }
#item-action-title, #primal-choice-modal h2 { margin-bottom: 30px; font-size: calc(1.8em * var(--ui-scale-modal-title)); }
#item-action-buttons, #primal-choice-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
#item-action-buttons .action-btn, #primal-choice-buttons .action-btn { padding: calc(15px * var(--ui-scale-action-btns)) calc(30px * var(--ui-scale-action-btns)); font-size: calc(1.2em * var(--ui-scale-action-btns)); }
#chat-messages .item-link { cursor: pointer; text-decoration: underline; font-weight: bold; }

@media (min-width: 900px){ 
    .main-content-wrapper{ flex-direction:row; } 
    .left-sector{ flex: 4; } 
    .right-sector{ flex: 6; }
}

@media (max-width: 820px) {

.auction-list-panel,
.auction-detail-panel {
    flex: none;       
    height: auto;     
    min-height: 300px; 
}

    body {
        height: auto;
        overflow: auto; 
    }
    #game-app-container {
        height: auto;
        min-height: 100vh;
    }
    .game-container {
        flex-direction: column;
        padding: 10px 5px;
    }
    .main-content-wrapper {
        flex-direction: column;
    }
    .left-sector, .right-sector {
        overflow-y: visible; 
    }
    .character-panel { padding:15px; gap:10px }
    .character-header h2 { font-size:calc(1.5em * var(--ui-scale-floor)) }
    .resource-display { font-size:calc(1.2em * var(--ui-scale-resources)) }
    .hp-bar { height:calc(35px * var(--ui-scale-combat-info)) }
    .hp-bar-text { font-size:calc(1em * var(--ui-scale-combat-info)) }
    .stat-info-combined, .stat-info-monster { gap:calc(8px * var(--ui-scale-stats)) }
    .stat-row, .stat-row-monster { font-size:calc(1em * var(--ui-scale-stats)) }
    .stat-row { grid-template-columns:auto 1fr auto }
    .button-group { gap:5px }
    .upgrade-btn { padding:calc(4px * var(--ui-scale-stat-btns)) calc(8px * var(--ui-scale-stat-btns)); font-size:calc(12px * var(--ui-scale-stat-btns)) }
    .equipment-slots { grid-template-columns: repeat(3, 1fr); gap: calc(10px * var(--ui-scale-equip)); }
    .slot { height:calc(100px * var(--ui-scale-equip)); }
    .artifact-sockets { gap: 15px; justify-content: space-around; }
    .artifact-socket { width: 50px; height: 50px; }
    .tabs { flex-wrap:nowrap }
    .tab-button { padding:calc(12px * var(--ui-scale-tabs)) calc(8px * var(--ui-scale-tabs)); font-size:calc(1em * var(--ui-scale-tabs)) }
    .tab-content { padding:10px }
    .inventory-grid { grid-template-columns:repeat(auto-fill,minmax(calc(80px * var(--ui-scale-inventory)),1fr)); gap:calc(10px * var(--ui-scale-inventory)) }
    .inventory-item, .enhancement-slot { padding:calc(8px * var(--ui-scale-inventory)) }
    .item-name { font-size:calc(.9em * var(--ui-scale-inventory)) }
    .item-effect { font-size:calc(.8em * var(--ui-scale-inventory)); margin-top:4px }
    .item-enhancement-level { font-size:calc(.8em * var(--ui-scale-inventory)); top:5px; right:5px }
    .item-quantity { font-size:calc(1.1em * var(--ui-scale-inventory)); bottom:5px; left:5px }
    .inventory-item { padding-bottom:1.8em }
    .enhancement-anvil { grid-template-columns:1fr; gap:15px }
    .enhancement-slot-wrapper, .enhancement-details, .enhancement-info, .enhance-execute-btn, .auto-amp-trigger-btn, .batch-amp-trigger-btn, .public-amp-trigger-btn { grid-column:1/-1 }
    .enhancement-slot { width:calc(150px * var(--ui-scale-enhance)); height:calc(150px * var(--ui-scale-enhance)) }
    .enhancement-details { font-size:calc(1.2em * var(--ui-scale-enhance)) }
    .enhancement-info { text-align:center; font-size:calc(1.1em * var(--ui-scale-enhance)) }
    .enhance-execute-btn { width:80%; padding:calc(15px * var(--ui-scale-enhance)); font-size:calc(1.2em * var(--ui-scale-enhance)) }
    .auto-amp-trigger-btn, .batch-amp-trigger-btn, .public-amp-trigger-btn { width:80% }
    .modal-overlay { padding:10px; }
    .modal-content { padding:15px; width: 95%; }
    .modal-content h2 { font-size:calc(1.5em * var(--ui-scale-modal-title)) }
    #ranking-list li, .feed-list li { font-size:calc(1em * var(--ui-scale-modal-body)); flex-wrap:wrap }
    .top-bar { flex-wrap:wrap; justify-content:center; gap:8px; padding:8px 10px; }
.top-buttons {
    order: 1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.top-buttons::-webkit-scrollbar { height: 4px; }
.top-buttons::-webkit-scrollbar-track { background: transparent; }
.top-buttons::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.top-buttons button { flex-shrink: 0; min-height: 44px; }
    .top-bar-right { order:2; gap:8px; }
    .topbar-controls { gap:6px; }
    .reconnect-text { display: none; }
    .reconnect-toggle-label { padding:4px 8px; }
    .lang-option { width:28px; height:24px; font-size:calc(13px * var(--ui-scale-top-menu)); }
    #auction-container { flex-direction:column }
    .inventory-container { flex-direction: column; }
    .interaction-panel { flex-basis: auto; width: 100%; }

}

@media (max-width:480px) {
    #user-info { width:100%; text-align:center; order:-1; margin-bottom:5px; font-size:calc(0.9em * var(--ui-scale-top-menu)); }
    .top-bar-right { order:3; width:100%; justify-content:center; gap:6px; flex-wrap:wrap; }
    #open-ui-settings-btn { height: 32px; padding: 0 10px; font-size: 12px; }
    .topbar-controls { gap:6px; flex-wrap:wrap; justify-content:center; }
    .lang-option { width:28px; height:28px; }
    #logout-button { min-height:44px; padding:calc(8px * var(--ui-scale-top-menu)) calc(16px * var(--ui-scale-top-menu)); font-size:calc(0.85em * var(--ui-scale-top-menu)); }
    .modal-overlay { padding:0; }
    .modal-content { padding:12px; width:100%; max-width:calc(100% * var(--ui-scale-modal-size)); border-radius:8px; }
    .modal-content h2 { font-size:calc(1.3em * var(--ui-scale-modal-title)); margin-bottom:15px; }
    .close-button { top:10px; right:12px; font-size:1.6em; min-width:44px; min-height:44px; display:flex; align-items:center; justify-content:center; }
    .game-container { padding:5px 3px; gap:8px; }
    .left-sector, .right-sector { padding:10px; }
    .character-panel { padding:8px; gap:10px; }
    .player-panel .character-header { flex-wrap:wrap; gap:8px; }
    .player-panel .character-header > div:first-child { width:100%; gap:10px !important; flex-wrap:wrap; }
    .character-header h2 { font-size:calc(1.1em * var(--ui-scale-floor)); }
    #player-floor-display { font-size:calc(0.85em * var(--ui-scale-floor)); }
    .resource-display { font-size:calc(0.9em * var(--ui-scale-resources)); width:100%; }
    .hp-bar { height:calc(28px * var(--ui-scale-combat-info)); }
    .hp-bar-text { font-size:calc(0.85em * var(--ui-scale-combat-info)); }
    .stat-row, .stat-row-monster { font-size:calc(0.9em * var(--ui-scale-stats)); }
    .stat-row { grid-template-columns:1fr auto; gap:calc(5px * var(--ui-scale-stat-btns)); }
    .stat-row .button-group { grid-column:1 / -1; }
    .button-group { justify-content:center; flex-wrap:wrap; gap:calc(4px * var(--ui-scale-stat-btns)); }
    .upgrade-btn { min-height:calc(40px * var(--ui-scale-stat-btns)); padding:calc(6px * var(--ui-scale-stat-btns)) calc(10px * var(--ui-scale-stat-btns)); font-size:calc(0.85em * var(--ui-scale-stat-btns)); }
    .equipment-slots { grid-template-columns:repeat(3, 1fr); gap:calc(6px * var(--ui-scale-equip)); }
    .slot { height:calc(80px * var(--ui-scale-equip)); padding:calc(6px * var(--ui-scale-equip)); font-size:calc(0.7em * var(--ui-scale-equip)); }
    .artifact-socket { width:40px; height:40px; }
    .tab-button { padding:calc(10px * var(--ui-scale-tabs)) calc(6px * var(--ui-scale-tabs)); font-size:calc(0.85em * var(--ui-scale-tabs)); }
    .tab-content { padding:8px; }
    .inventory-grid { grid-template-columns:repeat(auto-fill, minmax(calc(70px * var(--ui-scale-inventory)), 1fr)); gap:calc(6px * var(--ui-scale-inventory)); }
    .inventory-item, .enhancement-slot { padding:calc(6px * var(--ui-scale-inventory)); }
    .item-name { font-size:calc(0.8em * var(--ui-scale-inventory)); }
    .item-quantity { font-size:calc(1em * var(--ui-scale-inventory)); bottom:3px; left:5px; }
    .item-enhancement-level { font-size:calc(0.7em * var(--ui-scale-inventory)); top:3px; right:5px; padding:calc(2px * var(--ui-scale-inventory)) calc(4px * var(--ui-scale-inventory)); }
    .enhancement-slot { width:calc(120px * var(--ui-scale-enhance)); height:calc(120px * var(--ui-scale-enhance)); }
    .enhance-execute-btn { width:100%; padding:calc(12px * var(--ui-scale-enhance)); font-size:calc(1.1em * var(--ui-scale-enhance)); min-height:48px; }
    .auto-amp-trigger-btn, .batch-amp-trigger-btn { width:100%; min-height:44px; }
    #item-action-buttons .action-btn, #primal-choice-buttons .action-btn { padding:calc(12px * var(--ui-scale-action-btns)) calc(20px * var(--ui-scale-action-btns)); font-size:calc(1.1em * var(--ui-scale-action-btns)); min-height:48px; flex:1 1 auto; }
    #item-action-title, #primal-choice-modal h2 { font-size:calc(1.4em * var(--ui-scale-modal-title)); margin-bottom:20px; }
    #ranking-list li, .feed-list li, .record-item { font-size:calc(.9em * var(--ui-scale-modal-body)); padding-left:0; padding-right:0 }
    .rank-badge { margin-right:8px!important }
    #title-codex-content { grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; }
    .title-card { min-height:100px; padding:10px; }
    .title-card-name { font-size:1em; }
    button, [role="button"], .action-btn, input[type="submit"], select { min-height:44px; }
    input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea { font-size:16px; }
    .monster-header-controls { flex-wrap:wrap; gap:6px; }
    .floor-action-buttons { flex-wrap:wrap; gap:4px; }
    .floor-action-buttons .action-btn,
    .floor-action-buttons button { padding:calc(5px * var(--ui-scale-action-btns)) calc(8px * var(--ui-scale-action-btns)); font-size:calc(0.72em * var(--ui-scale-action-btns)); min-height:32px; white-space:nowrap; }
    #floor-controls { display:flex; gap:4px; }
    .chat-input-area { flex-wrap:wrap; gap:5px; }
    .chat-actions { gap:3px; }
    #chat-submit-btn { padding:0 calc(10px * var(--ui-scale-chat)); font-size:calc(0.85em * var(--ui-scale-chat)); white-space:nowrap; height:calc(36px * var(--ui-scale-chat)); min-height:36px; }
    #open-chat-custom-btn, #open-chat-manage-btn, #open-alarm-settings-btn { width:36px; height:36px; font-size:1em; min-height:36px; }
}

#auction-container {
    display:flex;
    flex-direction:row;
    gap:20px;
    min-height:0;
    flex-grow:1;
    overflow-y:auto
}

#special-stats-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:calc(5px * var(--ui-scale-stats)) calc(5px * var(--ui-scale-stats));
    margin-top:calc(5px * var(--ui-scale-stats));
    font-size:calc(1em * var(--ui-scale-stats));
}

.player-panel{ gap:10px; }
#title-codex-button {
    background: #8e44ad; 
    color: #fff;
}

.tab-button[data-tab="spirit-tab"] {
    color: #48dbfb;
}
.tab-button[data-tab="spirit-tab"].active {
    color: #48dbfb;
    border-bottom-color: #48dbfb;
}

.inventory-item[data-item-type="Spirit"] {
    border-color: #48dbfb;
    box-shadow: 0 0 8px #48dbfb;
    animation: pulse-spirit 2s infinite;
}

@keyframes pulse-spirit {
    50% { box-shadow: 0 0 15px #0abde3, 0 0 5px #fff inset; }
}
#title-codex-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    align-content: start;
}
.title-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--bg-color-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    transition: all 0.2s ease-in-out;
}
.title-card.locked {
    opacity: 0.5;
    filter: grayscale(80%);
    cursor: help;
}
.title-card.unlocked {
    cursor: pointer;
}

.title-card.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--secondary-color);
}
.title-card-name {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    text-align: center;
    word-break: break-all;
}

.title-card-effect {
    font-size: 0.9em;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 15px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-card-actions {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.title-card-equipped-badge {
    color: var(--epic-color);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}
#chat-messages li .username .title {
    font-weight: bold;
    margin-right: 5px;
    vertical-align: middle;
}

#admin-panel-button {
    background: var(--gold-color);
    color: var(--bg-color-dark);
    font-weight: 700;
    border: 1px solid #000;
}

.admin-panel-content {
    width: 95%;
    max-width: 1600px;
    height: 90vh;
}

.admin-panel-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.admin-tab-button {
    padding: 12px 20px;
    font-size: 1.2em;
    font-weight: 500;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.admin-tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-tab-content {
    display: none;
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
}

.admin-tab-content.active {
    display: flex;
    flex-direction: column;
}

.admin-tab-content h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.metric-card h4 {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.metric-card p {
    font-size: 2em;
    font-weight: 700;
}

.online-users-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

#admin-online-users-table {
    width: 100%;
    border-collapse: collapse;
}

#admin-online-users-table th, #admin-online-users-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

#admin-online-users-table tbody tr {
    cursor: pointer;
}

#admin-online-users-table tbody tr:hover {
    background-color: var(--surface-color);
}
.user-mgmt-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-search-section {
    display: flex;
    gap: 10px;
}

#admin-user-search-input {
    flex-grow: 1;
    padding: 10px;
    font-size: 1em;
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
}

.admin-section {
    background: var(--surface-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.admin-section h4 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.user-edit-grid, .item-grant-grid, .sanction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.user-edit-grid label {
    align-self: center;
}

.admin-section input, .admin-section select {
    padding: 8px;
    font-size: 1em;
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
}

.sanction-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}
.sanction-buttons .action-btn.sell-btn {
    background-color: var(--fail-color);
}
#admin-chat-log-list {
    list-style-type: none;
    padding: 0;
    height: 100%;
    overflow-y: auto;
}

#admin-chat-log-list li {
    padding: 8px;
    border-bottom: 1px solid var(--surface-color);
    line-height: 1.6;
}

#admin-user-details-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.admin-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.admin-detail-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-detail-card h4 {
    font-size: 1.3em;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.admin-form-grid label {
    font-weight: 500;
    color: var(--text-muted);
}
.admin-form-grid input {
    width: 100%;
}
.admin-form-grid hr {
    grid-column: 1 / -1;
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}

.admin-sub-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}
.admin-sub-tab-button {
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.admin-sub-tab-button.active {
    color: var(--success-color);
    border-bottom-color: var(--success-color);
}

.admin-sub-tab-content {
    display: none;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}
.admin-sub-tab-content.active {
    display: block;
}
.admin-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.admin-inventory-item {
    position: relative;
}
.admin-item-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background-color: var(--fail-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.admin-item-delete-btn:hover {
    opacity: 1;
}
#admin-user-auctions-table {
    width: 100%;
    border-collapse: collapse;
}
#admin-user-auctions-table th, #admin-user-auctions-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}
#admin-user-auctions-table .action-btn {
    padding: 4px 8px;
    font-size: 0.9em;
}

#admin-user-equipment .slot {
    height: 110px;
    border: 2px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    position: relative;
}

#admin-user-equipment .slot .inventory-item {
    border: none;
    padding: 0;
    background: none;
    cursor: default;
}

#admin-user-equipment .slot:empty::after {
    content: '없음';
    color: var(--text-muted);
}
#announcement-banner.primal {
    background: linear-gradient(
        -45deg, 
        #000000, 
        #2d004d, 
        #00e6d2, 
        #ffd700, 
        #000000
    );
    background-size: 400% 400%;
    color: #ffffff;
    font-weight: 900;
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px 5px rgba(0, 230, 210, 0.7), 
                0 0 30px 10px rgba(255, 215, 0, 0.5),
                inset 0 0 10px 2px rgba(255, 215, 0, 0.8);
    animation: primal-gradient-flow 5s ease infinite;
}

#announcement-banner.primal span {
    text-shadow: 
        0 0 5px #fff, 
        0 0 10px #fff, 
        0 0 15px #00e6d2, 
        0 0 20px #00e6d2, 
        0 0 25px #00e6d2, 
        0 0 30px #00e6d2, 
        0 0 35px #00e6d2;
    animation: text-flicker 3s linear infinite;
}

@keyframes primal-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes text-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 4px #fff,
            0 0 11px #00e6d2,
            0 0 19px #00e6d2,
            0 0 40px #00e6d2,
            0 0 80px #00e6d2;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.primal-drop-message {
    background: linear-gradient(-45deg, #000000, #2d004d, #00e6d2, #ffd700, #000000);
    background-size: 400% 400%;
    border: 1px solid #ffd700;
    border-radius: 8px;
    padding: 10px 15px;
    margin: 8px 0 !important;
    box-shadow: 0 0 10px 2px rgba(0, 230, 210, 0.6);
    animation: primal-gradient-flow 5s ease infinite;
    text-align: center;
    line-height: 1.6;
}

.slot.slot-grade-Primal {
    border-style: solid;
    border-color: var(--primal-color);
    box-shadow: 0 0 15px var(--primal-color), inset 0 0 10px rgba(0, 230, 210, 0.3);
    animation: pulse-primal-border 2.5s infinite alternate;
}

@keyframes pulse-primal-border {
    from {
        box-shadow: 0 0 10px rgba(0, 230, 210, 0.4), inset 0 0 8px rgba(0, 230, 210, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 230, 210, 0.8), inset 0 0 15px rgba(0, 230, 210, 0.4);
    }
}

.primal-drop-content .primal-congrats {
    display: block;
    font-size: 1.2em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 8px #ffd700;
    animation: text-flicker 3s linear infinite;
    margin-bottom: 5px;
}

.primal-drop-content .primal-text {
    font-size: 1.1em;
    color: #fff;
    text-shadow: 0 0 5px #000;
}

.stat-row .stat-value {
    font-size: 0.8em; 
    letter-spacing: -0.5px; 
}

#online-users-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    overflow-x: auto;
}

#online-users-list li.online-user-card {
    display: flex;
    align-items: baseline;
    white-space: nowrap;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: clamp(0.6em, 2.2vw, 0.88em);
    line-height: 1.8;
    overflow: visible;
    transition: background-color 0.2s;
}

#online-users-list li.online-user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.ou-sep {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.ou-icon {
    display: inline-block;
    margin: 0 4px 0 2px;
}

.ou-floor {
    font-weight: bold;
    color: var(--gold-color, #ffd700);
}

.ou-amp {
    -webkit-text-fill-color: #bf5af2 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #bf5af2 !important;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(191, 90, 242, 0.7), 0 0 16px rgba(191, 90, 242, 0.35);
    animation: ou-amp-pulse 2s ease-in-out infinite alternate;
}

@keyframes ou-amp-pulse {
    from { text-shadow: 0 0 6px rgba(191, 90, 242, 0.5); }
    to { text-shadow: 0 0 12px rgba(191, 90, 242, 0.9), 0 0 24px rgba(191, 90, 242, 0.4); }
}

#research-tab {
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.research-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(18, 20, 29, 0.95), transparent);
    border-bottom: 1px solid rgba(142, 142, 147, 0.15);
    flex-shrink: 0;
}

.research-header h3 {
    font-size: 1.3em;
    color: var(--primary-color);
    margin: 0;
}

.research-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.research-essence-display {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--mystic-color);
}

.research-essence-display span {
    font-weight: 700;
}

.research-reset-btn {
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.35);
    color: var(--fail-color);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.research-reset-btn:active {
    background: rgba(255, 59, 48, 0.25);
    transform: scale(0.95);
}

.research-spec-tabs {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.15);
}

.research-spec-tab {
    flex: 1;
    padding: 9px 6px;
    background: rgba(44, 45, 62, 0.4);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.research-spec-tab.active {
    color: var(--secondary-color);
    background: rgba(255, 149, 0, 0.1);
    border-color: rgba(255, 149, 0, 0.35);
    box-shadow: 0 0 10px rgba(255, 149, 0, 0.1);
}

.research-container {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 12px;
}

.research-spec-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.research-spec-panel.active {
    display: flex;
}

.rt-row {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.rt-row-multi {
    gap: 20px;
}

.rt-connectors {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    position: relative;
    width: 100%;
}

.rt-connectors.rt-branch {
    height: 40px;
}

.rt-branch-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.rt-svg-locked {
    stroke: rgba(142, 142, 147, 0.2);
    stroke-width: 2;
    stroke-dasharray: 5, 4;
}

.rt-svg-active {
    stroke: var(--primary-color);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 4px rgba(0, 122, 255, 0.5));
}

.rt-svg-maxed {
    stroke: var(--gold-color);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.rt-vline {
    width: 2px;
    height: 100%;
    border-radius: 1px;
}

.rt-line-locked {
    background: rgba(142, 142, 147, 0.2);
    background-image: repeating-linear-gradient(
        180deg,
        rgba(142, 142, 147, 0.25) 0px,
        rgba(142, 142, 147, 0.25) 5px,
        transparent 5px,
        transparent 9px
    );
    background-color: transparent;
}

.rt-line-active {
    background: var(--primary-color);
    box-shadow: 0 0 6px rgba(0, 122, 255, 0.5);
}

.rt-line-maxed {
    background: var(--gold-color);
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.rt-node {
    width: 130px;
    padding: 12px 8px 10px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(44, 45, 62, 0.85), rgba(28, 31, 45, 0.95));
    border: 1.5px solid rgba(142, 142, 147, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    transition: all 0.2s ease;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.rt-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.rt-node.unlocked {
    cursor: pointer;
    border-color: rgba(0, 122, 255, 0.5);
    background: linear-gradient(160deg, rgba(0, 122, 255, 0.1), rgba(28, 31, 45, 0.95));
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rt-node.unlocked:active {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rt-node.locked {
    opacity: 0.28;
    filter: grayscale(60%);
}

.rt-node.maxed {
    border-color: rgba(255, 215, 0, 0.45);
    background: linear-gradient(160deg, rgba(255, 215, 0, 0.07), rgba(28, 31, 45, 0.95));
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rt-node.maxed::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
}

.rt-node.maxed::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), transparent 40%, transparent 60%, rgba(255, 149, 0, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.rt-node-badge {
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
    padding: 1px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
}

.research-tier-basic { color: #a9a9a9; }
.research-tier-inter { color: var(--rare-color); }
.research-tier-adv { color: var(--legendary-color); }
.research-tier-inf { color: var(--mystic-color); }

.rt-node.maxed .research-tier-inf {
    animation: rt-mystic-pulse 2.5s ease-in-out infinite;
}

@keyframes rt-mystic-pulse {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 45, 85, 0.5); }
    50% { text-shadow: 0 0 12px rgba(255, 45, 85, 0.9), 0 0 20px rgba(255, 45, 85, 0.3); }
}

.rt-node-name {
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-color);
    word-break: keep-all;
}

.rt-node-level {
    font-size: 0.75em;
    color: var(--success-color);
    font-weight: 700;
    margin-top: 3px;
}

.rt-level-maxed {
    color: var(--gold-color);
}

.rt-progress {
    width: 80%;
    height: 3px;
    background: rgba(142, 142, 147, 0.15);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.rt-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: var(--primary-color);
}

.rt-node.maxed .rt-progress-bar {
    background: linear-gradient(90deg, var(--gold-color), var(--legendary-color));
}

.research-detail-content {
    max-width: calc(420px * var(--ui-scale-modal-size));
}

.research-detail-header {
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
}

.research-detail-tier-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.research-detail-tier-badge.research-tier-basic {
    background: rgba(169, 169, 169, 0.12);
    border: 1px solid rgba(169, 169, 169, 0.35);
}

.research-detail-tier-badge.research-tier-inter {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.35);
}

.research-detail-tier-badge.research-tier-adv {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.35);
}

.research-detail-tier-badge.research-tier-inf {
    background: rgba(255, 45, 85, 0.1);
    border: 1px solid rgba(255, 45, 85, 0.35);
}

.research-detail-level-display {
    font-size: 1.15em;
    color: var(--success-color);
    font-weight: 700;
    margin-top: 8px;
}

.research-detail-level-display.maxed {
    color: var(--gold-color);
}

#research-modal-body {
    padding: 0;
    line-height: 1.6;
}

.research-detail-effects {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.research-effect-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
}

.research-effect-row.current {
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.18);
}

.research-effect-row.next {
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.18);
}

.research-effect-label {
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-muted);
}

.research-effect-value {
    font-weight: 600;
    font-size: 0.95em;
}

.research-effect-row.current .research-effect-value {
    color: var(--success-color);
}

.research-effect-row.next .research-effect-value {
    color: var(--primary-color);
}

.research-detail-requirement {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 59, 48, 0.06);
    border: 1px solid rgba(255, 59, 48, 0.15);
    color: var(--fail-color);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.research-detail-cost {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 45, 85, 0.06);
    border: 1px solid rgba(255, 45, 85, 0.15);
}

.research-detail-cost .cost-value {
    color: var(--mystic-color);
    font-weight: 700;
    font-size: 1.15em;
}

.research-detail-cost .cost-balance {
    display: block;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 3px;
}

.research-detail-maxed-banner {
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 149, 0, 0.08));
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: var(--gold-color);
    font-weight: 700;
    font-size: 1.1em;
}

#research-modal-footer {
    text-align: center;
    margin-top: 14px;
}

#research-upgrade-button {
    width: 80%;
    padding: 14px;
    font-size: 1.15em;
    border-radius: 10px;
    font-weight: 700;
}

#research-upgrade-button:disabled {
    opacity: 0.35;
}

#announcement-banner.event {
    background: linear-gradient(-45deg, #ff3c00, #ff2d55, #d43cff, #5856d6, #007aff, #33abf3, #ffc900);
    background-size: 600% 600%;
    animation: primal-gradient-flow 8s ease infinite;
    color: #fff;
    text-shadow: 0 0 4px #000, 0 0 8px #000;
    border-bottom: 3px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

@keyframes primal-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.system-message.event-chat {
    background: linear-gradient(-45deg, #000000, #2d004d, #00e6d2, #ffd700, #000000);
    background-size: 400% 400%;
    border: 1px solid #ffd700;
    border-radius: 8px;
    padding: 10px 15px;
    margin: 8px 0 !important;
    box-shadow: 0 0 10px 2px rgba(0, 230, 210, 0.6);
    animation: primal-gradient-flow 5s ease infinite;
    text-align: center;
    line-height: 1.6;
    color: #fff;
    font-size: 1.1em;
    text-shadow: 0 0 5px #000;
}
.event-chat .event-tag {
    font-weight: 900;
    animation: text-flicker 3s linear infinite;
}
@keyframes text-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 4px #fff,
            0 0 11px #00e6d2,
            0 0 19px #00e6d2,
            0 0 40px #00e6d2,
            0 0 80px #00e6d2;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}
.helper-message {

    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15) 0%, rgba(175, 82, 222, 0.15) 100%);
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, var(--primary-color), var(--epic-color)) 1;
    border-radius: 6px;

    box-shadow: 0 0 8px rgba(175, 82, 222, 0.5);
    animation: helper-pulse 2.5s infinite ease-in-out;
}

.helper-message .username {
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary-color), var(--epic-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: helper-text-readable-shine 2s infinite;
}

@keyframes helper-pulse {
    0% {
        box-shadow: 0 0 8px rgba(88, 134, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(175, 82, 222, 0.7);
    }
    100% {
        box-shadow: 0 0 8px rgba(88, 134, 255, 0.5);
    }
}
@keyframes helper-text-readable-shine {
    0%, 100% {

        text-shadow: 0 0 1px #ffffff, 0 0 4px var(--primary-color);
    }
    50% {
        text-shadow: 0 0 1px #ffffff, 0 0 8px var(--epic-color);
    }
}

#incubator-tab {
    padding: 10px;
    align-items: center;
}

#incubator-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: calc(620px * var(--ui-scale-modal-size));
}

.incubator-slot {
    width: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px 8px;
    gap: 4px;
    text-align: center;
    font-size: 1em;
    transition: all 0.2s ease;
}

.incubator-slot.empty {
    justify-content: center;
    min-height: 80px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.incubator-slot.empty:hover {
    border-color: var(--success-color);
    background-color: rgba(52, 199, 89, .1);
    cursor: pointer;
}

.incubator-slot-egg-image {
    width: 65%;
}

.incubator-slot-egg-image .inventory-item {
    width: 100%;
    height: auto;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px;
    padding-bottom: 4px;
}

.incubator-slot-egg-image .inventory-item .item-image {
    padding-top: 100%;
}

.incubator-slot .start-hatch-btn {
    font-size: 0.85em;
    padding: 5px 12px;
    margin-top: 2px;
}

.incubator-slot .hatching-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.incubator-slot .progress-bar {
    width: 85%;
    height: 14px;
}

.incubator-slot .hatching-info [id^="hatch-timer"] {
    font-size: 0.8em;
    font-weight: 500;
}

#hatch-button {
    padding: 8px 16px;
    font-size: 0.95em;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background-color: var(--success-color);
    color: #fff;
    cursor: pointer;
}

#hatch-button:disabled {
    background-color: #444;
    color: #777;
    cursor: not-allowed;
}

.inventory-item.prefix-완벽 {
    border-color: #E0E0E0; 
    box-shadow: 0 0 10px #FFFFFF;
}
.inventory-item.prefix-격노 {
    border-color: #FF4D4D;
    box-shadow: 0 0 12px #FF4D4D;
    animation: pulse-fury 1.5s infinite;
}
.inventory-item.prefix-파멸 {
    border-color: #B388FF;
    box-shadow: 0 0 12px #B388FF;
    animation: pulse-ruin 2.0s infinite;
}
.inventory-item.prefix-포식자 {
    border-color: #CF2222;
    box-shadow: 0 0 12px #CF2222;
    animation: pulse-predator 2.5s infinite;
}
.inventory-item.prefix-계시 {
    border-color: #FFD700;
    box-shadow: 0 0 12px #FFD700;
    animation: pulse-revelation 1.8s infinite;
}

@keyframes pulse-fury { 50% { box-shadow: 0 0 20px #FF8A80; } }
@keyframes pulse-ruin { 50% { box-shadow: 0 0 20px #D1C4E9; } }
@keyframes pulse-predator { 50% { box-shadow: 0 0 20px #EF5350; } }
@keyframes pulse-revelation { 50% { box-shadow: 0 0 20px #FFF176; } }
.buff-icon.awakening { background-color: var(--gold-color); color: #000; box-shadow: 0 0 8px var(--gold-color); }
.buff-icon.fury-attack { background-color: #FF4D4D; color: #fff; box-shadow: 0 0 8px #FF4D4D; }
.buff-icon.fury-defense { background-color: #4D94FF; color: #fff; box-shadow: 0 0 8px #4D94FF; }
.buff-icon.predator-state { background-color: #CF2222; color: #fff; box-shadow: 0 0 8px #CF2222; }
.buff-icon.predator-endurance { background-color: #550000; color: #fff; border: 1px solid #CF2222; box-shadow: 0 0 8px #550000; }

.item-prefix-description {
    font-size: calc(0.85em * var(--ui-scale-inventory));
    color: #a0a0a0;
    margin-top: 4px;
    font-style: italic;
}
.set-effect-container {
    text-align: center;
    margin-top: 15px; 
    padding: 10px;
    border-radius: 8px;
    min-height: 60px; 
    transition: all 0.3s ease-in-out;
}
.set-effect-container.inactive {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
}
.set-effect-container.active {
    border: 1px solid; 
}

.set-effect-container h4 {
    margin-bottom: 5px;
    font-size: 1.1em;
    font-weight: 700;
}

.set-effect-container p {
    font-size: 0.9em;
    line-height: 1.5;
}
.set-effect-완벽 { border-color: #FFFFFF; color: #FFFFFF; text-shadow: 0 0 8px #FFFFFF; }
.set-effect-격노 { border-color: #FF4D4D; color: #FF4D4D; text-shadow: 0 0 8px #FF4D4D; }
.set-effect-파멸 { border-color: #B388FF; color: #B388FF; text-shadow: 0 0 8px #B388FF; }
.set-effect-포식자 { border-color: #CF2222; color: #CF2222; text-shadow: 0 0 8px #CF2222; }
.set-effect-계시 { border-color: #FFD700; color: #FFD700; text-shadow: 0 0 8px #FFD700; }
#scroll-target-slot-container {
    display: flex;
    align-items: center;
    gap: 20px;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background-color: var(--bg-color-dark);
    width: 100%;
}

#scroll-target-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: stretch; 
}

#scroll-target-item-details h3 {
    font-size: 1.4em;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

#scroll-item-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.1em;
    flex-grow: 1; 
    justify-content: center; 
}

#scroll-item-stats-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#scroll-item-stats-list > div .stat-name {
    color: var(--text-muted);
}

#scroll-item-stats-list > div .stat-value {
    font-weight: bold;
}
.item-enchantment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 2px;
}
.item-enchantment-grid.item-enchantment-grid-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scroll-enhancement-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    padding: 10px;
}

#scroll-target-sector {
    flex: 1.5; 
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0; 
    overflow-y: auto;
}

#scroll-material-sector {
    flex: 1; 
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0; 
}

#scroll-material-grid {
    overflow-y: auto;
    flex-grow: 1;
}

#scroll-target-slot-container {
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--bg-color-dark);
    width: 100%;
    max-width: calc(500px * var(--ui-scale-modal-size));
}

#scroll-target-item-image {
    width: 130px; 
    height: 130px;
    cursor: default;
    flex-shrink: 0;
    padding: 5px;
}

#scroll-target-item-details {
    flex-grow: 1;
}

#scroll-item-stats-list {
    font-size: 1.05em;
}

#scroll-execute-btn {
    margin-top: 15px;
}

#item-info-modal .modal-content {
    width: 90%;          
    max-width: calc(550px * var(--ui-scale-modal-size));
    padding: 30px;       
}

#item-info-modal .item-image-wrapper {
    width: 200px;       
    height: 200px;      
}

#item-info-modal h3 {
    font-size: 1.6em;    
}

#item-info-modal #scroll-item-stats-list {
    font-size: 1.15em;   
}
#item-info-modal .modal-stats-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#refinement-container {
    display: flex; flex-direction: column; height: 100%; gap: 10px; padding: 8px;
}
#refinement-target-sector {
    flex-shrink: 0;
    background: linear-gradient(160deg, rgba(15,18,30,0.98) 0%, rgba(25,30,55,0.95) 50%, rgba(20,25,45,0.98) 100%);
    border: 1px solid rgba(96,165,250,0.12); border-radius: 16px;
    padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px;
    overflow-y: auto;
    position: relative;
}
#refinement-target-sector::before {
    content: ''; position: absolute; inset: 0; border-radius: 16px;
    background: radial-gradient(ellipse at 50% 0%, rgba(96,165,250,0.06) 0%, transparent 70%);
    pointer-events: none;
}
#refinement-target-placeholder {
    padding: 30px 20px; text-align: center; color: #4a5568;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.refine-placeholder-icon {
    font-size: 2.5em; opacity: 0.4;
    animation: refine-placeholder-pulse 3s ease-in-out infinite;
}
@keyframes refine-placeholder-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}
#refinement-target-placeholder p {
    font-size: 0.9em; color: #64748b; line-height: 1.5;
}
#refinement-target-display {
    display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%;
}
.refine-hero-area {
    display: flex; align-items: center; gap: 18px; width: 100%;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(96,165,250,0.04) 0%, rgba(34,211,238,0.03) 100%);
    border: 1px solid rgba(96,165,250,0.08); border-radius: 14px;
    position: relative;
}
.refine-item-showcase {
    position: relative; flex-shrink: 0;
}
.refine-item-showcase .enhancement-slot {
    width: 96px; height: 96px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(0,0,0,0.4), rgba(15,20,35,0.6));
    border: 2px solid rgba(96,165,250,0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.refine-level-badge {
    position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; font-size: 0.72em; font-weight: 800;
    padding: 2px 10px; border-radius: 10px;
    white-space: nowrap; letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
    z-index: 2;
}
.refine-level-badge.max-level {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
    animation: refine-max-glow 2s ease-in-out infinite;
}
@keyframes refine-max-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 2px 16px rgba(245,158,11,0.7); }
}
#refinement-info-panel {
    flex: 1; min-width: 0; text-align: left;
    display: flex; flex-direction: column; gap: 6px;
}
#refinement-info-panel h3 {
    font-size: 1.15em; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
}
#refinement-level-text {
    font-size: 0.85em; font-weight: 700; color: #60a5fa;
    letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px;
}
.refinement-exp-bar {
    width: 100%; height: 22px; background: rgba(0,0,0,0.5); border-radius: 11px;
    position: relative; overflow: hidden; border: 1px solid rgba(96,165,250,0.12);
}
.refinement-exp-bar-inner {
    height: 100%; border-radius: 11px;
    background: linear-gradient(90deg, #3b82f6 0%, #22d3ee 60%, #a78bfa 100%);
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.refinement-exp-bar-inner::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    animation: refine-exp-shimmer 2.5s ease-in-out infinite;
}
@keyframes refine-exp-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
.refinement-exp-bar-text {
    position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
    font-size: 0.75em; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    font-variant-numeric: tabular-nums; letter-spacing: -0.2px;
}
#refinement-effect-text {
    font-size: 0.85em; color: #a78bfa; font-weight: 600;
    padding: 5px 10px; border-radius: 6px;
    background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.12);
    display: inline-block;
}
#refinement-materials-input {
    display: flex; flex-wrap: wrap; gap: 8px; width: 100%;
    justify-content: center; min-height: 36px; padding: 6px 0;
}
.refine-mat-chip {
    display: flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 5px 10px; font-size: 0.82em; color: #ccc;
    cursor: pointer; transition: all 0.2s;
}
.refine-mat-chip:hover { background: rgba(255,80,80,0.15); border-color: rgba(255,80,80,0.3); transform: scale(1.03); }
.refine-mat-chip img { width: 20px; height: 20px; object-fit: contain; }
.refine-mat-chip .chip-qty { font-weight: 700; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.refine-mat-chip .chip-exp { color: #60a5fa; font-weight: 600; margin-left: 2px; }
#refinement-action-buttons {
    display: flex; gap: 8px; justify-content: center; width: 100%;
}
#refinement-action-buttons .action-btn {
    flex: 1; padding: 11px 10px; font-size: 0.88em; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05);
    color: #ccc; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
#refinement-action-buttons .action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
#refinement-action-buttons .enhance-execute-btn {
    flex: 2; padding: 12px 14px; font-size: 0.95em; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #6366f1); border: none;
    color: #fff; font-weight: 700; cursor: pointer; transition: all 0.25s;
    box-shadow: 0 3px 12px rgba(59,130,246,0.3);
    position: relative; overflow: hidden;
}
#refinement-action-buttons .enhance-execute-btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%); transition: transform 0.5s;
}
#refinement-action-buttons .enhance-execute-btn:hover:not(:disabled)::before { transform: translateX(100%); }
#refinement-action-buttons .enhance-execute-btn:hover:not(:disabled) {
    box-shadow: 0 5px 20px rgba(99,102,241,0.5); transform: translateY(-2px);
}
#refinement-action-buttons .enhance-execute-btn:disabled {
    background: rgba(255,255,255,0.05); color: #555; box-shadow: none; cursor: default;
}
#refinement-action-buttons .sell-btn {
    background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #f87171;
}
#refinement-action-buttons .sell-btn:hover { background: rgba(239,68,68,0.18); color: #fca5a5; }
#refinement-material-sector {
    flex: 1; min-height: 100px;
    background: linear-gradient(160deg, rgba(15,18,30,0.98), rgba(25,30,55,0.95));
    border: 1px solid rgba(255,255,255,0.06); border-radius: 14px;
    padding: 12px; display: flex; flex-direction: column; overflow: hidden;
}
#refinement-material-sector h4 {
    text-align: center; margin-bottom: 8px; color: #64748b; font-size: 0.82em;
    font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
}
#refinement-material-grid { overflow-y: auto; flex-grow: 1; }
.item-refinement-level {
    position: absolute; top: 5px; left: 5px; font-size: 0.8em; font-weight: 700;
    background: rgba(0, 0, 0, 0.7); padding: 2px 5px; border-radius: 4px; z-index: 1;
}

.slot.refine-aura-blue { box-shadow: 0 0 15px 3px #3498db, inset 0 0 10px 2px rgba(52, 152, 219, 0.5); }
.slot.refine-aura-purple { box-shadow: 0 0 20px 4px var(--epic-color), inset 0 0 12px 3px rgba(175, 82, 222, 0.5); animation: pulse-purple 2s infinite; }
.slot.refine-aura-orange { box-shadow: 0 0 25px 5px var(--legendary-color), inset 0 0 15px 4px rgba(255, 149, 0, 0.5); animation: pulse-orange 1.5s infinite; }
.slot.refine-aura-primal {
    box-shadow: 0 0 30px 6px var(--primal-color), inset 0 0 18px 5px rgba(0, 230, 210, 0.6);
    animation: sparkle-rainbow-15 4s linear infinite, lightning 2s linear infinite;
}

.floor-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}
.refinement-great-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: 900;
    pointer-events: none;
    z-index: 10;
    animation: great-success-pop 1.5s cubic-bezier(.25, .46, .45, .94) forwards;
    background: linear-gradient(45deg, var(--primal-color), #ffd700, var(--mystic-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        0 0 10px var(--primal-color),
        0 0 20px #ffd700;
}

@keyframes great-success-pop {
    0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    to { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.item-refinement-level {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: calc(0.8em * var(--ui-scale-inventory));
    font-weight: 700;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 1;
    color: var(--primal-color);
}
.slot.refine-aura-blue, .inventory-item.refine-aura-blue { box-shadow: 0 0 15px 3px #3498db, inset 0 0 10px 2px rgba(52, 152, 219, 0.5); }
.slot.refine-aura-purple, .inventory-item.refine-aura-purple { box-shadow: 0 0 20px 4px var(--epic-color), inset 0 0 12px 3px rgba(175, 82, 222, 0.5); animation: pulse-purple 2s infinite; }
.slot.refine-aura-orange, .inventory-item.refine-aura-orange { box-shadow: 0 0 25px 5px var(--legendary-color), inset 0 0 15px 4px rgba(255, 149, 0, 0.5); animation: pulse-orange 1.5s infinite; }
.slot.refine-aura-primal, .inventory-item.refine-aura-primal {
    box-shadow: 0 0 30px 6px var(--primal-color), inset 0 0 18px 5px rgba(0, 230, 210, 0.6);
    animation: sparkle-rainbow-15 4s linear infinite, lightning 2s linear infinite;
}

@keyframes pulse-success {
    0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
    70% { box-shadow: 0 0 15px 20px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.refinement-infused-animation {
    animation: pulse-success 0.7s ease-out;
}

.refinement-great-success-aura {

    animation: sparkle-rainbow-15 2s linear 1, lightning 1.5s linear 1;
    border-style: solid !important; 
    border-width: 3px !important;   
}

@keyframes great-success-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.great-success-bar {
    background: linear-gradient(
        120deg, 
        #ffd700, 
        #ffab00, 
        var(--primal-color), 
        #ffd700,
        #ffab00
    );
    background-size: 200% 100%;
    animation: great-success-shimmer 2s linear infinite;
}
#announcement-banner.great-success {
    background: linear-gradient(
        135deg, 
        #ffde59, 
        #ff9500, 
        #ff2d55, 
        #af52de, 
        #00e6d2, 
        #ffde59
    );
    background-size: 300% 300%;
    color: #ffffff;
    font-weight: 900;
    border: 2px solid #fff;
    box-shadow: 0 0 20px 7px rgba(255, 255, 255, 0.8), 
                0 0 40px 15px rgba(255, 215, 0, 0.7);
    animation: great-success-flow 4s ease-in-out infinite; 
}
@keyframes great-success-pulse {
    0% {
        box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.4), 
                    0 0 20px 8px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px 8px rgba(255, 215, 0, 0.9), 
                    0 0 50px 20px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.4), 
                    0 0 20px 8px rgba(255, 255, 255, 0.3);
    }
}

#announcement-banner.great-success {
    background: linear-gradient(135deg, #28231E, #4A3F35); 
    color: #FFD700; 
    font-weight: 900;
    border: 2px solid #FFD700;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    animation: great-success-pulse 1.5s ease-in-out infinite; 
}

#announcement-banner.great-success span {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.system-message.great-success-chat {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700; 
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); 
    text-align: center;
    font-weight: bold;
    color: #FFD700;
    padding: 10px;
    margin: 8px 0 !important;
    text-shadow: none; 
    animation: none;  
}

.dps-result-overview h3, .dps-result-overview h4 {
    margin: 0;
}

.dps-stat-block h4 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.dps-stat-block p {
    margin: 8px 0;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
}

.dps-stat-block p span {
    font-weight: bold;
}

.dps-ranking-entry:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#chat-messages li.dps-boast-message {
    background-color: rgba(230, 126, 34, 0.1);
    border: 1px solid #e67e22;
    font-weight: bold;
    color: var(--primal-color);
    transition: background-color 0.2s;
    text-align: center;
    padding: 8px;
}

#chat-messages li.dps-boast-message:hover {
    background-color: rgba(230, 126, 34, 0.2);
}
.character-header h2 {
    display: flex;
    align-items: center;
    gap: 10px; 
    flex-wrap: nowrap;
}

#potion-buffs-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-size: calc(0.5em * var(--ui-scale-combat-info));
    line-height: 1.4;
    margin: 0 10px;
    color: var(--text-muted);
}

.potion-buff-timer {
    font-weight: normal;
    white-space: nowrap; 
}

.potion-buff-timer .timer {
    font-weight: bold;
    color: var(--success-color); 
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-header-left {
    display: flex;
    align-items: center; 
    gap: 20px;
}

#potion-buffs-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-size: calc(14px * var(--ui-scale-modal-body));
    line-height: 1.5;
    color: var(--text-muted);
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
}

.potion-buff-timer {
    font-weight: 500;
    white-space: nowrap;
}

.potion-buff-timer .timer {
    font-weight: 700;
    color: var(--success-color);
    margin-left: 5px;
}

#spirit-summon-modal .modal-content {
    gap: 15px; 
}

#spirit-summon-buttons button {
    width: 48%; 
    padding: 12px !important;
    font-size: 1.1em !important;
}
.pvp-ranking-container {
    display: flex;
    gap: 20px;
}
.pvp-ranking-section {
    flex: 1;
}
.pvp-ranking-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
#pvp-my-rank-info p {
    font-size: 1.2em;
    line-height: 1.8;
}
#pvp-my-rank-info .rp-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.5em;
}
#pvp-my-rank-info .win-loss {
    color: var(--text-muted);
}
.pvp-match-content {
    width: 90%;
    max-width: calc(1000px * var(--ui-scale-modal-size));
    text-align: center;
}
.pvp-match-title {
    font-size: 1.8em;
    color: var(--secondary-color);
}
.pvp-match-timer {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0 20px 0;
}
.pvp-arena {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.pvp-player-panel {
    flex: 1;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
}
.pvp-player-name {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 5px;
}
.pvp-player-rp {
    font-size: 1.1em;
    color: var(--text-muted);
    margin-bottom: 15px;
}
.pvp-damage-bar {
    width: 100%;
    height: 35px;
    background-color: rgba(0, 0, 0, .3);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.pvp-damage-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #28b485, #7ed56f);
    transition: width 0.5s linear;
}
#pvp-opponent-panel .pvp-damage-bar-inner {
    background: linear-gradient(to right, #c0392b, #e74c3c);
}
.pvp-damage-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}
.pvp-vs-text {
    font-size: 3em;
    font-weight: bold;
    color: var(--fail-color);
}

.pvp-result-content {
    text-align: center;
    max-width: calc(500px * var(--ui-scale-modal-size));
}
#pvp-result-body {
    font-size: 1.2em;
    line-height: 1.8;
    margin: 20px 0;
}
.rp-change {
    font-size: 1.5em;
    font-weight: bold;
}
.rp-gain {
    color: var(--success-color);
}
.rp-loss {
    color: var(--fail-color);
}
.pvp-management-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    height: 100%;
}
#pvp-snapshot-info {
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    min-height: 100px;
}
#pvp-register-snapshot-btn {
    width: 60%;
}

.pvp-snapshot-panel {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: calc(650px * var(--ui-scale-modal-size));
    margin: 0 auto;
}

.pvp-snapshot-panel .player-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.pvp-snapshot-panel .player-name {
    font-size: 1.5em;
    font-weight: bold;
}

.pvp-snapshot-panel .player-level {
    font-size: 1em;
    color: var(--text-muted);
}

.pvp-snapshot-panel .pvp-rp-display {
    font-size: 1.2em;
}

.pvp-snapshot-panel .rp-value {
    font-weight: bold;
    color: var(--primary-color);
}

.pvp-snapshot-panel .equipment-section {
    margin-bottom: 20px;
}
.pvp-snapshot-panel .equipment-slots {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.pvp-snapshot-panel .slot {
    height: 120px;
    border-style: solid;
    border-width: 2px;
    background-color: rgba(0,0,0,0.3);
}

.player-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(20px * var(--ui-scale-stats));
    margin-bottom: 20px;
    font-size: calc(1em * var(--ui-scale-stats));
}

.stat-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-line {
    font-size: calc(1.1em * var(--ui-scale-stats));
    display: flex;
    justify-content: space-between;
}

.stat-line .stat-value {
    font-weight: bold;
    color: var(--text-color);
}

.pvp-artifact-info {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.pvp-artifact-info h4 {
    color: var(--text-muted);
    font-size: 1em;
    margin-bottom: 15px;
}

.pvp-artifact-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.pvp-artifact-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-color-dark);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.pvp-artifact-slot.active {
    background-color: var(--legendary-color);
    border-color: var(--gold-color);
    box-shadow: 0 0 15px var(--legendary-color);
}

.pvp-match-content {
    width: 95%; 
    max-width: calc(1600px * var(--ui-scale-modal-size));
    gap: 15px;
    display: flex;
    flex-direction: column;
}
.pvp-player-panel {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1; 
}
.pvp-spec-display {
    overflow: hidden;
}
.pvp-spec-display .player-panel {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: rgba(0,0,0,0.2);
}
.pvp-spec-display .player-panel .player-name {
    font-size: 1.3em;
}
.pvp-spec-display .player-panel .slot {
    height: 110px;
}
.pvp-spec-display .player-panel .stat-line {
    font-size: 1em;
}
.pvp-buff-display {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    min-height: 30px; 
    padding: 5px;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.3);
}
.pvp-buff-display .buff-icon {
    padding: 3px 8px;
    font-size: 0.9em;
    animation: none;
}

#dps-leaderboard-list, #dps-personal-list {
    max-height: 350px; 
    overflow-y: auto;  
    padding-right: 15px; 
}
.top-buttons #raid-auction-reopen-btn {
    background: linear-gradient(45deg, #ff9500, #ffd700);
    color: #111;
    font-weight: bold;
    border: 1px solid #fff;
    animation: glitter 1.5s infinite;
}

.raid-auction-content {
    max-width: calc(800px * var(--ui-scale-modal-size));
    width: 95%;
}

.raid-auction-body {
    display: flex;
    gap: 25px;
    margin-top: 20px;
}

.auction-item-display {
    flex: 1;
    text-align: center;
    padding: 20px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
}

#auction-item-slot {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px auto;
    border-style: solid;
}

#auction-item-name {
    font-size: 1.5em;
    margin-bottom: 10px;
}

#auction-item-desc {
    font-size: 1em;
    color: var(--text-muted);
    min-height: 40px;
}

.auction-info-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.auction-timer {
    font-size: 3em;
    font-weight: bold;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--secondary-color);
}

.auction-status {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.auction-status p {
    font-size: 1.2em;
    line-height: 1.8;
    display: flex;
    justify-content: space-between;
}

.bid-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.bid-input-wrapper {
    display: flex;
    gap: 10px;
}

#auction-bid-input {
    flex-grow: 1;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color-dark);
    color: var(--text-color);
    font-size: 1em;
}

#auction-bid-manual-btn {
    padding: 0 25px;
}

#auction-bid-immediate-btn {
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
}

#auction-bid-immediate-btn.disabled {
    background-color: #555;
    cursor: not-allowed;
    text-shadow: none;
}

.auction-message {
    margin-top: 15px;
    text-align: center;
    color: var(--fail-color);
    min-height: 20px;
}

.raid-auction-sequence {
    font-size: 1.2em;
    color: var(--text-muted);
    width: 100%; 
    text-align: right; 
    padding-right: 10px;
    margin-top: -10px; 
}
#raid-auction-chat-container {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

#raid-auction-chat-messages {
    height: 300px; 
    overflow-y: auto; 
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 6px;
}
#raid-auction-chat-messages li {
    padding: 6px 10px;
    line-height: 1.5;
    font-size: 1.1em;
    word-break: break-all;
    border-radius: 4px;
    margin-bottom: 4px;
}

#raid-auction-chat-messages li .username {
    font-weight: 700;
    color: var(--secondary-color);
    margin-right: 8px;
    cursor: default;
    user-select: none;
}

#raid-auction-modal h2 small {
    display: block;
    font-size: 0.5em;
    font-weight: normal;
    color: var(--text-muted);
    margin-top: 5px;
}
#raid-auction-chat-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#raid-auction-chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-color-dark);
    color: var(--text-color);
    padding: 10px;
    border-radius: 6px;
    font-size: 1em;
}

#raid-auction-chat-form button {
    padding: 0 20px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.bid-controls .bid-input-wrapper,
.bid-controls #auction-bid-immediate-btn {
    width: 100%;
}

.transcend-btn {
    background: linear-gradient(45deg, var(--primal-color), var(--epic-color), var(--gold-color));
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    text-shadow: 0 0 5px #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

.transcend-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
}

.prefix-transcend {
    font-weight: 900;
    background: linear-gradient(45deg, #00e6d2, #ff2d55, #ffd700, #af52de);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: transcend-text-flow 4s ease infinite;
}

.inventory-item.prefix-초월 {
    position: relative;
    border-style: solid;
    border-width: 3px;
    border-image-slice: 1;
    border-image-source: linear-gradient(45deg, #00e6d2, #ff2d55, #ffd700, #af52de);
    animation: transcend-border-flow 4s ease infinite, transcend-glow 2s ease-in-out infinite alternate;
    overflow: hidden; 
}

.inventory-item.grade-Cosmic {
    border: 2px solid var(--cosmic-color);
    box-shadow: 0 0 15px var(--cosmic-color), inset 0 0 20px rgba(75, 0, 130, 0.5);
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    animation: cosmic-border-flow 4s ease infinite;
}

@keyframes cosmic-border-flow {
    0% { border-color: var(--cosmic-color); box-shadow: 0 0 15px var(--cosmic-color); }
    50% { border-color: #e0c3fc; box-shadow: 0 0 25px #e0c3fc; }
    100% { border-color: var(--cosmic-color); box-shadow: 0 0 15px var(--cosmic-color); }
}

.inventory-item.prefix-초월::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transform: rotate(45deg);
    animation: transcend-shine 5s linear infinite;
}

@keyframes transcend-text-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes transcend-border-flow {
    0% { border-image-source: linear-gradient(45deg, #00e6d2, #ff2d55, #ffd700, #af52de); }
    25% { border-image-source: linear-gradient(45deg, #ff2d55, #ffd700, #af52de, #00e6d2); }
    50% { border-image-source: linear-gradient(45deg, #ffd700, #af52de, #00e6d2, #ff2d55); }
    75% { border-image-source: linear-gradient(45deg, #af52de, #00e6d2, #ff2d55, #ffd700); }
    100% { border-image-source: linear-gradient(45deg, #00e6d2, #ff2d55, #ffd700, #af52de); }
}

@keyframes transcend-glow {
    from {
        box-shadow: 0 0 8px rgba(0, 230, 210, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(175, 82, 222, 0.8), 0 0 8px rgba(255, 255, 255, 0.5) inset;
    }
}

@keyframes transcend-shine {
    from {
        transform: rotate(45deg) translateX(-200%);
    }
    to {
        transform: rotate(45deg) translateX(200%);
    }
}

.transcend-announcement-message {
    background: linear-gradient(-45deg, #000000, #2d004d, #00e6d2, #ffd700, #000000);
    background-size: 400% 400%;
    border: 1px solid #ffd700;
    border-radius: 8px;
    padding: 10px 15px !important;
    margin: 8px 0 !important;
    box-shadow: 0 0 10px 2px rgba(0, 230, 210, 0.6);
    animation: primal-gradient-flow 5s ease infinite;
    text-align: center;
    line-height: 1.6;
    color: #fff !important;
    font-size: 1.1em;
    text-shadow: 0 0 5px #000;
}

.transcend-announcement-message span {
    animation: text-flicker 3s linear infinite;
}
.set-effect-초월 {
    border-width: 2px;
    border-style: solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(45deg, #00e6d2, #ff2d55, #ffd700, #af52de);
    animation: transcend-border-flow 4s ease infinite, transcend-glow 2s ease-in-out infinite alternate;
    background: rgba(0, 0, 0, 0.3);
}

.whale-monitoring-container {
    display: flex;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.whale-list-panel, .whale-portfolio-panel {
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.whale-list-panel {
    flex: 1;
}

.whale-portfolio-panel {
    flex: 2;
}

.whale-list-panel h4, .whale-portfolio-panel h4 {
    margin-bottom: 15px;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

#admin-whale-list, #admin-whale-portfolio-details {
    overflow-y: auto;
    flex-grow: 1;
}

#admin-whale-list .feed-list-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-color-dark);
    display: flex;
    justify-content: space-between;
}

#admin-whale-list .feed-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
#admin-whale-list .feed-list-item.selected {
    background-color: var(--primary-color);
    color: white;
}
#admin-whale-list .feed-list-item .gold-text {
    font-weight: bold;
}

#admin-whale-portfolio-details table {
    width: 100%;
    border-collapse: collapse;
}

#admin-whale-portfolio-details th, #admin-whale-portfolio-details td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

#admin-whale-portfolio-details th {
    text-align: right;
    color: var(--text-muted);
}
#admin-whale-portfolio-details th:first-child,
#admin-whale-portfolio-details td:first-child {
    text-align: left;
}

@media (max-width: 820px) {
    .whale-monitoring-container {
        flex-direction: column;
        height: auto;
        min-height: 500px;
        gap: 10px;
    }
}

#admin-coin-list .feed-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
#admin-coin-list .feed-list-item.selected {
    background-color: var(--primary-color);
    color: white;
}
#admin-coin-holders-details table {
    width: 100%;
    border-collapse: collapse;
}
#admin-coin-holders-details th, #admin-coin-holders-details td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}
#admin-coin-holders-details th {
    color: var(--text-muted);
}
#admin-coin-holders-details th:first-child,
#admin-coin-holders-details td:first-child {
    text-align: left;
}

.custom-announcement {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    margin: 12px 0 !important;
}

.announcement-box {
    border-radius: 8px;
    padding: 16px;
    color: #fff;
    text-align: center;
    line-height: 1.6;
    overflow: hidden;
    position: relative;
}

.announcement-header {
    font-size: 1.4em;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.announcement-body {
    font-size: 1.1em;
}

.coin-name-highlight {
    font-weight: bold;
    font-size: 1.2em;
}

.countdown-timer {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 8px;
}
.announcement-listing {
    background: linear-gradient(135deg, #0a3d2e, #0c5c45);
    border: 1px solid #34c759;
    box-shadow: 0 0 20px rgba(52, 199, 89, 0.6), inset 0 0 15px rgba(0,0,0,0.5);
}
.announcement-listing .announcement-header {
    color: #34c759;
    text-shadow: 0 0 10px #34c759;
}
.announcement-listing .coin-name-highlight {
    color: #ffd700;
}
.announcement-delisting {
    background: linear-gradient(135deg, #4d1010, #6e1616);
    border: 1px solid #ff3b30;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.6), inset 0 0 15px rgba(0,0,0,0.5);
}
.announcement-delisting .announcement-header {
    color: #ff3b30;
    text-shadow: 0 0 10px #ff3b30;
}
.announcement-delisting .coin-name-highlight {
    color: #c7c7c7;
}

#abyssal-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

#mysterious-coin-shop-grid .item-image,
#abyssal-shop-grid .item-image {
    width: 60%;
    padding-top: 60%; 
    margin: 0 auto 15px auto;
}

#mysterious-coin-shop-grid .item-image img,
#abyssal-shop-grid .item-image img {
    padding: 0; 
}

#mysterious-coin-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: none !important;
}

#mysterious-coin-shop-grid .inventory-item,
#abyssal-shop-grid .inventory-item {
    display: flex;
    flex-direction: column;
}

#mysterious-coin-shop-grid .item-info,
#abyssal-shop-grid .item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

#mysterious-coin-shop-grid .item-effect,
#abyssal-shop-grid .item-effect {
    flex-grow: 1;
}

#mysterious-coin-shop-grid .item-name,
#abyssal-shop-grid .item-name {
    max-height: none;
    overflow: visible;
}

.admin-form-grid .admin-stat-display {
    background-color: var(--bg-color-dark);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#admin-insignia-stats-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

#admin-insignia-stats-container h4 {
    font-size: 1.3em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.admin-stat-group {
    margin-bottom: 15px;
}

.admin-stat-group h5 {
    font-size: 1.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 5px;
}

.admin-stat-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 2fr 1fr;
    gap: 10px;
    background-color: var(--bg-color-dark);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.admin-stat-row span:first-child {
    font-weight: bold;
}
#cash-shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    margin-top: 25px; 
    flex-grow: 0; 
    overflow-y: visible; 
}
@media (max-width: 820px) {
    #cash-shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cash-shop-item {
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    text-align: center;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cash-shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.cash-shop-item .item-image {
    width: 70%;
    margin: 0 auto 20px auto;
}

.cash-shop-item .item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;

    margin-bottom: 15px;
}

.cash-shop-item .item-price {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-color);
    margin-top: 8px;
}

.cash-shop-item .item-price.discounted {
    color: var(--success-color);
    font-size: 1.3em;
}

.cash-shop-buy-btn {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
}

.cash-shop-buy-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.7;
}

#game-footer {
    width: 100%;
    padding: 15px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

#business-info-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

#business-info-btn:hover {
    color: var(--text-color);
}

.business-info-table {
    margin-top: 20px;
    font-size: 1.1em;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex-basis: 150px;
    font-weight: bold;
    color: var(--text-muted);
}

.info-value {
    flex-grow: 1;
}

#policy-modal {
    z-index: 10003; 
}

#policy-modal .box_section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgb(0 0 0 / 1%), 0 6px 6px rgb(0 0 0 / 6%);
    padding: 40px 50px;
    color: #333d4b;
    text-align: left;
}

#policy-modal h2 {
    margin: 0 0 20px 0;
    font-size: calc(24px * var(--ui-scale-modal-body));
    font-weight: 600;
    color: #4e5968;
    text-align: center;
}

#policy-modal h4 {
    margin: 20px 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333d4b;
}

#policy-modal p, 
#policy-modal li {
    margin: 0 0 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #4e5968;
    font-size: calc(15px * var(--ui-scale-modal-body));
    line-height: 1.7;
}

#policy-modal ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

#policy-modal strong {
    font-weight: 600;
    color: #333d4b;
}

#policy-modal #policy-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e8eb;
    padding: 20px;
    border-radius: 7px;
    margin-bottom: 20px;
    background-color: #f9fafb;
}

#policy-modal #policy-agreement {
    text-align: center;
    margin-top: 20px;
}

#policy-modal #policy-agreement label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 1.1em;
    color: #333d4b;
}

#policy-modal #agree-policy-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

#policy-modal .button {
  color: #f9fafb;
  background-color: #3182f6;
  font-size: calc(15px * var(--ui-scale-modal-body));
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  border: 0 solid transparent;
  user-select: none;
  transition: background 0.2s ease;
  text-decoration: none;
  border-radius: 7px;
  padding: 11px 16px;
}

#policy-modal .button:hover {
  background-color: #1b64da;
}

#policy-modal .button:disabled {
  background-color: #e5e8eb;
  cursor: not-allowed;
}
#foundry-timer {
    background: linear-gradient(45deg, #2c0b4d, #5b2c8c);
    border: 1px solid #8e44ad;
    color: #fff;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-left: auto; 
    white-space: nowrap;
    display: none; 
}

.monster-header-controls {
    display: flex;
    align-items: center;
    width: 100%;
}
#chat-custom-modal .modal-content {
    max-width: calc(800px * var(--ui-scale-modal-size));
}

.custom-section {
    margin-bottom: 25px;
}

.custom-section h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.custom-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.custom-option {
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: var(--bg-color-dark);
}

.custom-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.custom-option.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.custom-option-preview {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    padding: 10px 0;
    border-radius: 4px;
    background-color: var(--bg-color-light);
}

.chat-nickname-aurora {
    background: linear-gradient(90deg, #ff80ff, #80ffff, #ffff80, #ff80ff);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: aurora-flow 3s linear infinite;
}
@keyframes aurora-flow { to { background-position: 200% center; } }

.chat-nickname-gold {
    background: linear-gradient(45deg, #ffd700, #f0c75a, #d4af37, #ffd700);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: aurora-flow 4s linear infinite;
}

.chat-nickname-primal {
    background: linear-gradient(45deg, var(--primal-color), #ffffff, var(--primal-color));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: aurora-flow 3s linear infinite;
}

.chat-nickname-fire {
    text-shadow: 0 0 4px #fff, 0 0 6px #ff0, 0 0 10px #f90;
    color: #ffc288;
    animation: fire-flicker 2s ease-in-out infinite alternate;
}
@keyframes fire-flicker { 
    0% { text-shadow: 0 0 4px #fff, 0 0 6px #ff0, 0 0 10px #f90; }
    100% { text-shadow: 0 0 6px #fff, 0 0 8px #ff0, 0 0 12px #f00; }
}

.chat-box-pulsing-primal {
    border: 1px solid transparent;
    border-radius: 6px;
    box-shadow: 0 0 8px var(--primal-color);
    background-color: rgba(0, 230, 210, 0.05);
    animation: pulsing-border-primal 2s infinite alternate;
}
@keyframes pulsing-border-primal {
    from { box-shadow: 0 0 8px var(--primal-color); }
    to { box-shadow: 0 0 16px #fff, 0 0 20px var(--primal-color); }
}

.chat-box-pulsing-mystic {
    border: 1px solid transparent;
    border-radius: 6px;
    box-shadow: 0 0 8px var(--mystic-color);
    background-color: rgba(255, 45, 85, 0.05);
    animation: pulsing-border-mystic 2s infinite alternate;
}
@keyframes pulsing-border-mystic {
    from { box-shadow: 0 0 8px var(--mystic-color); }
    to { box-shadow: 0 0 16px #fff, 0 0 20px var(--mystic-color); }
}

.chat-box-dark-aurora {
    border-radius: 6px;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    background: #111;
}
.chat-box-dark-aurora::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 0;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 200% auto;
    animation: aurora-flow 3s linear infinite;
    opacity: 0.5;
}
.chat-box-dark-aurora .username, .chat-box-dark-aurora .message {
    position: relative;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-top: 10px;
    background-color: transparent;
}

.chat-nickname-neon {
    color: #fff;
    animation: neon-flicker 1.5s infinite alternate;
}
@keyframes neon-flicker {
  0%, 100% { text-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 8px #0fa, 0 0 12px #0fa; }
  50% { text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 0 12px #0fa, 0 0 18px #0fa; }
}

.chat-box-ghost {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    border-radius: 6px;
}

.chat-box-gold-border {
    background-color: rgba(255, 215, 0, 0.05);
    border: 1px solid #ffd700;
    border-radius: 6px;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.2);
}

#chat-form {
    display: flex;
    gap: 10px;
    padding: 15px; 
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, .2);
    align-items: center; 
}

#chat-submit-btn {
    padding: 0 25px;
    height: 44px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color .2s;
}

#chat-submit-btn:hover {
    background-color: #0056b3;
}
#open-chat-custom-btn {
    flex-shrink: 0; 
    height: 44px;
    padding: 0 15px;
    background: #fd79a8 !important;
   color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em; 
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s;
}

#open-chat-custom-btn:hover {
    background-color: #e86ca3;
}

.side-menu-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.side-menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.side-menu-panel {
    position: fixed;
    top: 0;
    left: 0; 
    width: 280px;
    height: 100%;
    background: var(--bg-color-light);
    border-right: 1px solid var(--border-color); 
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2); 
    z-index: 1001;
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
	overflow-y: auto;
}

.side-menu-panel.open {
    transform: translateX(0);
}

.side-menu-panel h3 {
    font-size: 1.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-panel button,
.side-menu-panel a {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    text-align: center;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-color);
    transition: background-color 0.2s, transform 0.2s;
	text-align: center;
}

.side-menu-panel a {
    display: flex;
    align-items: center;
    justify-content: center;
}

#side-menu-panel #auto-sell-button {
    background-color: #2980b9; 
}

#side-menu-panel #codex-button {
    background-color: #27ae60; 
}

#side-menu-panel #online-users-button { background-color: #9c27b0; }
#side-menu-panel #title-codex-button { background-color: #8e44ad; }
#side-menu-panel #abyssal-shop-button { background-color: #6a0dad; }
#side-menu-panel #dps-ranking-button { background-color: #e67e22; }
#side-menu-panel #pvp-ranking-button { background-color: #c0392b; }
#side-menu-panel #discord-button { background-color: #5865F2; }
#side-menu-panel #cp-ranking-button { background-color: #f39c12; }
#side-menu-panel a[href*="kakao"] { background-color: #FEE500; color: #191919; }
#side-menu-panel #mysterious-coin-shop-button { background-color: #48dbfb; color: #111; }
#side-menu-panel #insignia-button { background-color: #6a0dad; font-weight: bold; }
.cash-shop-item {
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    padding: 15px; 
    text-align: center;
    background-color: rgba(0,0,0,0.25); 
    border: 1px solid var(--border-color);
    border-radius: 10px; 
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden; 
    min-height: 320px; 
}
.cash-shop-item:hover {
    transform: translateY(-4px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.cash-shop-item.first-purchase-item {
    border: 2px solid #ffd700; 
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); 
    background-color: rgba(40, 35, 15, 0.3); 

}
.first-purchase-badge {
    position: absolute;
    top: 0;
    left: -8px; 
    background: linear-gradient(135deg, #d4af37, #ffd700); 
    color: #3b2b00; 
    padding: 5px 12px 5px 18px; 
    font-size: 0.9em; 
    font-weight: bold;
    border-radius: 0 4px 4px 0;
    box-shadow: 1px 1px 5px rgba(0,0,0,0.4);
    z-index: 5;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);

}
.first-purchase-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px; 
    border-top: 14px solid transparent; 
    border-bottom: 14px solid transparent;
    border-right: 8px solid #b8860b; 
    height: 0;
    width: 0;
}
.cash-shop-item .item-image-wrapper {
    width: 80px; 
    height: 80px;
    margin: 10px auto 10px auto; 
}
.cash-shop-item .item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); 
}
.cash-shop-item .item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 10px;
    overflow: visible;
}
.cash-shop-item .item-name {
    font-weight: bold;
    font-size: 1.05em;
    line-height: 1.3;
    min-height: 2.6em;
    max-height: none;
    overflow: visible;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.first-purchase-item .item-name {
    color: #ffecb3; 
}
.coin-amount {
    margin-bottom: 8px; 
    line-height: 1.2;
}
.first-purchase-item .coin-amount {

}
.first-purchase-item .original-coins {
    display: block; 
    font-size: 0.9em; 
    color: var(--text-muted);
    margin-bottom: 2px;
    white-space: nowrap; 
}
.first-purchase-item .original-coins .strikethrough {
    text-decoration: line-through;
}
.first-purchase-item .bonus-coins {
    display: block; 
    font-size: 1.6em; 
    color: var(--gold-color);
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    white-space: nowrap; 

}
.normal-coins {
    font-size: 1.25em; 
    font-weight: bold;
    color: var(--mystic-color);
    min-height: 2.8em; 
    display: flex; 
    align-items: center;
    justify-content: center;
    white-space: nowrap; 
}
.price-info {
    margin-top: auto; 
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 3.5em; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}
.cash-shop-item .item-price {
    line-height: 1.2;
    white-space: nowrap; 
}
.normal-krw-price {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
}

.discounted-krw-price {
    font-size: 1.2em; 
    font-weight: bold;
    color: var(--success-color);
}
.original-krw-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85em; 
}
.first-purchase-item .original-krw-price {
    font-size: 0.9em; 
}
.first-purchase-item .discounted-krw-price {
    font-size: 1.5em; 
    color: var(--success-color); 
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);

}
.cash-shop-item .cash-shop-buy-btn {
    width: calc(100% - 10px); 
    margin: 0px 5px 5px 5px; 
    padding: 10px 15px; 
    font-size: 1.05em; 
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary-color);
    border: none;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.cash-shop-item .cash-shop-buy-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
.first-purchase-item .cash-shop-buy-btn {
    background: var(--success-color); 
    font-size: 1.15em; 
    padding: 12px 20px;
    box-shadow: 0 3px 8px rgba(0, 100, 0, 0.5);

}
.first-purchase-item .cash-shop-buy-btn:hover {
    background: #2ca04c;
    box-shadow: 0 4px 10px rgba(0, 100, 0, 0.7);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .cash-shop-item {
        min-height: 290px; 
        padding: 10px;
    }
    .first-purchase-badge {
        font-size: 0.8em;
        padding: 4px 10px 4px 15px;
        top: -1px;
        left: -6px;
    }
	.price-info {
        min-height: 3.2em; 
    }
    .first-purchase-badge::before {
        border-top-width: 12px;
        border-bottom-width: 12px;
        border-right-width: 8px;
        left: -8px;
    }
    .cash-shop-item .item-image-wrapper {
        width: 70px;
        height: 70px;
    }
    .cash-shop-item .item-name {
        font-size: 0.95em;
        min-height: 2.4em;
    }
    .first-purchase-item .bonus-coins {
        font-size: 1.4em;
    }
    .normal-coins {
        font-size: 1.1em;
        min-height: 2.5em;
    }
    .first-purchase-item .discounted-krw-price {
        font-size: 1.3em;
    }
    .cash-shop-item .cash-shop-buy-btn {
        font-size: 1em;
        padding: 9px 13px;
        margin-top: 8px;
    }
    .first-purchase-item .cash-shop-buy-btn {
        font-size: 1.1em;
        padding: 11px 15px;
    }
}

#game-rating-display {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 19999;
    width: 150px;
    opacity: 0;
    display: none;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

#game-rating-display.visible {
    display: block;
    opacity: 1;
}

#game-rating-display img {
    width: 100%;
    height: auto;
}

#game-rating-display {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 19999;
    width: 150px;
    opacity: 0;
    display: none;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

#game-rating-display.visible {
    display: block;
    opacity: 1;
}

#game-rating-display img {
    width: 100%;
    height: auto;
}

.my-rank-highlight {
    background-color: rgba(0, 122, 255, 0.25) !important;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
    border-radius: 6px;
}

.cp-platform-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.cp-platform-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cp-platform-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

.cp-platform-tab.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cp-platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 800;
    flex-shrink: 0;
}

.cp-platform-icon-toss {
    background: #3182F6;
    color: #fff;
}

.cp-platform-icon-kakao {
    background: #FEE500;
    color: #191919;
}

.cp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 800;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.cp-badge-toss {
    background: #3182F6;
    color: #fff;
}

.cp-badge-kakao {
    background: #FEE500;
    color: #191919;
}

.cp-toss-leaderboard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3182F6 0%, #1B6CF2 100%);
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(49, 130, 246, 0.3);
}

.cp-toss-leaderboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(49, 130, 246, 0.5);
}

.cp-toss-leaderboard-btn:active {
    transform: translateY(0);
}

.cp-toss-profile-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    object-fit: cover;
}
.custom-option-preview.theme-preview-box {
    padding: 10px;
    height: 60px; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.theme-preview-message {
    width: 95%;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    line-height: 1.3;
    text-align: left;

    background-color: transparent;
    border: 1px solid transparent;
}

.theme-preview-user {
    font-weight: bold;
    color: var(--secondary-color);
    margin-right: 5px;
}

.theme-preview-text {
    color: var(--text-color);
}
.theme-preview-message.chat-box-pulsing-primal {
    box-shadow: 0 0 5px var(--primal-color);
    background-color: rgba(0, 230, 210, 0.05);
    animation: pulsing-border-primal 2s infinite alternate;
}
.theme-preview-message.chat-box-pulsing-mystic {
    box-shadow: 0 0 5px var(--mystic-color);
    background-color: rgba(255, 45, 85, 0.05);
    animation: pulsing-border-mystic 2s infinite alternate;
}
.theme-preview-message.chat-box-dark-aurora {
    position: relative;
    overflow: hidden;
    background: #111;
}
.theme-preview-message.chat-box-dark-aurora::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 0;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 200% auto;
    animation: aurora-flow 3s linear infinite;
    opacity: 0.5;
}
.theme-preview-message.chat-box-dark-aurora .theme-preview-user,
.theme-preview-message.chat-box-dark-aurora .theme-preview-text {
    position: relative; z-index: 1;
}
.theme-preview-message.chat-box-ghost {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.theme-preview-message.chat-box-gold-border {
    background-color: rgba(255, 215, 0, 0.05);
    border: 1px solid #ffd700;
}
.theme-preview-message.chat-box-ice-border {
    background-color: rgba(100, 200, 255, 0.05);
    border: 1px solid #80ffff;
    box-shadow: 0 0 5px #00ffff;
}
.theme-preview-message.chat-box-toxic-border {
    background-color: rgba(100, 255, 100, 0.05);
    border: 1px solid #00ff00;
    box-shadow: 0 0 5px #00ff00;
}
.theme-preview-message.chat-box-classic-gold {
    border: 2px solid #b8860b;
    background: #1a1a1a;
}
.theme-preview-message.chat-box-chat-bubble {
    background: #333;
    border-radius: 10px;
    border: 1px solid #555;
    position: relative;
}
.theme-preview-message.chat-box-chat-bubble::after {
    content: '';
    position: absolute;
    left: 8px;
    bottom: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #333;
    border-left: 0;
    border-right: 0;
}

.chat-nickname-flashy {
    background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet, red);
    background-size: 400% 400%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: aurora-flow 2s linear infinite;
}
.chat-nickname-shadow {
    color: #ccc;
    text-shadow: 2px 2px 4px #000, 0 0 1px #000;
}
.chat-nickname-ice {
    color: #e0ffff;
    text-shadow: 0 0 3px #fff, 0 0 6px #00ffff, 0 0 10px #00ffff;
    animation: ice-flicker 2.5s ease-in-out infinite alternate;
}
@keyframes ice-flicker { 
    from { text-shadow: 0 0 3px #fff, 0 0 6px #00ffff, 0 0 10px #00ffff; }
    to { text-shadow: 0 0 5px #fff, 0 0 10px #80ffff, 0 0 15px #80ffff; }
}
.chat-nickname-toxic {
    color: #d0ffd0;
    text-shadow: 0 0 3px #fff, 0 0 6px #00ff00, 0 0 10px #00ff00;
    animation: toxic-flicker 2s ease-in-out infinite alternate;
}
@keyframes toxic-flicker {
    from { text-shadow: 0 0 3px #fff, 0 0 6px #00ff00, 0 0 10px #00ff00; }
    to { text-shadow: 0 0 5px #fff, 0 0 10px #80ff80, 0 0 15px #80ff80; }
}

.chat-box-ice-border {
    border-radius: 6px;
    background-color: rgba(100, 200, 255, 0.05);
    border: 1px solid #80ffff;
    box-shadow: 0 0 8px #00ffff;
    animation: pulsing-border-ice 2.5s infinite alternate;
}
@keyframes pulsing-border-ice {
    from { box-shadow: 0 0 8px #00ffff; }
    to { box-shadow: 0 0 16px #fff, 0 0 20px #80ffff; }
}

.chat-box-toxic-border {
    border-radius: 6px;
    background-color: rgba(100, 255, 100, 0.05);
    border: 1px solid #00ff00;
    box-shadow: 0 0 8px #00ff00;
    animation: pulsing-border-toxic 2s infinite alternate;
}
@keyframes pulsing-border-toxic {
    from { box-shadow: 0 0 8px #00ff00; }
    to { box-shadow: 0 0 16px #fff, 0 0 20px #80ff80; }
}

.chat-box-classic-gold {
    border-radius: 4px;
    background: #1a1a1a;
    border: 2px solid #b8860b;
}

.chat-box-chat-bubble {
    background: #333;
    border-radius: 10px;
    border: 1px solid #555;
    position: relative;
    padding: 8px 12px;
}

.chat-box-chat-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #333;
    border-left: 0;
}
.chat-box-chat-bubble::after {
    content: '';
    position: absolute;
    left: -8px; 
    top: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #555; 
    border-left: 0;
    z-index: -1;
}

    .guide-modal-content {
        width: 95%;
        max-width: calc(1400px * var(--ui-scale-modal-size));
        height: 90vh;
    }
    .guide-container {
        display: flex;
        gap: 20px;
        height: 100%;
        min-height: 0;
    }
    .guide-list-panel {
        flex: 1;
        min-width: 280px;
        display: flex;
        flex-direction: column;
        background-color: rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 15px;
    }
    .guide-list-panel h2 {
        text-align: center;
        margin-bottom: 15px;
        color: var(--primary-color);
        flex-shrink: 0;
    }
    .guide-search-wrapper {
        margin-bottom: 15px;
        flex-shrink: 0;
    }
    #guide-search-input {
        width: 100%;
        padding: 12px;
        font-size: 1em;
        background: var(--bg-color-dark);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 6px;
    }
    #guide-topic-list {
        overflow-y: auto;
        flex-grow: 1;
    }
    .guide-category-group {
        margin-bottom: 20px;
    }
    .guide-category-title {
        font-size: 1.2em;
        font-weight: bold;
        color: var(--secondary-color);
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 10px;
    }
    .guide-topic-item {
        padding: 10px;
        font-size: 1.1em;
        cursor: pointer;
        border-radius: 6px;
        transition: background-color 0.2s;
    }
    .guide-topic-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    .guide-topic-item.active {
        background-color: var(--primary-color);
        color: white;
        font-weight: bold;
    }

    .guide-detail-panel {
        flex: 3;
        background-color: rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 25px;
        overflow-y: auto;
    }
    #guide-detail-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        text-align: center;
        color: var(--text-muted);
    }
    .placeholder-icon {
        font-size: 4em;
        margin-bottom: 20px;
    }
    #guide-detail-title {
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        font-size: 2em;
    }
    #guide-detail-content .ql-editor {
        font-size: 1.1em;
        line-height: 1.8;
        padding: 0;
    }
     #guide-detail-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 10px 0;
    }

    #admin-guide-mgmt {
        padding: 0;
        background-color: transparent;
    }
    .admin-guide-container {
        display: flex;
        gap: 15px;
        height: 100%;
    }
    .admin-guide-list-panel {
        flex: 1;
        min-width: 250px;
        background-color: rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 15px;
        display: flex;
        flex-direction: column;
    }
    #admin-guide-new-btn {
        width: 100%;
        margin-bottom: 15px;
        padding: 12px;
        font-size: 1.1em;
    }
    #admin-guide-list {
        overflow-y: auto;
        flex-grow: 1;
    }
    .admin-guide-item {
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
        cursor: pointer;
    }
    .admin-guide-item:hover {
        background-color: rgba(255,255,255,0.05);
    }
    .admin-guide-item.selected {
        background-color: var(--primary-color);
        color: white;
    }
    .admin-guide-item-title {
        font-weight: bold;
    }
    .admin-guide-item-category {
        font-size: 0.9em;
        color: var(--text-muted);
    }

    .admin-guide-editor-panel {
        flex: 3;
        background-color: rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    .admin-guide-editor-panel .form-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
    }
    .admin-guide-editor-panel .form-group label {
        margin-bottom: 5px;
        font-weight: bold;
        color: var(--text-muted);
    }
    .admin-guide-editor-panel .form-group input {
        padding: 10px;
        font-size: 1em;
        background: var(--bg-color-dark);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 4px;
    }
    .admin-guide-editor-panel #admin-guide-editor-container .ql-editor {
        background: var(--bg-color-dark);
    }
    .admin-guide-editor-panel .form-actions {
        margin-top: auto; 
        padding-top: 20px;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    #side-menu-panel #open-guide-button {
        background-color: #f39c12; 
    }
.ql-editor img {
  display: block;
  max-width: 100%;
}

.ql-editor table {
  border-collapse: collapse;
  margin: 8px 0;
  width: 100%;
}

.ql-editor th,
.ql-editor td {
  border: 1px solid var(--border-color);
  padding: 6px 8px;
}
@media (min-width: 900px) {
    .guide-container {
        flex-direction: row; 
    }
    .guide-list-panel {
        flex: 1; 
        min-width: 280px;
        height: auto;
        display: flex !important; 
    }
    .guide-detail-panel {
        flex: 3; 
        display: block !important; 
        height: auto;
        padding: 25px;
    }

    #guide-back-btn {
        display: none;
    }
}

@media (max-width: 899px) {
    .guide-modal-content {
        padding: 10px;
        height: 95vh;
    }
    .guide-container {
        flex-direction: column;
        height: 100%;
    }
    .guide-list-panel {
        flex: none;
        min-width: 0;
        height: 100%;
        display: flex; 
    }
    .guide-detail-panel {
        flex: none;
        display: none; 
        height: 100%;
        padding: 15px;
    }

    #guide-back-btn {
        display: block;
        margin-bottom: 15px;
        background-color: var(--surface-color);
        width: 120px;
    }
    .guide-container.viewing-detail .guide-list-panel {
        display: none;
    }
    .guide-container.viewing-detail .guide-detail-panel {
        display: flex; 
        flex-direction: column;
    }
}
#cash-shop-special-pack-container {
    width: 100%;
}

.special-pack-card {
	position: relative;
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 20px;
    border: 2px solid var(--primal-color);
    background: linear-gradient(145deg, rgba(0, 40, 37, 0.5), rgba(0, 10, 20, 0.5));
    box-shadow: 0 0 20px rgba(0, 230, 210, 0.5), inset 0 0 15px rgba(0, 230, 210, 0.3);
    border-radius: 12px;
    animation: pulse-primal-border 2.5s infinite alternate;
}

.special-pack-card.purchased {
    background: var(--bg-color-dark);
    border-color: var(--border-color);
    box-shadow: none;
    animation: none;
    filter: grayscale(80%);
    opacity: 0.7;
}

.special-pack-image {
    flex: 0 0 150px; 
    width: 150px;

    background-color: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    display: flex; 
    align-items: center; 
}

.special-pack-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.special-pack-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.special-pack-header .item-name {
    font-size: clamp(1.2em, 4vw, 2.2em);
    font-weight: 900;
    color: var(--primal-color);
    text-shadow: 0 0 10px var(--primal-color);
    margin-bottom: 5px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.special-pack-rules {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.5;
}
.special-pack-rules p {
    margin: 0;
}

.special-pack-contents {
    margin: 15px 0;
}

.special-pack-contents h4 {
    font-size: 1.2em;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.special-pack-contents ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 5px 15px;
}

.special-pack-contents li {
    font-size: 1.1em;
    font-weight: 500;
}
.special-pack-contents li span {
    font-weight: 700;
    margin-right: 5px;
}

.special-pack-actions {
    text-align: right; 
}

.special-pack-buy-btn {
    background: var(--primal-color);
    color: var(--bg-color-dark);
    font-size: 1.0em; 
    font-weight: 700;
    padding: 18px 35px; 
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 230, 210, 0.5);
    transition: all 0.2s ease;
}

.special-pack-buy-btn:hover:not(:disabled) {
    background: #00fff0;
    box-shadow: 0 6px 20px rgba(0, 230, 210, 0.7);
    transform: translateY(-2px);
}

@media (max-width: 820px) {
    .special-pack-card {
        flex-direction: column; 
        padding: 15px;
        gap: 15px;
    }
    .special-pack-image {
        flex: 0 0 150px;
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    .special-pack-details {
        text-align: center;
    }
    .special-pack-contents ul {
        grid-template-columns: 1fr; 
        text-align: center;
    }
    .special-pack-header .item-name {
        font-size: 1.8em;
    }
    .special-pack-actions {
        text-align: center;
    }
    .special-pack-buy-btn {
        width: 100%;
        font-size: 1.3em;
        padding: 15px;
    }
    #cash-shop-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

.special-pack-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    font-size: 0.9em;
    font-weight: bold;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 0 5px rgba(255, 0, 0, 1);
}

.special-pack-purchase-limit {
    color: var(--success-color) !important; 
    font-weight: bold;
}

#admin-special-product .admin-form-grid {
    align-items: center;
}
#admin-special-product label[for="admin-sp-isActive"] {
    justify-self: end;
    font-weight: bold;
}
#admin-special-product #admin-sp-isActive {
    justify-self: start;
}
#admin-special-product #admin-sp-status {
    min-height: 1.2em;
}

.guide-tabs {
  display: flex;
  gap: 0;
  align-items: flex-end;
  margin-bottom: 10px;
  padding: 0;
  border-bottom: 1px solid var(--border-color, #444);
}

.guide-tab {
  appearance: none;
  background: transparent;
  border: none;
  margin: 0;
  padding: 10px 14px;
  color: var(--text-color, #ddd);
  border-bottom: 2px solid transparent; 
  border-radius: 0;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .1px;
  transition: border-color .12s ease, color .12s ease;
}
.guide-tab + .guide-tab {
  margin-left: 16px; 
}
.guide-tab:hover {
  color: #fff;
}
.guide-tab:focus-visible {
  outline: none;
  border-bottom-color: rgba(111,111,255,.5);
}

.guide-tab.active {
  color: var(--mystic-color, #6f6fff);
  border-bottom-color: var(--mystic-color, #6f6fff); 
}

.guide-topic-item {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: flex-start; 
    padding: 10px 12px;
}

.guide-topic-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; 
    font-size: 1.1em; 
    font-weight: 500; 
    margin-bottom: 5px; 
}

.guide-topic-likes {

    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-muted);
    background-color: var(--bg-color-dark);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.guide-topic-likes.liked-by-user {
    color: var(--gold-color);
    border-color: var(--gold-color);
    box-shadow: 0 0 5px var(--gold-color);
}

.guide-topic-likes.popular {
    color: var(--success-color);
    border-color: var(--success-color);
}

.guide-topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.guide-topic-author {
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%; 
}

#guide-like-action {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
    margin-top: 25px;
}

#guide-like-btn {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 12px 25px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#guide-like-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#guide-like-btn.liked {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 0 15px var(--success-color);
}

#guide-like-btn.liked #guide-like-icon {
    animation: like-pop 0.5s ease;
}

@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4) rotate(15deg); }
    100% { transform: scale(1); }
}

#guide-user-actions {
    margin-top: auto; 
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
#guide-user-write-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    box-sizing: border-box; 
}

#guide-detail-actions-footer {
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    gap: 15px;
    margin-top: 25px; 
    padding-top: 15px;
    border-top: 1px solid var(--border-color); 
}

#guide-author-actions {
    margin: 0 !important;
    gap: 8px !important;
}

#guide-like-action {
    border-top: none !important; 
    padding-top: 0 !important;
    margin: 0 !important; 
    padding: 0 !important;
    text-align: right !important; 
}

#guide-like-btn {
    padding: 8px 16px;
    font-size: 1em;
}

#guide-topic-list.official-guide-view .guide-topic-likes {
    display: none;
}

#guest-login-container {
    text-align: center;
    width: 100%; 
    margin-top: 25px; 
}

#guest-login-btn {
    padding: 15px 28px; 
    font-size: 1.15em; 
    font-weight: 500;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.08); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); 
}

#guest-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#guest-link-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: fit-content;
    max-width: 320px;
    min-width: 220px;
    background-color: #333742;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    z-index: 10005;
}

#guest-link-banner .banner-content {
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 10px;
}

#guest-link-banner .banner-icon {
    font-size: 1.8em;
    color: var(--secondary-color);
    margin-left: 5px;
}

#guest-link-banner .banner-text {
    line-height: 1.4;
}

#guest-link-banner .banner-text strong {
    font-size: 0.95em;
    color: #FEE500;
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

#guest-link-banner .banner-text p {
    font-size: 0.8em;
    color: #E0E0E0;
    margin: 0;
}

#guest-link-banner .banner-buttons {
    display: flex;
    gap: 8px;
}

#guest-link-kakao-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FEE500;
    color: #191919;
    border-radius: 6px;
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8em;
    flex: 1 1 0;
    min-width: 0;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: none;
    text-align: center;
}

#guest-link-kakao-btn:hover {
    background-color: #F0D900;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

#guest-link-kakao-btn span {
    text-align: center;
}

#guest-link-kakao-btn img {
    width: 18px;
    height: auto;
    margin-right: 5px;
}

#guest-link-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8em;
    flex: 1 1 0;
    min-width: 0;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-align: center;
}

#guest-link-google-btn:hover {
    background-color: #f1f1f1;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    #guest-login-container {
        width: 100%;
        margin-top: 20px;
    }
    #guest-login-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.1em;
    }

    #guest-link-banner {
        right: 10px;
        bottom: 10px;
        left: auto;
        width: fit-content;
        max-width: calc(100vw - 20px);
        min-width: 200px;
    }
    #guest-link-banner .banner-content {
        padding: 10px;
        gap: 8px;
    }
    #guest-link-kakao-btn,
    #guest-link-google-btn {
        height: 34px;
        font-size: 0.75em;
    }
}
.cash-shop-item .price-wrapper {
    min-height: 2.5em; 
}

.cash-shop-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px auto; 
}

.cash-shop-quantity-selector .quantity-btn {
    width: 36px;
    height: 36px;
    background-color: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 50%; 
    cursor: pointer;
    transition: all 0.2s;
}

.cash-shop-quantity-selector .quantity-btn:hover:not(:disabled) {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
}

.cash-shop-quantity-selector .quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cash-shop-quantity-selector .quantity-input {
    width: 60px;
    height: 36px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-color);
    background-color: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    -moz-appearance: textfield; 
}
.cash-shop-quantity-selector .quantity-input::-webkit-outer-spin-button,
.cash-shop-quantity-selector .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 480px) {
    .cash-shop-quantity-selector {
        margin: 10px auto;
    }
    .cash-shop-quantity-selector .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2em;
    }
    .cash-shop-quantity-selector .quantity-input {
        width: 50px;
        height: 32px;
        font-size: 1.1em;
    }
}

.first-purchase-item .quantity-warning {
    font-size: 0.8em;
    color: var(--fail-color);
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.7);
    margin-top: -10px; 
    margin-bottom: 10px;
    display: none;
}

.first-purchase-item .quantity-input:not([value="1"]) ~ .quantity-warning {
    display: block; 
}
.special-pack-card .cash-shop-quantity-selector {
    margin: 10px 0;
}
.special-pack-card .quantity-input {
    background-color: var(--bg-color-light);
}
.special-pack-card .quantity-warning {
    font-size: 0.9em;
    color: var(--fail-color);
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.7);
    margin-top: 5px;
    display: none;
}
.special-pack-card .quantity-warning.visible {
    display: block;
}
.coin-display-wrapper .bonus-breakdown {
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 2px;
}

.first-purchase-item .normal-coins {
     font-size: 1.4em; 
}

.first-purchase-item .coin-display-wrapper {
    min-height: 4.5em; 
}

#transcend-enchant-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.transcend-enchant-select {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    background-color: var(--bg-color-dark);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.transcend-enchant-select:focus {
    outline: none;
    border-color: var(--primal-color);
    box-shadow: 0 0 8px var(--primal-color);
}

#chat-log-hide-wrapper, #chat-time-show-wrapper, #chat-translate-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    flex-shrink: 0;
    min-height: 20px;
}

#chat-log-hide-wrapper input[type="checkbox"],
#chat-time-show-wrapper input[type="checkbox"],
#chat-translate-wrapper input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
}

#chat-log-hide-wrapper label,
#chat-time-show-wrapper label,
#chat-translate-wrapper label {
    font-size: 0.95em;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

#chat-log-hide-wrapper label:hover,
#chat-time-show-wrapper label:hover,
#chat-translate-wrapper label:hover {
    color: var(--text-color);
}
@media (max-width: 480px) {
    #chat-log-hide-wrapper {
        margin-left: 5px;
        margin-right: 5px;
        gap: 4px;
    }
    #chat-log-hide-wrapper label {
         font-size: calc(0.9em * var(--ui-scale-chat));
    }
}

.artifact-sockets-moved {
    display: flex;
    justify-content: center;
    gap: 15px; 
    margin-bottom: 10px;
}
#player-floor-display {
    margin-left: 15px; 
    line-height: 1.3; 
    font-weight: 500;
    align-self: flex-end; 
    padding-bottom: 2px;  
}

#player-floor-display .current-floor {
    font-size: calc(0.8em * var(--ui-scale-floor));
    color: var(--text-color);
    display: block;
}

#player-floor-display .max-floor {
    font-size: calc(0.6em * var(--ui-scale-floor));
    color: var(--text-muted);
    display: block;
}

.bid-preview-text {
    min-height: 1.2em; 
    font-size: 1.1em;
    font-weight: bold;
    color: var(--gold-color); 
    text-align: right; 
    padding-right: 5px;
    margin-top: -5px; 
    margin-bottom: 10px;
    width: 100%; 
}

.equipment-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "weapon armor pet"
        "necklace earring wristwatch"
        "core_left core core_right"; 
    gap: 15px;
}
#core-left-slot { grid-area: core_left; }
#core-right-slot { grid-area: core_right; }
#weapon-slot { grid-area: weapon; }
#armor-slot { grid-area: armor; }
#pet-slot { grid-area: pet; }
#necklace-slot { grid-area: necklace; }
#earring-slot { grid-area: earring; }
#wristwatch-slot { grid-area: wristwatch; }
#core-slot { grid-area: core; } 

.amp-stats-list-horizontal {
    display: flex;
    flex-direction: column;
    gap: 8px;              
    width: 100%;
}

.amp-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;     
    padding: 2px 0;
}

.amp-stat-item span {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;  
}

.amp-stat-item strong {
    font-size: 1.05em;    
    color: var(--text-color);
    font-weight: 700;
}
#amplification-details {
    display: flex;
    flex-direction: row; 
    justify-content: center;
    align-items: flex-start; 
    width: 100%;
    gap: 15px;
}
#amplification-before, 
#amplification-after {
    flex: 1; 
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
#amplification-before b, 
#amplification-after b {
    display: block;
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
#amplification-after b {
    color: var(--success-color);
}
#amplification-after .amp-stat-item strong {
    color: var(--success-color);
}

#item-info-modal .amp-stat-item strong {
    font-size: 1.1em; 
}
.modal-stats-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-info-modal .artifact-sockets {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
#user-info-modal .equipment-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "weapon armor pet"
        "necklace earring wristwatch"
        "core_left core core_right";
    gap: 15px;
}
#user-info-modal .slot[data-item-type="weapon"] { grid-area: weapon; }
#user-info-modal .slot[data-item-type="armor"] { grid-area: armor; }
#user-info-modal .slot[data-item-type="pet"] { grid-area: pet; }
#user-info-modal .slot[data-item-type="necklace"] { grid-area: necklace; }
#user-info-modal .slot[data-item-type="earring"] { grid-area: earring; }
#user-info-modal .slot[data-item-type="wristwatch"] { grid-area: wristwatch; }
#user-info-modal .slot[data-item-type="core"] { grid-area: core; }
#user-info-modal .slot[data-item-type="core_left"] { grid-area: core_left; }
#user-info-modal .slot[data-item-type="core_right"] { grid-area: core_right; }

#user-info-modal .core-info-section {
    text-align: left;
    padding: 10px;
}
#user-info-modal .core-info-section h4 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: var(--primal-color);
    text-shadow: 0 0 5px var(--primal-color);
}
#user-info-modal .amp-stats-list-horizontal {
    max-width: calc(300px * var(--ui-scale-modal-size));
    margin: 0 auto;
    background: var(--bg-color-dark);
    padding: 10px;
    border-radius: 6px;
}

.player-panel-modal {
    background: none;
    box-shadow: none;
}

.player-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.player-panel-name-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.player-panel-title {
    margin: 0;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-panel-floor {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-left: 5px;
}

.player-panel-actions {
    padding-top: 5px;
}

.player-panel-report-btn {
    background: transparent;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    font-size: 0.85em;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.player-panel-vip-effect {
    grid-column: 1 / -1;
    margin-top: 5px;
    color: #ffd700;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 5px;
    font-size: 0.9em;
}

.player-panel-divider {
    border-color: var(--border-color);
    margin: 20px 0;
}

.player-panel-artifacts {
    margin-top: 15px;
}

.player-panel-equips {
    margin-top: 15px;
}

@keyframes core-amplify-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes core-amplify-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 4px #fff,
            0 0 11px #ff2d55,
            0 0 19px #ff2d55,
            0 0 40px #af52de,
            0 0 80px #af52de;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

#announcement-banner.core-amplify {
    background: linear-gradient(
        -45deg, 
        #1a001a, 
        #4d004d, 
        #ff2d55, 
        #af52de, 
        #1a001a
    );
    background-size: 400% 400%;
    color: #ffffff;
    font-weight: 900;
    border: 2px solid #ff2d55;
    box-shadow: 0 0 15px 5px rgba(175, 82, 222, 0.7), 
                0 0 30px 10px rgba(255, 45, 85, 0.5),
                inset 0 0 10px 2px rgba(255, 45, 85, 0.8);
    animation: core-amplify-gradient-flow 5s ease infinite;
}

#announcement-banner.core-amplify span {
    animation: core-amplify-flicker 3s linear infinite;
}

.core-amplify-message {
    background: linear-gradient(-45deg, #1a001a, #4d004d, #ff2d55, #af52de, #1a001a);
    background-size: 400% 400%;
    border: 1px solid #ff2d55;
    border-radius: 8px;
    padding: 10px 15px !important;
    margin: 8px 0 !important;
    box-shadow: 0 0 10px 2px rgba(175, 82, 222, 0.6);
    animation: core-amplify-gradient-flow 5s ease infinite;
    text-align: center;
    line-height: 1.6;
}

.core-amplify-message span {
    color: #fff !important;
    font-size: 1.1em;
    text-shadow: 0 0 5px #000;
    animation: core-amplify-flicker 3s linear infinite;
}
.monitor-container {
    display: flex;
    gap: 20px;
    height: 100%;
    min-height: 500px;
}

.monitor-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden; 
}

.monitor-panel h4 {
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.monitor-list-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}
.admin-table.full-width {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9em;
}
.admin-table th {
    background: rgba(0,0,0,0.3);
    color: var(--text-muted);
    position: sticky;
    top: 0;
}
.coupon-row.expired {
    opacity: 0.5;
    color: var(--fail-color);
}
.detail-slide-view {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%; 
    height: 100%;
    background: #1e232e; 
    border-left: 2px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.detail-slide-view h5 {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.detail-info-header {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 1.2fr; 
    font-weight: bold;
    padding: 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 4px;
    margin-bottom: 5px;
    color: var(--text-muted);
    text-align: center;
}

.detail-list-content {
    flex-grow: 1;
    overflow-y: auto;
}
.detail-list-item {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 1.2fr; 
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95em;
    align-items: center;
    text-align: center;
}
.detail-list-item span:first-child {
    text-align: left; 
    padding-left: 5px;
}
.detail-list-item:hover {
    background: rgba(255,255,255,0.05);
}
.suspicious-user {
    color: var(--fail-color);
    font-weight: bold;
}

.close-detail-btn {
    align-self: flex-end;
    margin-bottom: 10px;
    padding: 5px 10px;
}
@media (max-width: 900px) {
    .monitor-container {
        flex-direction: column;
    }
}
.rank-title-1 {
    font-weight: 900;
    font-size: 1.1em;
    margin-right: 4px;
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    -webkit-background-clip: text;
    color: transparent;
    animation: rainbow-text 3s linear infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    display: inline-block;
}
.rank-title-2 {
    font-weight: 800;
    color: #FFD700;
    margin-right: 4px;
    text-shadow: 0 0 5px #FFA500, 0 0 10px #FFD700;
    animation: shine-gold 2s infinite;
    display: inline-block;
}
.rank-title-3 {
    font-weight: bold;
    color: #b197fc;
    margin-right: 4px;
    text-shadow: 0 0 3px #9c27b0;
    display: inline-block;
}

@keyframes rainbow-text {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes shine-gold {
    0% { text-shadow: 0 0 5px #FFA500; opacity: 1; }
    50% { text-shadow: 0 0 15px #FFD700, 0 0 5px #fff; opacity: 0.9; }
    100% { text-shadow: 0 0 5px #FFA500; opacity: 1; }
}
.mission-list-container {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 520px; overflow-y: auto; padding: 2px;
}
.mission-item {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(30,35,50,0.95), rgba(20,24,36,0.95));
  border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mission-item:hover { border-color: rgba(255,255,255,0.12); box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.mission-item.claimed { opacity: 0.4; filter: grayscale(80%); pointer-events: none; }
.mission-item.mission-done { border-color: rgba(46,204,113,0.4); }
.mission-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mission-title { font-size: 1em; font-weight: 700; color: #e8e8e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mission-progress-wrap { display: flex; align-items: center; gap: 8px; }
.mission-progress-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; position: relative; }
.mission-progress-fill {
  height: 100%; border-radius: 3px; transition: width 0.4s ease;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.mission-item.mission-done .mission-progress-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.mission-progress-text { font-size: 0.78em; color: #888; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mission-reward {
  display: flex; align-items: center; gap: 5px; padding: 0 4px;
  white-space: nowrap; min-width: 90px; justify-content: flex-end;
}
.mission-reward img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.mission-reward-qty { color: var(--mystic-color); font-weight: 700; font-size: 0.95em; font-variant-numeric: tabular-nums; }
.mission-reward-gold { color: var(--gold-color); font-weight: 700; font-size: 0.95em; }
.mission-action { flex-shrink: 0; }
.mission-action .action-btn {
  width: 64px; height: 32px; border-radius: 6px; font-size: 0.8em; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.3px;
}
.mission-action .action-btn.btn-progress {
  background: rgba(255,255,255,0.06); color: #666; cursor: default;
  font-variant-numeric: tabular-nums;
}
.mission-action .action-btn.btn-claim {
  background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}
.mission-action .action-btn.btn-claim:hover { box-shadow: 0 3px 14px rgba(34,197,94,0.5); transform: translateY(-1px); }
.mission-action .action-btn.btn-claimed {
  background: rgba(255,255,255,0.04); color: #555; cursor: default;
}
.mission-action .action-btn.btn-claimed::after { content: '✓'; margin-left: 2px; }
.upgrade-btn.gold-mode-btn {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid #ffd700;
    color: #ffd700;
    font-weight: 900;
    margin-left: 5px;
}
.upgrade-btn.gold-mode-btn:hover {
    background-color: #ffd700;
    color: #000;
    box-shadow: 0 0 8px #ffd700;
}
#custom-gold-input::-webkit-inner-spin-button, 
#custom-gold-input::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.recovery-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 15px;
    margin-top: 15px;
}

.recovery-header-panel {
    display: flex;
    gap: 20px;
    background: var(--surface-color);
    padding: 15px;
    border-radius: 8px;
    flex-shrink: 0;
}

.recovery-search-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.recovery-timeline-wrapper {
    flex-grow: 1;
    overflow-x: auto;
}

.snapshot-list {
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
}

.snapshot-item {
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9em;
    color: var(--text-muted);
}
.snapshot-item:hover { border-color: var(--primary-color); color: #fff; }
.snapshot-item.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

.recovery-main-body {
    display: flex;
    gap: 15px;
    flex-grow: 1;
    min-height: 0; 
}

.recovery-viewer-panel, .recovery-editor-panel {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.viewer-content {
    margin-top: 10px;
}
.viewer-section-title {
    font-weight: bold; color: var(--secondary-color);
    margin: 15px 0 5px 0; border-bottom: 1px solid #444;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.editor-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.item-image-preview {
    width: 60px; height: 60px;
    background: #000; border: 1px solid #555;
}
.item-image-preview img { width: 100%; height: 100%; object-fit: contain; }

.editor-basic-info { flex-grow: 1; display: flex; flex-direction: column; gap: 5px; }

.editor-section { margin-bottom: 10px; }
.editor-section label { display: block; font-size: 0.85em; color: #aaa; margin-bottom: 3px; }
.editor-section input, .editor-section select {
    width: 100%; padding: 6px;
    background: var(--bg-color-dark); border: 1px solid #555; color: #fff;
}

.group-box {
    border: 1px solid #444;
    padding: 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.1);
}
.group-box h5 { margin-bottom: 8px; color: var(--text-color); }
.group-box .row { display: flex; gap: 10px; align-items: center; margin-bottom: 5px; }
.group-box input.short { width: 50px; }

.enchant-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 5px;
    margin-bottom: 5px;
}

.recovery-clickable-item {
    cursor: copy;
    border: 1px dashed transparent;
    transition: all 0.2s;
}
.recovery-clickable-item:hover {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.1);
    transform: scale(1.02);
}

#custom-amount-modal .modal-content {
    max-width: calc(550px * var(--ui-scale-modal-size)) !important;
    padding: 30px !important;
}

#custom-amount-preview {
    font-size: 1.3em !important; 
    line-height: 1.6 !important;
    min-height: 2.5em !important; 
}

.core-choice-container {
    width: 100%;
    padding: 10px;
    text-align: center;
}

.core-choice-title {
    color: var(--primal-color);
    margin-bottom: 20px;
    font-size: 1.4em;
    text-shadow: 0 0 10px rgba(0, 230, 210, 0.3);
}

.core-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.core-choice-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.core-choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: #fff;
}

.core-choice-card.active {
    background: linear-gradient(145deg, rgba(0, 230, 210, 0.1), rgba(0, 0, 0, 0.6));
    border-color: var(--primal-color);
    box-shadow: 0 0 20px rgba(0, 230, 210, 0.4);
}

.core-choice-image {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.core-choice-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.core-choice-info {
    text-align: center;
    width: 100%;
}

.core-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
}

.core-type {
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.core-desc {
    font-size: 0.8em;
    color: var(--text-muted);
    line-height: 1.4;
    min-height: 2.8em; 
}

.choice-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin-top: 10px;
    position: relative;
}

.core-choice-card.active .choice-radio {
    border-color: var(--primal-color);
    background-color: var(--primal-color);
    box-shadow: 0 0 10px var(--primal-color);
}

.core-choice-card.active .choice-radio::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: calc(12px * var(--ui-scale-modal-body));
    font-weight: bold;
}

.core-choice-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

#claim-core-item-btn {
    width: 80%;
    padding: 15px;
    font-size: 1.2em;
    background-color: #444;
    transition: all 0.3s;
}

#claim-core-item-btn:not(:disabled) {
    background: linear-gradient(45deg, var(--primal-color), #2980b9);
    box-shadow: 0 0 15px rgba(0, 230, 210, 0.4);
    animation: pulse-green 2s infinite;
}

.core-choice-warning {
    margin-top: 15px;
    color: var(--fail-color);
    font-size: 0.9em;
    font-weight: bold;
}

@media (max-width: 600px) {
    .core-choice-grid {
        grid-template-columns: 1fr; 
        gap: 10px;
    }
    .core-choice-card {
        flex-direction: row; 
        text-align: left;
        padding: 10px;
    }
    .core-choice-image {
        width: 60px;
        height: 60px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    .core-choice-info {
        text-align: left;
        flex: 1;
    }
    .choice-radio {
        margin-top: 0;
        margin-left: 10px;
    }
}

.xmas-box-container {
    width: 100%;
    padding: 15px;
    text-align: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    border: 2px solid #ff2d55;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255, 45, 85, 0.3);
    position: relative;
    overflow: hidden;
}

.xmas-box-container::before {
    content: '❄';
    position: absolute;
    top: -20px;
    left: 10%;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
    animation: snow-fall 3s linear infinite;
}
.xmas-box-container::after {
    content: '❄';
    position: absolute;
    top: -20px;
    right: 20%;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.2);
    animation: snow-fall 4s linear infinite 1s;
}

@keyframes snow-fall {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(200px); opacity: 0; }
}

.xmas-decor {
    font-size: 1.6em;
    font-weight: 900;
    color: #2ecc71; 
    text-shadow: 2px 2px 0px #c0392b, 0 0 10px #fff; 
    margin-bottom: 20px;
    letter-spacing: 2px;
    animation: pulse-red 2s infinite;
}

.xmas-contents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
    margin-bottom: 20px;
}

.xmas-content-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.xmas-item-img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}
.xmas-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.xmas-item-info {
    text-align: left;
}

.xmas-qty {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.9em;
}

.xmas-actions button {
    width: 100%;
    padding: 15px;
    font-size: 1.3em;
    background: linear-gradient(to right, #c0392b, #e74c3c); 
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
    animation: glitter 2s infinite;
}

.xmas-actions button:hover {
    transform: scale(1.02);
}

.lunar-box-container {
    width: 100%;
    padding: 22px 16px;
    text-align: center;
    background: linear-gradient(145deg, #0d0d1a 0%, #141428 50%, #0d0d1a 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #6a0dad, #00e6d2, #af52de) 1;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}
.lunar-shimmer {
    position: absolute;
    top: 0; left: -100%; right: 0; bottom: 0;
    width: 300%;
    background: linear-gradient(90deg, transparent, rgba(0,230,210,0.04), rgba(175,82,222,0.06), transparent);
    animation: lunar-shine 4s linear infinite;
    pointer-events: none;
}
@keyframes lunar-shine {
    0% { transform: translateX(-33%); }
    100% { transform: translateX(33%); }
}
.lunar-decor {
    font-size: 1.5em;
    font-weight: 900;
    background: linear-gradient(90deg, #00e6d2, #af52de, #ff2d55, #00e6d2);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: lunar-text-flow 3s linear infinite;
    margin-bottom: 6px;
}
@keyframes lunar-text-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
.lunar-subtitle {
    font-size: 0.82em;
    color: rgba(255,255,255,0.45);
    margin-bottom: 16px;
}
.lunar-contents-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}
.lunar-content-item {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.03);
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.25s;
}
.lunar-content-item:hover {
    background: rgba(175,82,222,0.08);
    border-color: rgba(175,82,222,0.3);
}
.lunar-item-img {
    width: 38px;
    height: 38px;
    margin-right: 12px;
    flex-shrink: 0;
}
.lunar-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 3px rgba(0,230,210,0.25));
}
.lunar-item-info {
    text-align: left;
    font-size: 0.9em;
}
.lunar-qty {
    color: #00e6d2;
    font-weight: 600;
    font-size: 0.82em;
    opacity: 0.85;
}
.lunar-open-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.2em;
    font-weight: 800;
    background: linear-gradient(135deg, #6a0dad, #af52de);
    border: none !important;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(106,13,173,0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}
.lunar-open-btn:hover {
    box-shadow: 0 6px 30px rgba(175,82,222,0.55);
    transform: translateY(-1px);
}

.lunar-reward-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(8px);
}
.lunar-reward-modal {
    background: linear-gradient(160deg, #0d0d1a, #141428, #1a0d28);
    border: 2px solid rgba(175,82,222,0.4);
    border-radius: 20px;
    padding: 30px 24px;
    width: 90%;
    max-width: calc(400px * var(--ui-scale-modal-size));
    text-align: center;
    position: relative;
    box-shadow: 0 0 60px rgba(106,13,173,0.3), 0 0 120px rgba(0,230,210,0.08);
    overflow: hidden;
}
.lunar-rw-glow {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0,230,210,0.06), transparent, rgba(175,82,222,0.06), transparent);
    animation: lunar-modal-rotate 8s linear infinite;
    pointer-events: none;
}
@keyframes lunar-modal-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.lunar-rw-header {
    margin-bottom: 22px;
    position: relative;
}
.lunar-rw-title {
    font-size: 1.6em;
    font-weight: 900;
    background: linear-gradient(90deg, #00e6d2, #af52de);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}
.lunar-rw-subtitle {
    font-size: 0.85em;
    color: rgba(255,255,255,0.5);
}
.lunar-rw-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 22px;
    position: relative;
}
.lunar-rw-item {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 11px 14px;
    gap: 14px;
    transition: all 0.25s;
}
.lunar-rw-item:hover {
    background: rgba(175,82,222,0.08);
    border-color: rgba(175,82,222,0.3);
    transform: translateX(3px);
}
.lunar-rw-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}
.lunar-rw-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0,230,210,0.3));
}
.lunar-rw-name {
    font-size: 0.9em;
    font-weight: 600;
    text-align: left;
    flex: 1;
    line-height: 1.3;
}
.lunar-rw-qty {
    font-size: 0.9em;
    color: #00e6d2;
    font-weight: 700;
    white-space: nowrap;
}
.lunar-rw-close {
    width: 100%;
    padding: 13px;
    font-size: 1.1em;
    font-weight: 700;
    background: linear-gradient(135deg, #6a0dad, #af52de);
    border: none;
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(106,13,173,0.35);
    position: relative;
    letter-spacing: 0.5px;
}
.lunar-rw-close:hover {
    box-shadow: 0 6px 30px rgba(175,82,222,0.5);
    transform: translateY(-1px);
}

#season-sp-convert-container {
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.sp-convert-btn {
    background: linear-gradient(45deg, #6a0dad, #ff2d55);
    border: 2px solid #ffd700;
    color: #fff;
    font-size: 1.2em;
    font-weight: 900;
    padding: 12px 30px;
    border-radius: 25px;
    box-shadow: 0 0 15px rgba(255, 45, 85, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    display: inline-block;
}

.sp-convert-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

.sp-convert-info {
    margin-top: 8px;
    font-size: 0.9em;
    color: #ffd700;
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.season-pass-admin-card {
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9), rgba(20, 20, 30, 0.9));
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.season-pass-admin-card h4 {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.toggle-wrapper {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: #ffd700; 
    box-shadow: 0 0 10px #ffd700;
}

.toggle-checkbox:checked + .toggle-label:before {
    transform: translateX(24px);
}

.toggle-checkbox:disabled + .toggle-label {
    background-color: #555;
    cursor: not-allowed;
}

.sp-admin-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 8px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sp-admin-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #2c2f3b;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 5px;
    font-size: 0.85em;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: default;
}

.sp-admin-node .sp-level-label {
    font-size: 0.8em;
    margin-bottom: 2px;
}

.sp-admin-node .sp-status-text {
    font-weight: bold;
    font-size: 0.9em;
}

.sp-admin-node.claimed {
    background-color: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #fff;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.3);
}

.sp-admin-node.claimed .sp-status-text {
    color: #2ecc71;
}

.sp-admin-node.locked {
    opacity: 0.5;
}

.report-btn {
    background-color: transparent;
    border: 1px solid var(--fail-color);
    color: var(--fail-color);
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-btn:hover {
    background-color: var(--fail-color);
    color: white;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
}
.chat-log-viewer {
    flex-grow: 1;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 0.95em;
    max-height: 600px;
}

.report-log-item {
    padding: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.report-log-item .log-time {
    color: var(--text-muted);
    font-size: 0.85em;
    min-width: 140px;
}

.report-log-item .log-msg {
    color: #ddd;
    word-break: break-all;
}
.report-log-item.highlight {
    background-color: rgba(255, 59, 48, 0.15);
    border-left: 3px solid var(--fail-color);
}

.report-log-item.highlight .log-msg {
    color: #fff;
    font-weight: bold;
}

.report-row:hover {
    background-color: rgba(255, 59, 48, 0.05); 
}

.report-row td {
    vertical-align: middle;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#inquiry-modal .modal-content {
    background: linear-gradient(165deg, #0a0a12 0%, #14141c 100%) !important; 
    border: 1px solid rgba(100, 200, 255, 0.2) !important; 
    box-shadow: 0 0 50px rgba(0, 150, 255, 0.1) inset, 0 20px 50px rgba(0,0,0,0.8) !important; 
    border-radius: 16px !important;
    overflow: hidden;
    padding: 0 !important;
}
.inquiry-layout {
    display: flex;
    height: 100%;

    background: transparent; 
    border-radius: 0;
    box-shadow: none;
    border: none;
}
.inquiry-sidebar {
    width: 320px;

    background: rgba(20, 25, 40, 0.6);
    backdrop-filter: blur(20px); 
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.inquiry-sidebar-header {
    padding: 25px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inquiry-sidebar-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
}

.inquiry-list-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}
.inquiry-list-scroll::-webkit-scrollbar,
.conversation-area::-webkit-scrollbar {
    width: 6px;
}
.inquiry-list-scroll::-webkit-scrollbar-thumb,
.conversation-area::-webkit-scrollbar-thumb {
    background: rgba(100, 200, 255, 0.3);
    border-radius: 3px;
}
.inquiry-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.inquiry-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(100, 200, 255, 0.3);
    transform: translateX(5px);
}
.inquiry-item.active {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.2) 0%, transparent 100%);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.15) inset;
}
.inquiry-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; height: 100%;
    width: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}
.inquiry-item.unread::after {
    content: '';
    position: absolute;
    top: 12px; right: 12px;
    width: 8px; height: 8px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
    animation: pulse-gold 2s infinite;
}

.inquiry-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8em;
}

.inquiry-date {
    color: rgba(255,255,255,0.4);
}

.inquiry-item-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #eee;
    font-size: 1.0em;
}
.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.status-badge.wait { background: rgba(255, 255, 255, 0.1); color: #888; }
.status-badge.done { 
    background: rgba(46, 204, 113, 0.2); 
    color: #2ecc71; 
    border: 1px solid rgba(46, 204, 113, 0.5);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.inquiry-main {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;

    background-color: rgba(10, 10, 15, 0.4);
    background-image: 
        linear-gradient(rgba(100, 200, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 200, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.inquiry-view-header {
    padding: 25px 30px;

    background: rgba(25, 30, 45, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(100, 200, 255, 0.15);
}

.inquiry-view-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.8em;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.inquiry-view-header > span {
    color: rgba(255,255,255,0.5);
    font-size: 0.9em;
    font-family: monospace;
}
.compensation-timer-badge {
    margin-top: 15px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: #ffd700;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.compensation-timer-badge span {
    color: #fff;
    margin-left: 10px;
    font-family: monospace;
    font-size: 1.2em;
    text-shadow: 0 0 5px #ffd700;
}
.compensation-timer-badge.expired {
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.1), transparent);
    border-color: #2ecc71;
    color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
}

.conversation-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    gap: 30px;
}
.chat-bubble {
    max-width: 80%;
    padding: 25px;
    border-radius: 20px;
    line-height: 1.6;
    position: relative;
    font-size: calc(1.05em * var(--ui-scale-chat));
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}

.bubble-header {
    font-size: 0.85em;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}
.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #333842, #22252b);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom-right-radius: 4px;
    color: #eee;
}
.chat-bubble.user .bubble-header { color: var(--primary-color); }
.chat-bubble.admin {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.15), rgba(0, 150, 255, 0.05));
    border: 1px solid rgba(0, 255, 200, 0.4);
    border-bottom-left-radius: 4px;
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 255, 200, 0.15);
}
.chat-bubble.admin .bubble-header { color: #00ffc8; text-shadow: 0 0 10px rgba(0, 255, 200, 0.5); }
.waiting-message {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    margin-top: 30px;
    font-style: italic;
    border: 1px dotted rgba(255,255,255,0.1);
}
.placeholder-text, .no-data {
    text-align: center;
    margin-top: 150px;
    color: rgba(255,255,255,0.3);
    font-size: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.placeholder-text::before { content: '📋'; font-size: 4em; opacity: 0.3; filter: grayscale(1); }
.no-data::before { content: '📭'; font-size: 4em; opacity: 0.3; filter: grayscale(1); }

#inquiry-write-view {
    padding: 40px !important;
    background: rgba(0,0,0,0.2);
}
#inquiry-write-view h3 {
    font-size: 1.8em;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
@media (max-width: 768px) {
    .inquiry-main {
        display: flex !important;
        flex-direction: column !important;
        height: 60% !important; 
        overflow: hidden !important; 
    }

    #inquiry-write-view {
        flex: 1 1 auto !important; 
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important; 
        height: auto !important;
        max-height: 100% !important;
        padding: 20px 20px 100px 20px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
    }

    #inquiry-form {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important; 
        min-height: 0 !important;
        height: auto !important;
        gap: 15px !important;
    }

    #inquiry-form textarea {
        min-height: 200px !important; 
        flex-shrink: 0 !important;
    }

    #inquiry-form .form-actions,
    #inquiry-form > div:last-child {
        margin-top: 20px !important;
        padding-bottom: 20px !important; 
        flex-shrink: 0 !important;
    }
}

#inquiry-form label {
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-color);
    font-size: 1.1em;
}

#inquiry-form input, #inquiry-form textarea {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(100, 200, 255, 0.2) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 15px !important;
    font-size: 1.05em;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) inset;
}
#inquiry-form input:focus, #inquiry-form textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4) !important;
    background: rgba(0, 0, 0, 0.7) !important;
    outline: none;
}
@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}
@media (max-width: 768px) {
    .inquiry-layout { flex-direction: column; height: 95vh; }
    .inquiry-sidebar { width: 100%; height: 40%; border-right: none; border-bottom: 1px solid rgba(100,200,255,0.2); }
    .inquiry-main { height: 60%; }
    .chat-bubble { max-width: 95%; padding: calc(20px * var(--ui-scale-chat)); font-size: calc(1em * var(--ui-scale-chat)); }
    #inquiry-modal .modal-content { width: 95% !important; margin: 10px auto; }
}

.compensation-timer-badge {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.compensation-timer-badge span {
    color: #fff;
    margin-left: 5px;
}

.compensation-timer-badge.expired {
    background-color: rgba(46, 204, 113, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: none;
}

#toggle-number-format-btn:hover {
    background-color: #b2bec3 !important;
    color: #2d3436 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.resource-display {
    display: flex;
    align-items: center;
    gap: 12px; 
}

.gold-toggle-btn {
    background-color: transparent;
    border: 2px solid var(--border-color); 
    color: var(--text-muted);
    font-size: 0.7em; 
    padding: 5px 12px; 
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    height: 34px; 
    line-height: 1;
    white-space: nowrap;
    display: flex; 
    align-items: center;
    justify-content: center;
}

.gold-toggle-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.vip-tag-container {
    margin-top: 4px;
    font-size: 0.8em;
    letter-spacing: 1px;
}

.vip-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: calc(11px * var(--ui-scale-modal-body)) !important;
    line-height: 1.2;
    vertical-align: middle;
    margin-left: 5px; 
    transform: translateY(-1px);
}
.top-bar-vip {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vip-1 { 
    background: linear-gradient(135deg, #8a6e4b, #d8b88e);
    color: #3e2723;
    border-color: #d8b88e;
}
.vip-2 { 
    background: linear-gradient(135deg, #7f8c8d, #bdc3c7);
    color: #2c3e50;
    border-color: #ecf0f1;
}
.vip-3 { 
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #583e03;
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.4);
}
.vip-4 { 
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
    animation: vip-pulse-blue 2s infinite alternate;
}
.vip-5 { 
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: #fff;
    border: 1px solid #d2b4de;
    box-shadow: 0 0 10px rgba(142, 68, 173, 0.6);
}
.vip-6 { 
    background: linear-gradient(135deg, #2c3e50, #000000);
    color: #00e6d2;
    border: 1px solid #00e6d2;
    box-shadow: 0 0 12px rgba(0, 230, 210, 0.4);
    animation: vip-shine 3s infinite linear;
}
.vip-vvip { 
    background: linear-gradient(135deg, #c0392b, #ff0000, #800000);
    color: #ffd700;
    border: 1px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8), inset 0 0 10px rgba(255, 215, 0, 0.5);
    animation: vip-rainbow-border 3s linear infinite;
    font-size: 1.1em;
}

@keyframes vip-pulse-blue {
    from { box-shadow: 0 0 5px #3498db; }
    to { box-shadow: 0 0 15px #3498db, 0 0 5px #fff inset; }
}
@keyframes vip-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
@keyframes vip-rainbow-border {
    0% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000; }
    33% { border-color: #ffd700; box-shadow: 0 0 10px #ffd700; }
    66% { border-color: #ff2d55; box-shadow: 0 0 10px #ff2d55; }
    100% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000; }
}

.original-price-strike {
    text-decoration: line-through;
    color: #888;
    font-size: 0.8em;
    display: block;
}
.vip-discount-price {
    color: #00e6d2;
    font-weight: bold;
    font-size: 1.2em;
}
.damage-number {
    position: absolute;
    font-weight: 900;
    font-size: 1.5em;
    pointer-events: none;
    z-index: 9000;
    text-shadow: 2px 2px 0 #000;
    animation: damage-float 0.8s ease-out forwards;
}

.damage-player { color: #fff; font-size: calc(2em * var(--ui-scale-combat-info)); }
.damage-monster { color: #ff3b30; }
.damage-crit { color: #ffd700; font-size: calc(2.5em * var(--ui-scale-combat-info)); text-shadow: 0 0 10px #ff0; } 

@keyframes damage-float {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -150%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -300%) scale(1); opacity: 0; }
}
.shake-effect {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}
.Cosmic {
    font-weight: 900;

    background: linear-gradient(90deg, #d9afd9 0%, #97d9e1 50%, #fff 75%, #d9afd9 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cosmic-text-flow 3s linear infinite;
    text-shadow: 0 0 5px rgba(151, 217, 225, 0.3);
}
#announcement-banner.cosmic {

    padding: 15px 60px 15px 20px;
    width: 80%;
    max-width: 1200px;
    border-radius: 0 0 12px 12px;

    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
                url('https://media.giphy.com/media/U3qYN8S0j3bpK/giphy.gif');
    background-size: cover;      
    background-position: center; 

    color: #ffffff;
    font-weight: 900;

    border: 2px solid #a35ddf;
    border-top: none;

    box-shadow: 
        0 0 20px rgba(163, 93, 223, 0.8), 
        inset 0 0 50px rgba(0, 0, 0, 0.8);

    z-index: 20000;
}

#announcement-banner.cosmic span {
    position: relative;
    z-index: 1;

    text-shadow: 0 0 5px #fff, 0 0 15px #00d4ff;
}
.cosmic-drop-message {

    padding: 10px 15px !important;
    margin: 8px 0 !important;
    border-radius: 8px;

    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('https://media.giphy.com/media/U3qYN8S0j3bpK/giphy.gif');
    background-size: cover;
    background-position: center;

    border: 1px solid #a35ddf;

    text-align: center;
    line-height: 1.6;
    color: #fff !important;
    font-size: 1.1em;

    box-shadow: 0 0 15px rgba(163, 93, 223, 0.5);
}

.cosmic-drop-content .cosmic-header {
    display: block;
    font-size: 1.25em;
    font-weight: 900;
    color: #e0c3fc;
    margin-bottom: 5px;
    animation: cosmic-text-flicker 2s linear infinite; 
}

.cosmic-drop-content .cosmic-text {
    font-size: 1.1em;
    color: #fff;
    text-shadow: 0 0 5px #000;
}
.inventory-item.grade-Cosmic {
    border: 2px solid #a35ddf !important;
    box-shadow: 0 0 8px rgba(163, 93, 223, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #10002b, #240046);
}
@keyframes cosmic-text-flow {
    to { background-position: 200% center; }
}
@keyframes cosmic-bg-flash {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(163, 93, 223, 0.3);
        border-color: #a35ddf;
    }
    50% {
        background-position: 100% 50%;

        box-shadow: 0 0 35px rgba(0, 212, 255, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.2);
        border-color: #00d4ff;
    }
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(163, 93, 223, 0.3);
        border-color: #a35ddf;
    }
}
@keyframes cosmic-text-flicker {
    0%, 100% {
        text-shadow: 0 0 4px #fff, 0 0 10px #a35ddf, 0 0 20px #a35ddf;
        color: #fff;
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 2px #e0c3fc, 0 0 5px #4b0082;
        color: #e0c3fc;
        opacity: 0.9;
    }
    20%, 80% {
        text-shadow: 0 0 15px #00d4ff, 0 0 30px #00d4ff; 
        color: #fff;
    }
}

.slot.slot-grade-Cosmic {
    border-style: solid;
    border-color: var(--cosmic-color); 
    box-shadow: 0 0 15px var(--cosmic-color), inset 0 0 10px rgba(163, 93, 223, 0.5);
    animation: cosmic-border-flow 4s ease infinite;
    background: linear-gradient(135deg, #10002b, #240046);
}
.cosmic-level-container {
    position: absolute;
    top: 6px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 5;
}

.c-enh-val {
    color: #fff;
    font-weight: 900;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px #000, 0 0 2px rgba(0,0,0,0.8);
}

.c-amp-val {
    color: #af52de; 
    font-weight: 900;
    font-size: 1.1em;
    text-shadow: 0 0 5px #af52de, 1px 1px 2px #000;
}
.grade-Cosmic .item-enhancement-level {
    display: none;
}

.set-effect-Cosmic {
    background: linear-gradient(135deg, #10002b 0%, #240046 50%, #000000 100%);
    border: 2px solid #a35ddf;
    box-shadow: 0 0 20px rgba(163, 93, 223, 0.6), inset 0 0 30px rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: cosmic-box-pulse 3s infinite alternate;
}

.set-effect-Cosmic::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.1;
    animation: cosmic-stars-move 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.set-effect-Cosmic h4 {
    position: relative;
    z-index: 1;
    font-size: 1.3em !important;
    font-weight: 900 !important;
    background: linear-gradient(90deg, #e0c3fc, #8ec5fc, #e0c3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(142, 197, 252, 0.5);
    margin-bottom: 8px !important;
}

.set-effect-Cosmic p {
    position: relative;
    z-index: 1;
    color: #fff !important;
    font-size: 1em !important;
    line-height: 1.6 !important;
}

.cosmic-highlight {
    color: #00d4ff;
    font-weight: bold;
    text-shadow: 0 0 5px #00d4ff;
}

@keyframes cosmic-box-pulse {
    0% { box-shadow: 0 0 15px rgba(163, 93, 223, 0.5); border-color: #a35ddf; }
    100% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.6); border-color: #00d4ff; }
}

@keyframes cosmic-stars-move {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.golden-goblin-name {
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFA500;
    animation: golden-shimmer 1.5s ease-in-out infinite alternate;
}

@keyframes golden-shimmer {
    0% {
        text-shadow: 0 0 10px #FFD700, 0 0 20px #FFA500;
        color: #FFD700;
    }
    100% {
        text-shadow: 0 0 20px #FFD700, 0 0 35px #FFA500, 0 0 50px #FFFFFF;
        color: #FFFACD; 
    }
}

.goblin-result-content {
    background: linear-gradient(135deg, #1a1c2c 0%, #4a1942 100%) !important;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3) !important;
    max-width: calc(600px * var(--ui-scale-modal-size)) !important;
    border-radius: 20px !important;
    padding: 30px !important;
}
.goblin-result-header h2 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-size: 1.8em;
    margin-bottom: 5px;
}
.timer-info {
	text-align: center;
    color: #ff3b30;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.1em;
}
.goblin-rank-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 20px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.goblin-rank-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    font-size: 1.1em;
}
.goblin-rank-item:last-child { border-bottom: none; }
.goblin-rank-item.is-me {
    background: rgba(0, 122, 255, 0.2);
    border: 1px solid #007aff;
    border-radius: 8px;
    color: #00d4ff;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}
.rank-number { width: 50px; font-weight: 900; color: #ffd700; }
.goblin-action-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(to bottom, #ffd700, #b8860b);
    border: 1px solid #fff;
    border-radius: 12px;
    color: #000;
    font-size: 1.3em;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.goblin-action-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
}
.goblin-action-btn:disabled {
    background: #555;
    color: #aaa;
    cursor: not-allowed;
    border-color: #777;
    animation: none;
    box-shadow: none;
}
.animate-shine {
    background: linear-gradient(to right, #ffd700 20%, #fff 40%, #fff 60%, #ffd700 80%);
    background-size: 200% auto;
    color: #000;
    animation: shine-bg 3s linear infinite;
}
@keyframes shine-bg { to { background-position: 200% center; } }

.chat-time {
    display: none; 
    color: #888;
    font-size: 0.9em;
    margin-right: 5px;
    vertical-align: middle;
}

#chat-messages.show-time .chat-time {
    display: inline;
}

.chat-delete-checkbox {
    display: none;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}
#chat-messages.manage-mode .chat-delete-checkbox {
    display: inline-block;
}
#chat-messages.manage-mode li {
    padding-left: 5px;
}
#chat-messages.manage-mode li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#chat-messages.manage-mode li {
    padding-left: 30px; 
    position: relative;
    cursor: pointer;
}

#chat-messages.manage-mode li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-delete-checkbox {
    display: none;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    cursor: pointer;
    z-index: 10;
}

#chat-messages.manage-mode .chat-delete-checkbox {
    display: block;
}

#chat-manage-bar input {
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 4px;
}
#chat-form {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: rgba(0, 0, 0, .3);
    border-top: 1px solid var(--border-color);
    position: relative;
    gap: 5px;
}

#chat-manage-bar {
    display: none;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(30, 30, 40, 0.95);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 5px;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.manage-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.manage-label {
    font-size: 0.8em;
    color: #aaa;
}

#chat-limit-input {
    width: 50px;
    padding: 4px;
    background: #111;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}

.manage-btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
    background: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.manage-divider {
    width: 1px;
    height: 15px;
    background: #555;
    margin: 0 5px;
}

.manage-btn-del {
    padding: 5px 12px;
    font-size: 0.9em;
    background: var(--fail-color);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.manage-btn-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1em;
    cursor: pointer;
    padding: 5px;
}
.manage-btn-close:hover { color: #fff; }

.chat-input-area {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
}

#chat-input {
    flex-grow: 1;
    height: calc(40px * var(--ui-scale-chat));
    padding: 0 10px;
    font-size: calc(1em * var(--ui-scale-chat));
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 65px;
}
.chat-options .checkbox-wrapper label { font-size: 0.75em; cursor: pointer; }
.chat-options .checkbox-wrapper input { width: 12px; height: 12px; }

@media (max-width: 480px) {
    .chat-options { flex-direction:row; flex-wrap:nowrap; width:100%; min-width:unset; order:-1; gap:8px; align-items:center; }
    .chat-options .checkbox-wrapper { display:flex; align-items:center; gap:2px; }
    .chat-options .checkbox-wrapper label { font-size:calc(0.7em * var(--ui-scale-chat)); white-space:nowrap; }
}

.chat-actions {
    display: flex;
    gap: 5px;
}

#chat-submit-btn, #open-chat-custom-btn, #open-chat-manage-btn {
    height: calc(40px * var(--ui-scale-chat));
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#chat-submit-btn {
    padding: 0 calc(15px * var(--ui-scale-chat));
    background: var(--primary-color);
    color: white;
    font-size: calc(1em * var(--ui-scale-chat));
}

#open-chat-custom-btn {
    width: 40px;
    padding: 0;
    background: #fd79a8;
    font-size: 1.2em;
}

#open-chat-manage-btn {
    width: 40px;
    padding: 0;
    background: #636e72;
    font-size: 1.2em;
    color: white;
}

#chat-submit-btn:hover { background: #0056b3; }
#open-chat-custom-btn:hover { background: #e84393; }
#open-chat-manage-btn:hover { background: #2d3436; }

#chat-messages.manage-mode li {
    padding-left: 35px;
    transition: background 0.1s;
}
#chat-messages.manage-mode li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.chat-delete-checkbox {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    cursor: pointer;
    display: none;
    z-index: 100;
}
#chat-messages.manage-mode .chat-delete-checkbox {
    display: block;
}

#open-alarm-settings-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f1c40f; 
    color: #111;
    border: none;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#open-alarm-settings-btn:hover {
    background: #f39c12;
    transform: translateY(-2px);
}

.alarm-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.alarm-section h3 {
    font-size: 1.1em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}

.alarm-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
}
.alarm-label {
    display: flex;
    flex-direction: column;
}
.alarm-name {
    font-weight: bold;
    color: #fff;
}
.alarm-desc {
    font-size: 0.8em;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}
.lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: calc(15px * var(--ui-scale-top-menu));
    line-height: 1;
    opacity: 0.5;
}
.lang-option:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.08);
}
.lang-option.active {
    opacity: 1;
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

.reconnect-widget {
    position: relative;
    display: flex;
    align-items: center;
}
.reconnect-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.reconnect-widget.active .reconnect-toggle-label {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.1);
    box-shadow: 0 0 12px rgba(52, 199, 89, 0.2);
}
.reconnect-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.reconnect-widget.active .reconnect-status-dot {
    background: var(--success-color);
    box-shadow: 0 0 6px var(--success-color);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 4px var(--success-color); }
    50% { box-shadow: 0 0 10px var(--success-color), 0 0 20px rgba(52, 199, 89, 0.3); }
}
.reconnect-text {
    font-size: calc(12px * var(--ui-scale-top-menu));
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}
.reconnect-widget.active .reconnect-text {
    color: var(--success-color);
}

.reconnect-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: calc(12px * var(--ui-scale-top-menu));
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.reconnect-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}
.reconnect-widget:hover .reconnect-tooltip {
    display: block;
}

.toggle-switch-sm {
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}
.toggle-switch-sm .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}
.toggle-switch-sm input:checked + .slider:before {
    transform: translateX(16px);
}

@media (max-width: 768px) {
    .reconnect-text { display: none; }
    .reconnect-toggle-label { padding: 4px 8px; }
    .lang-option { width: 28px; height: 24px; font-size: calc(13px * var(--ui-scale-top-menu)); }
}

.custom-alarm-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}
.time-input {
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 4px;
    padding: 8px;
    font-size: 1.1em;
    cursor: pointer;
}
#custom-alarm-memo {
    flex-grow: 1;
    background: var(--bg-color-dark);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 4px;
    padding: 8px;
}
.custom-alarm-list {
    max-height: 150px;
    overflow-y: auto;
}
.custom-alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    margin-bottom: 5px;
    border-left: 3px solid var(--primary-color);
}
.custom-alarm-item span {
    font-size: 1em;
}
.delete-alarm-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2em;
}
.delete-alarm-btn:hover {
    color: var(--fail-color);
}
.alarm-permission-alert {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid var(--fail-color);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
}

.time-input:hover, .time-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    background: rgba(255, 255, 255, 0.15) !important;
}

.lang-widget-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    font-family: 'Noto Sans KR', sans-serif;
}

.current-lang-display {
    background: rgba(30, 30, 40, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.current-lang-display:hover {
    background: rgba(40, 40, 50, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    transform: translateY(-2px);
}

.globe-icon {
    font-size: 1.2em;
}

.lang-text {
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lang-widget-container:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    text-decoration: none;
    color: #ccc;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-size: 0.9em;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.lang-option.active {
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.2), transparent);
    color: var(--primary-color);
    font-weight: bold;
    border-left: 3px solid var(--primary-color);
}

.lang-option .flag {
    font-size: 1.2em;
}

#payment-method-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.payment-tab-btn {
    padding: 12px 30px;
    border: 2px solid;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-tab-btn[data-payment-type="krw"] {
    border-color: var(--primary-color);
}

.payment-tab-btn[data-payment-type="paypal"] {
    border-color: #0070ba;
}

.payment-tab-btn.active[data-payment-type="krw"] {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.payment-tab-btn.active[data-payment-type="paypal"] {
    background: linear-gradient(135deg, #0070ba, #003087);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 112, 186, 0.4);
}

.payment-tab-btn:not(.active):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.payment-tab-btn:not(.active)[data-payment-type="krw"] {
    background: transparent;
    color: var(--primary-color);
}

.payment-tab-btn:not(.active)[data-payment-type="paypal"] {
    background: transparent;
    color: #0070ba;
}

@media (max-width: 480px) {
    #payment-method-tabs {
        flex-direction: row;
        gap: 8px;
    }

    .payment-tab-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

.translate-toggle {
    cursor: pointer;
    font-size: calc(10px * var(--ui-scale-chat));
    margin-left: 4px;
    opacity: 0.6;
    user-select: none;
    display: inline-block;
}
.translate-toggle:hover {
    opacity: 1;
}
.guide-translate-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: calc(12px * var(--ui-scale-modal-body));
    color: #b0b0b0;
    padding: 4px 8px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    user-select: none;
    width: fit-content;
}
.guide-translate-label input {
    width: 12px;
    height: 12px;
    cursor: pointer;
}
.guide-translate-label:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.guide-translate-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(12px * var(--ui-scale-modal-body));
    margin-bottom: 8px;
}
.guide-translate-btn:hover {
    background: rgba(255,255,255,0.2);
}

@keyframes ampScrollOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ampScrollCardIn {
    from { opacity: 0; transform: scale(0.88) translateY(18px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes ampScrollRunePulse {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.55; }
}
@keyframes ampScrollShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.amp-scroll-overlay {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.82);
    animation: ampScrollOverlayIn 0.25s ease-out;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.amp-scroll-modal {
    position: relative;
    width: 92%;
    max-width: calc(520px * var(--ui-scale-modal-size));
    background: linear-gradient(168deg, rgba(28, 31, 45, 0.96) 0%, rgba(18, 20, 29, 0.98) 100%);
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 16px;
    padding: 28px 24px 22px;
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.06),
        0 20px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: ampScrollCardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.amp-scroll-modal::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.08);
    animation: ampScrollRunePulse 4s ease-in-out infinite;
    pointer-events: none;
}

.amp-scroll-title {
    text-align: center;
    margin-bottom: 4px;
    font-size: 1.35em;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 40%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.amp-scroll-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88em;
    margin-bottom: 22px;
}

.amp-scroll-cores {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.amp-scroll-core-card {
    flex: 1;
    max-width: 155px;
    min-width: 0;
    background: rgba(44, 45, 62, 0.5);
    border: 1px solid rgba(142, 142, 147, 0.22);
    border-radius: 12px;
    padding: 14px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.amp-scroll-core-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.22s ease;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(175, 82, 222, 0.08));
    pointer-events: none;
}

.amp-scroll-core-card:hover:not(.amp-scroll-core-disabled) {
    border-color: rgba(255, 215, 0, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(255, 215, 0, 0.12), 0 0 0 1px rgba(255, 215, 0, 0.1);
}

.amp-scroll-core-card:hover:not(.amp-scroll-core-disabled)::after {
    opacity: 1;
}

.amp-scroll-core-card:active:not(.amp-scroll-core-disabled) {
    transform: translateY(-1px) scale(0.98);
}

.amp-scroll-core-disabled {
    cursor: not-allowed;
    opacity: 0.38;
    filter: grayscale(0.7);
}

.amp-scroll-core-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(142, 142, 147, 0.2);
    padding: 4px;
}

.amp-scroll-core-name {
    font-size: 0.92em;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    line-height: 1.2;
}

.amp-scroll-core-level {
    font-size: 0.78em;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.12);
    color: var(--gold-color);
    white-space: nowrap;
}

.amp-scroll-core-disabled .amp-scroll-core-level {
    background: rgba(255, 59, 48, 0.12);
    color: var(--fail-color);
}

.amp-scroll-core-after {
    font-size: 0.76em;
    color: var(--success-color);
    font-weight: 500;
    text-align: center;
}

.amp-scroll-core-disabled .amp-scroll-core-after {
    color: var(--text-muted);
}

.amp-scroll-core-stats {
    font-size: 0.68em;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.35;
    margin-top: 2px;
}

.amp-scroll-core-stats strong {
    color: var(--gold-color);
}

.amp-scroll-warning {
    text-align: center;
    font-size: 0.78em;
    color: var(--fail-color);
    padding: 10px 12px;
    background: rgba(255, 59, 48, 0.06);
    border: 1px solid rgba(255, 59, 48, 0.15);
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.45;
}

.amp-scroll-cancel {
    display: block;
    width: 100%;
    padding: 11px 0;
    border: 1px solid rgba(142, 142, 147, 0.25);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.92em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
}

.amp-scroll-cancel:hover {
    background: rgba(142, 142, 147, 0.08);
    color: var(--text-color);
    border-color: rgba(142, 142, 147, 0.4);
}

@media (max-width: 480px) {
    .amp-scroll-modal { padding: 20px 14px 16px; }
    .amp-scroll-cores { gap: 6px; }
    .amp-scroll-core-card { padding: 10px 6px 8px; }
    .amp-scroll-core-img { width: 40px; height: 40px; }
    .amp-scroll-core-name { font-size: 0.82em; }
    .amp-scroll-title { font-size: 1.15em; }
}

.auto-amp-modal-content {
    max-width: calc(480px * var(--ui-scale-modal-size));
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(145deg, #1a1d2e, #12141d);
    border: 1px solid rgba(163, 93, 223, 0.2);
}

.auto-amp-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 2px;
}

.auto-amp-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auto-amp-item-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.auto-amp-item-slot {
    width: 72px;
    height: 72px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auto-amp-item-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.auto-amp-item-name {
    font-size: 0.8em;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auto-amp-level-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auto-amp-current-level,
.auto-amp-target-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.auto-amp-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-amp-value {
    font-size: 2em;
    font-weight: 800;
    color: var(--gold-color);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.auto-amp-arrow {
    font-size: 1.6em;
    color: var(--cosmic-color);
    animation: auto-amp-arrow-pulse 1.5s ease-in-out infinite;
}

@keyframes auto-amp-arrow-pulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
}

.auto-amp-input {
    width: 64px;
    padding: 8px 4px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--success-color);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auto-amp-input:focus {
    border-color: var(--cosmic-color);
    box-shadow: 0 0 12px rgba(163, 93, 223, 0.3);
}

.auto-amp-progress-bar {
    height: 26px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 13px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auto-amp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7b2ff7, var(--cosmic-color), #c77dff);
    border-radius: 13px;
    transition: width 0.3s ease;
    position: relative;
    background-size: 200% 100%;
    animation: auto-amp-gradient 3s ease infinite;
}

@keyframes auto-amp-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auto-amp-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: auto-amp-shimmer 2s infinite;
}

@keyframes auto-amp-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.auto-amp-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.auto-amp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.auto-amp-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auto-amp-stat-card .auto-amp-stat-label {
    display: block;
    font-size: 0.65em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.auto-amp-stat-card .auto-amp-stat-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color);
}

.auto-amp-stat-success .auto-amp-stat-value { color: var(--success-color); }
.auto-amp-stat-fail .auto-amp-stat-value { color: var(--fail-color); }
.auto-amp-stat-highest .auto-amp-stat-value { color: var(--gold-color); }

.auto-amp-materials {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auto-amp-material-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.85em;
}

.auto-amp-material-label { color: var(--text-muted); }
.auto-amp-material-value { color: var(--text-color); font-weight: 600; }

.auto-amp-log-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    max-height: 130px;
    display: flex;
    flex-direction: column;
}

.auto-amp-log-header {
    padding: 6px 12px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.auto-amp-log {
    overflow-y: auto;
    padding: 4px 10px;
    font-size: 0.78em;
    line-height: 1.5;
    flex: 1;
    font-family: 'Courier New', monospace;
}

.auto-amp-log-entry { padding: 1px 0; }
.auto-amp-log-entry.success { color: var(--success-color); }
.auto-amp-log-entry.fail { color: var(--fail-color); }
.auto-amp-log-entry.maintain { color: var(--text-muted); }
.auto-amp-log-entry.destroy { color: #ff3b30; font-weight: bold; }

.auto-amp-controls { display: flex; gap: 10px; justify-content: center; }

.auto-amp-start-btn {
    flex: 1;
    padding: 13px;
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(135deg, #7b2ff7, #a35ddf);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.auto-amp-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(123, 47, 247, 0.5);
}

.auto-amp-start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.auto-amp-stop-btn {
    flex: 1;
    padding: 13px;
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--fail-color), #cc2d25);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    animation: auto-amp-stop-pulse 1.5s ease-in-out infinite;
}

@keyframes auto-amp-stop-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}

.auto-amp-status {
    text-align: center;
    font-size: 0.85em;
    min-height: 1.4em;
    color: var(--text-muted);
    font-weight: 500;
}

.auto-amp-status.running {
    color: var(--cosmic-color);
    animation: auto-amp-blink 1s ease-in-out infinite;
}

@keyframes auto-amp-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.auto-amp-status.stopped { color: var(--fail-color); }
.auto-amp-status.done { color: var(--gold-color); font-weight: 700; }

.auto-amp-trigger-btn {
    grid-column: 1 / 3;
    display: block;
    margin: -10px auto 0;
    background: linear-gradient(135deg, #7b2ff7, #9b4dca, #a35ddf) !important;
    color: #fff !important;
    border: 1px solid rgba(163, 93, 223, 0.4);
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 60%;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(123, 47, 247, 0.2);
}

.auto-amp-trigger-btn:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(123, 47, 247, 0.5);
    transform: translateY(-2px);
    border-color: rgba(163, 93, 223, 0.7);
}

.auto-amp-trigger-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(123, 47, 247, 0.3);
}

.auto-amp-trigger-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.batch-amp-trigger-btn {
    grid-column: 1 / -1;
    display: block;
    margin: -10px auto 0;
    background: linear-gradient(135deg, #e67e22, #f39c12, #d4a017) !important;
    color: #fff !important;
    border: 1px solid rgba(243, 156, 18, 0.5);
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 60%;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.25);
}

.batch-amp-trigger-btn:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.55);
    transform: translateY(-2px);
    border-color: rgba(243, 156, 18, 0.8);
}

.batch-amp-trigger-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(243, 156, 18, 0.3);
}

.batch-amp-trigger-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.batch-amp-modal-content {
    max-width: calc(480px * var(--ui-scale-modal-size));
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(145deg, #1a1d2e, #12141d);
    border: 1px solid rgba(243, 156, 18, 0.25);
}

.batch-amp-title-text {
    background: linear-gradient(135deg, #ffd700 0%, #f39c12 40%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.batch-amp-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 2px;
}

.batch-amp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(243, 156, 18, 0.15);
    border-top: 4px solid #f39c12;
    border-radius: 50%;
    margin: 0 auto;
    animation: batch-amp-spin 0.8s linear infinite;
}

@keyframes batch-amp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.batch-amp-start-btn {
    flex: 1;
    padding: 13px;
    font-size: 1.15em;
    font-weight: 700;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.batch-amp-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.5);
}

.batch-amp-start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.batch-amp-result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.batch-amp-result-stat {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.batch-amp-result-label {
    font-size: 0.78em;
    color: var(--text-muted);
}

.batch-amp-result-value {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-color);
}

.batch-amp-result-value.success { color: var(--success-color); }
.batch-amp-result-value.fail { color: var(--fail-color); }
.batch-amp-result-value.destroy { color: #ff3b30; }
.batch-amp-result-value.gold { color: var(--gold-color); }

.batch-amp-log-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.batch-amp-log {
    overflow-y: auto;
    padding: 4px 10px;
    font-size: 0.78em;
    line-height: 1.5;
    flex: 1;
    font-family: 'Courier New', monospace;
}

@media (max-width: 500px) {
    .batch-amp-result-stats { grid-template-columns: 1fr; }
}

.auto-amp-speed-control {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auto-amp-speed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.auto-amp-speed-label {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 600;
}

.auto-amp-speed-value {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--cosmic-color);
    min-width: 60px;
    text-align: right;
}

.auto-amp-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-amp-slider-mark {
    font-size: 0.65em;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 38px;
}

.auto-amp-slider-mark:last-child {
    text-align: right;
}

.auto-amp-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auto-amp-slider:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.auto-amp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b4dca, #7b2ff7);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(123, 47, 247, 0.4);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.auto-amp-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 18px rgba(123, 47, 247, 0.7);
    transform: scale(1.15);
}

.auto-amp-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b4dca, #7b2ff7);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(123, 47, 247, 0.4);
    cursor: pointer;
}

.auto-amp-slider::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

@media (max-width: 500px) {
    .auto-amp-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .auto-amp-header { flex-direction: column; gap: 10px; }
    .auto-amp-level-display { gap: 8px; }
    .auto-amp-value { font-size: 1.6em; }
    .auto-amp-input { width: 56px; font-size: 1.3em; }
    .auto-amp-item-slot { width: 60px; height: 60px; }
}

.public-amp-trigger-btn {
    grid-column: 1/3;
    width: 60%;
    margin: 6px auto 0;
    padding: 12px;
    border: 2px solid #a35ddf;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
    color: #e0b0ff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    text-align: center;
    display: block;
}
.public-amp-trigger-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(163,93,223,0.3), transparent);
    animation: publicAmpShimmer 3s infinite;
}
.public-amp-trigger-btn:hover:not(:disabled) {
    border-color: #c77dff;
    box-shadow: 0 0 15px rgba(163,93,223,0.5);
}
.public-amp-trigger-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@keyframes publicAmpShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.public-amplify-announcement {
    padding: 8px 12px !important;
    margin: 4px 0 !important;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(163,93,223,0.15), rgba(75,0,130,0.25));
    border: 1px solid rgba(163,93,223,0.4);
    list-style: none;
    text-align: center;
}
.public-amp-announce-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
}
.public-amp-announce-icon { font-size: 1.2em; }
.public-amp-announce-text { color: #e0b0ff; font-size: 0.92em; }
.public-amp-watch-link {
    padding: 4px 14px;
    border: 1px solid #a35ddf;
    border-radius: 20px;
    background: linear-gradient(135deg, #a35ddf, #7b2fbe);
    color: #fff;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.public-amp-watch-link:hover {
    background: linear-gradient(135deg, #c77dff, #a35ddf);
    box-shadow: 0 0 10px rgba(163,93,223,0.6);
}
.public-amp-ended-badge {
    display: inline-block;
    padding: 3px 12px;
    border: 1px solid #555;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: #888;
    font-size: 0.82em;
    white-space: nowrap;
}
.public-amp-protection-info {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}
.public-amp-protection-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}
.public-amp-protection-badge.protection-on {
    background: rgba(0,200,83,0.15);
    border: 1px solid rgba(0,200,83,0.4);
    color: #69f0ae;
}
.public-amp-protection-badge.protection-off {
    background: rgba(255,23,68,0.15);
    border: 1px solid rgba(255,23,68,0.4);
    color: #ff6b6b;
}

.public-amp-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: publicAmpFadeIn 0.3s ease;
}
@keyframes publicAmpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.public-amp-content {
    position: relative;
    width: 95%;
    max-width: calc(420px * var(--ui-scale-modal-size));
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #0d0015, #1a0a2e, #120020);
    border: 1px solid rgba(163,93,223,0.5);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 0 40px rgba(163,93,223,0.3), inset 0 0 60px rgba(75,0,130,0.1);
    display: flex;
    flex-direction: column;
}
.public-amp-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 1.6em;
    color: #aaa;
    cursor: pointer;
    z-index: 2;
}
.public-amp-close:hover { color: #fff; }
.public-amp-viewer-badge {
    position: absolute;
    top: 14px; left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,0,0,0.15);
    border: 1px solid rgba(255,0,0,0.4);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8em;
    color: #ff6b6b;
}
.public-amp-live-dot {
    width: 8px; height: 8px;
    background: #ff0000;
    border-radius: 50%;
    animation: publicAmpPulse 1.5s infinite;
}
@keyframes publicAmpPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #ff0000; }
    50% { opacity: 0.5; box-shadow: 0 0 8px #ff0000; }
}

.public-amp-header { text-align: center; margin: 6px 0 8px; }
.public-amp-title {
    font-size: 1.15em;
    font-weight: 800;
    background: linear-gradient(90deg, #e0b0ff, #a35ddf, #e0b0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.public-amp-subtitle { color: #b0b0b0; font-size: 0.85em; margin-top: 2px; }

.public-amp-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 6px;
    overflow: hidden;
}
.public-amp-item-glow {
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(163,93,223,0.25), transparent 70%);
    pointer-events: none;
}
.public-amp-item-container {
    position: relative;
    width: 150px; height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-radius: 12px;
    overflow: hidden;
}
.public-amp-item-img {
    width: 150px; height: 150px;
    object-fit: cover;
    filter: drop-shadow(0 0 10px rgba(163,93,223,0.5));
    transition: filter 0.3s;
}
.public-amp-item-name {
    margin-top: 4px;
    font-size: 1em;
    font-weight: 700;
    text-align: center;
    z-index: 1;
}

.public-amp-progress-wrap {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}
.public-amp-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #a35ddf, #e0b0ff, #ffd700);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(163,93,223,0.6);
}

.public-amp-status {
    text-align: center;
    color: #b0b0b0;
    font-size: 0.9em;
    min-height: 18px;
    margin: 2px 0;
}
.public-amp-result-text {
    text-align: center;
    font-size: 1.6em;
    font-weight: 900;
    min-height: 24px;
    letter-spacing: 10px;
    margin: 4px 0;
}
.public-amp-text-success {
    background: linear-gradient(90deg, #ffd700, #ff6b35, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: publicAmpTextPop 0.6s ease;
    text-shadow: none;
}
.public-amp-text-destroy {
    color: #ff1744;
    animation: publicAmpTextShake 0.5s ease;
}
.public-amp-text-fail {
    color: #ff9500;
    animation: publicAmpTextPop 0.4s ease;
}
@keyframes publicAmpTextPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes publicAmpTextShake {
    0% { transform: scale(0); opacity: 0; }
    30% { transform: scale(1.2); opacity: 1; }
    40% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    70% { transform: translateX(4px); }
    80% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.public-amp-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 4px 0;
}
.public-amp-execute-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #a35ddf;
    border-radius: 10px;
    background: linear-gradient(135deg, #2d1b4e, #a35ddf);
    color: #fff;
    font-size: 1.1em;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.public-amp-execute-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: publicAmpShimmer 2s infinite;
}
.public-amp-execute-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(163,93,223,0.6);
    transform: scale(1.02);
}
.public-amp-execute-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.public-amp-protection-row {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}
.public-amp-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.public-amp-toggle-label input[type="checkbox"] {
    display: none;
}
.public-amp-toggle-slider {
    position: relative;
    width: 42px;
    height: 22px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #555;
    border-radius: 11px;
    transition: all 0.3s;
    flex-shrink: 0;
}
.public-amp-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #888;
    border-radius: 50%;
    transition: all 0.3s;
}
.public-amp-toggle-label input:checked + .public-amp-toggle-slider {
    background: rgba(163,93,223,0.4);
    border-color: #a35ddf;
}
.public-amp-toggle-label input:checked + .public-amp-toggle-slider::after {
    left: 22px;
    background: #c77dff;
    box-shadow: 0 0 6px rgba(163,93,223,0.6);
}
.public-amp-toggle-text {
    color: #ccc;
    font-size: 0.88em;
}
.public-amp-watching-label {
    color: #b0b0b0;
    font-size: 0.95em;
    text-align: center;
    width: 100%;
}

.public-amp-chat-section {
    margin-top: 8px;
    border-top: 1px solid rgba(163,93,223,0.2);
    padding-top: 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.public-amp-chat-header {
    font-size: 0.82em;
    color: #888;
    margin-bottom: 4px;
}
.public-amp-chat-messages {
    list-style: none;
    margin: 0;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(163,93,223,0.15);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.82em;
    color: #ddd;
    flex: 1;
}
.public-amp-chat-messages::-webkit-scrollbar { width: 4px; }
.public-amp-chat-messages::-webkit-scrollbar-track { background: transparent; }
.public-amp-chat-messages::-webkit-scrollbar-thumb { background: rgba(163,93,223,0.4); border-radius: 2px; }
.public-amp-chat-messages li {
    padding: 2px 0;
    line-height: 1.4;
    word-break: break-word;
}
.public-amp-chat-input-wrap {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.public-amp-chat-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(163,93,223,0.3);
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    color: #ddd;
    font-size: 0.88em;
    outline: none;
}
.public-amp-chat-input:focus { border-color: #a35ddf; }
.public-amp-chat-send {
    padding: 6px 12px;
    border: 1px solid #a35ddf;
    border-radius: 6px;
    background: rgba(163,93,223,0.2);
    color: #e0b0ff;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}
.public-amp-chat-send:hover { background: rgba(163,93,223,0.4); }

.public-amp-charging .public-amp-item-img {
    animation: publicAmpItemPulse 0.5s infinite alternate;
    filter: drop-shadow(0 0 15px rgba(163,93,223,0.8));
}
.public-amp-glow-charge {
    animation: publicAmpGlowGrow 3s ease-in forwards;
}
@keyframes publicAmpGlowGrow {
    0% { width: 160px; height: 160px; background: radial-gradient(circle, rgba(163,93,223,0.3), transparent 70%); }
    50% { width: 220px; height: 220px; background: radial-gradient(circle, rgba(163,93,223,0.6), rgba(255,215,0,0.2) 60%, transparent 80%); }
    100% { width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,255,255,0.8), rgba(163,93,223,0.6) 40%, transparent 70%); }
}
.public-amp-shake {
    animation: publicAmpShakeAnim 0.15s infinite alternate;
}
@keyframes publicAmpShakeAnim {
    0% { transform: translateX(-2px) rotate(-1deg); }
    100% { transform: translateX(2px) rotate(1deg); }
}
@keyframes publicAmpItemPulse {
    0% { filter: drop-shadow(0 0 10px rgba(163,93,223,0.6)); }
    100% { filter: drop-shadow(0 0 25px rgba(163,93,223,1)) brightness(1.2); }
}
.public-amp-charge-phase2 .public-amp-item-img {
    animation: publicAmpItemPulse2 0.3s infinite alternate;
}
@keyframes publicAmpItemPulse2 {
    0% { filter: drop-shadow(0 0 15px rgba(163,93,223,0.8)); transform: scale(1); }
    100% { filter: drop-shadow(0 0 30px rgba(255,215,0,0.8)) brightness(1.3); transform: scale(1.05); }
}
.public-amp-charge-phase3 .public-amp-item-img {
    animation: publicAmpItemPulse3 0.15s infinite alternate;
}
@keyframes publicAmpItemPulse3 {
    0% { filter: drop-shadow(0 0 20px rgba(255,215,0,0.9)) brightness(1.3); transform: scale(1.05); }
    100% { filter: drop-shadow(0 0 40px rgba(255,255,255,1)) brightness(1.6); transform: scale(1.1); }
}

.public-amp-result-success {
    animation: publicAmpFlashGold 0.5s ease;
}
@keyframes publicAmpFlashGold {
    0% { background: rgba(255,215,0,0.6); }
    100% { background: transparent; }
}
.public-amp-glow-success {
    width: 300px !important; height: 300px !important;
    background: radial-gradient(circle, rgba(255,215,0,0.5), rgba(163,93,223,0.3) 50%, transparent 70%) !important;
    animation: publicAmpSuccessRing 1.5s ease-out forwards;
}
@keyframes publicAmpSuccessRing {
    0% { width: 160px; height: 160px; opacity: 1; }
    100% { width: 400px; height: 400px; opacity: 0; }
}
.public-amp-item-rise {
    animation: publicAmpRise 0.8s ease forwards;
}
@keyframes publicAmpRise {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.15); }
    100% { transform: translateY(-5px) scale(1.1); }
}

.public-amp-result-destroy {
    animation: publicAmpFlashRed 0.5s ease;
}
@keyframes publicAmpFlashRed {
    0% { background: rgba(255,0,0,0.5); }
    100% { background: transparent; }
}
.public-amp-item-shatter {
    animation: publicAmpShatter 0.8s ease forwards;
}
@keyframes publicAmpShatter {
    0% { transform: scale(1); opacity: 1; filter: none; }
    30% { transform: scale(1.1); filter: brightness(2) hue-rotate(30deg); }
    60% { transform: scale(0.8) rotate(10deg); opacity: 0.6; filter: brightness(0.5) saturate(2); }
    100% { transform: scale(0) rotate(45deg); opacity: 0; }
}
.public-amp-screen-shake {
    animation: publicAmpScreenShake 0.6s ease;
}
@keyframes publicAmpScreenShake {
    0%, 100% { transform: translate(0,0); }
    10% { transform: translate(-4px, 2px); }
    20% { transform: translate(4px, -2px); }
    30% { transform: translate(-3px, -3px); }
    40% { transform: translate(3px, 3px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(2px, -1px); }
}

.public-amp-result-fail {
    animation: publicAmpFlashOrange 0.5s ease;
}
@keyframes publicAmpFlashOrange {
    0% { background: rgba(255,149,0,0.4); }
    100% { background: transparent; }
}
.public-amp-item-dim {
    animation: publicAmpDim 0.6s ease forwards;
}
@keyframes publicAmpDim {
    0% { filter: brightness(1); }
    50% { filter: brightness(0.3) grayscale(0.5); }
    100% { filter: brightness(0.7) grayscale(0.2); }
}

.public-amp-particle {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    animation: publicAmpParticleMove 1s ease-out forwards;
}
@keyframes publicAmpParticleMove {
    0% { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.public-amp-pill {
    position: fixed;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d1b4e, #a35ddf);
    border: 2px solid #c77dff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 10009;
    box-shadow: 0 0 20px rgba(163,93,223,0.6), 0 4px 12px rgba(0,0,0,0.4);
    animation: publicAmpPillPulse 2s infinite;
    transition: transform 0.2s;
    user-select: none;
    touch-action: none;
}
.public-amp-pill:hover {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(163,93,223,0.8), 0 4px 16px rgba(0,0,0,0.5);
}
.public-amp-pill-icon {
    font-size: 1.5em;
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.6));
}
@keyframes publicAmpPillPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(163,93,223,0.5), 0 4px 12px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 0 25px rgba(163,93,223,0.8), 0 4px 16px rgba(0,0,0,0.5); }
}

.public-amp-end-wrap {
    display: flex;
    justify-content: center;
    margin: 2px 0;
}
.public-amp-end-btn {
    padding: 6px 24px;
    border: 1px solid #555;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    color: #888;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.2s;
}
.public-amp-end-btn:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255,0,0,0.05);
}

.public-amp-chat-messages li {
    color: #ddd;
}
.public-amp-chat-messages .system-message {
    color: #aaa;
}
.public-amp-chat-messages .username {
    color: #e0b0ff;
}

.public-amp-flash-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}
.public-amp-flash-gold {
    animation: publicAmpFlashGoldAnim 0.8s ease-out forwards;
}
@keyframes publicAmpFlashGoldAnim {
    0% { background: rgba(255,215,0,0.8); }
    30% { background: rgba(255,215,0,0.4); }
    100% { background: transparent; }
}
.public-amp-flash-red {
    animation: publicAmpFlashRedAnim 0.6s ease-out forwards;
}
@keyframes publicAmpFlashRedAnim {
    0% { background: rgba(255,0,0,0.7); }
    20% { background: rgba(255,0,0,0.3); }
    100% { background: transparent; }
}
.public-amp-flash-orange {
    animation: publicAmpFlashOrangeAnim 0.6s ease-out forwards;
}
@keyframes publicAmpFlashOrangeAnim {
    0% { background: rgba(255,149,0,0.5); }
    100% { background: transparent; }
}
.public-amp-shard {
    position: absolute;
    border-radius: 2px;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 6px currentColor;
}

@media (max-width: 500px) {
    .public-amp-content { padding: 14px; max-width: 95vw; }
    .public-amp-result-text { font-size: 1.4em; letter-spacing: 8px; }
    .public-amp-chat-messages { max-height: 80px; }
    .public-amp-pill { width: 44px; height: 44px; }
}

.patch-notes-modal-content {
    max-width: calc(700px * var(--ui-scale-modal-size)) !important;
    width: 95% !important;
    height: 85vh !important;
    padding: 0 !important;
    background: linear-gradient(165deg, #0a0a18 0%, #111428 50%, #0d1020 100%) !important;
    border: 1px solid rgba(88, 101, 242, 0.3) !important;
    box-shadow: 0 0 60px rgba(88, 101, 242, 0.1) inset, 0 20px 60px rgba(0,0,0,0.8) !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.patch-notes-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.patch-notes-header {
    padding: 24px 28px 16px;
    background: rgba(88, 101, 242, 0.06);
    border-bottom: 1px solid rgba(88, 101, 242, 0.15);
    flex-shrink: 0;
}
.patch-notes-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.patch-notes-title-text {
    display: flex;
    align-items: center;
    gap: 10px;
}
.patch-notes-title-text h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, #7289da);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.patch-notes-icon {
    font-size: 1.5em;
}
.patch-notes-close {
    font-size: 1.8em;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.patch-notes-close:hover { color: #fff; }
.patch-notes-desc {
    margin: 8px 0 0;
    font-size: 0.82em;
    color: #666;
}
.patch-notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.patch-notes-list::-webkit-scrollbar { width: 6px; }
.patch-notes-list::-webkit-scrollbar-track { background: transparent; }
.patch-notes-list::-webkit-scrollbar-thumb { background: rgba(88, 101, 242, 0.3); border-radius: 3px; }
.patch-notes-list::-webkit-scrollbar-thumb:hover { background: rgba(88, 101, 242, 0.5); }
.patch-notes-loading, .patch-notes-empty {
    text-align: center;
    color: #555;
    padding: 60px 20px;
    font-size: 0.95em;
}
.patch-note-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.2s;
    position: relative;
}
.patch-note-card:hover {
    background: rgba(88, 101, 242, 0.06);
    border-color: rgba(88, 101, 242, 0.2);
}
.patch-note-card.is-new {
    border-left: 3px solid #5865F2;
    background: rgba(88, 101, 242, 0.04);
}
.patch-note-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.patch-note-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(88, 101, 242, 0.3);
}
.patch-note-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.patch-note-author {
    font-weight: 700;
    font-size: 0.92em;
    color: #e0e0e0;
}
.patch-note-time {
    font-size: 0.75em;
    color: #555;
}
.patch-note-edited {
    color: #666;
    font-style: italic;
}
.patch-note-new-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #5865F2, #7289da);
    color: #fff;
    font-size: 0.7em;
    font-weight: 800;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    animation: patchNewPulse 2s infinite;
}
@keyframes patchNewPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(88, 101, 242, 0.4); }
    50% { box-shadow: 0 0 12px rgba(88, 101, 242, 0.7); }
}
.patch-note-content {
    font-size: 0.9em;
    color: #ccc;
    line-height: 1.7;
    word-break: break-word;
}
.patch-note-content strong { color: #fff; font-weight: 700; }
.patch-note-content em { color: #b0b0b0; }
.discord-inline-code {
    background: rgba(88, 101, 242, 0.15);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.88em;
    color: #7289da;
}
.discord-codeblock {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #b5bac1;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    margin: 8px 0;
}
.discord-mention {
    background: rgba(88, 101, 242, 0.2);
    color: #7289da;
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 600;
}
.patch-note-content u {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.patch-note-content h2 {
    font-size: 1.2em;
    color: #fff;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.patch-note-content h3 {
    font-size: 1.05em;
    color: #e0e0e0;
    margin: 10px 0 4px;
}
.patch-note-content h4 {
    font-size: 0.95em;
    color: #b0b0b0;
    margin: 8px 0 4px;
}
.patch-note-content ul {
    margin: 6px 0;
    padding-left: 20px;
}
.patch-note-content li {
    margin: 3px 0;
    color: #bbb;
}
.patch-note-content li::marker {
    color: #5865F2;
}
.patch-note-content del { color: #666; }
.patch-note-images {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.patch-note-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}
.patch-note-img:hover {
    transform: scale(1.02);
}
.patch-note-embed {
    margin-top: 10px;
    padding: 10px 14px;
    border-left: 3px solid #5865F2;
    background: rgba(0,0,0,0.3);
    border-radius: 0 8px 8px 0;
}
.patch-note-embed-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #7289da;
    margin-bottom: 6px;
}
.patch-note-embed-desc {
    font-size: 0.85em;
    color: #b0b0b0;
    line-height: 1.6;
}
.patch-note-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.patch-note-embed-field {
    flex: 1 1 100%;
}
.patch-note-embed-field.inline {
    flex: 1 1 30%;
    min-width: 100px;
}
.patch-note-embed-field .field-name {
    font-weight: 700;
    font-size: 0.82em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.patch-note-embed-field .field-value {
    font-size: 0.85em;
    color: #ccc;
}
#patch-notes-button.has-new-patch {
    position: relative;
    animation: patchBtnGlow 2s infinite;
}
#patch-notes-button.has-new-patch::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: patchDot 1.5s infinite;
}
@keyframes patchBtnGlow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(88, 101, 242, 0.5); }
}
@keyframes patchDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@media (max-width: 500px) {
    .patch-notes-modal-content { height: 90vh !important; }
    .patch-notes-header { padding: 16px 18px 12px; }
    .patch-notes-title-text h3 { font-size: 1.2em; }
    .patch-notes-list { padding: 12px 14px; }
    .patch-note-card { padding: 12px 14px; }
}
.patch-notes-chat-notify {
    list-style: none;
    margin: 6px 0;
    padding: 0;
    animation: patchNotifySlideIn 0.4s ease-out;
}
.patch-notify-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(114, 137, 218, 0.1));
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.patch-notify-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #5865F2, #7289DA, #5865F2);
    background-size: 200% 100%;
    animation: patchNotifyShimmer 2s linear infinite;
}
.patch-notify-icon {
    font-size: calc(24px * var(--ui-scale-modal-body));
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.2);
    border-radius: 8px;
}
.patch-notify-body {
    min-width: 0;
    text-align: center;
}
.patch-notify-title {
    font-size: calc(12px * var(--ui-scale-modal-body));
    font-weight: 700;
    color: #7289DA;
    margin-bottom: 2px;
}
.patch-notify-preview {
    font-size: calc(11px * var(--ui-scale-modal-body));
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.patch-notify-view-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: calc(11px * var(--ui-scale-modal-body));
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.patch-notify-view-btn:hover {
    background: linear-gradient(135deg, #6B79F7, #5865F2);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(88, 101, 242, 0.4);
}
@keyframes patchNotifySlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes patchNotifyShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.patch-notes-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid rgba(88, 101, 242, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}
.patch-footer-notify-setting {
    display: flex;
    align-items: center;
    gap: 8px;
}
.patch-footer-setting-label {
    font-size: calc(11px * var(--ui-scale-modal-body));
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}
.patch-notify-count-selector {
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 2px;
}
.patch-count-opt {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: calc(11px * var(--ui-scale-modal-body));
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 28px;
    text-align: center;
}
.patch-count-opt:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(88, 101, 242, 0.15);
}
.patch-count-opt.active {
    background: #5865F2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}
.patch-notes-discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #5865F2;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: calc(13px * var(--ui-scale-modal-body));
    font-weight: 600;
    transition: all 0.25s;
    border: none;
    cursor: pointer;
}
.patch-notes-discord-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}
.patch-notes-discord-btn svg {
    flex-shrink: 0;
}

.dps-title { font-size: 1.5em; color: var(--text-muted); }
.dps-value-large { font-size: 3em; font-weight: bold; color: var(--damage-color); }
.dps-subtitle { font-size: 1.2em; color: var(--text-muted); margin-top: 15px; }
.dps-value-medium { font-size: 2em; font-weight: bold; color: var(--success-color); }
.wb-goblin-name { font-size: 1.2em; color: #000; font-weight: 900; text-shadow: none; }
.wb-infinity-symbol { font-size: 1.2em; }
.stat-max-label { color: #ff6b6b; font-size: 0.85em; }
.vip-hide-label { font-size: 0.8em; color: #aaa; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.dps-current-display { font-size: 0.9em; }

.hr-empty-message { color: #666; font-size: calc(12px * var(--ui-scale-modal-body, 1)); text-align: center; padding: 14px; }
.hr-rank-badge { color: #fff; font-size: calc(9px * var(--ui-scale-modal-body, 1)); padding: 1px 5px; border-radius: 3px; margin-right: 4px; font-weight: bold; }
.hr-active-detail-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: #bbb; }
.hr-ready-status { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.hr-kick-btn-text { font-size: calc(10px * var(--ui-scale-modal-body, 1)); }
.hr-chat-log-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.hr-chat-input-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.hr-chat-send-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.hr-ranking-detail-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.hr-ranking-party-members { color: #666; font-size: calc(10px * var(--ui-scale-modal-body, 1)); }
.hr-absent-label { color: #ff9800; font-size: calc(10px * var(--ui-scale-modal-body, 1)); }

.season-ended-title { font-size: 2.5em; color: #ffd700; margin-bottom: 20px; }
.season-preparing-text { font-size: 1.5em; }
.sp-convert-detail { font-size: 0.8em; }
.sp-collecting-detail { font-size: 0.8em; }
.att-empty-card { font-size: 0.8em; color: #555; }

.gd-death-lost { color: #e74c3c; font-size: 1.2em; margin: 8px 0; }

.rune-stat-preview-label { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); min-width: 55px; }
.rune-stat-preview-current { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: #aaa; }
.rune-stat-preview-arrow { color: var(--rune-gold); font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-stat-preview-next { font-size: calc(13px * var(--ui-scale-modal-body, 1)); font-weight: 700; }
.rune-stat-preview-effect-current { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: #aaa; }
.rune-stat-preview-effect-next { font-size: calc(12px * var(--ui-scale-modal-body, 1)); font-weight: 600; }
.rune-slot-size { width: 70px; height: 70px; }
.rune-slot-icon-large { font-size: calc(26px * var(--ui-scale-modal-body, 1)); }
.rune-slot-empty-icon { font-size: calc(20px * var(--ui-scale-modal-body, 1)); color: rgba(255,255,255,0.15); }
.rune-stone-qty { font-size: calc(18px * var(--ui-scale-modal-body, 1)); font-weight: 700; color: var(--rune-gold); min-width: 40px; text-align: center; }
.rune-stone-max-btn { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-stone-info-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-stone-name { font-size: calc(12px * var(--ui-scale-modal-body, 1)); font-weight: 600; }
.rune-stone-icon { font-size: calc(18px * var(--ui-scale-modal-body, 1)); margin-right: 8px; }
.rune-board-max-grade { font-size: calc(36px * var(--ui-scale-modal-body, 1)); font-weight: 800; margin-bottom: 8px; }
.rune-board-slot-count { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-bottom: 16px; }
.rune-board-max-msg { color: var(--rune-gold); font-weight: 700; font-size: calc(15px * var(--ui-scale-modal-body, 1)); }
.rune-system-title { font-size: calc(16px * var(--ui-scale-modal-body, 1)); font-weight: 700; color: var(--rune-gold); margin-bottom: 6px; }
.rune-system-desc { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); line-height: 1.6; }
.rune-slot-nav-icon { font-size: calc(18px * var(--ui-scale-modal-body, 1)); }
.rune-slot-nav-name { font-size: calc(14px * var(--ui-scale-modal-body, 1)); font-weight: 700; color: #fff; }
.rune-slot-nav-badge { font-size: calc(11px * var(--ui-scale-modal-body, 1)); padding: 2px 8px; border-radius: 8px; font-weight: 600; margin-left: auto; }
.rune-inv-icon { font-size: calc(16px * var(--ui-scale-modal-body, 1)); margin-bottom: 2px; }
.rune-inv-name { font-size: calc(11px * var(--ui-scale-modal-body, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rune-inv-grade { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-inv-stat { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: #4caf50; font-weight: 600; }
.rune-inv-empty-icon { font-size: calc(14px * var(--ui-scale-modal-body, 1)); color: rgba(255,255,255,0.15); }
.rune-slot-max-grade { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-slot-manage-link { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); font-weight: 600; }
.rune-bonus-summary-title { font-size: calc(12px * var(--ui-scale-modal-body, 1)); font-weight: 600; color: #4caf50; margin-bottom: 6px; }
.rune-inv-title { font-size: calc(14px * var(--ui-scale-modal-body, 1)); font-weight: 600; color: #fff; margin-bottom: 6px; }
.rune-filter-badge { font-size: calc(12px * var(--ui-scale-modal-body, 1)); padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: var(--rune-text); }
.rune-currency-name { font-size: calc(12px * var(--ui-scale-modal-body, 1)); }
.rune-currency-amount { font-size: calc(14px * var(--ui-scale-modal-body, 1)); color: #fff; }
.rune-board-badge { font-size: calc(11px * var(--ui-scale-modal-body, 1)); padding: 3px 14px; border-radius: 12px; font-weight: 600; }
.rune-board-slot-info { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-top: 6px; }
.rune-board-bonus-title { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: #4caf50; font-weight: 600; margin-bottom: 4px; }
.rune-equip-hint { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); text-align: center; padding: 8px; background: rgba(200,168,78,0.06); border-radius: 8px; border: 1px solid rgba(200,168,78,0.15); margin-bottom: 10px; }
.rune-enhance-desc { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); line-height: 1.5; background: rgba(0,0,0,0.15); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rune-enhance-hint { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-enhance-select-hint { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); text-align: center; padding: 14px; background: rgba(0,0,0,0.15); border-radius: 8px; border: 1px dashed rgba(255,255,255,0.1); }
.rune-enhance-no-target { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); text-align: center; padding: 8px; }
.rune-material-count { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-bottom: 6px; }
.rune-material-badge { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-upgrade-grade-current { font-size: calc(22px * var(--ui-scale-modal-body, 1)); font-weight: 800; }
.rune-upgrade-grade-label { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-upgrade-arrow { font-size: calc(24px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); }
.rune-upgrade-stat-row { font-size: calc(12px * var(--ui-scale-modal-body, 1)); }
.rune-upgrade-stat-detail { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-top: 2px; }
.rune-upgrade-material-info { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-bottom: 6px; }
.rune-upgrade-material-badge { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-upgrade-material-missing { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: #ef5350; }
.rune-upgrade-max-msg { font-size: calc(15px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); font-weight: 700; text-align: center; padding: 16px; }
.rune-upgrade-select-hint { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); text-align: center; padding: 14px; background: rgba(0,0,0,0.15); border-radius: 8px; border: 1px dashed rgba(255,255,255,0.1); }
.rune-upgrade-desc { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); line-height: 1.5; padding: 10px 12px; background: rgba(0,0,0,0.15); border-radius: 8px; margin-bottom: 12px; }
.rune-board-upgrade-slot-name { font-size: calc(13px * var(--ui-scale-modal-body, 1)); color: var(--rune-text); margin-bottom: 14px; }
.rune-board-upgrade-grade-large { font-size: calc(30px * var(--ui-scale-modal-body, 1)); font-weight: 800; }
.rune-board-upgrade-slot-count { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-board-upgrade-arrow { font-size: calc(28px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); }
.rune-board-upgrade-effect-title { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: var(--rune-gold); font-weight: 600; margin-bottom: 4px; }
.rune-board-upgrade-effect-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-detail-stat-value { font-size: calc(16px * var(--ui-scale-modal-body, 1)); }
.rune-detail-effect-desc { font-size: calc(10px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); line-height: 1.4; }
.rune-detail-fixed-value { font-size: calc(14px * var(--ui-scale-modal-body, 1)); }
.rune-detail-upgrade-label { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-detail-upgrade-grade { font-size: calc(12px * var(--ui-scale-modal-body, 1)); font-weight: 600; }
.rune-detail-upgrade-arrow { color: var(--rune-gold); font-size: calc(11px * var(--ui-scale-modal-body, 1)); }
.rune-detail-upgrade-target { font-size: calc(12px * var(--ui-scale-modal-body, 1)); font-weight: 700; }
.rune-detail-upgrade-stat { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-detail-upgrade-req { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); margin-top: 2px; }
.rune-inv-list-grade { font-size: calc(11px * var(--ui-scale-modal-body, 1)); color: var(--rune-text-dim); }
.rune-inv-list-stat { font-size: calc(12px * var(--ui-scale-modal-body, 1)); color: #4caf50; font-weight: 600; margin-top: 2px; }
.rune-filter-btn-text { font-size: calc(11px * var(--ui-scale-modal-body, 1)); padding: 4px 10px; }
.rune-toast { font-size: calc(13px * var(--ui-scale-modal-body, 1)); }
.rune-level-badge { font-size: calc(11px * var(--ui-scale-modal-body, 1)); padding: 3px 10px; border-radius: 8px; background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.2); color: #4caf50; font-weight: 600; }

.reconnect-overlay { font-size: 2em; text-align: center; }
.reconnect-counter { font-size: 0.8em; }
.reconnect-logout-btn { padding: 8px 16px; font-size: 0.5em; margin-top: 20px; background-color: #e74c3c; color: white; border: none; border-radius: 6px; cursor: pointer; }
.kakao-register-btn { width: 100%; padding: 15px; border: none; border-radius: 6px; background-color: #FEE500; color: #000; font-size: 1.2em; font-weight: 700; cursor: pointer; }
.referral-label { color: var(--text-muted); font-size: 0.9em; }
.referral-value { font-size: 1.2em; font-weight: bold; color: var(--secondary-color); }
.referral-empty { text-align: center; color: var(--text-muted); padding: 20px; font-size: 0.9em; }
.referral-level { color: var(--text-muted); font-size: 0.85em; }
.referral-status-badge { font-size: 0.8em; padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,0.06); }
.referral-status-detail { font-size: 0.8em; }
.referral-reward-text { font-size: 0.85em; color: var(--gold-color); }
.referral-debt { font-size: 0.9em; }
.guild-member-name { font-weight: bold; font-size: 1.1em; margin-left: 10px; }

.goblin-close-btn { font-size: 1.5em; }
.goblin-timer { font-size: 1.5em; }
.goblin-note { font-size: 0.9em; }
.defense-unit-summary { font-size: 0.9em; }
.defense-desc-text { font-size: 0.9em; }
.transcend-option-label { font-size: 1.1em; }
.transcend-modal-btn { font-size: 1.2em; }
.referral-heading { font-size: 1em; }
.referral-count-badge { font-size: 0.85em; }
.referral-link-input { font-size: 0.9em; }
.referral-generate-btn { font-size: 1em; }
.custom-amount-desc { font-size: 0.9em; }
.custom-amount-input { font-size: 1.1em; }
.custom-amount-preview { font-size: 1em; }
.spirit-summon-desc { font-size: 1.1em; }
.spirit-summon-count { font-size: 1.2em; }
.spirit-summon-btn { font-size: 1.3em; }

#ui-settings-modal {
    background: none;
    pointer-events: none;
    justify-content: flex-end;
    align-items: stretch;
}
#ui-settings-modal .modal-content {
    pointer-events: auto;
    max-width: 360px;
    width: 360px;
    font-size: 1em;
    height: 100vh;
    max-height: 100vh;
    border-radius: 16px 0 0 16px;
    margin: 0;
    padding: 0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    --panel-opacity: 0.95;
    background: rgba(18, 18, 24, var(--panel-opacity));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255,255,255,0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
#ui-settings-modal .modal-content::-webkit-scrollbar { width: 4px; }
#ui-settings-modal .modal-content::-webkit-scrollbar-track { background: transparent; }
#ui-settings-modal .modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
#ui-settings-modal.open .modal-content {
    transform: translateX(0);
}
#ui-settings-modal .modal-content > .close-button {
    position: sticky;
    top: 0;
    float: right;
    z-index: 10;
    margin: 12px 12px 0 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 1.2em;
    transition: background 0.2s;
}
#ui-settings-modal .modal-content > .close-button:hover {
    background: rgba(255,255,255,0.15);
}
#ui-settings-modal .modal-content > h2 {
    padding: 20px 24px 0;
    font-size: 1.3em;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ui-scale-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px 20px;
}
.ui-scale-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}
.ui-scale-section:hover {
    border-color: rgba(255,255,255,0.12);
}
.ui-scale-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ui-scale-section-title .section-icon {
    font-size: 1.1em;
}
.ui-scale-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ui-scale-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.ui-scale-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.ui-scale-item-header label {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-color);
}
.ui-scale-value {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(99,102,241,0.12);
    padding: 2px 8px;
    border-radius: 6px;
    min-width: 42px;
    text-align: center;
    transition: background 0.2s;
}
.ui-scale-desc {
    font-size: 0.72em;
    color: rgba(255,255,255,0.35);
    line-height: 1.3;
    margin-bottom: 6px;
}
.ui-scale-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 24px;
}
.ui-scale-slider-wrap input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: height 0.15s;
}
.ui-scale-slider-wrap input[type="range"]:hover {
    height: 6px;
}
.ui-scale-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.3), 0 2px 8px rgba(99,102,241,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ui-scale-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.4), 0 3px 12px rgba(99,102,241,0.35);
}
.ui-scale-slider-wrap input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.25);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.5), 0 4px 16px rgba(99,102,241,0.4);
}
.ui-scale-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.3), 0 2px 8px rgba(99,102,241,0.25);
}
.ui-scale-slider-wrap input[type="range"]::-moz-range-track {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    border: none;
}
.ui-scale-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 20px 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.08));
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    width: calc(100% - 40px);
}
.ui-scale-reset-btn:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(239,68,68,0.15));
    border-color: rgba(239,68,68,0.4);
    transform: translateY(-1px);
}
#open-ui-settings-btn {
    width: auto;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(99,102,241,0.3);
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
#open-ui-settings-btn:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.2));
    border-color: rgba(99,102,241,0.5);
    color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.2);
}
#open-ui-settings-btn:active {
    transform: translateY(0);
}
.ui-panel-opacity-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 6px;
    font-size: 0.82em;
}
.ui-panel-opacity-wrap label {
    flex: 0 0 auto;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}
.ui-panel-opacity-wrap input[type="range"] {
    flex: 1;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.ui-panel-opacity-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a5b4fc;
    cursor: pointer;
    border: 2px solid rgba(18,18,24,0.8);
    box-shadow: 0 0 0 1px rgba(165,180,252,0.3);
}
.ui-panel-opacity-wrap input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a5b4fc;
    cursor: pointer;
    border: 2px solid rgba(18,18,24,0.8);
}
.ui-panel-opacity-value {
    flex: 0 0 35px;
    text-align: right;
    font-size: 0.9em;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}
.ui-hide-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 20px 8px;
}
.ui-hide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.ui-hide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.82em;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
    user-select: none;
}
.ui-hide-item:hover {
    background: rgba(255,255,255,0.05);
}
.ui-hide-item input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    min-width: 36px;
    height: 20px;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.25s;
}
.ui-hide-item input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
}
.ui-hide-item input[type="checkbox"]:checked {
    background: var(--fail-color);
}
.ui-hide-item input[type="checkbox"]:checked::after {
    transform: translateX(16px);
    background: #fff;
}
.ui-hide-item span {
    user-select: none;
    color: var(--text-color);
    font-weight: 500;
}
.ui-hidden { display: none !important; }
.ui-scale-preset-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 20px 8px;
}
.ui-scale-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ui-scale-preset-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.ui-scale-preset-label {
    font-size: 0.82em;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2px;
}
.ui-scale-preset-save-btn,
.ui-scale-preset-load-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ui-scale-preset-save-btn {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.08));
    color: #a5b4fc;
    border-color: rgba(99,102,241,0.25);
}
.ui-scale-preset-save-btn:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(99,102,241,0.15));
    border-color: rgba(99,102,241,0.4);
}
.ui-scale-preset-load-btn {
    background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.06));
    color: #86efac;
    border-color: rgba(34,197,94,0.2);
}
.ui-scale-preset-load-btn:hover {
    background: linear-gradient(135deg, rgba(34,197,94,0.22), rgba(34,197,94,0.12));
    border-color: rgba(34,197,94,0.4);
}
@media (max-width: 480px) {
    .ui-scale-item-header label { font-size: 0.82em; }
    .ui-scale-desc { font-size: 0.68em; }
    .ui-scale-value { font-size: 0.72em; min-width: 38px; }
    #open-ui-settings-btn { height: 30px; padding: 0 8px; font-size: 11px; }
    .ui-panel-opacity-wrap { padding: 8px 14px 4px; }
    #ui-settings-modal .modal-content { width: 300px; max-width: 300px; }
    .ui-scale-sections { padding: 10px 14px 14px; }
    .ui-scale-section { padding: 10px 12px; }
    .ui-hide-section { margin: 0 14px 8px; padding: 10px 12px; }
    .ui-hide-grid { grid-template-columns: 1fr; }
}
