:root {
    --accent-color: rgb(218, 76, 111);
    --second-color: rgb(218, 168, 76);
    --bg: #1d1d1d;
    --card: #2c2c2c;
}

@font-face {
    font-family: 'Zhcn';
    src: url('../assets/ui/zhcn.ttf') format('truetype');
}

body {
    margin: 0;
    background: var(--bg);
    color: white;
    font-family: 'Zhcn', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
}

[hidden] {
    display: none !important;
}

#game-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #2b1809;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #2b1809;
    padding-top: 4px;
    padding-bottom: 2px;
}

.row {
    display: flex;
    flex-direction: row;
}

.col {
    display: flex;
    flex-direction: column;
}

.card {
    padding: 5px;
    margin: 5px;
    background: var(--card);
    border-radius: 8px;
}

#beer-storage-row {
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 8px;
    margin: 2px 5px 5px 5px;
    cursor: pointer;
}

.storage-label-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.net-flow-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.2;
    text-shadow: 1px 1px 1px #000;
    transition: all 0.2s ease;
}

.net-flow-filling {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.5);
}

.net-flow-draining {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.net-flow-full {
    background: rgba(234, 179, 8, 0.25);
    color: #fde047;
    border: 1px solid rgba(253, 224, 71, 0.6);
}

.net-flow-empty {
    background: rgba(156, 163, 175, 0.2);
    color: #e5e7eb;
    border: 1px solid rgba(156, 163, 175, 0.4);
}

.net-flow-balanced {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(252, 211, 77, 0.4);
}

.storage-bar-bg {
    flex: 1;
    height: 14px;
    background-color: #374151; /* grey empty space */
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.storage-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
    border-radius: 7px;
    transition: width 0.1s linear, background 0.3s ease;
}

.storage-bar-fill.is-draining {
    background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}

.storage-bar-fill.is-full {
    background: linear-gradient(180deg, #fef08a 0%, #eab308 100%);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

.storage-bar-fill.is-empty {
    background: #6b7280;
}

button {
    padding: 10px;
    margin: 5px;
    border-radius: 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Zhcn', sans-serif;
    text-shadow: 1px 1px black;
}

.cancel-btn {
    background-color: var(--bg);
    border: 2px solid var(--accent-color);
}

#tabs,
.tabs-row {
    display: grid;
    gap: 4px;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
}

#tabs {
    grid-template-columns: repeat(2, 1fr);
}

.tabs-row {
    grid-template-columns: repeat(5, 1fr);
}

#tabs button,
.tabs-row button {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 42px;
    border-radius: 6px;
    background: linear-gradient(180deg, #5a381e 0%, #3a2210 100%);
    border: 2px solid #281609;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

#tabs button {
    gap: 5px;
}

#tabs .tab-icon,
#tabs .tab-flow {
    position: relative;
    z-index: 1;
}

#tabs .tab-icon {
    font-size: 18px;
    line-height: 1;
}

#tabs .tab-flow {
    display: flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1;
    white-space: nowrap;
}

#tabs .tab-flow-label {
    color: #f8deb4;
    font-size: 11px;
    text-transform: uppercase;
}

#tabs .tab-flow b {
    font-size: 14px;
    letter-spacing: 0.1px;
}

#tabs button::before,
.tabs-row button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--fill-pct, 0%);
    background: linear-gradient(180deg, #fde047 0%, #d49838 50%, #8c5b1b 100%);
    opacity: 0.6;
    z-index: 0;
    transition: height 0.25s ease;
    pointer-events: none;
}

#tabs button::before {
    background: linear-gradient(180deg, #fde047 0%, #d49838 50%, #8c5b1b 100%);
}

#tabs .beer-bubbles {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--fill-pct, 0%);
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

#tabs .beer-bubble {
    position: absolute;
    bottom: -4px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 248, 210, 0.58);
    opacity: 0;
    animation-name: beer-bubble-rise;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

#tabs .bubble-a { left: 18%; animation-duration: 2.7s; animation-delay: -0.8s; }
#tabs .bubble-b { left: 43%; width: 3px; height: 3px; animation-duration: 3.9s; animation-delay: -2.4s; }
#tabs .bubble-c { left: 67%; animation-duration: 3.2s; animation-delay: -1.7s; }
#tabs .bubble-d { left: 84%; width: 1px; height: 1px; animation-duration: 4.6s; animation-delay: -3.5s; }

@keyframes beer-bubble-rise {
    0% { opacity: 0; transform: translate(0, 3px); }
    12% { opacity: 0.65; }
    72% { opacity: 0.42; }
    100% { opacity: 0; transform: translate(5px, -38px); }
}

#tabs button.has-badge::after,
.tabs-row button.has-badge::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 6px #ef4444, 0 0 0 1.5px #281609;
    animation: tab-badge-pulse 2s infinite ease-in-out;
    z-index: 2;
}

@keyframes tab-badge-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.85; }
}

#tabs button:hover,
.tabs-row button:hover {
    border-color: #5a381e;
}

#tabs button.active,
.tabs-row button.active {
    border: 2px solid #ffe082;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 10px rgba(255, 224, 130, 0.65);
    transform: translateY(-1px);
}

#panel-tavern {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 5px 8px 5px;
    box-sizing: border-box;
}

#map {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    padding: 0;
}

#tavern-canvas.tavern-floors {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    background: #211b20;
}

.floor-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px 5px;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
    user-select: none;
    background: linear-gradient(180deg, #2b2223 0%, #211b20 100%);
}

.floor-divider::before,
.floor-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 231, 0.5));
}

.floor-divider::after {
    background: linear-gradient(90deg, rgba(232, 157, 203, 0.5), transparent);
}

.floor-label {
    color: #d8eaff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 1.5px;
    text-shadow: 0 0 12px rgba(116, 210, 255, 0.45);
    text-transform: uppercase;
}

.tavern-floor {
    --floor-accent: #9de7ff;
    --floor-glow: rgba(93, 194, 255, 0.2);
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    image-rendering: pixelated;
    box-shadow: 0 8px 20px rgba(3, 6, 24, 0.45);
}

.tavern-floor::before {
    background:
        linear-gradient(135deg, rgba(76, 187, 255, 0.06), transparent 35%),
        linear-gradient(315deg, color-mix(in srgb, var(--floor-glow) 45%, transparent), transparent 42%);
    content: '';
    inset: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.floor-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 9px 12px;
    background: linear-gradient(180deg, rgba(28, 22, 27, 0.78) 0%, rgba(38, 28, 36, 0.34) 68%, transparent 100%);
    backdrop-filter: blur(1px);
    pointer-events: none;
    box-sizing: border-box;
}

.floor-bottom-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 10px 9px 7px;
    background: linear-gradient(0deg, rgba(29, 23, 28, 0.82) 0%, rgba(40, 29, 38, 0.34) 64%, transparent 100%);
    pointer-events: none;
    box-sizing: border-box;
}

.floor-waifu-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    pointer-events: auto;
}

