/* CSS Variables for Skill Colors */
:root {
    --skill-mining: #808080;
    --skill-fishing: #5DADE2;
    --skill-woodcutting: #27AE60;
    --skill-cooking: #8E44AD;
    --skill-default: #f39c12;

    /* Additional skill colors */
    --skill-attack: #C0392B;
    --skill-strength: #E74C3C;
    --skill-defence: #3498DB;
    --skill-magic: #2E86AB;
    --skill-ranged: #16A085;
    --skill-prayer: #F4D03F;
    --skill-runecraft: #5B2C6F;
    --skill-construction: #A04000;
    --skill-agility: #2E4053;
    --skill-herblore: #239B56;
    --skill-thieving: #884EA0;
    --skill-crafting: #935116;
    --skill-fletching: #0E6655;
    --skill-slayer: #641E16;
    --skill-hunter: #5D4E37;
    --skill-smithing: #515A5A;
    --skill-firemaking: #DC7633;
    --skill-farming: #1E8449;
    --skill-sailing: #1E90FF;
}
/* Skill-specific progress bar colors */
.task-progress-fill.skill-mining { background-color: var(--skill-mining); }
.task-progress-fill.skill-fishing { background-color: var(--skill-fishing); }
.task-progress-fill.skill-woodcutting { background-color: var(--skill-woodcutting); }
.task-progress-fill.skill-cooking { background-color: var(--skill-cooking); }
.task-progress-fill.skill-attack { background-color: var(--skill-attack); }
.task-progress-fill.skill-strength { background-color: var(--skill-strength); }
.task-progress-fill.skill-defence { background-color: var(--skill-defence); }
.task-progress-fill.skill-magic { background-color: var(--skill-magic); }
.task-progress-fill.skill-ranged { background-color: var(--skill-ranged); }
.task-progress-fill.skill-prayer { background-color: var(--skill-prayer); }
.task-progress-fill.skill-runecraft { background-color: var(--skill-runecraft); }
.task-progress-fill.skill-construction { background-color: var(--skill-construction); }
.task-progress-fill.skill-agility { background-color: var(--skill-agility); }
.task-progress-fill.skill-herblore { background-color: var(--skill-herblore); }
.task-progress-fill.skill-thieving { background-color: var(--skill-thieving); }
.task-progress-fill.skill-crafting { background-color: var(--skill-crafting); }
.task-progress-fill.skill-fletching { background-color: var(--skill-fletching); }
.task-progress-fill.skill-slayer { background-color: var(--skill-slayer); }
.task-progress-fill.skill-hunter { background-color: var(--skill-hunter); }
.task-progress-fill.skill-smithing { background-color: var(--skill-smithing); }
.task-progress-fill.skill-firemaking { background-color: var(--skill-firemaking); }
.task-progress-fill.skill-farming { background-color: var(--skill-farming); }
.task-progress-fill.skill-sailing { background-color: var(--skill-sailing); }
/* Default for other skills */
.task-progress-fill { background-color: var(--skill-default); }

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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

/* Game Wrapper for scaling */
.game-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
}

/* Scaled container - prevent smoothing during transform */
.scaled-container {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    transform-origin: top left;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 2560px;
    height: 1440px;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #f39c12;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-progress {
    height: 100%;
    background-color: #f39c12;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    color: #aaa;
}

/* Game Container */
.game-container {
    position: relative;
    width: 2560px;
    height: 1440px;
    background-color: #1a1a1a;
}

.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    /* GPU acceleration hints */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -o-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Single UI Panel (bottom right) */
.ui-panel {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 500px;
    height: 900px;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
}

/* Panel Selector Buttons */
.panel-selector {
    display: flex;
    background-color: #1a1a1a;
    border-bottom: 2px solid #444;
    border-radius: 6px 6px 0 0;
}

.panel-btn {
    flex: 1;
    height: 70px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.panel-btn:hover {
    background-color: #333;
}

.panel-btn.active {
    background-color: #2a2a2a;
    border-bottom: 2px solid #f39c12;
}

/* Pause button specific styling */
.panel-btn.pause-btn {
    flex: 0 0 80px; /* Fixed width instead of flex: 1 */
    border-left: 2px solid #444;
}

.panel-btn.pause-btn:hover {
    background-color: #333;
}

.pause-icon {
    font-size: 32px;
    color: #f39c12;
    display: inline-block;
    line-height: 1;
}

.panel-btn.pause-btn:hover .pause-icon {
    color: #e67e22;
}

.panel-btn img {
    width: 54px;
    height: 54px;
    filter: brightness(0.8);
}

.panel-btn.active img {
    filter: brightness(1.2);
}

/* When image fails to load, show text */
.panel-btn::after {
    content: attr(title);
    position: absolute;
    font-size: 10px;
    color: #999;
    display: none;
}

.panel-btn img[src=""]:after,
.panel-btn img:not([src]):after {
    display: block;
}

/* Panel Content Area */
.panel-content {
    flex: 1;
    padding: 10px;
}

.panel {
    display: none;
    height: 100%;
}

.panel.active {
    display: block;
}

/* Panel Controls at bottom */
.panel-controls {
    padding: 2px;
    border-top: 1px solid #444;
}

/* Minimized state for UI panel */
.ui-panel.minimized {
    width: 500px;
    right: 20px;
    bottom: 20px;
    top: auto;
    left: auto;
    height: auto;
    background: rgba(0, 0, 0, 1.0);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.ui-panel.minimized .panel-buttons {
    margin: 0;
    gap: 10px;
}

.ui-panel.minimized .panel-content {
    display: none !important;
}

/* Optional: Add a subtle animation for the minimize/maximize transition */
.ui-panel {
    transition: all 0.3s ease-in-out;
}

.control-btn {
    width: 100%;
    padding: 10px;
    background-color: #f39c12;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-btn:hover {
    background-color: #e67e22;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    justify-items: anchor-center;
}

.inventory-slot {
    width: 100px;
    height: 100px;
    background-color: #222;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.inventory-slot:hover {
    border-color: #f39c12;
}

/* Skills Panel */
.skills-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.skill-item {
    background-color: #222;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    height: auto;
}

.skill-item:hover {
    background-color: #333;
}

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

.skill-icon {
    width: 50px;
    height: 50px;
}

.skill-level {
    color: #FFD700;
    font-size: 44px;
    font-family: Courier New, monospace;
}

.skill-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.95);
    color: #FFD700;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    border: 1px solid #444;
    text-align: left;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

.skill-item:hover .skill-tooltip {
    opacity: 1;
}

.skill-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #111;
    border-radius: 1.5px;
    margin-top: 2px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background-color: #f39c12;
    transition: width 0.3s ease;
}

.level-total {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #444;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.level-item:hover .skill-tooltip {
    opacity: 1;
}

