:root {
    --tg-theme-bg-color: #222;
    --universal-text-color: #f0f0f0;
    --progress-bar-color: #6a5acd;
    --checked-in-color: #3e8e41;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

body {
    background-color: var(--tg-theme-bg-color);
    background-size: cover;
    background-position: center;
    color: var(--universal-text-color);
    font-family: 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
button:focus,
button:active {
    outline: none;
    box-shadow: none;
    touch-action: manipulation;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
}

.player-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    background-color: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 5px 15px;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.avatar-frame {
    width: 40px;
    height: 40px;
    background-color: #444;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.player-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#player-name {
    font-weight: bold;
    font-size: 16px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

#player-level {
    font-size: 12px;
    background-color: #333;
    padding: 2px 6px;
    border-radius: 5px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

#settings-button,
#header-calendar-button,
#header-bag-button {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.header-right-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}

.progress-container,
.level-display {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    position: relative;
    padding-bottom: 12px;
}

.label {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.game-arena {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    padding-top: 10px;
}

.monster-sprite {
    width: 280px;
    height: 32vh;
    max-height: 320px;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
}

.monster-sprite:active:not(.monster-wobble):not(.monster-frenzy) {
    transform: scale(0.95);
}

.monster-wrapper {
    position: relative;
    width: 280px;
    height: 32vh;
    max-height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    margin-top: 10px;
}

.hero-sprite {
    width: 100%;
    height: 100%;
    max-height: none;
    background-position: center bottom;
    background-size: contain;
    background-repeat: no-repeat;
}

.left-controls-stack {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 60;
}

.right-controls-stack {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 60;
}

.map-btn-style {
    font-size: 10px !important;
    color: #e67e22 !important;
    border-color: #d35400 !important;
    background-color: #222;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.5);
}

#combat-controls {
    display: none !important;
}

#hero-ui-wrapper {
    position: relative;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 12px 25px;
    margin-top: 0px !important;
    width: auto;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#hero-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.click-effect.hero-float {
    animation: float-short 2s ease-out forwards;
    z-index: 50;
    text-shadow: 0 0 3px #000;
}

@keyframes float-short {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    20% {
        transform: translateY(-10px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-25px) scale(1);
    }
}

.rpg-stats-display {
    font-size: 14px;
    color: #87CEEB;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 2px 0 #000;
}

#lobby-status-text {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    margin-top: 5px;
    text-shadow: 0 1px 2px #000;
}

.header-container {
    width: 100%;
    margin-bottom: 15px;
}

#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.progress-container {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.button-bar {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
    margin-top: auto;
}

.button-bar button {
    background: rgba(44, 44, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color);
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.button-bar button:hover,
.button-bar button:active {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.button-bar button:disabled {
    background-color: #555;
    opacity: 0.6;
    cursor: not-allowed;
}

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.modal.closing {
    animation: fadeOutScaleDown 0.3s ease-out forwards;
}

.hidden {
    display: none !important;
}

.modal-content {
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 350px;
    position: relative;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    font-family: 'Lilita One', cursive;
    font-size: 28px;
}

.close-button {
    position: absolute;
    top: 0px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;

}

.next-level-preview {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: -8px;
    margin-bottom: 12px;
}

.click-effect {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: white;
    pointer-events: none;
    animation: float-up 2s ease-out forwards;
}

#click-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.click-effect.critical {
    color: #ffd700;
    font-size: 32px;
    font-weight: 900;
    text-shadow: 0 0 5px #ffc400;
}

.click-effect.overcharge {
    color: #999999;
    font-size: 20px;
    text-shadow: none;
}

#calendar-streak-count {
    font-size: 40px;
    font-weight: bold;
    color: #FFD700;
    margin: 10px 0;
}

#next-reward-label {
    display: block;
    font-size: 18px;
    opacity: 0.8;
    margin-top: 20px;
}

#next-reward-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    margin-top: 5px;
}

.streak-day.completed {
    background-color: var(--checked-in-color);
}

.streak-day.current {
    border: 2px solid var(--tg-theme-text-color);
    background-color: var(--checked-in-color);
}

#cheat-modal .modal-content {
    background-color: #a01c1c;
    border: 2px solid #ff0000;
}

.monster-wobble {
    animation: wobble 0.5s ease-in-out;
}

.monster-frenzy {
    animation: wobble 0.5s ease-in-out infinite;
}

.glow-wrapper {
    position: absolute;
    animation: sway 2s ease-in-out infinite;
}

.glow-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle,
            rgba(255, 240, 150, 1) 0%,
            rgba(255, 215, 80, 0.9) 30%,
            rgba(255, 180, 0, 0) 80%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatUpTransform 5s ease-out forwards, flicker 5s ease-out forwards;
    filter: brightness(1.5) blur(1px);
    box-shadow:
        0 0 12px rgba(255, 240, 150, 0.9),
        0 0 25px rgba(255, 210, 60, 0.7),
        0 0 45px rgba(255, 180, 0, 0.5),
        0 0 70px rgba(255, 150, 0, 0.3);
}

.spinning {
    animation: spin 0.15s linear infinite;
    filter: blur(3px);
}

.icon-crystaldust {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0px;
}

.icon-gem {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 2px;
}

#offline-dust-amount {
    color: #87CEEB;
    text-shadow: 0 0 5px #00BFFF;
}

.time-passed-label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: -12px;
}

.inline-icon {
    width: 18px;
    height: 18px;
    vertical-align: -4px;
}

.settings-modal-content {
    position: relative;
    width: min(90vw, 540px);
    aspect-ratio: 2 / 3;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    max-height: 400px;
}

#settings-modal .modal-inner {
    position: absolute;
    top: 35%;
    left: 17%;
    width: 66%;
    height: 81%;
    text-align: center;
    color: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.settings-img-button {
    width: 190px;
    height: auto;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.settings-img-button:active {
    transform: scale(0.95);
}

#close-settings-button {
    z-index: 10;
    left: 82%;
    transform: translateX(-50%);
    top: 28%;
    width: 30px;
    height: 29px;
    background-size: contain;
    background-repeat: no-repeat;
    font-size: 0;
}

#close-achievements-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.treasure-box img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

#offline-progress-modal .modal-content {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    width: min(90vw, 438px);
    line-height: 1;
}

#welcome-frame-img {
    width: 100%;
    height: auto;
    display: block;
}

#offline-progress-modal .modal-text-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

#offline-progress-modal .modal-text-content h2 {
    font-size: 22px;
}

#offline-progress-modal .modal-text-content p {
    font-size: 14px;
    line-height: 1.4;
}

#welcome-back-title {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-top: 25px;
    margin-bottom: 0px;
}

#login-reward-modal .modal-content {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    width: min(90vw, 438px);
    line-height: 1;
}

#login-frame-img {
    width: 100%;
    height: auto;
    display: block;
}

#login-reward-modal .modal-text-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.dust-amount-color {
    color: #87CEEB;
    text-shadow: 0 0 5px #00BFFF;
    font-weight: bold;
}

#daily-login-title {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-top: 25px;
    margin-bottom: 0px;
}

#craft-button,
#new-shop-button,
#tasks-button,
#hero-menu-button {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    font-family: 'Graduate', serif;
    width: 95px;
    height: 50px;
    border-radius: 0;
}

#craft-button,
#new-shop-button,
#tasks-button,
#hero-menu-button {
    color: #dfc117;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#calendar-modal .modal-content {
    position: relative;
    width: min(90vw, 540px);
    aspect-ratio: 2 / 3;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    max-height: 400px;
}

#calendar-modal .modal-inner {
    position: absolute;
    top: 20%;
    left: 17%;
    width: 66%;
    height: 81%;
    text-align: center;
    color: #fff;
    box-sizing: border-box;
}

#close-calendar-button {
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    top: 88%;
    width: 30px;
    height: 29px;
    background-size: contain;
    background-repeat: no-repeat;
    font-size: 0;
}

#calendar-title-img {
    width: 70%;
    max-width: 280px;
    height: auto;
    margin-bottom: 0px;
    margin-top: 10px
}

.streak-unit-font {
    font-family: 'Oswald', sans-serif;
    font-size: 30px;
    opacity: 0.8;
}

#next-reward-value .dust-amount-color {
    font-size: 18px;
}

img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.levelup-title {
    font-size: 28px;
    font-weight: bold;
}

.levelup-reward {
    font-size: 18px;
    color: #87CEEB;
    text-shadow: 0 0 5px #00BFFF;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#daily-login-title {
    width: 80%;
    max-width: 250px;
    height: auto;
    margin-bottom: 15px;
}

#login-streak-text {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
}

#login-reward-text {
    display: block;
    font-size: 20px;
}

/* --- SCROLL MENU & NAVIGATION --- */

.scroll-navigation-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 -5px 0;
    gap: 5px;
}

.scroll-menu-container {
    width: 280px;
    max-width: 75vw;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-sizing: border-box;
    overflow: hidden;
}

.scroll-menu {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.scroll-menu::-webkit-scrollbar {
    display: none;
}

.scroll-menu-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 0;
    cursor: pointer;
    object-fit: contain;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.scroll-menu-icon:active {
    transform: scale(0.9);
}

/* ARROW BUTTONS */
.scroll-arrow-btn {
    width: 30px;
    height: 60px;
    background: rgba(44, 44, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffd700;
    font-family: 'Graduate', serif;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.1s;
    flex-shrink: 0;
}

.scroll-arrow-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.combat-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: auto;
    max-height: none;
    margin-bottom: 5px;
    z-index: 5;
}

.shop-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/modalframe.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 85vh;
    max-height: 600px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.shop-header {
    padding: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.shop-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    margin: 0;
    color: #ffd55c;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.shop-footer {
    flex-shrink: 0;
    height: 30px;
}

#close-shop-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0;

}