.floor-waifu-name {
    color: var(--floor-accent);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px #07102d, 0 0 10px var(--floor-glow);
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.floor-waifu-name.rarity-c,
.floor-waifu-name.rarity-common {
    color: #d8f4ff;
}

.floor-waifu-name.rarity-r,
.floor-waifu-name.rarity-rare {
    color: #86dcff;
}

.floor-waifu-name.rarity-sr,
.floor-waifu-name.rarity-epic {
    color: #d0a8ff;
}

.floor-waifu-name.rarity-ssr,
.floor-waifu-name.rarity-legendary {
    color: #ffe397;
}

.floor-waifu-name.rarity-ss,
.floor-waifu-name.rarity-mythic {
    color: #ffaddd;
}

.floor-waifu-rate {
    font-size: 11px;
    color: #9de7ff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(103, 210, 255, 0.45);
}

.floor-waifu-gold {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 16px;
    font-weight: 800;
    color: #fff1ae;
    padding: 6px 9px;
    border-radius: 0;
    line-height: 1;
    text-shadow: 0 1px 3px #21171a, 0 0 8px rgba(255, 214, 111, 0.35);
    pointer-events: auto;
    cursor: default;
}


.floor-levelup-btn {
    pointer-events: auto;
    margin: 0;
    padding: 7px 11px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 0;
    background: linear-gradient(105deg, #70e5ff 0%, #8d9eff 52%, #f2a6d9 100%);
    border: 0;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 6px 50%);
    color: #101838;
    text-shadow: none;
    box-shadow: 0 4px 14px rgba(91, 192, 255, 0.38);
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.12s ease, transform 0.12s ease;
}

.floor-levelup-btn:hover:not(:disabled) {
    background: linear-gradient(105deg, #9af0ff 0%, #adb7ff 52%, #ffc3e8 100%);
    filter: brightness(1.08) saturate(1.08);
    transform: translateY(-1px);
}

.floor-levelup-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.95);
    filter: brightness(1.15);
}

.floor-levelup-btn:disabled,
.floor-levelup-btn.disabled {
    background: linear-gradient(105deg, #53617f, #414765);
    color: #aeb6cb;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.75;
}

.tavern-floor[data-rarity="c"],
.tavern-floor[data-rarity="common"] {
    --floor-accent: #c6f1ff;
    --floor-glow: rgba(103, 210, 255, 0.2);
}

.tavern-floor[data-rarity="r"],
.tavern-floor[data-rarity="rare"] {
    --floor-accent: #7ddcff;
    --floor-glow: rgba(71, 181, 255, 0.26);
}

.tavern-floor[data-rarity="sr"],
.tavern-floor[data-rarity="epic"] {
    --floor-accent: #d0a0ff;
    --floor-glow: rgba(174, 102, 255, 0.28);
}

.tavern-floor[data-rarity="ssr"],
.tavern-floor[data-rarity="legendary"] {
    --floor-accent: #ffe08c;
    --floor-glow: rgba(255, 185, 79, 0.28);
}

.tavern-floor[data-rarity="ss"],
.tavern-floor[data-rarity="mythic"] {
    --floor-accent: #ffabd9;
    --floor-glow: rgba(255, 101, 210, 0.3);
}

#coins-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
}

.level-up-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    background: linear-gradient(180deg, #6bd07a 0%, #3ea64f 100%);
    border: 1px solid rgba(20, 80, 30, 0.9);
    color: white;
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.12s ease;
}

.level-up-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #7be28b 0%, #46b859 100%);
    transform: translateY(-1px);
}

.level-up-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.96);
    filter: brightness(1.15);
}

.level-up-btn:disabled,
.level-up-btn.disabled {
    background: linear-gradient(180deg, #444 0%, #2a2a2a 100%);
    border-color: #1a1a1a;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.75;
}

.floor-actors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tavern-npc {
    position: absolute;
    z-index: 1;
    bottom: 7%;
    width: 19%;
    max-width: 96px;
    transform: translateX(-50%);
    transition: left 50ms linear;
    pointer-events: none;
}

.tavern-npc.waifu-npc {
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
    width: auto;
    height: 58%;
    max-width: none;
    transform: translateX(-50%) scale(var(--waifu-scale, 1));
    transform-origin: bottom center;
}

.tavern-npc.waifu-npc img {
    height: 100%;
    width: auto;
    max-width: none;
}

.tavern-npc.drunk-npc {
    width: 26%;
    max-width: 132px;
    transform: translateX(-50%) scale(var(--drunk-scale, 1));
    transform-origin: bottom center;
}

.tavern-npc.waifu-npc:hover img {
    filter: brightness(1.12);
}

.tavern-npc.waifu-npc:active img {
    transform: scale(0.92);
}

/* Golden glow effect on Level Up ONLY */
.tavern-npc.waifu-npc.level-up-glow img {
    animation: waifuLevelUpGlow 0.85s cubic-bezier(0.2, 0.8, 0.3, 1) !important;
}

@keyframes waifuLevelUpGlow {
    0% {
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 1)) drop-shadow(0 0 28px rgba(255, 170, 0, 0.85)) brightness(1.6);
        transform: scale(1.18);
    }
    40% {
        filter: drop-shadow(0 0 24px rgba(255, 220, 50, 1)) drop-shadow(0 0 36px rgba(255, 150, 0, 0.95)) brightness(1.7);
        transform: scale(1.24);
    }
    100% {
        filter: drop-shadow(0 3px 1px rgba(0, 0, 0, 0.52)) brightness(1);
        transform: scale(1);
    }
}

.tavern-npc img {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    transform-origin: bottom center;
}