/* Override the text styling for level items - but NOT tooltips */
.level-item > div:not(.skill-tooltip) {
    color: #FFD700 !important;
    font-size: 44px !important;
    font-family: 'Courier New', monospace !important;
    font-weight: normal !important;
}

.level-item {
    background-color: #222;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 230px;
    width: 230px;
}

.level-item:hover {
    background-color: #333;
}

/* Keep the existing tooltip behavior */
.level-item:hover .skill-tooltip {
    opacity: 1;
}

.level-icon {
    width: 50px;
    height: 50px;
}

/* Tasks Panel - NEW STYLES */

.task-section {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #333;
}

.task-section-header {
    font-size: 18px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.regular-tasks-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    background-color: #222;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

.task-item:hover {
    background-color: #2a2a2a;
}

.task-complete {
    opacity: 0.6;
}

.task-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    border-radius: 4px;
    padding: 4px;
}

.task-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.task-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.task-description {
    font-size: 16px;
    color: #FFD700;
    flex: 1;
    line-height: 1.3;
}

.task-reroll {
    padding: 14px 8px;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.task-reroll:hover {
    background-color: #666;
}

.task-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.task-progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #111;
    border-radius: 8px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Progress bar text overlay */
.progress-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    color: #FFD700;
    font-weight: bold;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.progress-text-left {
    text-align: left;
    min-width: 30px;
}

.progress-text-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.progress-text-right {
    text-align: right;
    min-width: 30px;
}

/* Level progress bar (green) */
.level-progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #111;
    border-radius: 8px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background-color: #27ae60;
    transition: width 0.3s ease;
}

.level-xp-text {
    text-align: center;
    color: #FFD700;
    font-size: 14px;
    margin-top: 4px;
}

/* Completed Tasks Modal */
.completed-tasks-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.completed-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #222;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #444;
}

.completed-task-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    border-radius: 4px;
    padding: 3px;
}

.completed-task-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Item count displays */
.item-count {
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 24px;
    color: #FFD700;
    padding: 1px 3px;
    border-radius: 2px;
    z-index: 10;
}

/* Bank Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    max-width: 1000px;
    width: 1000px;
    max-height: 1350px;
    height: 1350px;
    overflow-y: auto;
    top: 40px;
}

.modal-content h2 {
    color: #f39c12;
    margin-bottom: 20px;
    font-size: 40px;
}

.bank-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.bank-slot {
    width: 100px;
    height: 100px;
    background-color: #222;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.bank-slot:hover {
    border-color: #f39c12;
}

/* Shop Panel */
.shop-container {
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #444;
}

.shop-title {
    font-size: 24px;
    font-weight: bold;
    color: #f39c12;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-gold {
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
}

.shop-category {
    background: #222;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #444;
}

.shop-category-header {
    font-size: 18px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-item-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    min-height: 100px;
    padding-bottom: 12px;
}

/* Add divider between resource items */
.shop-category .shop-item-container:not(:last-child) {
    border-bottom: 1px solid #444;
    margin-bottom: 12px;
}

/* Remove divider from single-item categories */
.shop-category .shop-item-container:only-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.shop-column-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    flex: 0 0 120px;
    gap: 10px;
}

.shop-column-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.shop-right-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shop-item-icon {
    width: 64px;
    height: 64px;
    background: #333;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-icon-fallback {
    font-size: 20px;
    color: #888;
    font-weight: bold;
}

.shop-quantity-input {
    width: 100px;
    padding: 6px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    font-size: 16px;
}

.shop-quantity-input:focus {
    outline: none;
    border-color: #f39c12;
}

.shop-item-name {
    font-size: 18px;
    color: #fff;
    font-weight: bold;
}

.shop-item-price {
    font-size: 16px;
    color: #aaa;
}

.shop-item-price .price-amount {
    color: #FFD700;
    font-weight: bold;
}

.shop-item-price .price-range {
    color: #888;
    font-size: 14px;
    font-style: italic;
}

.shop-total-cost {
    font-size: 18px;
    color: #e74c3c;
    font-weight: bold;
    min-height: 22px;
}

.shop-buy-btn {
    padding: 8px 24px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    align-self: flex-start;
}

.shop-buy-btn:hover:not(:disabled) {
    background: #2ecc71;
    transform: translateY(-1px);
}

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

/* Universal modal close button (X) */
.modal-close-x,
.skill-customization-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 50px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3000;
    font-weight: bold;
}

.modal-close-x:hover,
.skill-customization-close:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Ensure modal content has proper positioning context */
.modal-content {
    position: relative;
}

.modal-close-x:active,
.skill-customization-close:active {
    transform: scale(0.95);
}

/* Developer Console - Split View */
.dev-console {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 500px;
    background-color: rgba(0, 0, 0, 0.95);
    border-top: 2px solid #f39c12;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    z-index: 30000;
}

.dev-console-split {
    display: flex;
    height: 100%;
}

/* Left side - Commands */
.dev-console-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #444;
}

/* Right side - Console Output */
.dev-console-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dev-console-header {
    height: 30px;
    padding: 0 10px;
    background-color: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    color: #f39c12;
    font-weight: bold;
    font-size: 13px;
}

.dev-console-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 12px;
}

.dev-console-entry {
    margin-bottom: 5px;
    line-height: 1.4;
}

.dev-console-normal {
    color: #fff;
}

.dev-console-info {
    color: #3498db;
}

.dev-console-success {
    color: #2ecc71;
}

.dev-console-error {
    color: #e74c3c;
}

.dev-console-command {
    color: #f39c12;
}