.shop-content {
    padding: 2px 35px;
    overflow-y: auto;
    flex-grow: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.shop-content::-webkit-scrollbar {
    display: none;
}

.shop-content h3 {
    font-family: 'Graduate', serif;
    color: #dfc117;
    text-align: center;
    margin: 15px 0 10px 0px;
    font-size: 18px;
}

.shop-item-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.shop-item-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.shop-item-card {
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Lilita One', cursive;
}

.shop-item-card .card-title {
    font-size: 24px;
    color: #ffffff;
    font-weight: bold;
    margin-top: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.shop-item-card .card-bonus {
    font-size: 12px;
    color: #ffd55c;
    margin-top: -4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.shop-item-card .card-image-container {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.shop-item-card .card-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin-top: 15px;
}

.shop-item-card .card-buy-button,
.shop-footer .card-buy-button {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    width: 100%;
    min-height: 50px;
    cursor: pointer;
    transition: transform 0.1s ease;
    margin-top: 5px;
    position: relative;
}

.shop-item-card .card-buy-button:active,
.shop-footer .card-buy-button:active {
    transform: scale(0.95);
}

.shop-item-card .card-buy-button span,
.shop-footer .card-buy-button span {
    position: absolute;
    top: 50%;
    left: 50%;
    white-space: nowrap;
    font-family: 'Graduate', serif;
    font-size: 14px;
    color: #dfc117;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.shop-item-card .card-buy-button span {
    transform: translate(-52%, -50%);
}

.shop-footer .card-buy-button span {
    transform: translate(-50%, -50%);
}

.shop-item-vertical .shop-item-card {
    min-height: 90px;
    padding: 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    cursor: pointer;
    border: none;
    transition: transform 0.1s ease;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shop-item-vertical .shop-item-card span {
    font-family: 'Graduate', serif;
    font-weight: bold;
    white-space: nowrap;
}

.pass-title {
    font-size: 16px;
    color: #FFFFFF;
}

.pass-price {
    font-size: 14px;
    color: #FFD700;
    margin-top: 3px;
}

.shop-item-card:first-child .pass-title {
    color: #FFD700;
    font-size: 15px;
}

.shop-item-card:first-child .pass-price {
    color: #FFFFFF;
}

.shop-item-card:last-child .pass-title {
    color: #E0E0E0;
    font-size: 14px;
}

.shop-item-card:last-child .pass-price {
    color: #FFFFFF;
}

.shop-item-vertical .shop-item-card:active {
    transform: scale(0.95);
}

.shop-item-card:first-child .pass-title.animated-gold-text,
.perk-list .animated-gold-text {
    background: linear-gradient(to right,
            #D4AF37 0%,
            #D4AF37 40%,
            #FFF7B6 50%,
            #D4AF37 60%,
            #D4AF37 100%);

    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: rainbow-wave 7s linear infinite;
    text-shadow: none;
}

.shop-item-card:last-child .pass-title.animated-silver-text,
.perk-list .animated-silver-text {
    background: linear-gradient(to right,
            #A9A9A9 0%,
            #A9A9A9 40%,
            #FFFFFF 50%,
            #A9A9A9 60%,
            #A9A9A9 100%);

    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: rainbow-wave 7s linear infinite;
    text-shadow: none;
}

#gold-pass-modal,
#silver-pass-modal {
    z-index: 101;
}

#close-gold-pass-button,
#close-silver-pass-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0;

}

.shop-footer .card-buy-button {
    width: 100%;
    min-height: 60px;
    margin-bottom: 5px;
    margin-top: -5px;
}

.perk-list {
    text-align: left;
    font-family: 'Nunito', sans-serif;
    color: #f0f0f0;
    padding: 0 10px;
}

.perk-list ul {
    list-style-type: '✓ ';
    padding-left: 20px;
    margin: 10px 0;
}

.perk-list li {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.perk-subtitle {
    font-family: 'Graduate', serif;
    color: #dfc117;
    text-align: center;
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 15px;
}

#tasks-modal {
    z-index: 101;
}

#close-tasks-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0;

}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #3e3e42;
    border: 1px solid #666;
    border-radius: 10px;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
}

.task-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
    flex-shrink: 0;
}

.task-info {
    flex-grow: 1;
    text-align: left;
    font-family: 'Nunito', sans-serif;
}

.task-title {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.task-reward {
    display: block;
    font-size: 12px;
    color: #ffd55c;
}

.task-claim-button {
    width: 70px;
    height: 30px;
    min-height: 0;
    padding: 0;
    font-family: 'Graduate', serif;
    font-size: 10px;
    font-weight: bold;
    color: #888;
    text-shadow: none;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.task-claim-button.task-ready {
    background: linear-gradient(to bottom, #f1c40f, #d35400);
    border: 1px solid #f39c12;
    border-bottom: 3px solid #a04000;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
    animation: none;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.task-claim-button.task-ready:active {
    transform: translateY(2px);
    border-bottom: 1px solid #a04000;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}

.task-claim-button:disabled {
    opacity: 0.7;
}

.task-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/modalframe3.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 85vh;
    max-height: 600px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.task-header {
    padding: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.task-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    margin: 0;
    color: #ffd55c;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

.task-content {
    padding: 2px 35px;
    overflow-y: auto;
    flex-grow: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.task-content::-webkit-scrollbar {
    display: none;
}

.task-content h3 {
    font-family: 'Graduate', serif;
    color: #dfc117;
    text-align: center;
    margin: 15px 0 10px 0px;
    font-size: 18px;
}

.task-footer {
    flex-shrink: 0;
    height: 30px;
}

/* --- HERO MENU (EQUIPMENT) --- */

#hero-modal {
    z-index: 101;
}

.hero-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/heroframe.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 520px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.hero-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 5px;
    padding-bottom: 10px;
}

.hero-header h2 {
    font-family: 'Rye', serif;
    font-size: 32px;
    margin: 0;
    color: #ffd55c;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
}

#close-hero-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* MAIN LAYOUT */
.hero-content-split {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 10px;
    height: 100%;
    box-sizing: border-box;
}

/* LEFT COLUMN: SLOTS */
.equipment-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 70px;
    align-items: center;
    padding-top: 10px;
}

.equip-slot {
    width: 64px;
    height: 64px;
    background-color: #222;
    border: 2px solid #444;
    border-radius: 6px;
    box-shadow: inset 0 0 10px #000;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 6px;
}

.slot-item-name {
    font-family: 'Nunito', sans-serif;
    font-size: 8px;
    color: #ccc;
    text-align: center;
    line-height: 1;
    margin-top: auto;
    margin-bottom: 4px;
    width: 95%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

.equip-slot:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.equip-slot.locked {
    background-color: #111;
    border-color: #222;
    cursor: default;
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            #1a1a1a 10px,
            #1a1a1a 20px);
}

.equip-slot.locked::after {
    content: "🔒";
    font-size: 16px;
    opacity: 0.3;
}

.slot-label {
    position: absolute;
    bottom: -14px;
    font-size: 9px;
    color: #888;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    pointer-events: none;
    width: 100%;
    text-align: center;
}

/* RIGHT COLUMN: AVATAR */
.hero-preview-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.hero-avatar-frame {
    width: 100%;
    height: 320px;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hero-stats-summary {
    margin-top: -10px;
    z-index: 10;
    width: 70%;
    background: linear-gradient(to bottom, #333, #111);
    border: 2px solid #555;
    border-radius: 15px;
    padding: 5px 10px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    margin-left: auto;
    margin-right: auto;
}

.hero-full-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.8));
}

.hero-stats-summary {
    margin-top: -20px;
    z-index: 10;
    width: 90%;
    background: linear-gradient(to bottom, #333, #111);
    border: 2px solid #555;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.stat-row {
    font-family: 'Graduate', serif;
    font-size: 16px;
    color: #ccc;
    text-shadow: 1px 1px 0 #000;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-row span {
    font-weight: bold;
}

.weapon-icon,
.armor-icon,
.bag-item-icon {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

.bag-item-icon {
    width: 40px;
    height: 40px;
}

#gold-pass-modal .shop-content,
#silver-pass-modal .shop-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    -ms-overflow-style: auto;
}

#gold-pass-modal .shop-content::-webkit-scrollbar,
#silver-pass-modal .shop-content::-webkit-scrollbar {
    display: block;
    width: 8px;
}

#gold-pass-modal .shop-content::-webkit-scrollbar-track,
#silver-pass-modal .shop-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

#gold-pass-modal .shop-content::-webkit-scrollbar-thumb,
#silver-pass-modal .shop-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

#mimic-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
}

#mimic-stage-text {
    font-family: 'Graduate', serif;
    font-size: 18px;
    color: #dfc117;
    margin-bottom: 10px;
}

#mimic-image {
    width: 170px;
    height: 170px;
    object-fit: contain;
    margin-bottom: 10px;
}

#mimic-progress-container {
    width: 90%;
    position: relative;
    margin-bottom: 25px;
}

#mimic-progress-bar-outer {
    width: 100%;
    height: 30px;
    background-color: #333;
    border: 2px solid #000;
    border-radius: 15px;
    padding: 3px;
    box-sizing: border-box;
}

#mimic-progress-bar-inner {
    width: 0%;
    height: 100%;
    background-color: #FFD700;
    border-radius: 10px;
    transition: width 0.5s ease;
}

#mimic-progress-text {
    position: absolute;
    bottom: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
}

#mimic-cost-text {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

#mimic-attempts-text {
    font-size: 14px;
    color: #ccc;
    margin-top: 15px;
}

#mimic-result-text {
    font-size: 14px;
    color: #ffd55c;
    margin-top: 15px;
    min-height: 20px;
}

.mimic-button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 5px;
}

#mimic-reward-text {
    font-size: 14px;
    color: #ccc;
    margin-top: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

#mimic-reward-text .gem-reward-amount {
    color: #ffd55c;
    font-size: 16px;
}

#mimic-stage-info-text {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #ffd55c;
    margin-top: -5px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#mimic-image-wrapper {
    position: relative;
    width: 170px;
    height: 170px;
    margin-bottom: 10px;
}

#mimic-image {
    margin-bottom: 0;
}

#mimic-reward-gem {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px #ffd55c);
    opacity: 0;
    transition: opacity 0.3s ease-in;
    pointer-events: none;
}

#mimic-reward-gem:not(.hidden) {
    opacity: 1;
}

#game-wrapper {
    width: 400px;
    height: 912px;
    transform-origin: top center;
    position: relative;
    overflow: hidden;
}

.rpg-monster-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    overflow: visible;
}

.rpg-label {
    font-family: 'Lilita One', cursive;
    font-size: 18px;
    color: #ffd55c;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.rpg-value {
    font-size: 14px;
    color: #fff;
    margin-top: 3px;
    font-weight: bold;
}

.rpg-bar-outer {
    position: relative;
    width: 200px;
    height: 18px;
    background-color: #333;
    border: 2px solid #000;
    border-radius: 8px;
    overflow: hidden;
    display: block !important;
}

.rpg-bar-outer.limit-ready {
    cursor: pointer;
    box-shadow: 0 0 10px #ff00ff;
    transition: transform 0.1s;
    z-index: 50;
    animation: urgent-pulse 0.8s infinite alternate;
}

.rpg-bar-outer.limit-ready:active {
    transform: scale(0.95);
}

@keyframes urgent-pulse {
    0% {
        border-color: #ff00ff;
        box-shadow: 0 0 5px #ff00ff;
    }

    100% {
        border-color: #ffffff;
        box-shadow: 0 0 20px #ff00ff, 0 0 10px #ffffff;
    }
}

#monster-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    margin: 0;
    font-size: 11px;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000, 0 0 2px #000;
    z-index: 5;
    pointer-events: none;
}

.rpg-bar-inner {
    height: 100%;
    width: 100%;
    transition: width 0.2s ease-out;
}

.hp-fill {
    background-color: #e74c3c;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.xp-fill {
    background-color: #3498db;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.rpg-stats-display {
    font-size: 14px;
    color: #87CEEB;
    margin-top: 8px;
    font-family: 'Graduate', serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
}

#monster-image {
    background-image: url('./images/1defaultegg.png');
    transition: transform 0.1s;
    display: block !important;
    transform: scale(1.0);
    margin-bottom: 20px;
}

#monster-image:active {
    transform: scale(0.95);
}

.energy-fill {
    background-color: #FFD700;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.small-bar {
    height: 6px;
    margin-top: 5px;
    opacity: 0.8;
}

#combat-controls {
    margin-bottom: 10px;
    z-index: 50;
}

.slash-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    background-image: url('./images/slash.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: normal;
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
}

.slash-effect.animate {
    animation: slash-strike 0.25s ease-out forwards;
}

#dungeon-button {
    width: 160px;
    height: 60px;
    background: linear-gradient(to bottom, #27ae60, #2ecc71);
    border: 2px solid #2ecc71;
    border-radius: 15px;
    color: white;
    font-family: 'Graduate', serif;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 0 #1e8449;
    text-shadow: 1px 1px 2px black;
    transition: transform 0.1s;
}

#dungeon-button:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #1e8449;
}

#scene-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-color: #000000;
    z-index: 9999;
    transform: translateY(-100%);
    pointer-events: none;
}

#scene-transition.active {
    pointer-events: auto;
}