/* Oval ground shadow under NPC feet */
.tavern-npc::before {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.tavern-npc.sprite-facing-left img {
    transform: scaleX(-1);
}

/* Continuous Waifu idle animation - gentle breathing and swaying bounce */
.tavern-npc.waifu-npc.waifu-idle img {
    animation: waifuIdleAnim 2.4s ease-in-out infinite alternate;
}

/* Waifu serving animation when pouring drinks */
.tavern-npc.waifu-npc.waifu-serving img {
    animation: waifuServingAnim 0.6s ease-in-out infinite;
}

.tavern-npc.waifu-npc.sprite-facing-left.waifu-idle img {
    animation: waifuIdleAnimLeft 2.4s ease-in-out infinite alternate;
}

.tavern-npc.waifu-npc.sprite-facing-left.waifu-serving img {
    animation: waifuServingAnimLeft 0.6s ease-in-out infinite;
}

@keyframes waifuIdleAnim {
    0% {
        transform: translateY(0) scale(1, 1);
    }
    50% {
        transform: translateY(-3px) scale(1.02, 0.98);
    }
    100% {
        transform: translateY(-6px) scale(0.98, 1.02);
    }
}

@keyframes waifuIdleAnimLeft {
    0% {
        transform: scaleX(-1) translateY(0) scale(1, 1);
    }
    50% {
        transform: scaleX(-1) translateY(-3px) scale(1.02, 0.98);
    }
    100% {
        transform: scaleX(-1) translateY(-6px) scale(0.98, 1.02);
    }
}

@keyframes waifuServingAnim {
    0% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-8px) scale(1.06, 0.94);
    }
    60% {
        transform: translateY(-3px) scale(0.95, 1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes waifuServingAnimLeft {
    0% {
        transform: scaleX(-1) translateY(0) scale(1);
    }
    30% {
        transform: scaleX(-1) translateY(-8px) scale(1.06, 0.94);
    }
    60% {
        transform: scaleX(-1) translateY(-3px) scale(0.95, 1.05);
    }
    100% {
        transform: scaleX(-1) translateY(0) scale(1);
    }
}

.npc-badge {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 93%;
    transform: translateX(-50%);
    padding: 2px 4px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    white-space: nowrap;
    color: #fff;
    background: rgba(22, 22, 22, 0.9);
    font-size: 10px;
    line-height: 1;
    text-shadow: 1px 1px #000;
}

.npc-badge.drinking {
    background: rgba(180, 86, 16, 0.94);
}

.counter {
    position: absolute;
    width: 28px;
    height: 220px;
    left: 50%;
    top: 40px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #b97f35 0%, #7a4c1c 100%);
    border: 2px solid #4b2d0c;
    border-radius: 8px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.waifu {
    width: 32px;
    height: auto;
    border-radius: 0;
    background: transparent;
    image-rendering: pixelated;
}

.drunk {
    width: 32px;
    height: auto;
    border-radius: 0;
    background: transparent;
    image-rendering: pixelated;
}

.pull-waifu-btn {
    position: sticky;
    bottom: 8px;
    margin: 8px 0 0 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 20;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(180deg, #e5a035 0%, #a26418 100%);
    border: 2px solid #ffe082;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    transition: all 0.15s ease;
}

.pull-waifu-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f5b045 0%, #b27428 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pull-waifu-btn:disabled,
.pull-waifu-btn.disabled {
    background: linear-gradient(180deg, #4a4a4a 0%, #2f2f2f 100%);
    border-color: #383838;
    color: #888888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#panel-buildings {
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 12px;
}

.building-map-intro {
    gap: 4px;
    display: flex;
    flex-direction: column;
    background: #25441d;
    border: 1px solid #3d6a2f;
}

#building-list {
    background-image: url('../assets/ui/grass-map.png');
    background-repeat: repeat;
    background-size: 512px auto;
    image-rendering: pixelated;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 2px solid #23481b;
    overflow: hidden;
    margin: 4px;
}

.building-map-intro span {
    font-size: 12px;
    opacity: 0.9;
}

.building-card {
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    background-color: #40905153;

}


.building-card.locked {
    background: rgba(10, 25, 10, 0.48);
    backdrop-filter: blur(1px);
    opacity: 0.8;
}

.building-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.7);
}

.building-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    cursor: pointer;
    padding: 0 0 0 4px;
    margin: 0;
    width: auto;
    max-width: none;
    line-height: 1;
    position: relative;
    vertical-align: middle;
    transition: color 0.15s ease, transform 0.15s ease;
    box-shadow: none;
    margin-top: 0;
    margin-bottom: 0;
}

.building-info-btn:hover {
    color: #fff;
    transform: scale(1.15);
    background: none;
    box-shadow: none;
}

.building-info-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    width: 220px;
    pointer-events: none;
}

.building-info-modal.visible {
    display: block;
    pointer-events: auto;
}

.building-info-modal-inner {
    background: rgba(15, 30, 10, 0.96);
    border: 1px solid rgba(100, 180, 60, 0.45);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.building-info-category {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    color: #aadda8;
    margin-bottom: 6px;
    text-shadow: none;
}

.building-info-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #f0f0e0;
    text-shadow: none;
}

.building-info-desc span {
    color: #fff0b0;
}

.building-world-row {
    min-height: 68px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 6px 0;
    padding: 6px 8px;
    background-color: #40905153;
    border-radius: 10px;
    min-width: 0;
    overflow: hidden;
}

/* Building sprite wrapper — provides the oval ground shadow */
.building-sprite-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Oval ground shadow — appears beneath the sprite like a 2D game map object */
.building-sprite-wrap::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0) 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.building-sprite {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    image-rendering: pixelated;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 1;
}

.building-world-row .building-sprite-wrap:nth-child(odd) {
    z-index: 2;
}

.building-world-row .building-sprite-wrap:nth-child(even) {
    transform: translateY(-18px);
    z-index: 1;
}

.building-sprite.preview {
    opacity: 0.7;
}

.building-sprite.locked-preview {
    opacity: 0.4;
    filter: grayscale(85%) brightness(65%);
}



.building-buy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.building-new-badge {
    font-size: 11px;
    font-weight: bold;
    color: #fde047;
    background: rgba(253, 224, 71, 0.15);
    border: 1px solid rgba(253, 224, 71, 0.45);
    padding: 2px 7px;
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
    animation: new-badge-shimmer 2s ease-in-out infinite;
}

.building-lock-req {
    font-size: 11px;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px dashed rgba(245, 158, 11, 0.45);
    padding: 2px 7px;
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

@keyframes new-badge-shimmer {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
        box-shadow: 0 0 6px rgba(253, 224, 71, 0.4);
    }
}

.building-quantity {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.95em;
    opacity: 0.9;
    transition: transform 0.15s ease, color 0.15s ease;
}

.building-prod-total {
    display: inline-block;
    transition: transform 0.15s ease, color 0.15s ease;
}

#beer-storage-text {
    display: inline-block;
    transition: transform 0.15s ease, color 0.15s ease;
}

.pulse-highlight {
    animation: quick-pulse 0.4s ease-out;
}

@keyframes quick-pulse {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.22);
        color: #fde047;
        text-shadow: 0 0 8px rgba(253, 224, 71, 0.75);
    }
    100% {
        transform: scale(1);
    }
}

.building-card button:not(.building-info-btn) {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    max-width: fit-content;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.12s ease;
    flex-shrink: 0;
    background-color: rgb(92, 107, 235);
}


.building-card button:not(.building-info-btn):hover:not(:disabled) {
    background-color: rgb(92, 107, 235);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.building-card button:not(.building-info-btn):active:not(:disabled) {
    transform: translateY(1px) scale(0.97);
    filter: brightness(1.15);
}

.building-card button:not(.building-info-btn):disabled {
    cursor: not-allowed;
    opacity: 0.85;
    background-color: grey;
    transform: none;
    box-shadow: none;
}

.pull-waifu-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    filter: brightness(1.15);
}

/* Settings Page */
#panel-settings {
    padding: 10px;
    min-height: 350px;
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-title {
    margin: 4px 0 12px 0;
    font-size: 20px;
    color: var(--second-color);
    text-align: center;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: #333;
    border-radius: 8px;
}

.settings-section h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.settings-btn {
    min-width: 110px;
    font-size: 13px;
    font-weight: bold;
    padding: 8px 14px;
    border-radius: 16px;
    transition: background-color 0.2s ease;
}

.settings-btn.sfx-on {
    background-color: #2e7d32;
}

.settings-btn.sfx-off {
    background-color: #c62828;
}

.volume-slider {
    flex: 1;
    max-width: 180px;
    accent-color: var(--second-color);
    cursor: pointer;
}

.test-btn {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #4a5568;
    border-radius: 12px;
}

.test-btn:hover {
    background-color: #718096;
}

/* Cloud Account & Offline Modal */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.account-input {
    background: #222;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.account-input:focus {
    border-color: var(--second-color);
}

.account-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    background: #4a5568;
    color: #edf2f7;
}

.account-badge.linked {
    background: #2e7d32;
}

.account-btn {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    margin: 4px 0 0 0;
}

.account-btn:hover {
    filter: brightness(1.1);
}