.dev-console-input-container {
    height: 40px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.dev-console-prompt {
    color: #f39c12;
    margin-right: 10px;
}

.dev-console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* Console Output Entries */
.console-output-entry {
    margin-bottom: 3px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.console-output-log {
    color: #ffffff;
}

.console-output-error {
    color: #ff6b6b;
    background-color: rgba(255, 0, 0, 0.1);
    padding: 2px 4px;
    border-left: 3px solid #ff0000;
}

.console-output-warn {
    color: #ffd93d;
    background-color: rgba(255, 217, 61, 0.1);
    padding: 2px 4px;
    border-left: 3px solid #ffd93d;
}

.console-output-info {
    color: #6bcf7f;
}

.console-output-debug {
    color: #888888;
    font-style: italic;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Skill Customization Overlay */
.skill-customization-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.skill-customization-container {
    width: 90%;
    height: 90%;
    background: #2c3e50;
    border: 2px solid #34495e;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.skill-customization-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.skill-customization-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #34495e;
}

.header-left {
    flex: 1;
}

.skill-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.skill-icon-large {
    width: 48px;
    height: 48px;
}

.skill-name {
    font-size: 44px;
    font-weight: bold;
    color: #ecf0f1;
}

.skill-stats {
    display: flex;
    gap: 40px;
    color: #95a5a6;
    font-size: 30px;
}

.header-right {
    text-align: right;
    margin-right: 60px;
}

/* Three-tier credit display */
.skill-cred-display {
    font-size: 44px;
    color: #FFD700;
    margin-bottom: 10px;
    font-weight: bold;
}

.skill-cred-display .cred-amount {
    font-weight: bold;
    color: #FFD700;
}

.other-credits {
    display: flex;
    gap: 30px;
    margin-bottom: 10px;
}

.secondary-cred {
    font-size: 28px;
    color: #95a5a6;
}

.secondary-cred .cred-amount-secondary {
    color: #ecf0f1;
    font-weight: bold;
}

.skill-tasks-completed {
    color: #95a5a6;
    font-size: 24px;
    font-style: italic;
}

.total-tasks {
    color: #95a5a6;
    font-size: 24px;
    display: none;  /* We're not showing this anymore */
}

.speed-bonuses {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.speed-bonus-title {
    font-size: 30px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.bonus-percent {
    color: #2ecc71;
    font-weight: bold;
    font-size: 30px;
    min-width: 84px;
}

.speed-bonus-list {
    display: inline-flex;
    gap: 30px;
    margin-left: 30px;
}

.speed-bonus-item {
    padding: 3px 8px;
    background: #2c3e50;
    border-radius: 3px;
    color: #7f8c8d;
    font-size: 30px;
}

.speed-bonus-item.active {
    background: #27ae60;
    color: white;
}

.skill-customization-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.customization-column {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
}

.customization-column h3 {
    margin: 0 0 15px 0;
    color: #ecf0f1;
    font-size: 30px;
}

.tasks-list, .nodes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 22px;
}

/* Base task and node row styles */
.task-row, .node-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #2c3e50;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

span.control-emoji {
    font-size: 22px;
}

/* Task info styling */
.task-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.task-level {
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    display: inline-block;
}

.task-level-has {
    color: #27ae60 !important; /* Green when player has the level */
}

.task-level-needs {
    color: #e74c3c !important; /* Red when player doesn't have the level */
}

.task-chance {
    color: #f39c12;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    display: inline-block;
}

.task-name {
    color: #ecf0f1;
}

.task-quantity {
    color: #95a5a6;
}

/* Node info styling */
.node-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    color: #ecf0f1;
}

.node-weight-display {
    color: #f39c12;
    font-weight: bold;
    min-width: 45px;
    text-align: center;
    display: inline-block;
    margin-right: 10px;
}

.node-name {
    flex: 1;
}

/* Control buttons */
.task-controls, .node-controls {
    display: flex;
    gap: 6px;
}

.control-button {
    width: 30px;
    height: 30px;
    border: 2px solid #7f8c8d;
    background: #2c3e50;
    color: #ecf0f1;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    font-size: 18px;
}

.control-button:hover {
    background: #34495e;
}

.control-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #1a1a1a;
}

.control-button.disabled:hover {
    background: #1a1a1a;
}

/* Modification level orbs */
.mod-orb-green, .mod-orb-red {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mod-orb-green {
    background: #27ae60;
    border: 1px solid #229954;
}

.mod-orb-red {
    background: #e74c3c;
    border: 1px solid #c0392b;
}

/* Unavailable items (greyed out) */
.task-row.unavailable,
.node-row.unavailable {
    opacity: 0.4;
}

.task-row.unavailable .task-name,
.node-row.unavailable .node-name {
    color: #7f8c8d;
}

.task-row.unavailable .task-chance {
    color: #555;
}

/* Hover behavior - NO background changes, NO opacity changes */
.task-row:hover,
.node-row:hover {
    /* Do not change background or opacity */
    /* Outline classes handle all visual feedback */
}

.task-row.unavailable:hover,
.node-row.unavailable:hover {
    opacity: 0.4; /* Maintain the same opacity */
    background: #2c3e50; /* Maintain the same background */
}

/* Hover outline classes (when hovering the item itself) */
.task-row.hover-outline-green,
.node-row.hover-outline-green {
    outline: 2px solid #27ae60 !important;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

.task-row.hover-outline-red,
.node-row.hover-outline-red {
    outline: 2px solid #e74c3c !important;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

/* Highlight outlines (when OTHER items are hovered) */
.task-row.green-outline,
.node-row.green-outline {
    outline: 2px solid #27ae60 !important;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

.task-row.red-outline,
.node-row.red-outline {
    outline: 2px solid #e74c3c !important;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

/* Utility class */
.spent-amount {
    display: none;
}

/* Skill Customization - Two Column Layout */
.skill-customization-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 20px;
}

/* Left Column - Completed Tasks */
.skill-customization-completed {
    width: 720px;
    background: #2c3e50;
    padding: 20px;
    border-right: 2px solid #34495e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.completed-tasks-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #34495e;
}

.completed-tasks-header h3 {
    margin: 0;
    color: #ecf0f1;
    font-size: 44px;
}

.completed-tasks-stats {
    background: #34495e;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.completed-stats-text {
    color: #f39c12;
    font-weight: bold;
    font-size: 30px;
    text-align: center;
}

.completed-tasks-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.completed-tasks-empty {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 10px;
    font-style: italic;
    font-size: 22px;
}

/* Single-line completed task display */
.completed-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #34495e;
    border-radius: 3px;
    margin-bottom: 6px;
    border: 1px solid #2c3e50;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.completed-task-row:hover {
    background: #3a4d63;
    border-color: #7f8c8d;
}

.completed-task-number {
    color: #f39c12;
    min-width: 60px;
    font-size: 22px;
}

.completed-task-skill-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.completed-task-skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.completed-task-separator {
    color: #7f8c8d;
    font-size: 22px;
    user-select: none;
}

.completed-task-description {
    flex: 1;
    color: #ecf0f1;
    font-size: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completed-task-time {
    color: #95a5a6;
    font-size: 22px;
    min-width: 60px;
    text-align: right;
}

/* Adjust main content to account for the completed tasks column */
.skill-customization-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Scrollbar styling for completed tasks */
.completed-tasks-scroll::-webkit-scrollbar {
    width: 6px;
}

.completed-tasks-scroll::-webkit-scrollbar-track {
    background: #2c3e50;
}

.completed-tasks-scroll::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 3px;
}

.completed-tasks-scroll::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* ==================== SKILL CUSTOMIZATION - GLOBAL MODE ==================== */

/* Capes and Pets Section */
.capes-and-pets-section {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.achievement-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.achievement-row:last-child {
    margin-bottom: 0;
}

.achievement-label {
    font-size: 30px;
    color: #ecf0f1;
    font-weight: bold;
    min-width: 140px;
}

.achievement-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}

.achievement-item {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    border-radius: 5px;
    padding: 5px;
    position: relative;
}

.achievement-item.achievement-cape {
    border: 2px solid #f39c12;
}

.achievement-item.achievement-pet {
    border: 2px solid #9b59b6;
}

.achievement-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.achievement-none {
    color: #7f8c8d;
    font-style: italic;
    font-size: 24px;
}

/* Three Column Skill Weights Layout */
.skill-weight-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.skill-weight-column {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-weight-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #2c3e50;
    border-radius: 3px;
}

.skill-weight-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.skill-weight-icon {
    width: 32px;
    height: 32px;
}

.skill-weight-name {
    color: #ecf0f1;
    font-size: 22px;
    flex: 1;
}

.skill-weight-level {
    color: #FFD700;
    font-weight: bold;
    font-size: 22px;
    min-width: 45px;
    text-align: center;
    display: inline-block;
    margin-right: 10px;
}

.skill-weight-percent {
    color: #f39c12;
    font-weight: bold;
    font-size: 22px;
    min-width: 50px;
    text-align: center;
    display: inline-block;
    margin-right: 10px;
}

.skill-weight-controls {
    display: flex;
    gap: 6px;
}

/* ==================== UNLOCK ITEMS (CAPES AND PETS) ==================== */

.unlock-item {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    border-radius: 5px;
    padding: 4px;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.unlock-item-placeholder {
    width: 40px;
    height: 40px;
    padding: 4px;
    margin: 0;
    border: 2px solid transparent;
    visibility: hidden;
}

.unlock-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
    border-color: #e74c3c;
}

.unlock-item.unlocked {
    opacity: 1;
    filter: none;
    border-color: #27ae60;
}

.unlock-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.unlock-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #7f8c8d;
    background: #1a1a1a;
    border-radius: 3px;
}

.pet-quantity {
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    padding: 0 3px;
    border-radius: 2px;
}

.unlock-tooltip {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #ecf0f1;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}

.unlock-item:hover .unlock-tooltip {
    opacity: 1;
}

/* ==================== SKILL HEADER ROW ==================== */

/* Special styling for the skill header row */
.skill-header-row {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #2c3e50;
}

/* Skill header icons - no locked/unlocked states */
.skill-header-icon {
    opacity: 1 !important;
    filter: none !important;
    border-color: transparent !important;
    background: #2c3e50;
    cursor: default;
}

.skill-header-icon:hover {
    border-color: #7f8c8d !important;
}

/* Make sure header icons align with the items below */
.skill-header-icon .unlock-image {
    opacity: 1;
    filter: none;
}

.skill-header-icon .unlock-fallback {
    opacity: 1;
    color: #ecf0f1;
}

/* ==================== SPEED BONUS IMAGES ==================== */

.speed-bonus-images {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-right: 15px;
    vertical-align: middle;
}

.speed-bonus-image-item {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    border-radius: 5px;
    padding: 4px;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.speed-bonus-image-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
    border-color: #e74c3c;
}

.speed-bonus-image-item.unlocked {
    opacity: 1;
    filter: none;
    border-color: #27ae60;
}

.speed-bonus-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.speed-bonus-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #7f8c8d;
    background: #1a1a1a;
    border-radius: 3px;
}

.speed-bonus-tooltip {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #ecf0f1;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}

.speed-bonus-image-item:hover .speed-bonus-tooltip {
    opacity: 1;
}

/* Update speed-bonus-title to be inline */
.speed-bonuses .speed-bonus-title {
    display: flex;
    align-items: center;
    font-size: 30px;
    flex-wrap: nowrap;
}

.speed-bonuses .bonus-percent {
    margin-left: 5px;
}

/* Add these styles to your CSS file for the skill customization updates */

/* Header rows for tasks and nodes */
.task-header-row, .node-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
    font-weight: bold;
}

.task-header-info, .node-header-info {
    flex: 1;
    color: #f39c12;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-header-controls {
    display: flex;
    gap: 40px; /* Space between Weight and Quantity columns */
    align-items: center;
}

.node-header-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-header-weight, .task-header-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px; /* Ensure consistent column width */
}

.header-icon {
    font-size: 22px;
    filter: grayscale(20%); /* Slightly mute the emoji colors */
}

.header-label {
    font-size: 22px;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Control button grouping */
.control-group {
    display: flex;
    gap: 6px;
}

.weight-group {
    margin-right: 30px; /* Space between weight and quantity groups */
}

.task-controls, .node-controls {
    display: flex;
    align-items: center;
}

/* Control button tooltips */
.control-button {
    position: relative;
}

.control-button-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 10px 12px;
    white-space: nowrap;
    z-index: 10000;
    display: none;
    pointer-events: none;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 24px;
}

.control-button:hover .control-button-tooltip {
    display: block;
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
}

.tooltip-header {
    color: #f39c12;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 26px;
}

.tooltip-effect {
    color: #95a5a6;
    margin-bottom: 5px;
}

.tooltip-cost {
    color: #e74c3c;
    font-weight: 600;
}

.tooltip-refund {
    color: #2ecc71;
    font-weight: 600;
}

.tooltip-disabled {
    color: #7f8c8d;
    font-style: italic;
}

/* Tooltip arrow pointing down */
.control-button-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* Update task row styling to align with new headers */
.task-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
}

.task-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ensure consistent spacing for percentage display */
.task-chance {
    min-width: 35px;
    text-align: right;
}

/* Selectable Task System */
.selectable-task .task-icon-container {
    position: relative;
    width: 64px;
    height: 64px;
    overflow: visible;
    z-index: 20; /* Ensure it renders above other elements */
}

.task-icons-wrapper {
    display: flex;
    gap: 8px;
    position: absolute;
    right: 0; /* Align to right edge */
    top: 0;
    z-index: 100; /* High z-index to render above panel edge */
    transition: all 0.2s ease;
    flex-direction: row-reverse; /* Right to left ordering */
}

/* Hide non-selected icons by default */
.task-icon-container:not(:hover) .task-icon-option:not(.selected) {
    display: none;
}

/* Show all icons on hover, expanding to the left */
.task-icon-container:hover .task-icons-wrapper {
    background: #1a1a1a;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    transform: translateX(0); /* No transform needed - stays right-aligned */
    flex-direction: row; /* Normal left-to-right when expanded */
}

.task-icon-container:hover .task-icon-option {
    display: flex !important;
}

.task-icon-option {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative; /* For quantity positioning */
}

.task-icon-option:hover {
    background-color: #444;
    border-color: #f39c12; /* Default fallback */
    transform: scale(1.1);
}

/* Skill-specific hover colors for task options */
.task-icon-option.task-skill-mining:hover { border-color: var(--skill-mining); }
.task-icon-option.task-skill-fishing:hover { border-color: var(--skill-fishing); }
.task-icon-option.task-skill-woodcutting:hover { border-color: var(--skill-woodcutting); }
.task-icon-option.task-skill-cooking:hover { border-color: var(--skill-cooking); }
.task-icon-option.task-skill-attack:hover { border-color: var(--skill-attack); }
.task-icon-option.task-skill-strength:hover { border-color: var(--skill-strength); }
.task-icon-option.task-skill-defence:hover { border-color: var(--skill-defence); }
.task-icon-option.task-skill-magic:hover { border-color: var(--skill-magic); }
.task-icon-option.task-skill-ranged:hover { border-color: var(--skill-ranged); }
.task-icon-option.task-skill-prayer:hover { border-color: var(--skill-prayer); }
.task-icon-option.task-skill-runecraft:hover { border-color: var(--skill-runecraft); }
.task-icon-option.task-skill-construction:hover { border-color: var(--skill-construction); }
.task-icon-option.task-skill-agility:hover { border-color: var(--skill-agility); }
.task-icon-option.task-skill-herblore:hover { border-color: var(--skill-herblore); }
.task-icon-option.task-skill-thieving:hover { border-color: var(--skill-thieving); }
.task-icon-option.task-skill-crafting:hover { border-color: var(--skill-crafting); }
.task-icon-option.task-skill-fletching:hover { border-color: var(--skill-fletching); }
.task-icon-option.task-skill-slayer:hover { border-color: var(--skill-slayer); }
.task-icon-option.task-skill-hunter:hover { border-color: var(--skill-hunter); }
.task-icon-option.task-skill-smithing:hover { border-color: var(--skill-smithing); }
.task-icon-option.task-skill-firemaking:hover { border-color: var(--skill-firemaking); }
.task-icon-option.task-skill-farming:hover { border-color: var(--skill-farming); }
.task-icon-option.task-skill-sailing:hover { border-color: var(--skill-sailing); }
.task-icon-option.task-skill-hitpoints:hover { border-color: #e74c3c; }

.task-icon-option.selected {
    background-color: #2a2a2a;
}

.task-icon-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Reroll button styling */
.task-icon-option.reroll-option {
    background-color: #555;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #777;
}

.task-icon-option.reroll-option:hover {
    background-color: #666;
    border-color: #f39c12;
    transform: scale(1.1);
}

/* Hide reroll button when not hovering (along with other non-selected) */
.task-icon-container:not(:hover) .reroll-option {
    display: none;
}

/* Task quantity badge */
.task-quantity-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    padding: 0 4px;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
    pointer-events: none; /* Don't interfere with clicking */
}

/* Also update the current/next task icon size */
.task-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    border-radius: 4px;
    padding: 4px;
    position: relative;
}

/* Add quantity badge to current/next tasks too */
.task-icon .task-quantity-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    padding: 0 4px;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
}