.curtain-in {
    animation: curtain-drop 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.curtain-out {
    animation: curtain-lift 0.4s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.victory-message {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 120;
    pointer-events: none;
    width: 300px;
    text-align: center;
    font-family: 'Lilita One', cursive;
    font-size: 32px;
    color: #FFD700;
    text-shadow:
        0 0 5px #000,
        0 0 10px #FFA500,
        0 4px 0 #8B4513;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-message.show {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.1);
}

#revive-button {
    width: 200px;
    height: 65px;
    background-size: 100% 100% !important;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    color: #dfc117;
    font-family: 'Graduate', serif;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#revive-button:active {
    transform: scale(0.95);
}

#dungeon-button.heal-mode {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    border-color: #2980b9;
    box-shadow: 0 5px 0 #1a5276;
}

#dungeon-button.heal-mode:active {
    box-shadow: 0 1px 0 #1a5276;
}

#monster-image {
    display: block !important;
}

#hero-image {
    display: none !important;
}

#monster-name {
    display: block !important;
    font-family: 'Lilita One', cursive;
    font-size: 18px;
    color: #FFD700;
    text-shadow:
        0px 0px 0px #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    letter-spacing: 1px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

#hero-lobby-name {
    display: none !important;
}

#hero-hp-text,
#hero-energy-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    margin: 0;
    font-size: 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 0 0 2px #000;
    z-index: 5;
    pointer-events: none;
}

.intent-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #333;
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: help;
}

.intent-badge.aggressive {
    background-color: #c0392b;
    border-color: #e74c3c;
}

.intent-badge.spiked {
    background-color: #7f8c8d;
    border-color: #bdc3c7;
    box-shadow: 0 0 10px #bdc3c7;
}

.intent-badge.enraged {
    background-color: #d35400;
    border-color: #f39c12;
    box-shadow: 0 0 15px #e67e22;
    animation: pulse-active 0.5s infinite;
}

/* --- COMBAT ANIMATIONS --- */

@keyframes camera-shake-heavy {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-6px, -6px) rotate(-2deg);
    }

    20% {
        transform: translate(6px, 6px) rotate(2deg);
    }

    30% {
        transform: translate(-6px, 6px) rotate(0deg);
    }

    40% {
        transform: translate(6px, -6px) rotate(1deg);
    }

    50% {
        transform: translate(-4px, 4px) rotate(-1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.shake-heavy {
    animation: camera-shake-heavy 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes camera-zoom-hit {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }

}

.zoom-hit {
    animation: camera-zoom-hit 0.3s ease-out forwards;
}

@keyframes flash-hit {
    0% {
        filter: brightness(1);
    }

    10% {
        filter: brightness(8) sepia(1) hue-rotate(-50deg);
    }

    40% {
        filter: brightness(2);
    }

    100% {
        filter: brightness(1);
    }
}

.monster-hit-flash {
    animation: flash-hit 0.25s ease-out forwards;
}

.click-effect.heavy-damage {
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px #ff0000;
    animation: damage-pop 1s ease-out forwards;
    z-index: 200;
}

@keyframes damage-pop {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -30px) scale(1.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -100px) scale(1);
        opacity: 0;
    }
}