/* Offline Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #2b1809;
    border: 2px solid var(--second-color);
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
    animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: 22px;
    color: var(--second-color);
    margin: 0 0 8px 0;
}

.modal-desc {
    font-size: 14px;
    color: #cbd5e0;
    margin-bottom: 16px;
}

.modal-rewards {
    background: #1a0e05;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-reward-item {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: bold;
}

.modal-claim-btn {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    margin: 0;
}

.storage-unlock-modal-overlay {
    z-index: 10000;
}

.storage-unlock-modal-content {
    max-width: 460px;
}

.storage-unlock-icon {
    font-size: 48px;
    margin-bottom: 4px;
}

.storage-explanation {
    background: #1a0e05;
    border-radius: 8px;
    padding: 4px 14px;
    margin: 16px 0;
    text-align: left;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.45;
}

.storage-explanation p {
    margin: 10px 0;
}

/* ==========================================================================
   Tavern Chat Component Styles
   ========================================================================== */

#panel-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
    padding: 0 4px 8px 4px;
    box-sizing: border-box;
}

.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    gap: 6px;
}

.chat-header {
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 2px 4px;
    background: #1f140c;
    border: 1px solid #3d2314;
}

.chat-title-group {
    align-items: center;
    gap: 8px;
}

.chat-title-icon {
    font-size: 16px;
}

.chat-title-text {
    font-weight: bold;
    font-size: 14px;
    color: #fde047;
    text-shadow: 1px 1px 2px #000;
}

.chat-online-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #3a2213;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #cbd5e1;
}

.online-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.online-green {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: pulse-online 2s infinite ease-in-out;
}

.online-yellow {
    background: #eab308;
    box-shadow: 0 0 6px #eab308;
}

.chat-user-bar {
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin: 0 4px;
    background: #180d05;
    border: 1px dashed #4a2815;
    font-size: 12px;
}

.chat-user-label {
    color: #94a3b8;
}

.chat-my-name {
    color: #38bdf8;
    font-size: 13px;
}

.chat-change-name-btn {
    background: #2b1809;
    border: 1px solid #5c321a;
    color: #fde047;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-change-name-btn:hover {
    background: #4a2815;
    border-color: #f59e0b;
    transform: scale(1.03);
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.chat-messages-container {
    flex: 1;
    min-height: 260px;
    max-height: 48vh;
    overflow-y: auto;
    padding: 8px;
    margin: 2px 4px;
    background: #1a0e05;
    border: 1px solid #3d2314;
    position: relative;
    scroll-behavior: smooth;
}

.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: #120903;
    border-radius: 3px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: #4a2815;
    border-radius: 3px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: #6b3a1e;
}

.chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-loading-placeholder,
.chat-empty-state {
    text-align: center;
    padding: 30px 10px;
    color: #94a3b8;
    font-size: 13px;
}

.chat-msg-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 9px;
    border-radius: 6px;
    background: #26160c;
    border: 1px solid #3d2314;
    transition: background 0.15s ease;
}

.chat-msg-item:hover {
    background: #2e1a0e;
}

.chat-msg-own {
    background: #271d15;
    border-color: #5c391f;
}

.chat-msg-vip {
    border-color: #d97706;
    background: linear-gradient(90deg, #2c1a0e 0%, #3a2213 100%);
    box-shadow: inset 0 0 6px rgba(217, 119, 6, 0.15);
}

.chat-msg-header {
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.chat-msg-author-group {
    align-items: center;
    gap: 5px;
}

.chat-badge-vip {
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    text-shadow: 1px 1px 1px #000;
}

.chat-badge-level {
    background: #38251b;
    color: #e2e8f0;
    border: 1px solid #4d3326;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

.chat-msg-username {
    font-weight: bold;
    color: #fbbf24;
    font-size: 12px;
}

.author-own {
    color: #38bdf8;
}

.chat-msg-time {
    font-size: 10px;
    color: #78716c;
}

.chat-msg-bubble {
    font-size: 13px;
    color: #f1f5f9;
    line-height: 1.4;
    word-break: break-word;
}

.chat-scroll-bottom-btn {
    position: sticky;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #000;
    font-weight: bold;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 10;
    animation: bounce-btn 1.5s infinite;
}

@keyframes bounce-btn {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -4px); }
}

.chat-quick-cheers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 4px;
}

.cheer-chip {
    background: #2b1809;
    border: 1px solid #4a2815;
    color: #e2e8f0;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cheer-chip:hover {
    background: #4a2815;
    border-color: #f59e0b;
    color: #fef08a;
    transform: translateY(-1px);
}

.chat-composer-card {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin: 2px 4px;
    background: #1f140c;
    border: 1px solid #3d2314;
}

.chat-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.chat-input {
    width: 100%;
    background: #120903;
    border: 1px solid #3d2314;
    color: #f8fafc;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 50px 8px 10px;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.chat-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.chat-char-count {
    position: absolute;
    right: 8px;
    font-size: 10px;
    color: #64748b;
    pointer-events: none;
}

.chat-send-btn {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    color: white;
    font-weight: bold;
    font-size: 13px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.chat-send-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
}

.chat-send-btn:disabled,
.btn-cooldown {
    background: #331f13 !important;
    border-color: #4a2d1c !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.chat-status-toast {
    background: #1f140c;
    color: #f87171;
    border: 1px solid #f87171;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 2px 4px;
    text-align: center;
    animation: fade-in 0.2s ease-in-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Tavern Leaderboard / Ranks Styles
   ========================================================================== */

#panel-ranks {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
    padding: 0 4px 8px 4px;
    box-sizing: border-box;
}

.ranks-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.ranks-header {
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 2px 4px;
    background: #1f140c;
    border: 1px solid #3d2314;
}

.ranks-title-group {
    align-items: center;
    gap: 10px;
}

.ranks-title-icon {
    font-size: 20px;
}

.ranks-title-text {
    font-weight: bold;
    font-size: 14px;
    color: #fde047;
    text-shadow: 1px 1px 2px #000;
}

.ranks-subtitle-text {
    font-size: 11px;
    color: #94a3b8;
}

.ranks-refresh-btn {
    background: #2b1809;
    border: 1px solid #5c321a;
    color: #e2e8f0;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ranks-refresh-btn:hover {
    background: #4a2815;
    border-color: #f59e0b;
    color: #fef08a;
    transform: translateY(-1px);
}

.ranks-list-container {
    flex: 1;
    min-height: 280px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
    margin: 2px 4px;
    background: #1a0e05;
    border: 1px solid #3d2314;
}

.ranks-list-container::-webkit-scrollbar {
    width: 6px;
}

.ranks-list-container::-webkit-scrollbar-track {
    background: #120903;
    border-radius: 3px;
}

.ranks-list-container::-webkit-scrollbar-thumb {
    background: #4a2815;
    border-radius: 3px;
}

.ranks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranks-loading-placeholder,
.ranks-empty-state {
    text-align: center;
    padding: 35px 10px;
    color: #94a3b8;
    font-size: 13px;
}

.rank-item-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #26160c;
    border: 1px solid #3d2314;
    transition: all 0.15s ease;
}

.rank-item-card:hover {
    background: #2e1a0e;
}