/* Skill-specific border colors for selected tasks */
.skill-border-mining { border: 2px solid var(--skill-mining) !important; }
.skill-border-fishing { border: 2px solid var(--skill-fishing) !important; }
.skill-border-woodcutting { border: 2px solid var(--skill-woodcutting) !important; }
.skill-border-cooking { border: 2px solid var(--skill-cooking) !important; }
.skill-border-attack { border: 2px solid var(--skill-attack) !important; }
.skill-border-strength { border: 2px solid var(--skill-strength) !important; }
.skill-border-defence { border: 2px solid var(--skill-defence) !important; }
.skill-border-magic { border: 2px solid var(--skill-magic) !important; }
.skill-border-ranged { border: 2px solid var(--skill-ranged) !important; }
.skill-border-prayer { border: 2px solid var(--skill-prayer) !important; }
.skill-border-runecraft { border: 2px solid var(--skill-runecraft) !important; }
.skill-border-construction { border: 2px solid var(--skill-construction) !important; }
.skill-border-agility { border: 2px solid var(--skill-agility) !important; }
.skill-border-herblore { border: 2px solid var(--skill-herblore) !important; }
.skill-border-thieving { border: 2px solid var(--skill-thieving) !important; }
.skill-border-crafting { border: 2px solid var(--skill-crafting) !important; }
.skill-border-fletching { border: 2px solid var(--skill-fletching) !important; }
.skill-border-slayer { border: 2px solid var(--skill-slayer) !important; }
.skill-border-hunter { border: 2px solid var(--skill-hunter) !important; }
.skill-border-smithing { border: 2px solid var(--skill-smithing) !important; }
.skill-border-firemaking { border: 2px solid var(--skill-firemaking) !important; }
.skill-border-farming { border: 2px solid var(--skill-farming) !important; }
.skill-border-sailing { border: 2px solid var(--skill-sailing) !important; }
.skill-border-hitpoints { border: 2px solid #e74c3c !important; }

/* Apply border to current and next task icons as well */
.task-icon.skill-border-mining,
.task-icon.skill-border-fishing,
.task-icon.skill-border-woodcutting,
.task-icon.skill-border-cooking,
.task-icon.skill-border-attack,
.task-icon.skill-border-strength,
.task-icon.skill-border-defence,
.task-icon.skill-border-magic,
.task-icon.skill-border-ranged,
.task-icon.skill-border-prayer,
.task-icon.skill-border-runecraft,
.task-icon.skill-border-construction,
.task-icon.skill-border-agility,
.task-icon.skill-border-herblore,
.task-icon.skill-border-thieving,
.task-icon.skill-border-crafting,
.task-icon.skill-border-fletching,
.task-icon.skill-border-slayer,
.task-icon.skill-border-hunter,
.task-icon.skill-border-smithing,
.task-icon.skill-border-firemaking,
.task-icon.skill-border-farming,
.task-icon.skill-border-sailing,
.task-icon.skill-border-hitpoints {
    border-radius: 4px;
}

/* Ensure task details don't jump when icons expand */
.selectable-task .task-details {
    margin-left: 0px; /* Account for larger icon width + gap */
}

/* Smooth transition for description changes */
.selectable-task .task-description {
    transition: opacity 0.1s ease;
}

/* Ensure the panel doesn't clip the expanded icons */
.ui-panel {
    overflow: visible;
}

.panel-content {
    overflow: visible;
}

#tasks-panel {
    overflow: visible;
}