.limit-fill {
    background: linear-gradient(90deg, #550055, #ff00ff);
    width: 0%;
    transition: width 0.2s ease-out;
}

.limit-ready .limit-fill {
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 200% 100%;
    animation: rainbow-flow 2s linear infinite;
}

.limit-ready-text {
    animation: pulse-text 0.5s infinite alternate;
    color: #fff !important;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff0000 !important;
}

@keyframes rainbow-flow {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes pulse-text {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

#slot-spin-btn.limit-active {
    background: linear-gradient(45deg, #ff0000, #ffae00);
    color: white;
    border: 2px solid #fff;
    box-shadow: 0 0 15px #ff0000;
    animation: shake-slight 0.2s infinite;
}

@keyframes shake-slight {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(1px, 1px);
    }

    50% {
        transform: translate(-1px, -1px);
    }

    75% {
        transform: translate(1px, -1px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* --- BOSS VICTORY MODAL --- */

.boss-victory-panel {
    width: 95%;
    max-width: 400px;
    background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1a 100%);
    border: 4px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    position: relative;
    animation: modal-slam 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modal-slam {
    0% {
        transform: scale(0.5) translateY(-100px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.victory-header {
    text-align: center;
    margin-bottom: 20px;
}

.victory-title {
    font-family: 'Lilita One', cursive;
    font-size: 42px;
    text-align: center;
    color: #FFD700;
    text-shadow:
        0 0 0px #FFD700,
        0 0 10px #FFA500,
        2px 2px 0px #000000;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    animation: victory-glow-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes victory-glow-pulse {
    0% {
        text-shadow:
            0 0 5px #FFD700,
            2px 2px 0px #000;
    }

    100% {
        text-shadow:
            0 0 25px #FFD700,
            0 0 40px #ffae00,
            2px 2px 0px #000;
    }
}

.victory-subtitle {
    font-family: 'Graduate', serif;
    color: #ccc;
    font-size: 14px;
    letter-spacing: 2px;
}

.victory-loot-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 25px;
}

/* --- DEFEAT MODAL STYLES --- */

.defeat-panel {
    width: 95%;
    max-width: 400px;
    background: linear-gradient(180deg, #2e2a2a 0%, #1a1a1a 100%);
    border: 4px solid #e74c3c;
    border-radius: 15px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 50px rgba(231, 76, 60, 0.3);
    position: relative;
    animation: modal-slam 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.defeat-header {
    text-align: center;
    margin-bottom: 20px;
}

.defeat-title {
    font-family: 'Lilita One', cursive;
    font-size: 42px;
    text-align: center;
    color: #e74c3c;
    text-shadow:
        0 0 5px #e74c3c,
        2px 2px 0px #000;
    margin-bottom: 5px;
}

.defeat-subtitle {
    font-family: 'Graduate', serif;
    color: #aaa;
    font-size: 14px;
    letter-spacing: 1px;
}

#defeat-countdown {
    font-family: 'Lilita One', cursive;
    font-size: 80px;
    color: #fff;
    text-shadow: 0 0 10px #e74c3c;
    margin: 10px 0;
    animation: pulse-countdown 1s infinite;
}

@keyframes pulse-countdown {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- DEATH & SPAWN ANIMATIONS --- */

@keyframes monster-death-anim {
    0% {
        opacity: 1;
        filter: brightness(1) grayscale(0);
        transform: scale(1);
    }

    20% {
        opacity: 1;
        filter: brightness(10) sepia(1) hue-rotate(-50deg);
        transform: scale(1.1);
    }

    40% {
        opacity: 0.8;
        filter: brightness(0.5) grayscale(1) sepia(1) hue-rotate(0deg);
        transform: scale(1);
    }

    100% {
        opacity: 0;
        filter: brightness(0) grayscale(1);
        transform: scale(0.8);
    }
}

.monster-die {
    animation: monster-death-anim 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes monster-spawn-anim {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.monster-appear {
    animation: monster-spawn-anim 0.5s ease-out forwards;
}

.monster-invisible {
    opacity: 0 !important;
}

#monster-status-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    z-index: 20;
    pointer-events: none;
    font-family: 'Lilita One', cursive;
    font-size: 36px;
    color: #fff;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#monster-status-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.loot-card {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 10px 2px;
    width: 22%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loot-icon-wrapper {
    width: 50px;
    height: 50px;
    border: 2px solid #ffd700;
    border-radius: 50%;
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.loot-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.loot-amount {
    font-family: 'Lilita One', cursive;
    font-size: 20px;
    color: #ffd700;
    text-shadow: 1px 1px 0 #000;
}

.loot-label {
    font-size: 9px;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
}

.victory-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.victory-btn {
    width: 100%;
    height: 55px;
    border: none;
    border-radius: 8px;
    font-family: 'Graduate', serif;
    font-weight: bold;
    font-size: 16px;
    color: white;
    cursor: pointer;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.victory-btn:active {
    transform: scale(0.98);
}

.btn-continue {
    background: linear-gradient(to bottom, #27ae60, #219150);
    border-bottom: 4px solid #196f3d;
}

.btn-leave {
    background: linear-gradient(to bottom, #7f8c8d, #707b7c);
    border-bottom: 4px solid #566573;
}

/* --- BAG MODAL STYLES --- */

.bag-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/inventoryframe.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 80vh;
    max-height: 550px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.bag-header {
    padding: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.bag-header h2 {
    font-family: 'Rye', serif;
    font-size: 26px;
    margin: 0;
    color: #e67e22;
    text-shadow: 2px 2px 0px #000;
}

#close-bag-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0;
}

.bag-content {
    flex-grow: 1;
    padding: 10px 15px;
    overflow-y: auto;
}

.bag-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bag-item {
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bag-item-count {
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    font-size: 10px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 4px;
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: auto;
}

.bag-item-name {
    display: block !important;
    font-family: 'Nunito', sans-serif;
    font-size: 9px;
    color: #ccc;
    text-align: center;
    line-height: 1.1;
    margin-top: auto;
    margin-bottom: 4px;
    width: 95%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bag-empty-message {
    grid-column: 1 / -1;
    color: #888;
    font-style: italic;
    margin-top: 20px;
}

.bag-section-title {
    width: 100%;
    font-family: 'Graduate', serif;
    color: #3e2723;
    border-bottom: 3px solid #5d4037;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: none;
}

.bag-section-title:first-child {
    margin-top: 0;
}

.bag-list-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.bag-section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.mat-wood {
    background: #8B4513;
    border-color: #a05a2c;
}

.mat-copper {
    background: #b87333;
    border-color: #d48f4f;
}

.mat-iron {
    background: #7a7a7a;
    border-color: #999;
}

.mat-silver {
    background: #c0c0c0;
    border-color: #eee;
    box-shadow: 0 0 5px #fff;
}

.mat-gold {
    background: #ffd700;
    border-color: #ffec8b;
    box-shadow: 0 0 5px #ffd700;
}

.mat-obsidian {
    background: #2c003e;
    border-color: #5e0085;
}

.mat-mythic {
    background: #ff00ff;
    border-color: #fff;
    animation: prism-glow 3s linear infinite;
}

@keyframes prism-glow {
    0% {
        box-shadow: 0 0 5px 1px rgba(255, 0, 0, 0.6);
        border-color: #ffcccc;
    }

    20% {
        box-shadow: 0 0 5px 1px rgba(255, 255, 0, 0.6);
        border-color: #ffffcc;
    }

    40% {
        box-shadow: 0 0 5px 1px rgba(0, 255, 0, 0.6);
        border-color: #ccffcc;
    }

    60% {
        box-shadow: 0 0 5px 1px rgba(0, 255, 255, 0.6);
        border-color: #ccffff;
    }

    80% {
        box-shadow: 0 0 5px 1px rgba(138, 43, 226, 0.6);
        border-color: #e6ccff;
    }

    100% {
        box-shadow: 0 0 5px 1px rgba(255, 0, 0, 0.6);
        border-color: #ffcccc;
    }
}

/* --- SMITHY / BLACKSMITH STYLES --- */

#smithy-modal {
    z-index: 105;
}

.smithy-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/smithframe.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.smithy-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.smithy-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    margin: 0;
    color: #ffd55c;
    text-shadow: 2px 2px 0 #000;
}

#close-smithy-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
}

.smithy-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    overflow-y: auto;
    gap: 15px;
}

.smithy-big-btn {
    width: 92%;
    margin: 0 auto 10px auto;
    height: 90px;
    background: linear-gradient(to bottom, #3e424b 0%, #2a2e35 100%);
    border: 1px solid #555;
    border-bottom: 4px solid #111;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.smithy-big-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.smithy-big-btn:active {
    transform: translateY(4px);
    border-bottom: 1px solid #111;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.smithy-big-btn .btn-icon {
    font-size: 42px;
    margin-right: 25px;
    filter: drop-shadow(0 2px 0 #000);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.smithy-big-btn .btn-text {
    text-align: left;
}

.smithy-big-btn .btn-title {
    display: block;
    font-family: 'Rye', serif;
    font-size: 22px;
    color: #ffd700;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 1px;
}

.smithy-big-btn .btn-desc {
    display: block;
    font-size: 12px;
    color: #aaa;
    font-family: 'Nunito', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 2px;
}

.forge-list-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.forge-item {
    width: 85%;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #2e2e30 0%, #222 100%);
    border: 1px solid #444;
    border-top: 1px solid #555;
    border-bottom: 3px solid #111;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;

    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.forge-header-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.forge-item.blackout {
    border: 1px solid #333;
    background-color: #151515;
    background-image: repeating-linear-gradient(45deg,
            #1a1a1a,
            #1a1a1a 10px,
            #222 10px,
            #222 20px);
    opacity: 0.8;
}

.forge-item.blackout>* {
    visibility: hidden;
}

.forge-item.blackout::after {
    content: "???";
    visibility: visible;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #444;
    font-size: 28px;
    font-family: 'Graduate', serif;
    text-shadow: 0 -1px 0 #000;
    font-weight: bold;
    letter-spacing: 2px;
}

.forge-icon-box {
    width: 54px;
    height: 54px;
    background: #111;
    border: 2px solid #444;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    box-shadow: inset 0 0 10px #000;
}

.forge-details {
    flex-grow: 1;
    text-align: left;
}

.forge-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: #f0f0f0;
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 #000;
}

.forge-stats {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-row {
    font-size: 13px;
    color: #ccc;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    padding-top: 8px;
    background: none;
    border: none;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.recipe-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-family: 'Nunito', sans-serif;
}

.recipe-item img,
.recipe-item .bag-item-icon {
    vertical-align: middle;
}

.recipe-item.missing {
    color: #ff5555;
}

.forge-btn {
    background: linear-gradient(to bottom, #27ae60, #219150);
    color: white;
    border: 1px solid #2ecc71;
    border-bottom: 3px solid #145a32;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Graduate', serif;
    font-size: 12px;
    cursor: pointer;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    min-width: 80px;
}

.forge-btn:active {
    transform: translateY(2px);
    border-bottom: 1px solid #145a32;
}

.forge-btn:disabled {
    background: #444;
    border-color: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.sharpen-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 50px;
}

.sharpen-preview {
    text-align: center;
    width: 100%;
}

.sharpen-icon-frame {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #333 0%, #111 100%);
    border: 4px solid #444;
    border-radius: 12px;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

#sharpen-item-name {
    font-family: 'Lilita One', cursive;
    font-size: 24px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.sharpen-stats-row {
    font-family: 'Graduate', serif;
    font-size: 28px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #333;
    width: 280px;
    margin: 0 auto;
}

.sharpen-stats-row .arrow {
    color: #aaa;
    font-size: 20px;
}

#sharpen-stat-next {
    color: #2ecc71;
    text-shadow:
        0 0 5px #2ecc71,
        0 0 15px #00ff00,
        2px 2px 0px #000000;
    animation: sharpen-glow-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes sharpen-glow-pulse {
    0% {
        text-shadow:
            0 0 5px #2ecc71,
            2px 2px 0px #000;
    }

    100% {
        text-shadow:
            0 0 20px #2ecc71,
            0 0 35px #00ff00,
            2px 2px 0px #000;
    }
}

.sharpen-info-box {
    width: 92%;
    margin: 15px auto auto auto;
    max-width: 320px;
    background: #222;
    padding: 15px;
    border: 1px solid #444;
    border-radius: 8px;
    text-align: center;
    box-shadow: inset 0 0 15px #000;
    margin-bottom: auto;
    margin-top: 15px;
    box-sizing: border-box;
}

.chance-row {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

#sharpen-chance {
    font-size: 18px;
    color: #fff;
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #555;
    margin-left: 5px;
}

.cost-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid #333;
    padding-top: 12px;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f0f0f0;
    font-weight: 800;
    font-family: 'Graduate', serif;
    font-size: 16px;
}

.smithy-action-btn {
    width: 92%;
    margin: 0 auto 5px auto;
    height: 65px;
    background: linear-gradient(to bottom, #e67e22, #d35400);
    color: white;
    border: 2px solid #d35400;
    border-bottom: 5px solid #a04000;
    border-radius: 12px;
    font-family: 'Graduate', serif;
    font-size: 22px;
    cursor: pointer;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
    transition: all 0.1s;
    margin-bottom: 5px;
}

.smithy-action-btn:active {
    transform: translateY(4px);
    border-bottom: 2px solid #a04000;
    box-shadow: 0 2px 5px rgba(230, 126, 34, 0.3);
}

.smithy-action-btn:disabled {
    background: #444;
    border-color: #555;
    border-bottom: 5px solid #222;
    color: #888;
    text-shadow: none;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.sharpen-msg {
    height: 24px;
    font-weight: bold;
    margin-top: 5px;
    font-family: 'Lilita One', cursive;
    font-size: 18px;
    text-shadow: 1px 1px 0 #000;
}

.msg-success {
    color: #2ecc71;
}

.msg-fail {
    color: #e74c3c;
}

.back-arrow {
    align-self: flex-start;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    padding: 0;
    text-transform: uppercase;
}

.icon-small {
    width: 16px;
    height: 16px;
}

.icon-small-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #fff;
}

.equip-select-content {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.forge-item.equipped {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
}

.equip-btn {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    color: white;
    border: 1px solid #3498db;
    border-bottom: 3px solid #1f618d;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Graduate', serif;
    font-size: 12px;
    cursor: pointer;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    min-width: 80px;
}

.equip-btn:active {
    transform: translateY(2px);
    border-bottom: 1px solid #1f618d;
}

.equip-btn:disabled {
    background: #27ae60;
    border-color: #2ecc71;
    border-bottom: 3px solid #1e8449;
    color: #fff;
    cursor: default;
    transform: none;
    box-shadow: none;
}

#close-equip-select-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    width: 30px;
    height: 30px;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

#close-equip-select-button:active {
    transform: translateY(-50%) scale(0.9);
}

.dungeon-panel {
    border: 15px solid transparent;
    border-image-source: url('./images/heroframe.png');
    border-image-slice: 100 fill;
    border-image-width: 70px;
    width: 95%;
    max-width: 380px;
    height: 70vh;
    max-height: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.dungeon-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
    padding-top: 10px;
}

.dungeon-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 22px;
    margin: 0;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.dungeon-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-bottom: 20px;
}

.back-arrow-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-image: url('./images/backbutton.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
    z-index: 10;
}

#close-dungeon-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-image: url('./images/closebutton2.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
}

.dungeon-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.area-select-btn {
    width: 160px;
    height: 50px;
    background: linear-gradient(to bottom, #f39c12, #d35400);
    border: 2px solid #e67e22;
    border-radius: 12px;
    color: white;
    font-family: 'Graduate', serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #a04000;
    text-shadow: 1px 1px 2px black;
    transition: transform 0.1s;
}

.area-select-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #a04000;
}

.stage-btn {
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, #3e3e42, #2a2a2e);
    border: 2px solid #555;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 0 #111;
    transition: transform 0.1s;
}

.stage-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0 0 #111;
}

.stage-btn.locked {
    background: #222;
    border-color: #333;
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.stage-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.stage-title {
    font-family: 'Graduate', serif;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 4px;
}

.stage-range {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    color: #aaa;
}

.stage-cost {
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    color: #ffd700;
    text-shadow: 1px 1px 0 #000;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lock-icon {
    font-size: 24px;
    margin-right: 10px;
}

.left-controls {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 60;
    align-items: center;
}

.control-circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #444;
    border: 2px solid #777;
    color: #ccc;
    font-family: 'Graduate', serif;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 0 #000;
}

.control-circle-btn:active {
    transform: scale(0.95);
}

.control-circle-btn.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border-color: #a9dfbf;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    text-shadow: none;
}

.control-circle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    background: #222;
    border-color: #333;
}

.control-rect-btn {
    width: 90px;
    height: 35px;
    background: linear-gradient(to bottom, #c0392b, #e74c3c);
    border: 2px solid #e74c3c;
    border-radius: 8px;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 4px 0 #922b21;
    margin-top: 5px;
    animation: pulse-attention 1s infinite alternate;
}

.control-rect-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #922b21;
}

.control-rect-btn.hidden {
    display: none;
}

@keyframes pulse-attention {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(231, 76, 60, 0);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(231, 76, 60, 0.7);
    }
}

/* --- LIMIT BREAK EFFECTS --- */

.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 9999;
    pointer-events: none;
    animation: flash-fade 0.2s ease-out forwards;
}

@keyframes flash-fade {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* --- SMITHY IMPACT VISUALS --- */

.smithy-hammer {
    position: absolute;
    top: -50%;
    left: 60%;
    font-size: 90px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transform-origin: bottom right;
    filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, 0.5));
    overflow: visible;
}

.smithy-hammer.striking {
    animation: hammer-smash 0.6s ease-in forwards;
}

@keyframes hammer-smash {
    0% {
        opacity: 1;
        transform: rotate(10deg);
    }

    40% {
        transform: rotate(30deg);
    }

    60% {
        transform: rotate(-50deg) scale(1.1);
    }

    80% {
        transform: rotate(-40deg) scale(1.0);
    }

    100% {
        opacity: 0;
        transform: rotate(-40deg);
    }
}

.smithy-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #ffd700;
    border-radius: 50%;
    z-index: 99;
    pointer-events: none;
    box-shadow: 0 0 10px #ff4500;
    top: 50%;
    left: 50%;
}

@keyframes spark-fly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.shake-vertical {
    animation: shake-v 0.2s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-v {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(10px);
    }

    75% {
        transform: translateY(-5px);
    }
}

/* --- GLASS CAPSULE UI --- */
.stat {
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-align: center;
}

#dust-counter {
    color: #00ffff;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.6);
    letter-spacing: 0.5px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

#gem-shards-counter {
    background: linear-gradient(90deg,
            #ffd700,
            #ffec8b,
            #fff7c9,
            #ffac33,
            #ffd700);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    letter-spacing: 0.5px;
    animation: rainbow-flow 3s linear infinite;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

#prism-stone-counter {
    background: linear-gradient(90deg,
            #ffc0cb, #ffe4b5, #98ff98, #add8e6, #ffc0cb);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    letter-spacing: 0.5px;
    animation: prism-flow 4s linear infinite;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
}

@keyframes prism-flow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: -200% center;
    }
}

.stat .label {
    color: #ffffff;
    font-size: 8px;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.player-info {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    gap: 10px;
}


.scroll-menu-container {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    margin: 10px 5px;
    width: auto;
}

/* --- MINING MODAL STYLES --- */

#mining-modal {
    z-index: 106;
}

.mining-panel {
    width: 95%;
    max-width: 380px;
    height: auto;
    min-height: auto;
    max-height: none;
    background: linear-gradient(180deg, #26211f 0%, #0f0c0b 100%);
    border: 3px solid #8d6e63;
    border-radius: 20px;
    box-shadow: 0 0 0 3px #1a1a1a, 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 15px;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
}

.mining-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.mining-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    margin: 0;
    color: #ffd700;
    text-shadow: 2px 2px 0 #3e2723, 0 0 10px rgba(255, 215, 0, 0.5);
}

#close-mining-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    width: 30px;
    height: 29px;
    border: none;
    cursor: pointer;
}

.mining-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    overflow: visible;
    justify-content: flex-start;
    gap: 10px;
}

/* --- TOP STATS BAR --- */
.mining-stats-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 5px;
    box-sizing: border-box;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48%;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 4px 0;
}

.stat-pill .stat-label {
    font-size: 10px;
    color: #aaa;
    font-family: 'Graduate', serif;
}

.stat-pill .stat-value {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    font-family: 'Nunito', sans-serif;
}

/* --- THE COCKPIT LAYOUT --- */
.mining-cockpit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    margin-bottom: 20px;
}

/* SIDE COLUMNS (SATELLITES) */
.mining-column {
    display: flex;
    flex-direction: column;
    gap: 35px;
    z-index: 2;
}

.mining-slot {
    width: 60px;
    height: 60px;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;

    overflow: visible;
}

.mining-slot-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 9px;
    font-weight: bold;
    color: #aaa;
    text-shadow: 1px 1px 1px #000;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.mining-slot.selected .mining-slot-label {
    color: #ffd700;
    text-shadow: 0 0 5px #ff6f00;
}

.mining-slot:active {
    transform: scale(0.95);
}

.mining-icon-frame {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #3e3e42 0%, #1a1a1a 100%);
    border: 2px solid #555;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.5);
    position: relative;
}

.mining-icon-frame img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.mining-lvl-badge {
    position: absolute;
    bottom: -6px;
    background: #000;
    color: #fff;
    border: 1px solid #555;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
}

.mining-slot.active .mining-icon-frame {
    border-color: #8d6e63;
}

.mining-slot.selected .mining-icon-frame {
    border-color: #ffd700;
    background: radial-gradient(circle, #4e342e 0%, #261b17 100%);
    box-shadow: 0 0 15px #ffb74d, inset 0 0 10px #ffb74d;
}

.mining-slot.locked {
    filter: grayscale(100%) opacity(0.6);
    cursor: not-allowed;
}

.mining-slot.locked::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

.mining-center-silo {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    z-index: 1;
}

#mining-silo-click-area {
    position: relative;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;

}

#mining-silo-image {
    width: 140px;
    height: 140px;
    object-fit: contain;
    transition: filter 0.5s ease;
}

.silo-glow-low {
    filter: drop-shadow(0 0 2px rgba(255, 165, 0, 0.2)) brightness(0.8);
}

.silo-glow-med {
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.6)) brightness(1.0);
    animation: breathe-soft 3s infinite ease-in-out;
}

.silo-glow-full {
    filter: drop-shadow(0 0 15px #ffd700) brightness(1.2);
    animation: breathe-hard 1.5s infinite ease-in-out;
}

@keyframes breathe-soft {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 140, 0, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.8));
    }
}