.rank-item-own {
    background: #2b1c12;
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.rank-item-vip {
    border-color: #d97706;
}

.rank-badge-col {
    min-width: 48px;
    display: flex;
    justify-content: center;
}

.rank-badge {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    text-shadow: 1px 1px 1px #000;
    text-align: center;
    white-space: nowrap;
}

.rank-badge-gold {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.rank-badge-silver {
    background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
    color: #000;
    text-shadow: none;
}

.rank-badge-bronze {
    background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
    color: #fff;
}

.rank-badge-normal {
    background: #180d05;
    color: #94a3b8;
    border: 1px solid #3d2314;
}

.rank-info-col {
    flex: 1;
    gap: 3px;
}

.rank-user-row {
    align-items: center;
    gap: 6px;
}

.rank-username {
    font-weight: bold;
    color: #f8fafc;
    font-size: 13px;
}

.rank-you-tag {
    font-size: 10px;
    color: #38bdf8;
    font-weight: bold;
}

.rank-stats-row {
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #cbd5e1;
}

.rank-stat-item b {
    color: #fde047;
}

.rank-stat-divider {
    color: #5c391f;
}

/* ==========================================================================
   Gacha Reveal Modal & Rarity Aesthetics
   ========================================================================== */
.gacha-modal-overlay {
    padding: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(74, 173, 255, 0.16), transparent 52%),
        rgba(7, 9, 29, 0.82);
    backdrop-filter: blur(12px);
}

.gacha-modal-content {
    --rarity-glow: rgba(117, 215, 255, 0.22);
    --rarity-tint: rgba(100, 190, 255, 0.11);
    --rarity-accent: #9de7ff;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse 100% 56% at 50% 40%, var(--rarity-tint), transparent 70%),
        linear-gradient(160deg, #152b5b 0%, #17183d 42%, #35173f 100%);
    border: 0;
    border-radius: 0;
    padding: max(18px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
    max-width: 500px;
    width: 100%;
    height: 100dvh;
    box-shadow: 0 0 90px var(--rarity-glow);
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.gacha-modal-content::before {
    background-image:
        radial-gradient(circle at 12% 17%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 84% 12%, rgba(179, 239, 255, 0.8) 0 1px, transparent 2px),
        radial-gradient(circle at 91% 54%, rgba(255, 190, 232, 0.7) 0 1px, transparent 2px),
        radial-gradient(circle at 8% 72%, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px);
    content: '';
    inset: 0;
    opacity: 0.75;
    pointer-events: none;
    position: absolute;
    z-index: 0;
    animation: gachaStarDrift 8s ease-in-out infinite alternate;
}

.gacha-modal-content > * {
    position: relative;
    z-index: 1;
}

@keyframes gachaStarDrift {
    0% { transform: translate3d(0, 0, 0); opacity: 0.55; }
    100% { transform: translate3d(0, -6px, 0); opacity: 0.9; }
}

.gacha-stars-header {
    color: #c2eaff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1;
    margin: 2px 0 10px;
    text-transform: uppercase;
}

.gacha-title {
    background: linear-gradient(90deg, #ffffff 0%, #c9f3ff 42%, #ffd2ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.1;
    margin: 0 0 12px;
    text-shadow: 0 4px 22px rgba(123, 211, 255, 0.35);
}

.gacha-rarity-badge {
    align-self: center;
    border: 0;
    border-bottom: 1px solid var(--rarity-accent);
    border-radius: 0;
    box-shadow: none;
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
    text-transform: uppercase;
    margin: 0 auto 8px;
    padding: 0 0 5px;
}

.rarity-badge-c {
    color: #c5efff;
}

.rarity-badge-r {
    color: #86d5ff;
}

.rarity-badge-sr {
    color: #d3b2ff;
}

.rarity-badge-ssr {
    color: #ffe39a;
}

.rarity-badge-ss {
    color: #ffb6e4;
}

.gacha-art-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0 auto;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.2), transparent 30%),
        radial-gradient(ellipse at 50% 55%, rgba(104, 213, 255, 0.23), transparent 58%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.gacha-art-wrap::after {
    background: radial-gradient(ellipse, rgba(255, 198, 239, 0.5), var(--rarity-glow) 38%, transparent 70%);
    bottom: 5%;
    content: '';
    height: 14px;
    left: 18%;
    position: absolute;
    width: 64%;
    z-index: 0;
}

.gacha-art-wrap::before {
    background: conic-gradient(
        from 210deg at 50% 58%,
        transparent 0deg,
        rgba(107, 220, 255, 0.2) 35deg,
        transparent 72deg,
        rgba(255, 155, 221, 0.18) 142deg,
        transparent 190deg,
        rgba(255, 226, 142, 0.14) 250deg,
        transparent 300deg
    );
    content: '';
    filter: blur(18px);
    inset: 4% -15% 4%;
    opacity: 0.9;
    position: absolute;
    z-index: 0;
    animation: gachaLightSweep 7s linear infinite;
}

@keyframes gachaLightSweep {
    to { transform: rotate(360deg); }
}

.gacha-waifu-img {
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    position: relative;
    width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.8));
    animation: waifuFloat 3s ease-in-out infinite;
    z-index: 1;
}

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

.gacha-waifu-name {
    background: linear-gradient(90deg, #fff6fd, #ffffff 45%, #c8f4ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    margin: 12px 0 14px;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8);
}

.gacha-stats-box {
    border: 0;
    border-top: 1px solid rgba(190, 231, 255, 0.35);
    border-bottom: 1px solid rgba(255, 190, 231, 0.3);
    border-radius: 0;
    padding: 9px 2px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    font-size: 13px;
}

.gacha-stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c4d6eb;
    min-height: 24px;
}

.gacha-stat-line b {
    color: #ffffff;
    font-size: 13px;
}

.gacha-stat-line:nth-child(2) b {
    color: #ffe18b;
}

.gacha-stat-line:nth-child(3) b {
    color: #83f4d0;
}

.gacha-claim-btn {
    background: linear-gradient(100deg, #69ddff 0%, #8e9cff 48%, #f6a5d6 100%);
    border: 0;
    border-radius: 1px;
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 10px 50%);
    box-shadow: 0 8px 28px rgba(108, 196, 255, 0.3);
    color: #111938;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 14px 20px;
    cursor: pointer;
    width: 100%;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.gacha-claim-btn:hover {
    filter: brightness(1.12) saturate(1.12);
    transform: translateY(-1px);
}

/* Rarity atmosphere */
.rarity-border-c { --rarity-glow: rgba(117, 215, 255, 0.22); --rarity-tint: rgba(100, 190, 255, 0.11); --rarity-accent: #9de7ff; }
.rarity-border-r { --rarity-glow: rgba(77, 188, 255, 0.28); --rarity-tint: rgba(62, 147, 255, 0.14); --rarity-accent: #6ad5ff; }
.rarity-border-sr { --rarity-glow: rgba(185, 121, 255, 0.3); --rarity-tint: rgba(147, 78, 255, 0.16); --rarity-accent: #d2a7ff; }
.rarity-border-ssr { --rarity-glow: rgba(255, 210, 102, 0.34); --rarity-tint: rgba(255, 164, 82, 0.17); --rarity-accent: #ffe08b; }
.rarity-border-ss { --rarity-glow: rgba(255, 126, 218, 0.38); --rarity-tint: rgba(227, 71, 203, 0.18); --rarity-accent: #ffafd9; }

/* ==========================================================================
   3D Rolling Dice & RNG Fate Reel Animations (Max ~0.6s, No full-screen flash)
   ========================================================================== */
.gacha-rolling-state {
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    width: 90%;
    border: 0;
    border-radius: 0;
    padding: 28px 24px;
    box-shadow: 0 0 70px rgba(245, 158, 11, 0.18);
    display: block;
}

.gacha-dice-stage {
    width: 90px;
    height: 90px;
    margin: 6px auto 16px auto;
    perspective: 450px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gacha-dice-cube {
    width: 52px;
    height: 52px;
    position: relative;
    transform-style: preserve-3d;
    animation: diceTumble 0.55s cubic-bezier(0.3, 0.9, 0.4, 1) infinite;
}

@keyframes diceTumble {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0);
    }
    25% {
        transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg) translateY(-18px);
    }
    50% {
        transform: rotateX(360deg) rotateY(270deg) rotateZ(180deg) translateY(0);
    }
    75% {
        transform: rotateX(540deg) rotateY(360deg) rotateZ(270deg) translateY(-10px);
    }
    100% {
        transform: rotateX(720deg) rotateY(720deg) rotateZ(360deg) translateY(0);
    }
}

.dice-face {
    position: absolute;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #fef08a 0%, #d97706 100%);
    border: 2px solid #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #1e0b02;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.dice-1 { transform: rotateY(0deg) translateZ(26px); }
.dice-2 { transform: rotateY(90deg) translateZ(26px); }
.dice-3 { transform: rotateY(180deg) translateZ(26px); }
.dice-4 { transform: rotateY(-90deg) translateZ(26px); }
.dice-5 { transform: rotateX(90deg) translateZ(26px); }
.dice-6 { transform: rotateX(-90deg) translateZ(26px); }

.dice-shadow {
    position: absolute;
    bottom: 2px;
    width: 48px;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    filter: blur(4px);
    animation: shadowPulse 0.55s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 50%, 100% { transform: scale(1); opacity: 0.7; }
    25%, 75% { transform: scale(0.55); opacity: 0.25; }
}

.gacha-rolling-title {
    font-size: 18px;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    animation: textBlink 0.6s ease-in-out infinite alternate;
}

@keyframes textBlink {
    0% { opacity: 0.85; }
    100% { opacity: 1; filter: drop-shadow(0 0 6px #fde047); }
}

.gacha-reel-container {
    background: #0f0703;
    border: 1px solid #633215;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.reel-item {
    font-size: 14px;
    font-weight: 900;
    padding: 5px 16px;
    border-radius: 16px;
    letter-spacing: 1px;
    display: inline-block;
    transition: transform 0.08s ease, filter 0.08s ease;
    transform: scale(1.05);
}

.gacha-rolling-sub {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

/* ==========================================================================
   SHOP & GRAND REOPENING (PRESTIGE) STYLING
   ========================================================================== */

#panel-shop {
    padding: 8px 6px;
    box-sizing: border-box;
    width: 100%;
}

.shop-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.shop-header {
    text-align: center;
    padding: 4px 0;
}

.shop-title {
    margin: 2px 0;
    font-size: 18px;
    color: var(--second-color);
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px #000;
}

.shop-subtitle {
    font-size: 11px;
    color: #cbd5e1;
    opacity: 0.85;
}

.shop-currency-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px;
    margin-top: 6px;
    background: #1e1208;
    border: 1px solid #4a2912;
    border-radius: 8px;
}

.currency-pill {
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.currency-pill.medal-pill {
    color: #fde047;
    background: rgba(253, 224, 71, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(253, 224, 71, 0.3);
}

.currency-pill.gem-pill {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Prestige Hero Card */
.shop-prestige-card {
    background: linear-gradient(135deg, #3d1e08 0%, #201004 100%);
    border: 2px solid #eab308;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.25), inset 0 0 10px rgba(234, 179, 8, 0.1);
    border-radius: 10px;
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.prestige-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.prestige-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prestige-badge {
    background: #eab308;
    color: #000;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.prestige-title {
    margin: 0;
    font-size: 16px;
    color: #fef08a;
    text-shadow: 1px 1px 2px #000;
}

.generation-tag {
    font-size: 11px;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.prestige-desc {
    font-size: 11.5px;
    color: #e2e8f0;
    line-height: 1.4;
    margin: 6px 0 10px 0;
}

.prestige-stats-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.prestige-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prestige-stat-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
}

.prestige-stat-value {
    font-size: 13px;
}

.text-gold {
    color: #fde047;
}

.text-red {
    color: #f87171;
}

.text-green {
    color: #4ade80;
}

.shop-prestige-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
    color: #1a0800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 2px solid #fef08a;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease, filter 0.15s ease;
}

.shop-prestige-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.shop-prestige-btn.disabled,
.shop-prestige-btn:disabled {
    background: #3a2e22;
    color: #8c7e70;
    border-color: #554433;
    cursor: not-allowed;
    text-shadow: none;
}

.prestige-hint {
    display: block;
    font-size: 10.5px;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
}

.pulse-glow {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 8px rgba(234, 179, 8, 0.4); }
    100% { box-shadow: 0 0 18px rgba(253, 224, 71, 0.85); }
}

/* Section Cards */
.shop-section-card {
    background: #201309;
    border: 1px solid #4a2810;
    border-radius: 8px;
    padding: 10px;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.section-heading-row h3 {
    margin: 0;
    font-size: 14px;
    color: #f8deb4;
}

.section-hint {
    font-size: 10px;
    color: #94a3b8;
}

/* Royal Skills List */
.shop-skills-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shop-skill-card {
    display: grid;
    grid-template-columns: 44px 1fr 70px;
    gap: 8px;
    align-items: center;
    background: #2b1a0d;
    border: 1px solid #4a2d18;
    border-radius: 6px;
    padding: 6px 8px;
    transition: background-color 0.15s ease;
}

.shop-skill-card:hover {
    background: #362111;
}

.skill-icon-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.skill-emoji {
    font-size: 22px;
    line-height: 1;
}

.skill-lvl-badge {
    font-size: 9px;
    color: #cbd5e1;
    background: #1a0f07;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
}

.skill-details-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.skill-name-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.skill-name {
    font-size: 12.5px;
    color: #fef08a;
}

.skill-effect-tag {
    font-size: 10px;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.skill-desc {
    font-size: 10.5px;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.25;
}

.skill-action-col {
    display: flex;
    justify-content: flex-end;
}

.shop-upgrade-btn {
    padding: 6px 8px;
    font-size: 11px;
    font-weight: bold;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    border: 1px solid #fbbf24;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    width: 100%;
    max-width: 65px;
}

.shop-upgrade-btn:hover:not(:disabled) {
    filter: brightness(1.15);
}

.shop-upgrade-btn.disabled,
.shop-upgrade-btn:disabled {
    background: #3b2a1e;
    color: #786455;
    border-color: #553e2d;
    cursor: not-allowed;
}

/* Boosters Grid */
.shop-boosters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.shop-booster-card {
    background: #2c1a0e;
    border: 1px solid #5a341a;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.booster-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.booster-icon {
    font-size: 20px;
}

.booster-title-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.booster-title-block b {
    font-size: 12.5px;
    color: #fff;
}

.booster-tag {
    font-size: 10px;
    color: #fde047;
    background: rgba(253, 224, 71, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(253, 224, 71, 0.3);
}

.booster-desc {
    font-size: 11px;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.3;
}

.booster-btn-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 6px;
    margin-top: 2px;
}

.booster-btn {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: filter 0.15s ease;
}

.booster-btn.ad-btn {
    background: linear-gradient(180deg, #10b981 0%, #047857 100%);
    color: white;
    border: 1px solid #34d399;
}

.booster-btn.gem-btn {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    color: white;
    border: 1px solid #38bdf8;
}

.booster-btn:hover {
    filter: brightness(1.15);
}

/* Gem Packs */
.gem-packs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gem-pack-card {
    background: #25160b;
    border: 1px solid #4a2812;
    border-radius: 6px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    position: relative;
}

.gem-pack-card.featured {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.pack-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    background: #0284c7;
    color: white;
    font-size: 8px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #38bdf8;
}

.gem-pack-icon {
    font-size: 26px;
}

.gem-pack-card b {
    font-size: 12px;
    color: #fff;
}

.gem-pack-desc {
    font-size: 9.5px;
    color: #94a3b8;
}

.gem-pack-buy-btn {
    margin-top: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border: 1px solid #34d399;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}

.gem-pack-buy-btn:hover {
    filter: brightness(1.15);
}

/* Prestige Confirmation Modal */
.prestige-modal-content {
    max-width: 440px;
}

.prestige-breakdown-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
    background: #1a0e05;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 14px;
    border: 1px solid #3a200e;
}

.breakdown-col .col-title {
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
}

.breakdown-col ul {
    margin: 0;
    padding-left: 16px;
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
}

.modal-actions-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8px;
}

.modal-action-btn {
    margin: 0;
    padding: 10px;
    font-size: 13px;
}

/* Non-intrusive Toast */
.shop-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: rgba(18, 10, 5, 0.95);
    color: #fef08a;
    border: 1px solid #eab308;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    text-shadow: 1px 1px 2px #000;
}

.shop-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================================================
   WAIFU COMPENDIUM (MODERN GACHA / POKEDEX TCG STYLES)
   Inspired by Genshin Impact, Wuthering Waves & Zenless Zone Zero
   ========================================================================== */

#panel-compendium {
    background: radial-gradient(circle at 50% 0%, #151c2e 0%, #0a0d16 55%, #05070a 100%);
    min-height: calc(100vh - 120px);
    padding: 8px 6px 40px 6px;
    color: #f1f5f9;
    box-sizing: border-box;
}

.compendium-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* --- Hero Header Banner --- */
.compendium-hero {
    background: linear-gradient(135deg, rgba(26, 36, 56, 0.85) 0%, rgba(13, 19, 32, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compendium-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.compendium-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compendium-eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    color: #38bdf8;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.compendium-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff 0%, #38bdf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.compendium-progress-badge {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 5px 10px;
    text-align: right;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.compendium-badge-label {
    font-size: 8.5px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1px;
}

.compendium-badge-count {
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
}

.compendium-badge-count .count-highlight {
    color: #38bdf8;
    font-size: 15px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Animated Progress Meter */
.compendium-meter-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compendium-meter-bar {
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

.compendium-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #38bdf8, #818cf8, #c084fc);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    position: relative;
}

.compendium-meter-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: meter-sheen 2.4s infinite linear;
}

@keyframes meter-sheen {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.compendium-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

/* --- Filter & Search Toolbar --- */
.compendium-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(18, 24, 38, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(12px);
}

.compendium-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.compendium-search-box .search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    color: #64748b;
    pointer-events: none;
}

.compendium-input {
    width: 100%;
    background: rgba(10, 14, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 7px;
    color: #f8fafc;
    font-size: 12px;
    padding: 7px 30px 7px 32px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.compendium-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
    background: rgba(14, 20, 34, 0.95);
}

.compendium-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.compendium-clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Status Toggles (ALL / RECRUITED / MISSING) */
.compendium-status-toggles {
    display: flex;
    gap: 6px;
}

.status-toggle-btn {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
}

.status-toggle-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
}

.status-toggle-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(129, 140, 248, 0.25) 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Rarity Pills */
.compendium-rarity-pills {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.rarity-pill {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    transition: all 0.2s ease;
    min-width: 44px;
}

.rarity-pill .pill-badge {
    font-size: 8.5px;
    font-weight: 600;
    color: #94a3b8;
}

.rarity-pill:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.rarity-pill.active {
    box-shadow: 0 0 12px currentColor;
    transform: translateY(-1px);
}

.rarity-pill.pill-c.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

.rarity-pill.pill-r.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.rarity-pill.pill-sr.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #c084fc;
}

.rarity-pill.pill-ssr.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fbbf24;
}

.rarity-pill.pill-ss.active {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(139, 92, 246, 0.3));
    border-color: #ec4899;
    color: #f472b6;
}

/* --- Card Grid --- */
.compendium-grid-container {
    width: 100%;
}

.compendium-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .compendium-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* --- Card Base Styles (Chamfered Tech Corners) --- */
.compendium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    box-sizing: border-box;
    padding: 8px 8px 10px 8px;
    min-height: 220px;
}

/* Chamfered Tech Accents */
.card-corner-accent {
    position: absolute;
    width: 6px;
    height: 6px;
    pointer-events: none;
    z-index: 5;
}

.card-corner-accent.top-left {
    top: 2px;
    left: 2px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.4);
    border-left: 1.5px solid rgba(255, 255, 255, 0.4);
}

.card-corner-accent.bottom-right {
    bottom: 2px;
    right: 2px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
    border-right: 1.5px solid rgba(255, 255, 255, 0.4);
}

/* --- UNLOCKED CARDS --- */
.compendium-card.unlocked {
    background: linear-gradient(180deg, rgba(24, 32, 50, 0.92) 0%, rgba(12, 17, 28, 0.96) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.compendium-card.unlocked:hover {
    transform: translateY(-3px) scale(1.015);
    z-index: 10;
}

.compendium-card.unlocked:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Foil Shimmer on Hover */
.compendium-card.unlocked .card-sheen {
    position: absolute;
    top: 0; left: -150%; width: 100%; height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 6;
    transition: none;
}

.compendium-card.unlocked:hover .card-sheen {
    left: 200%;
    transition: left 0.8s ease-in-out;
}

/* Rarity Color Themes for Unlocked Cards */
.compendium-card.unlocked.rarity-c {
    border-color: rgba(56, 189, 248, 0.35);
}
.compendium-card.unlocked.rarity-c:hover {
    border-color: #38bdf8;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.4);
}

.compendium-card.unlocked.rarity-r {
    border-color: rgba(16, 185, 129, 0.4);
}
.compendium-card.unlocked.rarity-r:hover {
    border-color: #10b981;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.7), 0 0 16px rgba(16, 185, 129, 0.45);
}

.compendium-card.unlocked.rarity-sr {
    border-color: rgba(168, 85, 247, 0.45);
}
.compendium-card.unlocked.rarity-sr:hover {
    border-color: #c084fc;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.7), 0 0 18px rgba(168, 85, 247, 0.5);
}

.compendium-card.unlocked.rarity-ssr {
    border-color: rgba(245, 158, 11, 0.55);
}
.compendium-card.unlocked.rarity-ssr:hover {
    border-color: #fbbf24;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.55);
}

.compendium-card.unlocked.rarity-ss {
    border-color: rgba(236, 72, 153, 0.65);
    background: linear-gradient(180deg, rgba(38, 24, 48, 0.95) 0%, rgba(15, 12, 26, 0.98) 100%);
}
.compendium-card.unlocked.rarity-ss:hover {
    border-color: #f472b6;
    box-shadow: 0 8px 26px -4px rgba(0, 0, 0, 0.75), 0 0 24px rgba(236, 72, 153, 0.65), 0 0 12px rgba(139, 92, 246, 0.5);
}

/* Card Top Bar */
.card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    z-index: 4;
}

.card-dex-number {
    font-size: 11px;
    font-weight: 800;
    font-family: monospace, sans-serif;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.8);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    letter-spacing: 0.5px;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-rarity-pill {
    font-size: 9.5px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.card-rarity-pill.rarity-c { background: rgba(56, 189, 248, 0.25); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.card-rarity-pill.rarity-r { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.card-rarity-pill.rarity-sr { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.card-rarity-pill.rarity-ssr { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }
.card-rarity-pill.rarity-ss { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); text-shadow: 0 0 6px #000; }

/* Future Elemental Types Support */
.card-type-tag {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}
.card-type-tag.type-fire { background: rgba(239, 68, 68, 0.3); color: #f87171; border: 1px solid #ef4444; }
.card-type-tag.type-water { background: rgba(6, 182, 212, 0.3); color: #22d3ee; border: 1px solid #06b6d4; }
.card-type-tag.type-grass { background: rgba(34, 197, 94, 0.3); color: #4ade80; border: 1px solid #22c55e; }
.card-type-tag.type-poison { background: rgba(168, 85, 247, 0.3); color: #c084fc; border: 1px solid #a855f7; }
.card-type-tag.type-electric { background: rgba(234, 179, 8, 0.3); color: #fde047; border: 1px solid #eab308; }

/* Artwork Frame */
.card-art-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.15;
    background: radial-gradient(circle at 50% 40%, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-art-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
    transition: transform 0.25s ease;
}

.compendium-card.unlocked:hover .card-art-img {
    transform: scale(1.05);
}

.card-station-tag {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 8.5px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #fbbf24;
    color: #fbbf24;
    padding: 1px 5px;
    border-radius: 4px;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Card Metadata */
.card-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    flex: 1;
}

.card-name {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.card-desc-snippet {
    font-size: 9.5px;
    color: #94a3b8;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-inspect-hint {
    margin-top: 4px;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #38bdf8;
    text-align: right;
    opacity: 0;
    transform: translateY(2px);
    transition: all 0.2s ease;
}

.compendium-card.unlocked:hover .card-inspect-hint {
    opacity: 1;
    transform: translateY(0);
}

/* --- BLANK / LOCKED POKEDEX SLOTS --- */
.compendium-card.locked {
    background: linear-gradient(180deg, rgba(16, 22, 36, 0.65) 0%, rgba(9, 13, 22, 0.85) 100%);
    border: 1px dashed rgba(100, 116, 139, 0.35);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
    opacity: 0.85;
}

.compendium-card.locked:hover {
    border-color: rgba(56, 189, 248, 0.3);
    opacity: 0.95;
}

.card-dex-number.locked {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.25);
    background: rgba(15, 23, 42, 0.5);
}

.card-locked-icon {
    font-size: 11px;
    opacity: 0.6;
}

.card-art-wrap.locked-silhouette {
    background: radial-gradient(circle at 50% 50%, rgba(20, 28, 45, 0.6) 0%, rgba(8, 12, 20, 0.9) 100%);
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

.locked-hologram {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.locked-padlock {
    font-size: 28px;
    filter: grayscale(0.5) drop-shadow(0 0 10px rgba(56, 189, 248, 0.25));
    animation: pulse-lock 3s infinite ease-in-out;
}

@keyframes pulse-lock {
    0%, 100% { transform: scale(1); opacity: 0.65; }
    50% { transform: scale(1.08); opacity: 0.95; filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.5)); }
}

.locked-slot-label {
    font-size: 9px;
    font-weight: 800;
    font-family: monospace, sans-serif;
    color: #64748b;
    letter-spacing: 1px;
}

.card-meta.locked-meta {
    align-items: center;
    text-align: center;
}

.card-name.locked-name {
    color: #64748b;
    font-size: 13px;
    letter-spacing: 2px;
}

.card-desc-snippet.locked-snippet {
    color: #475569;
    font-style: italic;
    font-size: 9px;
}

/* Empty State */
.compendium-empty-state {
    padding: 40px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.compendium-empty-state .empty-icon {
    font-size: 36px;
    opacity: 0.6;
}

.compendium-empty-state .empty-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
}

.compendium-empty-state .empty-sub {
    font-size: 11px;
    color: #64748b;
}

/* --- Pagination Controls --- */
.compendium-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px 6px 6px;
    background: rgba(18, 24, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-top: 4px;
}

.page-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-size: 14px;
    font-weight: 800;
    width: 34px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.page-btn:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.page-btn:disabled,
.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
    color: #64748b;
}

.page-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: #e2e8f0;
    padding: 0 8px;
}

.page-current {
    color: #38bdf8;
    font-weight: 800;
}

.page-sep {
    color: #64748b;
}

.page-total {
    color: #cbd5e1;
}

.page-range {
    font-size: 9.5px;
    color: #64748b;
    margin-left: 2px;
}

/* --- Card Detail Inspection Modal --- */
.compendium-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: compendium-fade-in 0.2s ease-out forwards;
}

@keyframes compendium-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.compendium-modal-overlay.closing {
    opacity: 0;
    transition: opacity 0.18s ease-in;
}

.compendium-modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: linear-gradient(180deg, #161e31 0%, #0c1220 100%);
    border-radius: 16px;
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.25);
    padding: 20px 18px 16px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: compendium-pop-up 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes compendium-pop-up {
    from { transform: scale(0.92) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fff;
}

.modal-dex-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.modal-dex-num {
    font-size: 13px;
    font-weight: 800;
    font-family: monospace, sans-serif;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.modal-dex-tag {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
}

.modal-hero-rarity {
    font-size: 11.5px;
    font-weight: 900;
    padding: 3px 12px;
    border-radius: 12px;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.modal-art-stage {
    position: relative;
    width: 170px;
    height: 190px;
    margin: 4px 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-halo-glow {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    filter: blur(28px);
    opacity: 0.55;
    z-index: 1;
}

.rarity-halo-c { background: #38bdf8; }
.rarity-halo-r { background: #10b981; }
.rarity-halo-sr { background: #a855f7; }
.rarity-halo-ssr { background: #f59e0b; }
.rarity-halo-ss { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

.modal-waifu-art {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.8));
    z-index: 2;
}

.modal-waifu-name {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.5px;
}

.modal-lore-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.modal-lore-text {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #cbd5e1;
    font-style: italic;
}

.modal-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    margin-bottom: 14px;
}

.modal-stat-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.stat-card-label {
    font-size: 8px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.stat-card-val {
    font-size: 11.5px;
    font-weight: 800;
    color: #f1f5f9;
}

.modal-claim-btn {
    width: 100%;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.modal-claim-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
    transform: translateY(-1px);
}