.regular-tasks-container {
    position: relative;
    overflow: visible;
}

/* Login Screen Styles */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    width: 100%;
    max-width: 760px;
    width: 760px;
    padding: 20px;
}

.login-box {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 720px;
    min-width: 720px;
}

.game-title {
    text-align: center;
    color: #f39c12;
    font-size: 72px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
}

.login-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: #888;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-tab.active {
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
    margin-bottom: -2px;
}

.auth-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 36px;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: #f39c12;
    background: rgba(255, 255, 255, 0.15);
}

.username-hint {
    font-size: 24px;
    color: #888;
    margin-top: 5px;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.offline-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Account info in game */
.account-info {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    color: #fff;
    font-size: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-username {
    color: #f39c12;
    font-weight: bold;
    margin-right: 6px;
}

.logout-btn {
    background: #e74c3c;
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 36px;
}

.logout-btn:hover {
    background: #c0392b;
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(46, 204, 113, 0.9);
    padding: 10px 15px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    display: none;
    z-index: 1000;
}

.save-indicator.show {
    display: block;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.auth-success {
    color: #2ecc71;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

.logout-everywhere-btn {
    background: #f39c12;
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 32px;
    margin-right: 6px;
}

.logout-everywhere-btn:hover {
    background: #e67e22;
}

/* Login Background Canvas */
#login-background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind everything else */
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -o-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Ensure login container is above the canvas */
.login-container {
    position: relative;
    z-index: 1;
}

/* Hiscores Modal */
.hiscores-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.hiscores-content {
    background: #2c2416;
    border: 2px solid #5a4a3a;
    border-radius: 5px;
    width: 60%;
    height: 98%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.hiscores-layout {
    display: flex;
    height: 100%;
    padding: 20px;
    gap: 20px;
    font-size: 20px;
}

.hiscores-categories {
    width: 200px;
    background: #1a1611;
    border: 1px solid #3a3025;
    padding: 10px;
    overflow-y: auto;
}

.hiscores-leaderboard {
    flex: 1;
    background: #1a1611;
    border: 1px solid #3a3025;
    padding: 20px;
    overflow-y: auto;
}

.hiscores-controls {
    width: 250px;
    background: #1a1611;
    border: 1px solid #3a3025;
    padding: 10px;
}

.hiscores-title {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 18px;
}

.hiscores-category-item {
    padding: 8px;
    margin: 2px 0;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hiscores-category-item:hover {
    background: #2a2015;
}

.hiscores-category-item.active {
    background: #3a2520;
    color: #f39c12;
}

.category-icon {
    width: 20px;
    height: 20px;
}

.hiscores-leaderboard-title {
    color: #f39c12;
    text-align: center;
    margin-bottom: 20px;
}

.hiscores-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
}

.hiscores-table th {
    background: #2a2015;
    padding: 10px;
    text-align: left;
    color: #f39c12;
}

.hiscores-table td {
    padding: 8px;
    border-bottom: 1px solid #2a2015;
}

.hiscores-table tr:hover {
    background: #2a2015;
}

.hiscores-own-rank {
    background: #3a2520;
}

.hiscores-highlight {
    background: #4a3530 !important;
}

.hiscores-name {
    color: #5DADE2;
    cursor: pointer;
}

.hiscores-name:hover {
    text-decoration: underline;
}

.hiscores-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.hiscores-pagination button {
    padding: 5px 15px;
    background: #3a2520;
    border: 1px solid #5a4a3a;
    color: #ccc;
    cursor: pointer;
}

.hiscores-pagination button:hover {
    background: #4a3530;
}

.hiscores-search-section {
    margin-top: 120px;
}

.hiscores-search-section label {
    display: block;
    color: #f39c12;
    margin-bottom: 5px;
}

.hiscores-search-input {
    width: 100%;
    padding: 5px;
    background: #2a2015;
    border: 1px solid #3a3025;
    color: #ccc;
    margin-bottom: 5px;
    font-size: 20px;
}

.hiscores-search-btn {
    width: 100%;
    padding: 5px;
    background: #3a2520;
    border: 1px solid #5a4a3a;
    color: #ccc;
    cursor: pointer;
}

.hiscores-search-btn:hover {
    background: #4a3530;
}

.hiscores-your-rank-btn {
    width: 100%;
    padding: 10px;
    background: #f39c12;
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.hiscores-your-rank-btn:hover {
    background: #e67e22;
}

.hiscores-back-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #3a2520;
    border: 1px solid #5a4a3a;
    color: #ccc;
    cursor: pointer;
}

.hiscores-back-btn:hover {
    background: #4a3530;
}

.hiscores-compare-table td:nth-child(2),
.hiscores-compare-table td:nth-child(3) {
    font-weight: bold;
}

.hiscores-loading,
.hiscores-error {
    text-align: center;
    padding: 50px;
    color: #ccc;
    font-size: 18px;
}

/* Hiscores Title with Icon */
.hiscores-leaderboard-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.hiscores-title-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

/* Inline icons in tables */
.hiscores-skill-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hiscores-inline-icon {
    width: 20px;
    height: 20px;
}

/* Improved comparison table styles */
.hiscores-compare-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
    margin-bottom: 20px;
}

.hiscores-compare-table th {
    background: #2a2015;
    padding: 10px;
    text-align: left;
    color: #f39c12;
    font-size: 16px;
}

.hiscores-subheader th {
    background: #221a10;
    font-size: 14px;
    color: #999;
    padding: 5px 10px;
}

.hiscores-compare-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #2a2015;
    font-size: 14px;
}

.hiscores-compare-rank {
    font-weight: bold;
    min-width: 60px;
}

.hiscores-compare-value {
    min-width: 80px;
}

.hiscores-compare-winner {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

/* Comparison page styles */
.compare-player {
    display: inline-block;
    margin: 0 15px;
}

.compare-name {
    font-weight: bold;
}

.compare-tally {
    margin-left: 10px;
    font-size: 18px;
    font-weight: bold;
}

.compare-wins-losses {
    font-size: 16px;
    font-weight: normal;
}

.compare-vs {
    color: #999;
    margin: 0 10px;
}

.compare-loading {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Floating Current Task Display */
.floating-current-task {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    min-width: 500px;
    max-width: 500px;
}

/* Make sure all task styles work for floating task too */
.floating-current-task .task-item {
    margin: 0;
}

.floating-current-task .task-section-header {
    font-size: 18px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Floating task specific adjustments */
.floating-current-task .task-progress {
    margin-top: 10px;
}

.floating-current-task .task-item {
    padding: 12px;
}

.floating-current-task .task-details {
    flex: 1;
}

/* Ensure golden text color for all progress text */
.progress-bar-text span {
    color: #FFD700 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.level-xp-text {
    color: #FFD700 !important;
}

/* Make sure percentage is always centered in full bar */
.progress-text-center {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* XP Drops and Celebrations */
.xp-drops-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 34%;
    pointer-events: none;
    z-index: 100;
}

.xp-drop {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: xpDropAnimation 1.8s ease-out forwards;
}

.xp-drop-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.xp-drop-text {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
    white-space: nowrap;
}

@keyframes xpDropAnimation {
    0% {
        bottom: 0;
        opacity: 1;
    }
    66.67% {
        /* 1.2s of 1.8s = 66.67% */
        opacity: 1;
    }
    100% {
        bottom: 100%; /* Move to top of container */
        opacity: 0;
    }
}

/* Celebration Container */
.celebration-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 200;
    width: 1000px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Level Up Celebration */
.level-up-celebration {
    animation: celebrationPulse 3s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-title {
    font-size: 72px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 -3px 0 #000,
        0 3px 0 #000,
        -3px 0 0 #000,
        3px 0 0 #000,
        0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
    animation: levelUpGlow 1.5s ease-in-out infinite;
}

.celebration-skill-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.celebration-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.celebration-level {
    font-size: 48px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

/* Task Complete Celebration */
.task-complete-celebration {
    animation: celebrationSlide 2.5s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-complete {
    font-size: 48px;
    font-weight: bold;
    color: #2ecc71;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 0 15px rgba(46, 204, 113, 0.5);
}

/* Animations */
@keyframes celebrationPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    20% {
        transform: scale(1.2);
        opacity: 1;
    }
    40% {
        transform: scale(0.95);
    }
    60% {
        transform: scale(1.05);
    }
    80% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes celebrationSlide {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    20% {
        transform: translateY(0);
        opacity: 1;
    }
    80% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

@keyframes levelUpGlow {
    0%, 100% {
        text-shadow: 
            -3px -3px 0 #000,
            3px -3px 0 #000,
            -3px 3px 0 #000,
            3px 3px 0 #000,
            0 -3px 0 #000,
            0 3px 0 #000,
            -3px 0 0 #000,
            3px 0 0 #000,
            0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 
            -3px -3px 0 #000,
            3px -3px 0 #000,
            -3px 3px 0 #000,
            3px 3px 0 #000,
            0 -3px 0 #000,
            0 3px 0 #000,
            -3px 0 0 #000,
            3px 0 0 #000,
            0 0 40px rgba(255, 215, 0, 0.8);
    }
}

/* Fireworks */
.fireworks, .fireworks-small {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework-burst {
    position: absolute;
    width: 4px;
    height: 4px;
    animation: fireworkBurst 1.5s ease-out forwards;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #FFD700 0%, #FF6347 50%, transparent 100%);
    border-radius: 50%;
    animation: particleShoot 1.5s ease-out forwards;
}

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

@keyframes particleShoot {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100px) translateY(0);
        opacity: 0;
    }
}

.fireworks-small .firework-burst {
    animation-duration: 1.2s;
}

.fireworks-small .firework-particle {
    animation-duration: 1.2s;
    width: 3px;
    height: 3px;
}

.fireworks-small .firework-particle {
    animation-name: particleShootSmall;
}

@keyframes particleShootSmall {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(60px) translateY(0);
        opacity: 0;
    }
}

/* Additional Celebration Styles */
.cape-unlock-celebration {
    animation: celebrationPulse 3.5s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-cape-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 10px;
}

.celebration-unlock {
    font-size: 48px;
    font-weight: bold;
    color: #f39c12;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 0 15px rgba(243, 156, 18, 0.5);
}

.celebration-unlock-gold {
    font-size: 48px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 0 20px rgba(255, 215, 0, 0.8);
}

.pet-obtained-celebration {
    animation: petBounce 4s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-pet-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    animation: petSpin 2s ease-in-out;
}

.celebration-pet {
    font-size: 48px;
    font-weight: bold;
    color: #9b59b6;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 0 15px rgba(155, 89, 182, 0.5);
}

.celebration-pet-shiny {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8);
    animation: rainbowShift 2s linear infinite;
}

.max-cape-celebration {
    animation: maxCelebration 5s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-congrats {
    font-size: 60px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 20px;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 -3px 0 #000,
        0 3px 0 #000,
        -3px 0 0 #000,
        3px 0 0 #000;
}

.celebration-congrats-big {
    font-size: 72px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 -3px 0 #000,
        0 3px 0 #000,
        -3px 0 0 #000,
        3px 0 0 #000,
        0 0 30px rgba(255, 215, 0, 0.8);
    animation: levelUpGlow 1.5s ease-in-out infinite;
}

.celebration-congrats-rainbow {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: rainbowShift 1s linear infinite;
}

.celebration-max-cape-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.celebration-max {
    font-size: 60px;
    font-weight: bold;
    color: #e74c3c;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 -3px 0 #000,
        0 3px 0 #000,
        -3px 0 0 #000,
        3px 0 0 #000,
        0 0 25px rgba(231, 76, 60, 0.8);
}

.celebration-max-gold {
    font-size: 60px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 -3px 0 #000,
        0 3px 0 #000,
        -3px 0 0 #000,
        3px 0 0 #000,
        0 0 30px rgba(255, 215, 0, 1);
}

.celebration-why {
    font-size: 36px;
    color: #95a5a6;
    font-style: italic;
    margin-top: 30px;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

/* Special Animations */
@keyframes petBounce {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    20% { transform: scale(1.3) rotate(360deg); opacity: 1; }
    40% { transform: scale(0.9) rotate(350deg); }
    60% { transform: scale(1.1) rotate(370deg); }
    80% { transform: scale(1) rotate(360deg); opacity: 1; }
    100% { transform: scale(1) rotate(360deg); opacity: 0; }
}

@keyframes petSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(720deg); }
}

@keyframes maxCelebration {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    20% { transform: scale(1.2) rotate(20deg); opacity: 1; }
    30% { transform: scale(0.95) rotate(-10deg); }
    40% { transform: scale(1.05) rotate(5deg); }
    50% { transform: scale(1) rotate(0deg); }
    90% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 0; }
}

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

/* Special Fireworks */
.fireworks-cape .firework-particle {
    background: radial-gradient(circle, #f39c12 0%, #FFD700 50%, transparent 100%);
}

.fireworks-shiny .firework-particle {
    background: radial-gradient(circle, #ff0000 0%, #00ff00 25%, #0000ff 50%, #ffff00 75%, transparent 100%);
    animation: particleShootRainbow 1.5s ease-out forwards;
}

.fireworks-epic {
    animation: epicPulse 3s ease-out;
}

.fireworks-epic .firework-burst {
    animation-duration: 2s;
}

.fireworks-epic .firework-particle {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #FFD700 0%, #FF6347 30%, #9400d3 60%, transparent 100%);
    animation: particleShootEpic 2s ease-out forwards;
}

@keyframes particleShootRainbow {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
        filter: hue-rotate(0deg);
    }
    100% {
        transform: translateX(120px) translateY(0);
        opacity: 0;
        filter: hue-rotate(360deg);
    }
}

@keyframes particleShootEpic {
    0% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(150px) translateY(0) scale(0.5);
        opacity: 0;
    }
}

@keyframes epicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Clue scroll styles */
.clue-slot {
    position: relative;
}

.clue-complete {
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
    100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
}

.clue-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #5a4a3a;
    padding: 10px;
    min-width: 400px;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    font-size: 24px;
    margin-bottom: 5px;
    max-height: 300px;
    overflow-y: auto;
}

/* If tooltip would go above screen, show it below instead */
.bank-slot:nth-child(-n+16) .clue-tooltip {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 5px;
}

/* Task Clue Indicator */
.task-clue-indicator {
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 40px;
    height: 40px;
    z-index: 15;
}

.task-clue-indicator img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bank-slot:hover .clue-tooltip {
    opacity: 1;
}

.clue-tooltip-title {
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 8px;
    font-size: 16px;
}

.clue-complete-text {
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 8px;
}

.clue-steps-header {
    color: #888;
    margin-bottom: 5px;
}

.clue-steps-list {
    color: #fff;
}

.clue-step {
    margin: 3px 0;
}

.step-complete {
    color: #4CAF50;
    font-weight: bold;
    margin-right: 5px;
}

.step-incomplete {
    color: #f44336;
    font-weight: bold;
    margin-right: 5px;
}

.casket-slot {
    cursor: pointer;
}

.casket-slot:hover {
    border-color: #f39c12;
}

/* Clue obtained celebration */
.clue-obtained-celebration {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10000;
    animation: celebrationFadeIn 0.5s ease-out;
}

.celebration-clue-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(243, 156, 18, 0.6));
    animation: bounce 0.5s ease-out;
}

.celebration-clue {
    font-size: 28px;
    font-weight: bold;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: block;
    animation: slideUp 0.5s ease-out;
}

@keyframes bounce {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 0;
    z-index: 10000;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
    padding: 8px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: #3a3a3a;
}

/* Clue Step Overlay */
.clue-step-overlay {
    position: absolute;
    top: 2px;
    left: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.clue-step-indicator {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.step-indicator-complete {
    color: #4CAF50;
}

.step-indicator-incomplete {
    color: #f44336;
}

/* Clue Celebrations */
.clue-step-celebration {
    animation: celebrationSlide 2s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-clue-step {
    font-size: 36px;
    font-weight: bold;
    color: #5DADE2;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000;
}

.clue-complete-celebration {
    animation: celebrationPulse 3s ease-out forwards;
    text-align: center;
    z-index: 201;
}

.celebration-casket-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(243, 156, 18, 0.8));
}

.celebration-clue-complete {
    font-size: 42px;
    font-weight: bold;
    color: #f39c12;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 0 20px rgba(243, 156, 18, 0.6);
}

/* Floating Completed Clues Display */
.floating-completed-clues {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.floating-clue-item {
    width: 128px;
    height: 128px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.floating-clue-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
}

.floating-clue-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes pulseClue {
    0% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
    100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
}

/* Tooltip for floating clues */
.floating-clue-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #5a4a3a;
    padding: 10px;
    min-width: 200px;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    font-size: 14px;
    white-space: nowrap;
}

.floating-clue-item:hover .floating-clue-tooltip {
    opacity: 1;
}

.floating-clue-tooltip-title {
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Casket Rewards Modal */
.casket-rewards-content {
    max-width: 800px;
    width: 800px;
    max-height: 600px;
    height: auto;
}

.casket-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 40px;
    color: #FFD700;
}

.casket-header-icon {
    width: 64px;
    height: 64px;
}

.casket-rewards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    min-height: 200px;
    justify-items: center;
}

/* Match bank slot sizing exactly */
.casket-reward-slot {
    width: 100px;
    height: 100px;
    background-color: #222;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
}

/* Keep the highlight animation */
.casket-reward-slot.highlight {
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.5);
    animation: rewardPulse 0.5s ease-out;
}

@keyframes rewardPulse {
    0% { 
        transform: scale(0.8); 
        opacity: 0;
    }
    50% { 
        transform: scale(1.1);
    }
    100% { 
        transform: scale(1); 
        opacity: 1;
    }
}

/* Floating Pet Notifications */
.floating-pet-notifications {
    position: fixed;
    top: 20px;
    left: 170px; /* Positioned to the right of clues */
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.floating-pet-item {
    width: 128px;
    height: 128px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.floating-pet-item.pet-regular {
    border: 2px solid #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.floating-pet-item.pet-shiny {
    border: 2px solid #FF69B4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

.floating-pet-item:hover {
    transform: scale(1.1);
}

.floating-pet-item.pet-regular:hover {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
}

.floating-pet-item.pet-shiny:hover {
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}

.floating-pet-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tooltip for floating pets */
.floating-pet-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #5a4a3a;
    padding: 10px;
    min-width: 200px;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    font-size: 14px;
    white-space: nowrap;
}

.floating-pet-item:hover .floating-pet-tooltip {
    opacity: 1;
}

.floating-pet-tooltip-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.floating-pet-item.pet-regular .floating-pet-tooltip-title {
    color: #4CAF50;
}

.floating-pet-item.pet-shiny .floating-pet-tooltip-title {
    color: #FF69B4;
}

/* Task history pet icons and borders */
.completed-task-pet-icon,
.completed-task-pet-icon-empty {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.completed-task-pet-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.completed-task-row.pet-task-regular {
    border-left: 3px solid #4CAF50;
    padding-left: 7px;
    margin-left: -10px;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), transparent 100px);
}

.completed-task-row.pet-task-shiny {
    border-left: 3px solid #FF69B4;
    padding-left: 7px;
    margin-left: -10px;
    background: linear-gradient(90deg, rgba(255, 105, 180, 0.1), transparent 100px);
}

/* Reroll button tooltips */
.task-reroll {
    position: relative;
}

.reroll-option {
    position: relative;
}

.reroll-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px;
    min-width: 500px;
    display: none;
    z-index: 1000;
    font-size: 28px;
    pointer-events: none;
    margin-bottom: 4px;
}

.small-reroll-tooltip {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

.task-reroll:hover .reroll-tooltip,
.reroll-option:hover .reroll-tooltip {
    display: block;
}

.reroll-tooltip-header {
    color: #fff;
    font-weight: bold;
    margin-bottom: 4px;
}

.reroll-tooltip-cost {
    color: #ffd700;
    margin-bottom: 4px;
}

.reroll-tooltip-balance {
    color: #2ecc71;
    font-size: 24px;
}

.reroll-tooltip-balance.insufficient {
    color: #e74c3c;
}

.task-reroll.disabled,
.reroll-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.task-reroll.disabled:hover,
.reroll-option.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Auto-save timer display */
.auto-save-timer {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    z-index: 999;
    font-family: 'Courier New', monospace;
    min-width: 300px;
}

.save-timer-line {
    margin: 3px 0;
}

#last-save-time, #next-save-time {
    color: #f39c12;
    font-weight: bold;
}

#last-save-status {
    margin-left: 5px;
}

.save-success {
    color: #2ecc71;
}

.save-failed {
    color: #e74c3c;
}