@keyframes breathe-hard {

    0%,
    100% {
        filter: drop-shadow(0 0 15px #ffd700) brightness(1.2);
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 25px #ffab00) brightness(1.3);
        transform: scale(1.02);
    }
}

.silo-capacity-bar-outer {
    width: 100px;
    height: 8px;
    background: #111;
    border: 1px solid #444;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

#silo-capacity-bar-inner {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #ffd700);
    transition: width 0.3s ease;
    box-shadow: 0 0 5px #ff8c00;
}

#silo-amount-text {
    display: block;
    text-align: center;
    font-size: 10px;
    color: #ccc;
    margin-top: 2px;
}

#btn-claim-silo {
    width: 120px !important;
    height: 45px !important;
    min-height: 45px !important;
    margin-top: 10px;
    background: linear-gradient(to bottom, #f39c12, #d35400);
    border: 2px solid #e67e22;
    border-radius: 8px;
    box-shadow: 0 4px 0 #a04000, 0 5px 10px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: 'Graduate', serif;
    font-weight: bold;
    font-size: 14px !important;
    text-shadow: 1px 1px 2px black;
    background-image: none !important;
}

#btn-claim-silo:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #a04000;
}

#btn-claim-silo:disabled {
    background: #555;
    border-color: #444;
    box-shadow: none;
    color: #888;
}

#btn-buy-mining-upgrade {
    width: 100%;
    height: 55px;
    margin-top: 10px;
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    border: 2px solid #2ecc71;
    border-radius: 10px;
    box-shadow: 0 4px 0 #145a32;
    color: #fff;
    font-family: 'Graduate', serif;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background-image: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

#btn-buy-mining-upgrade span {
    position: static;
    transform: none;
    width: auto;
    margin: 0;
}

#btn-buy-mining-upgrade:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #145a32;
}

#btn-buy-mining-upgrade:disabled {
    background: #444;
    border-color: #555;
    box-shadow: none;
    color: #777;
}

/* --- BOTTOM UPGRADE PANEL --- */
.mining-upgrade-panel {
    background: rgba(20, 15, 10, 0.95);
    border: 2px solid #8d6e63;
    border-radius: 12px;
    padding: 12px;
    margin-top: 5px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    min-height: 160px;
    justify-content: center;
}

.upgrade-placeholder-text {
    color: #555;
    font-family: 'Graduate', serif;
    font-size: 14px;
    text-align: center;
    letter-spacing: 1px;
}

.upgrade-header-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
    gap: 4px;
}

#upgrade-name {
    font-family: 'Graduate', serif;
    font-size: 16px;
    color: #ffd700;
    margin: 0;
    text-shadow: 1px 1px 2px #000;
}

#upgrade-level-label {
    font-size: 12px;
    color: #ccc;
    font-weight: bold;
}

.upgrade-stats-row {
    display: flex;
    justify-content: space-between;
    background: #222;
    border-radius: 8px;
    padding: 10px;
}

.upgrade-stat {
    display: flex;
    flex-direction: column;
}

.upgrade-stat .label {
    font-size: 10px;
    color: #888;
}

.upgrade-stat .value {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.upgrade-stat .gain {
    font-size: 11px;
    color: #2ecc71;
    margin-left: 4px;
}

.upgrade-stat.cost-stat .value {
    color: #ffd700;
}

.mining-slot.silo-slot .mining-icon-frame {
    border-color: #ffd700;
    background: radial-gradient(circle, #3e2723 0%, #1a1a1a 100%);
}

/* --- JUICY EFFECTS --- */

.spotlight-beam {
    position: absolute;
    bottom: -50%;
    width: 100px;
    height: 200%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.4), transparent);
    z-index: -1;
    transform-origin: bottom center;
    pointer-events: none;
    filter: blur(15px);
}

.spotlight-left {
    left: -20px;
    animation: sweep-left 2s ease-in-out infinite alternate;
}

.spotlight-right {
    right: -20px;
    animation: sweep-right 2s ease-in-out infinite alternate;
}

@keyframes sweep-left {
    0% {
        transform: rotate(15deg);
        opacity: 0.3;
    }

    100% {
        transform: rotate(45deg);
        opacity: 0.7;
    }
}

@keyframes sweep-right {
    0% {
        transform: rotate(-15deg);
        opacity: 0.3;
    }

    100% {
        transform: rotate(-45deg);
        opacity: 0.7;
    }
}

.fullscreen-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.falling-confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 20px;
    background: #ff0000;
    animation: fall-sway 3s linear forwards;
}

@keyframes fall-sway {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg) translateX(var(--sway));
        opacity: 0;
    }
}

@keyframes curtain-drop {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(0%);
    }
}

@keyframes curtain-lift {
    0% {
        transform: translateY(0%);
    }

    100% {
        transform: translateY(-100%);
    }
}

@keyframes slash-strike {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }

    20% {
        opacity: 1;
        transform: scale(1.2) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: scale(1.4) rotate(5deg);
    }
}

@keyframes rainbow-wave {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes pulse-ready {
    0% {
        box-shadow: 0 0 10px 0px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 10px 0px rgba(255, 215, 0, 0.5);
    }
}

@keyframes pulse-active {
    0% {
        box-shadow: 0 0 15px 5px rgba(255, 0, 0, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 25px 15px rgba(255, 0, 0, 1);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 15px 5px rgba(255, 0, 0, 0.7);
        transform: scale(1);
    }
}

@keyframes flicker {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    30% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    70% {
        opacity: 0.2;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

@keyframes wobble {

    0%,
    100% {
        transform: translateX(0) rotate(0);
    }

    15% {
        transform: translateX(-8px) rotate(-5deg);
    }

    30% {
        transform: translateX(6px) rotate(3deg);
    }

    45% {
        transform: translateX(-4px) rotate(-2deg);
    }

    60% {
        transform: translateX(2px) rotate(1deg);
    }

    75% {
        transform: translateX(-1px) rotate(0deg);
    }
}

@keyframes fadeInScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutScaleDown {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px);
    }
}

@keyframes floatUpTransform {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateY(-120px) scale(1.4);
        opacity: 0;
    }
}

@keyframes sway {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(8px);
    }
}

@keyframes fallDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(60px);
        opacity: 0;
    }
}

@keyframes spin {
    from {
        transform: translateY(-50%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.energy-fill.refilling {
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: energy-flow 1s linear infinite;
}

@keyframes energy-flow {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

/* --- LIVING MINE ANIMATIONS --- */

.anim-swing {
    transform-origin: bottom right;
    animation: mining-swing 1.5s ease-in-out infinite;
}

@keyframes mining-swing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(-25deg);
    }
}

.anim-bob {
    animation: mining-bob 2s ease-in-out infinite;
}

@keyframes mining-bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.anim-breathe {
    animation: mining-breathe 3s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes mining-breathe {

    0%,
    100% {
        transform: scale(1, 1);
    }

    50% {
        transform: scale(1.05, 0.95);
    }
}

.anim-pulse-red {
    animation: mining-pulse-red 2s infinite;
}

@keyframes mining-pulse-red {

    0%,
    100% {
        filter: drop-shadow(0 0 0 transparent);
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 5px #ff0000);
        transform: scale(1.05);
    }
}

.anim-rock {
    transform-origin: bottom center;
    animation: mining-rock 1s ease-in-out infinite;
}

@keyframes mining-rock {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

.anim-pulse-glow {
    transform-origin: center center;
    animation: mining-battery-pulse 2s ease-in-out infinite;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

@keyframes mining-battery-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(0, 255, 255, 0.3)) brightness(1);
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8)) brightness(1.2);
    }
}

.anim-shake {
    animation: mining-drill 0.2s linear infinite;
}

@keyframes mining-drill {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(1px, 1px);
    }

    50% {
        transform: translate(-1px, -1px);
    }

    75% {
        transform: translate(-1px, 1px);
    }

    100% {
        transform: translate(1px, -1px);
    }
}

.anim-float-glow {
    animation: mining-nexus-rainbow 4s ease-in-out infinite;
}

@keyframes mining-nexus-rainbow {

    0% {
        transform: translateY(0);
        filter: drop-shadow(0 0 5px #ff0000);
    }

    25% {
        filter: drop-shadow(0 0 10px #ffd700);
    }

    50% {
        transform: translateY(-10px);
        filter: drop-shadow(0 0 15px #00ffff);
    }

    75% {
        filter: drop-shadow(0 0 10px #ff00ff);
    }

    100% {
        transform: translateY(0);
        filter: drop-shadow(0 0 5px #ff0000);
    }
}

.mining-icon-frame.large-frame {
    width: 140px;
    height: 140px;
    margin-bottom: 5px;
    background: radial-gradient(circle, #3e2723 0%, #1a1a1a 100%);
    border-color: #8d6e63;
}

.mining-icon-frame.large-frame img {
    width: 110px;
    height: 110px;
}

.large-frame .mining-lvl-badge {
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    padding: 2px 8px;
}

.mining-slot-label.static-label {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-bottom: 5px;
    color: #ffd700;
    font-size: 14px;
    text-shadow: 0 0 5px #ff6f00;
}

.mining-center-silo.selected .mining-icon-frame {
    border-color: #ffd700;
    box-shadow: 0 0 20px #ffb74d, inset 0 0 10px #ffb74d;
}

#achievements-modal {
    z-index: 200;
}

.achievement-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.ach-tab {
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    font-family: 'Graduate', serif;
    font-size: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    flex-grow: 1;
}

.ach-tab.active {
    background: linear-gradient(to bottom, #f39c12, #d35400);
    color: white;
    border-color: #e67e22;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
}

.achievement-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

/* --- THE SLIM RIBBON --- */
.ach-ribbon {
    position: relative;
    width: 100%;
    height: 55px;
    background: linear-gradient(90deg, #222 0%, #1a1a1a 100%);
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.ach-ribbon.completed {
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

.ach-ribbon.claimed {
    opacity: 0.6;
    border-color: #2ecc71;
}

.ach-progress-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #FFD700;
    z-index: 1;
    transition: width 0.5s ease;
    box-shadow: 0 0 5px #FFD700;
}

.ach-icon {
    font-size: 24px;
    margin-right: 15px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
    z-index: 2;
}

.ach-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.ach-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    line-height: 1.2;
}

.ach-desc {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.ach-btn {
    z-index: 2;
    font-family: 'Graduate', serif;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: default;
    background: #333;
    color: #555;
    min-width: 60px;
}

.ach-btn.claimable {
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
    color: white;
    cursor: pointer;
    border: 1px solid #2ecc71;
}

.ach-btn.done {
    background: transparent;
    color: #2ecc71;
    font-weight: bold;
    border: 1px solid #2ecc71;
}

.achievements-panel {
    width: 95%;
    max-width: 400px;
    height: 700px;
    max-height: 90vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 2px solid #444;
    border-top: 4px solid #ffd700;
    border-bottom: 4px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.achievements-panel .smithy-header h2 {
    color: #fff;
    text-shadow: 0 0 10px #ffd700;
}

/* --- CONFIRMATION MODAL --- */
.confirmation-panel {
    width: 280px;
    background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1a 100%);
    border: 2px solid #aaa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInScaleUp 0.2s ease-out forwards;
}

.confirmation-panel h3 {
    font-family: 'Lilita One', cursive;
    color: #ffd700;
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 0 #000;
}

.confirmation-panel p {
    font-family: 'Nunito', sans-serif;
    color: #ccc;
    font-size: 14px;
    margin: 0;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.confirm-btn {
    width: 80px;
    height: 40px;
    font-family: 'Graduate', serif;
    font-weight: bold;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.confirm-btn:active {
    transform: scale(0.95);
}

.btn-yes {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    border-bottom: 3px solid #145a32;
}

.btn-no {
    background: linear-gradient(to bottom, #c0392b, #922b21);
    border-bottom: 3px solid #641e16;
}

/* --- LOADING SCREEN (ROBUST FIX) --- */
#loading-screen {
    /* LOCK POSITION: Snaps to absolute edges of the screen */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    /* VISUALS */
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;

    /* LAYERING: Higher than any modal (200) or overlay (9999) */
    z-index: 2147483647;

    /* PREVENT CLIPPING/SCROLLING */
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;

    /* ANIMATION */
    transition: opacity 0.5s ease-out;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 300px;
    /* Ensure content sits on top of the black background */
    position: relative;
    z-index: 2147483648;
}

.loading-logo {
    font-family: 'Lilita One', cursive;
    font-size: 42px;

    /* GRADIENT TEXT */
    background: linear-gradient(to bottom, #ffd700, #ff8c00);

    /* 1. FIX WARNING: Add standard property */
    background-clip: text;
    -webkit-background-clip: text;

    /* Make text transparent so background shows through */
    -webkit-text-fill-color: transparent;
    color: transparent;

    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;

    /* 2. FIX BOXY GLOW: Use filter animation instead of box-shadow */
    animation: text-glow-pulse 2s infinite ease-in-out;
}

@keyframes text-glow-pulse {
    0% {
        /* Sharp black shadow + No Glow */
        filter: drop-shadow(2px 2px 0 #000) drop-shadow(0 0 0 rgba(255, 215, 0, 0));
        transform: scale(1);
    }

    50% {
        /* Sharp black shadow + Strong Gold Glow */
        filter: drop-shadow(2px 2px 0 #000) drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
        transform: scale(1.05);
    }

    100% {
        /* Back to start */
        filter: drop-shadow(2px 2px 0 #000) drop-shadow(0 0 0 rgba(255, 215, 0, 0));
        transform: scale(1);
    }
}

.loading-text {
    font-family: 'Graduate', serif;
    color: #ccc;
    font-size: 14px;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-align: center;
}

.loading-bar-container {
    width: 100%;
    height: 10px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#loading-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #ffd700);
    transition: width 0.2s ease-out;
}

#loading-percent {
    font-family: 'Nunito', sans-serif;
    color: #888;
    font-size: 12px;
    margin-top: 5px;
    font-weight: bold;
    text-align: center;
}

/* HIDE STATE */
#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- COMRADES / REFERRAL MODAL (Pure CSS) --- */

.comrades-panel {
    /* Pure CSS Box Design */
    width: 95%;
    max-width: 400px;
    height: auto;
    min-height: 500px;
    max-height: 80vh;
    background: linear-gradient(180deg, #2a2a2e 0%, #151515 100%);
    /* Dark Metal Gradient */
    border: 3px solid #ffd700;
    /* Gold Border */
    border-radius: 15px;
    box-shadow:
        0 0 0 3px #000,
        /* Outer black outline */
        0 0 30px rgba(255, 215, 0, 0.2),
        /* Gold Glow */
        inset 0 0 50px rgba(0, 0, 0, 0.8);
    /* Inner shadow */
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInScaleUp 0.3s ease-out forwards;
}

.comrades-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

.comrades-header h2 {
    font-family: 'Lilita One', cursive;
    font-size: 32px;
    color: #FFD700;
    margin: 0;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
}

/* FIX: Ensure Close Button is visible and clickable */
#close-comrades-button {
    position: absolute;
    right: -5px;
    top: -5px;
    width: 36px;
    height: 36px;
    background-color: #333;
    /* Dark background to make it pop */
    border: 2px solid #555;
    border-radius: 50%;
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#close-comrades-button:active {
    transform: scale(0.9);
    background-color: #555;
}

.comrades-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.invite-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.invite-desc {
    color: #ccc;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    line-height: 1.4;
    margin-bottom: 15px;
    text-shadow: 1px 1px 1px #000;
}

.comrades-section-title {
    font-family: 'Graduate', serif;
    color: #888;
    font-size: 14px;
    text-align: left;
    margin-top: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes slideInComrade {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- ROULETTE MINI-GAME --- */
.roulette-content {
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #daa520;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    max-width: 400px;
    width: 95%;
}

.roulette-header {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    padding: 0 35px;
    /* Creates a 35px 'Safe Zone' on the sides for the X button */
    box-sizing: border-box;
    /* Ensures the padding pushes the text inward */
}

.roulette-header h2 {
    color: #daa520;
    font-family: 'Rye', serif;
    margin: 0;
    text-shadow: 2px 2px 0 #000;

    /* Magically scales the font size based on the device width! */
    /* Minimum 18px (Z-Fold), Preferred 6vw, Maximum 28px (iPhone XR/Pro Max) */
    font-size: clamp(18px, 6vw, 28px);
    line-height: 1.1;
    /* Keeps it neat if the screen forces it to wrap to 2 lines */
}

.roulette-timer {
    font-family: 'Oswald', sans-serif;
    color: #ff4444;
    font-size: 1.2rem;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* --- SPIN HISTORY --- */
.roulette-history {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 5px 0 8px 0;
    min-height: 24px;
    /* Keeps the spacing from jumping when empty */
}

.history-bubble {
    width: 32px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Oswald', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* THE WHEEL STAGE */
.roulette-stage {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 10px auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* THE HORIZONTAL REEL STAGE */
.roulette-stage {
    position: relative;
    width: 100%;
    margin: 10px auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reel-window {
    width: 100%;
    height: 100px;
    background: #111;
    border: 4px solid #4a3c31;
    /* Wood rim to match your theme */
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    /* Hides the rest of the long strip */
    box-shadow: inset 0 0 20px #000, 0 5px 15px rgba(0, 0, 0, 0.5);
    touch-action: pan-y;
}

/* The Target Line in the middle */
.reel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ff3333;
    z-index: 10;
    box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
    pointer-events: none;
}

/* The long train of boxes */
.reel-strip {
    display: flex;
    height: 100%;
    width: max-content;
    /* Smooth 4-second spin animation */
    transition: transform 4s cubic-bezier(0.1, 0, 0.1, 1);
    will-change: transform;
    pointer-events: none;
    user-select: none;
}

/* Individual number boxes (Generated by JS) */
.reel-box {
    width: 80px;
    /* Crucial: Fixed width makes the JS math perfectly accurate */
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    border-right: 2px solid rgba(0, 0, 0, 0.4);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    flex-shrink: 0;
    /* Prevents boxes from squishing */
}

/* Dark shadows on the left/right edges for a 3D embedded look */
.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
    z-index: 5;
}

/* BETTING BOARD */
.bet-actions-row {
    display: flex;
    gap: 15px;
    /* Larger gap to separate Erase/Confirm from betting numbers */
    justify-content: space-between;
    align-items: stretch;
    /* Makes buttons the same height */
    margin-bottom: 15px;
}

.betting-board {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
}

.bet-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 10px;
}

.bet-options {
    display: flex;
    gap: 5px;
    width: 100%;
}

.chip-actions-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chips {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-grow: 1;
    /* This forces the chips to center and pushes icons to edges */
}

/* Make Erase and Confirm Perfect Circles */
.action-btn {
    width: 40px;
    /* Match chip width */
    height: 40px;
    /* Match chip height */
    padding: 0;
    border-radius: 50%;
    /* Perfect Circle */
    color: #fff;
    cursor: pointer;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    /* Size for emojis */
    transition: all 0.2s;
    flex-shrink: 0;
    /* Prevents them from squishing */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.erase-btn {
    background: #8b0000;
    border-color: #ff4444;
    padding-right: 1px;
}

.erase-btn:active {
    background: #ff0000;
    transform: scale(0.9);
}

.confirm-btn {
    background: #006400;
    border-color: #00ff00;
}

.confirm-btn:active {
    background: #00ff00;
    transform: scale(0.9);
}

/* Custom Close Button Styling */
#close-roulette-button {
    position: absolute;
    right: 5px;
    /* Pushes it nicely to the top right corner */
    top: 8px;
    width: 26px;
    /* Standard size */
    height: 26px;
    background-color: transparent;
    /* Removes the ugly circle background */
    border: none;
    /* Removes the ring border */
    background-size: contain;
    /* Forces the custom image to be 100% full size */
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    z-index: 100;
    box-shadow: none;
    /* Removes the shadow box */
}

#close-roulette-button:active {
    transform: scale(0.9);
    /* Keeps the nice click animation */
}

#close-roulette-button:hover {
    color: #fff !important;
}

.bet-btn {
    flex: 1;
    background: #444;
    border: 1px solid #666;
    border-radius: 5px;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    position: relative;
    transition: all 0.2s;
}

.bet-btn.active-bet {
    background: #5a4d2e;
    border-color: #daa520;
}

.bet-btn .multiplier {
    font-size: 1.1rem;
    font-weight: bold;
}

.bet-btn .my-bet {
    font-size: 0.75rem;
    color: #ffd700;
}

/* Colors for buttons */
.bet-btn[data-target="1.5"] {
    border-bottom: 3px solid #888;
}

.bet-btn[data-target="3"] {
    border-bottom: 3px solid #4caf50;
}

.bet-btn[data-target="5"] {
    border-bottom: 3px solid #2196f3;
}

.bet-btn[data-target="10"] {
    border-bottom: 3px solid #9c27b0;
}

.bet-btn[data-target="20"] {
    border-bottom: 3px solid #daa520;
}

.chip-selector {
    text-align: center;
}

.chip-selector p {
    margin: 0 0 5px 0;
    font-size: 0.8rem;
    color: #888;
}

.chips {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.chip-btn {
    background: #222;
    border: 1px solid #444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.7rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.chip-btn.active {
    background: #ffd700;
    color: #000;
    border-color: #fff;
    transform: scale(1.1);
}

/* --- THE SOLID GOLD VIP JACKPOT TILE --- */
.rainbow-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    z-index: 2;
    overflow: hidden;
    background: transparent !important;
    border: none !important;

    /* Clean, subtle drop shadow so white text is highly readable on Gold */
    color: #fff;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.7);
}

/* 1. The Continuous Solid Gold Border Sweep */
.rainbow-box::before {
    content: '';
    position: absolute;
    width: 250%;
    height: 250%;

    /* Replaced all transparent gaps with rich gold tones */
    background: conic-gradient(#b8860b 0%,
            /* Deep Bronze/Gold */
            #d4af37 20%,
            /* Classic Gold */
            #ffea00 30%,
            /* Bright Gold */
            #ffffff 35%,
            /* Diamond White Hot Center */
            #ffea00 40%,
            /* Bright Gold */
            #d4af37 50%,
            /* Classic Gold */
            #b8860b 70%,
            /* Deep Bronze/Gold */
            #ffea00 80%,
            /* Bright Gold */
            #ffffff 85%,
            /* Diamond White Hot Center */
            #ffea00 90%,
            /* Bright Gold */
            #b8860b 100%
            /* Deep Bronze/Gold */
        );
    top: 50%;
    left: 50%;
    animation: premiumChase 2.5s linear infinite;
    z-index: -2;
}

/* 2. The Solid Gold Inner Plate */
.rainbow-box::after {
    content: '';
    position: absolute;
    inset: 4px;
    /* The thickness of the glowing border */

    /* A bright, polished gold coin gradient */
    background: radial-gradient(circle at center, #ffe066 0%, #d4af37 100%);
    box-shadow: inset 0 0 10px rgba(184, 134, 11, 0.4);
    z-index: -1;
}

/* Smooth, elegant rotation */
@keyframes premiumChase {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =========================================
   FISHING MINI-GAME (FULL SCREEN)
   ========================================= */

#fishing-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d1b2a;
    /* Fallback color */
    background-size: cover;
    background-position: center top;
    z-index: 95;
    /* Sits right above the main game, below modals */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#fishing-screen.hidden {
    display: none !important;
}

/* --- 1. SKY HUD --- */
.fishing-top-hud {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    z-index: 10;
}

/* General Pill Design */
.fishing-hud-pill {
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 6px 14px;
    display: flex;
    flex-direction: row;
    /* Forces EVERYTHING to be side-by-side */
    align-items: center;
    /* Centers items vertically */
    gap: 8px;
    /* Gap between icon/text or level/bar */
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Bait Counter Adjustments */
.fishing-icon-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

.bait-inventory-pill {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 Columns */
    gap: 6px 15px;
    /* 6px vertical gap, 15px horizontal gap */
    padding: 10px 15px;
    /* Slightly thicker padding for the grid */
}

.bait-hud-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Make the text slightly smaller to fit all 4 comfortably */
.bait-hud-item span {
    font-family: 'Lilita One', cursive;
    color: #fff;
    font-size: 15px;
    text-shadow: 1px 1px 2px #000;
}

/* Keep the icons crisp */
.fishing-icon-small {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

/* Level & EXP Adjustments (Compact Blackjack Style) */
#fishing-level-display {
    font-family: 'Lilita One', cursive;
    color: #fff;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    /* Prevents text from wrapping */
}

.fishing-exp-outer {
    width: 60px;
    /* Much shorter, compact bar */
    height: 10px;
    /* Slightly thicker to match other games */
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #777;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 0 5px #000;
}

#fishing-exp-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    box-shadow: 0 0 5px #3498db;
    transition: width 0.3s ease;
}

/* --- 2. SURFACE CONTROLS --- */
.fishing-surface-zone {
    position: absolute;
    top: 35%;
    /* Perfect spot right under the boat on your image */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 10;
}

.fishing-surface-btn {
    width: 140px;
    height: 55px;
    border-radius: 12px;
    color: #fff;
    font-family: 'Graduate', serif;
    font-size: 15px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.1s ease;
}

/* Net Button (Orange/Gold theme) */
#btn-throw-net {
    background: linear-gradient(to bottom, #f39c12, #d35400);
    border: 2px solid #e67e22;
    border-bottom: 5px solid #a04000;
}

/* Rod Button (Green theme) */
#btn-cast-rod {
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
    border: 2px solid #2ecc71;
    border-bottom: 5px solid #145a32;
}

.fishing-surface-btn:active {
    transform: translateY(5px);
    border-bottom-width: 0px;
    margin-bottom: 5px;
    /* Prevents layout jump when border shrinks */
}

/* --- 3. ACTION GAP (Deep Ocean) --- */
#fishing-action-zone {
    position: absolute;
    top: 40%;
    bottom: 15%;
    left: 0;
    width: 100%;
    pointer-events: none;
    /* Let touches pass through unless an item spawns */
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 4. SEABED CONTROLS --- */
.fishing-seabed-zone {
    position: absolute;
    bottom: max(5%, env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.fishing-shop-btn {
    width: 220px;
    height: 65px;
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
    border: 2px solid #9b59b6;
    border-bottom: 6px solid #5b2c6f;
    border-radius: 15px;
    color: #ffd700;
    font-family: 'Graduate', serif;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.fishing-shop-btn:active {
    transform: translateY(6px);
    border-bottom-width: 0px;
    margin-bottom: 6px;
}

/* Anchors the Close Button to the Top Right */
.fishing-close-btn {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: 20px;
    width: 35px;
    height: 35px;
    background-color: transparent;
    border: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.1s;
    z-index: 20;
}

.fishing-close-btn:active {
    transform: scale(0.9);
}

/* Ambient Fish Silhouettes */
.ambient-fish {
    position: absolute;
    height: auto;
    pointer-events: none;
    /* Prevents players from accidentally clicking the fish */
    z-index: 1;
    /* Keeps them deep in the background */
    opacity: 0;
    /* Starts invisible */
}

/* Swim from Left to Right (Flipped to face right) */
@keyframes swim-right {
    0% {
        transform: translateX(-50px) scaleX(-1);
        opacity: 0;
    }

    15% {
        opacity: 0.6;
    }

    85% {
        opacity: 0.6;
    }

    100% {
        transform: translateX(calc(100vw + 50px)) scaleX(-1);
        opacity: 0;
    }
}

/* Swim from Right to Left (Natural SVG faces left) */
@keyframes swim-left {
    0% {
        transform: translateX(calc(100vw + 50px)) scaleX(1);
        opacity: 0;
    }

    15% {
        opacity: 0.6;
    }

    85% {
        opacity: 0.6;
    }

    100% {
        transform: translateX(-50px) scaleX(1);
        opacity: 0;
    }
}

/* Ambient Floating Crate */
.ambient-crate {
    position: absolute;
    height: auto;
    pointer-events: none;
    z-index: 1;
    /* Same depth as the fish */
    opacity: 0;
}

/* Fades in, bobs up and down gently, and fades out */
@keyframes float-crate {
    0% {
        transform: translateY(0px) rotate(-3deg);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
        transform: translateY(-8px) rotate(2deg);
    }

    50% {
        opacity: 0.6;
        transform: translateY(5px) rotate(-1deg);
    }

    80% {
        opacity: 0.6;
        transform: translateY(-5px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(-2deg);
        opacity: 0;
    }
}

/* =========================================
   FISHING MODALS (NET & SHOP)
   ========================================= */

/* Shared Popup Panel Styling */
.fishing-popup-panel {
    background: linear-gradient(135deg, #1a252c, #0f171e);
    border: 3px solid #34495e;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(52, 73, 94, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.small-panel {
    width: 90%;
    max-width: 320px;
}

.medium-panel {
    width: 95%;
    max-width: 400px;
}

.close-fishing-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: #e74c3c;
    font-size: 24px;
    font-family: 'Lilita One', cursive;
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
}

.fishing-popup-title {
    font-family: 'Lilita One', cursive;
    color: #ffd700;
    font-size: 26px;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 0 #000;
    text-align: center;
}

.fishing-popup-desc {
    color: #bdc3c7;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Nunito', sans-serif;
}

/* --- NET MODAL STYLES --- */
.net-options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.net-option-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.2s;
}

.net-option-card:active {
    transform: scale(0.95);
}

.net-time {
    font-family: 'Lilita One', cursive;
    font-size: 20px;
    color: #fff;
    margin-bottom: 5px;
}

.net-cost {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.inline-dust-icon {
    width: 14px;
    height: 14px;
}

.standard-net .net-action {
    background: #3498db;
    padding: 5px 15px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
}

.standard-net:hover {
    border-color: #3498db;
}

/* Ad Option gets Special Styling */
.premium-net {
    border: 2px solid #f39c12;
    background: rgba(243, 156, 18, 0.1);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.premium-net .net-time {
    color: #f39c12;
}

.premium-net .net-action {
    background: #d35400;
    padding: 5px 15px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
}

.ad-icon {
    color: #e74c3c;
    font-size: 16px;
    margin-left: 5px;
}


/* --- ANGLER SHOP STYLES (2x2 Grid) --- */

/* Restrict the panel width so it looks good on mobile */
.medium-panel {
    width: 95%;
    max-width: 360px;
    padding: 20px 15px;
}

/* The 2x2 Grid */
.angler-bait-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Two equal columns */
    gap: 12px;
    /* Space between cards */
    width: 100%;
    padding-bottom: 5px;
}

/* Compact Card Styling */
.bait-card {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #7f8c8d;
    border-radius: 10px;
    padding: 12px 8px;
    /* Tighter padding to fit 2 side-by-side */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bait-shop-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 3px 3px #000);
}

.bait-name {
    font-family: 'Graduate', serif;
    font-size: 12px;
    color: #fff;
    margin-bottom: 4px;
    text-align: center;
}

.bait-price {
    font-size: 11px;
    color: #2ecc71;
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
}

.bait-limit {
    font-size: 10px;
    color: #bdc3c7;
    margin-bottom: 10px;
}

.buy-bait-btn {
    width: 95%;
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 0;
    cursor: pointer;
    box-shadow: 0 3px 0 #145a32;
}

.buy-bait-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* Premium Card Special Styling */
.premium-card {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.1);
}

.premium-badge {
    position: absolute;
    top: -8px;
    background: #8e44ad;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
    border: 1px solid #d2b4de;
}

.premium-buy {
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
    box-shadow: 0 3px 0 #5b2c6f;
}

/* =========================================
   RARE SPAWN GLOW EFFECTS
   ========================================= */

/* Rare Golden Fish Aura */
.ambient-fish.rare-glow {
    /* Chaining: 2px white-gold core + 6px brilliant gold edge */
    filter: drop-shadow(0 0 2px #fff8b0) drop-shadow(0 0 6px #ffea00);
}

.ambient-fish.rare-glow svg path {
    fill: #4a3c00;
    /* A richer, dark gold body to contrast the intense glow */
}

/* Rare Golden Treasure Crate Aura (Updated from Purple) */
.ambient-crate.mystic-glow {
    /* Identical brilliant golden glow */
    filter: drop-shadow(0 0 2px #fff8b0) drop-shadow(0 0 6px #ffea00);
}

.ambient-crate.mystic-glow svg rect {
    fill: #4a3c00;
    /* Matching rich dark gold body */
}

/* =========================================
   MILESTONE REWARD BAR
   ========================================= */

#fishing-milestone-bar {
    position: absolute;
    right: 15px;
    top: 45%;
    /* Starts just below the Cast Rod button */
    bottom: 12%;
    /* Ends just above the Angler Shop */
    width: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* The Chest Container */
#milestone-chest {
    width: 45px;
    height: 45px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.8));
}

.milestone-chest-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The Reel Game Shake Animation */
@keyframes chest-shake {
    0% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(5deg) scale(1.05);
    }

    50% {
        transform: rotate(0deg) scale(1.05);
    }

    75% {
        transform: rotate(-5deg) scale(1.05);
    }

    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* We add this class via JS when the bar hits 50 */
.chest-ready {
    animation: chest-shake 0.4s infinite;
    filter: drop-shadow(0 0 10px #ffea00) !important;
    /* Golden glow! */
}

/* The Thick Vertical Bar */
.milestone-track {
    flex-grow: 1;
    /* Automatically stretches to fill the vertical gap */
    width: 20px;
    /* Nice and thick */
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #7f8c8d;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px #000;
}

/* The Fill Line (Starts at bottom) */
#milestone-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    /* JS will update this up to 100% */
    background: linear-gradient(to top, #f39c12, #ffea00);
    box-shadow: 0 0 10px #f39c12;
    transition: height 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy fill effect */
}

/* Text Counter */
#milestone-counter {
    margin-top: 5px;
    font-family: 'Lilita One', cursive;
    color: #fff;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
}

/* =========================================
   FISHING REWARD POPUP (FULL SCREEN)
   ========================================= */

#fishing-reward-popup {
    z-index: 105;
    /* Sits above EVERYTHING else */
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Spinning Sunburst Effect */
.reward-sunburst-bg {
    position: absolute;
    width: 150vw;
    height: 150vw;
    /* A soft, massive glowing golden orb instead of harsh lines */
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 140, 0, 0.1) 40%, transparent 70%);
    animation: pulse-halo 3s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes pulse-halo {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.reward-content-box {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: pop-in-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reward-jackpot-title {
    font-family: 'Lilita One', cursive;
    color: #ffea00;
    font-size: 36px;
    margin: 0 0 20px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.reward-massive-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(255, 234, 0, 0.8));
    margin-bottom: 20px;
    animation: solid-float 3s ease-in-out infinite;
    /* Brand new animation */
}

@keyframes solid-float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    /* Smoothly hovers up and down */
}

.reward-jackpot-text {
    font-family: 'Graduate', serif;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 0 #000;
}

.reward-tap-text {
    font-family: 'Nunito', sans-serif;
    color: #bdc3c7;
    font-size: 14px;
    animation: pulse-opacity 1.5s infinite;
}

@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* =========================================
   NET CLAIM LOOT POPUP
   ========================================= */
.net-loot-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.9), 2px 2px 2px #000;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    opacity: 0;
    animation: net-loot-anim 3.5s ease-in-out forwards;
}

@keyframes net-loot-anim {
    0% {
        transform: translate(-50%, -10px) scale(0.5);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -40px) scale(1.2);
        opacity: 1;
    }

    25% {
        transform: translate(-50%, -40px) scale(1);
        opacity: 1;
    }

    75% {
        transform: translate(-50%, -50px) scale(1);
        opacity: 1;
    }

    /* Hangs around longer */
    100% {
        transform: translate(-50%, -80px) scale(0.8);
        opacity: 0;
    }

    /* Slowly fades up */
}

/* =========================================
   CAST ROD: BAIT SELECTION MODAL
   ========================================= */
.cast-bait-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.cast-bait-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.2s;
}

.cast-bait-select-btn:active {
    transform: scale(0.95);
}

.cast-bait-select-btn:hover {
    border-color: #3498db;
}

/* Gray out buttons if player has 0 of that bait */
.cast-bait-select-btn.out-of-stock {
    filter: grayscale(1);
    opacity: 0.5;
    pointer-events: none;
}

.cast-bait-name {
    color: #fff;
    font-family: 'Graduate', serif;
    font-size: 16px;
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
}

.cast-bait-qty {
    color: #aaa;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
}

/* Premium Bait Special Styling */
.premium-cast-btn {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.15);
}

.premium-cast-btn .cast-bait-name {
    color: #e0b0ff;
}

.premium-cast-btn:hover {
    border-color: #e0b0ff;
}


/* =========================================
   CAST ROD: ACTIVE MINI-GAME UI
   ========================================= */

#active-fishing-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 15;
}

/* The Bobber */
#fishing-bobber-wrapper {
    position: relative;
    animation: bobber-float 2s ease-in-out infinite;
    transition: transform 0.1s;
}

.svg-bobber {
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.8));
}

@keyframes bobber-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px) rotate(5deg);
    }
}

/* The Bite Alert (!) */
#bobber-alert {
    position: absolute;
    top: -25px;
    right: -15px;
    background: #e74c3c;
    color: #fff;
    font-family: 'Lilita One', cursive;
    font-size: 22px;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
    animation: pop-alert 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-alert {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(10deg);
        opacity: 1;
    }
}

/* --- THE TENSION BAR --- */
#tension-mini-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    width: 90%;
    max-width: 320px;
    animation: pop-in-bounce 0.4s;
}

.tension-bar-track {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* The Green Sweet Spot */
#tension-sweet-spot {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.5), #2ecc71, rgba(46, 204, 113, 0.5));
    box-shadow: 0 0 10px #2ecc71;
    /* Width and Left will be injected dynamically by JS! */
}

/* The Moving Marker Line */
#tension-marker {
    position: absolute;
    top: -2px;
    height: 29px;
    /* Slightly taller than the track */
    width: 6px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 0 8px #fff, 0 0 5px #000;
    transform: translateX(-50%);
    z-index: 2;
    /* Left percentage injected by JS */
}

/* The PULL Button */
.catch-glow-btn {
    background: linear-gradient(to bottom, #e74c3c, #c0392b) !important;
    border: 2px solid #ff7979;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    animation: pulse-danger 0.6s infinite alternate;
    width: 150px;
}

@keyframes pulse-danger {
    from {
        filter: drop-shadow(0 0 5px #e74c3c);
        transform: scale(1);
    }

    to {
        filter: drop-shadow(0 0 15px #ff7979);
        transform: scale(1.05);
    }
}

/* Guarantee the PULL button is clickable */
#btn-pull-catch {
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 100;
}

/* =========================================
   FISHING CRYSTAL DUST COUNTER
   ========================================= */
.fishing-dust-container {
    position: absolute;
    top: 70px;
    /* Places it neatly below the close button */
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    border-radius: 15px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    /* Keeps it above the water layer */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#fishing-dust-amount {
    color: #00ffff;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    text-shadow: 1px 1px 2px #000;
}

.fishing-dust-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 0 2px #000);
}

/* =========================================
   UNIVERSAL FLOATING POPUP TEXT
   ========================================= */
.generic-floating-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Lilita One', cursive;
    font-size: 28px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.9), 2px 2px 2px #000;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    opacity: 0;
    animation: generic-float-anim 1.5s ease-in-out forwards;
}

@keyframes generic-float-anim {
    0% {
        transform: translate(-50%, -10px) scale(0.5);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -40px) scale(1.2);
        opacity: 1;
    }

    25% {
        transform: translate(-50%, -40px) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -40px) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -60px) scale(0.8);
        opacity: 0;
    }
}

/* =========================================
   UNIVERSAL AD UI PANELS
   ========================================= */
.universal-popup-panel {
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-universal-popup {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-family: 'Lilita One', cursive;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.universal-popup-title {
    font-family: 'Lilita One', cursive;
    margin: 0 0 10px 0;
    font-size: 24px;
    text-shadow: 1px 1px 2px #000;
}

.universal-popup-desc {
    color: #ccc;
    margin-bottom: 20px;
    font-size: 14px;
}

.universal-ad-btn {
    background: linear-gradient(to bottom, #f1c40f, #d35400);
    border: 2px solid #ffd700;
    color: #fff;
    font-family: 'Lilita One', cursive;
    font-size: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-shadow: 1px 1px 2px #000;
    animation: pulse-gold-ad 1.5s infinite alternate;
}

@keyframes pulse-gold-ad {
    0% {
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 25px rgba(243, 156, 18, 1);
        transform: scale(1.05);
    }
}

/* =========================================
   MIMIC MINI-GAME PURE CSS REDESIGN
   ========================================= */

/* The Main Window Background (Matched to Mining Panel Dark Wood/Bronze) */
.mimic-panel {
    background: linear-gradient(180deg, #26211f 0%, #0f0c0b 100%);
    border: 3px solid #8d6e63;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(0, 0, 0, 0.8);
    position: relative;
    margin: 0 auto;
}

.mimic-header {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid #8d6e63;
    padding: 15px;
    text-align: center;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.mimic-header h2 {
    margin: 0;
    font-family: 'Lilita One', cursive;
    color: #ffd700;
    /* Standard Game Gold */
    font-size: 26px;
    text-shadow: 2px 2px 4px #000;
}

#close-mimic-button {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    background-color: transparent;
    border: none;
    background-size: contain;
    cursor: pointer;
}

/* Base style for all 3 buttons */
.mimic-pure-btn {
    font-family: 'Graduate', serif;
    /* Changed to match your standard buttons */
    font-size: 16px;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid;
    cursor: pointer;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    width: 100%;
    margin-top: 10px;
    transition: transform 0.1s ease, filter 0.2s ease, box-shadow 0.1s ease;
}

/* Disabled State (For all buttons) */
.mimic-pure-btn:disabled {
    background: #444 !important;
    border-color: #555 !important;
    color: #888 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    text-shadow: none !important;
    transform: none !important;
}

/* Click Animation */
.mimic-pure-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent !important;
}

/* 1. Normal Feed Button (Matched to Mining Upgrade Green) */
.btn-feed {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    border-color: #2ecc71;
    box-shadow: 0 4px 0 #145a32;
}

/* 2. Force Feed Button (Matched to Dungeon Area Select Orange) */
.btn-force {
    background: linear-gradient(to bottom, #f39c12, #d35400);
    border-color: #e67e22;
    box-shadow: 0 4px 0 #a04000;
}

/* 3. Permanent Pass Button (Matched to Golden Perks) */
.btn-pass {
    background: linear-gradient(to bottom, #f1c40f, #f39c12);
    border-color: #ffd700;
    box-shadow: 0 4px 0 #b9770e;
    font-size: 14px;
    color: #fff;
}