/* Old School RuneScape Tithe Farm Herb Cascade Styling */

:root {
    --osrs-bg: #071206;
    --osrs-stone-dark: #162413;
    --osrs-stone-med: #24381f;
    --osrs-stone-light: #36542e;
    --osrs-border-outer: #030802;
    --osrs-border-light: #4c7741;
    --osrs-border-dark: #0f1c0d;
    --osrs-gold: #ffb833;
    --osrs-yellow: #ffff00;
    --osrs-green: #00ff00;
    --osrs-cyan: #00ffff;
    --osrs-red: #ff3333;
    --osrs-orange: #ff981a;
    --osrs-leaf: #76ff03;
    --osrs-font-pixel: 'Press Start 2P', monospace;
    --osrs-font-retro: 'VT323', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--osrs-bg);
    color: #e2f2de;
    font-family: var(--osrs-font-retro);
    font-size: 19px;
    line-height: 1.2;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(76, 175, 80, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(46, 125, 50, 0.12) 0%, transparent 50%);
}

.osrs-app-wrapper {
    width: 100%;
    max-width: 980px;
    background: var(--osrs-stone-dark);
    border: 3px solid var(--osrs-border-outer);
    box-shadow: 
        inset 2px 2px 0px var(--osrs-border-light),
        inset -2px -2px 0px var(--osrs-border-dark),
        0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

/* Header */
.osrs-header {
    background: linear-gradient(180deg, #2b4523 0%, #152912 100%);
    border-bottom: 2px solid var(--osrs-border-outer);
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.osrs-btn {
    font-family: var(--osrs-font-pixel);
    font-size: 10px;
    color: #ffeedd;
    background: linear-gradient(180deg, #3d6632 0%, #203b1a 100%);
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0px #5c994c, inset -1px -1px 0px #11240d;
    padding: 7px 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 0 #000;
    transition: filter 0.1s;
}

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

.osrs-btn:active {
    box-shadow: inset -1px -1px 0px #5c994c, inset 1px 1px 0px #11240d;
    transform: translateY(1px);
}

.osrs-btn:disabled {
    filter: grayscale(0.8) brightness(0.6);
    cursor: not-allowed;
}

.back-hub-btn {
    background: linear-gradient(180deg, #384234 0%, #1a2418 100%);
    border-color: #081206;
}

/* Skill Badge */
.skill-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111f0e;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #3b5c32, inset -1px -1px 0 #070d06;
    padding: 4px 8px;
}

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

.skill-info {
    display: flex;
    flex-direction: column;
}

.skill-title {
    font-family: var(--osrs-font-pixel);
    font-size: 8px;
    color: #a5d6a7;
}

.skill-lvl {
    font-family: var(--osrs-font-pixel);
    font-size: 12px;
    color: var(--osrs-yellow);
}

/* XP Bar */
.xp-container {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.xp-bar-bg {
    width: 100%;
    height: 12px;
    background: #091407;
    border: 1px solid #000;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.8);
    position: relative;
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #76ff03 0%, #2e7d32 100%);
    transition: width 0.2s ease;
}

.xp-text {
    font-size: 13px;
    color: #c8e6c9;
    white-space: nowrap;
}

/* GP Pouch */
.coins-pouch {
    background: #111f0e;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #3b5c32;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--osrs-font-pixel);
    font-size: 11px;
}

.gp-yellow {
    color: var(--osrs-yellow);
    text-shadow: 1px 1px 0 #000;
}

/* Speed Controls */
.speed-controls {
    display: flex;
    gap: 2px;
}

.speed-btn {
    font-family: var(--osrs-font-pixel);
    font-size: 9px;
    background: #1a2e16;
    color: #9cb897;
    border: 1px solid #000;
    padding: 5px 8px;
    cursor: pointer;
}

.speed-btn.active {
    background: #43a047;
    color: #fff;
    font-weight: bold;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px;
}

@media (max-width: 820px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
}

/* Canvas Board Column */
.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Special Attack Bar */
.spec-bar-wrapper {
    width: 100%;
    max-width: 460px;
}

.spec-btn {
    width: 100%;
    height: 32px;
    background: #111f0e;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #3b5c32, inset -1px -1px 0 #070d06;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.spec-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #ffd700 0%, #ff8f00 100%);
    transition: width 0.15s ease;
}

.spec-btn.active .spec-bar-fill {
    background: linear-gradient(180deg, #ffff8d 0%, #ffd600 100%);
    animation: specPulse 0.4s infinite alternate;
}

@keyframes specPulse {
    from { filter: brightness(1.0); }
    to { filter: brightness(1.4); }
}

.spec-text {
    position: relative;
    z-index: 2;
    font-family: var(--osrs-font-pixel);
    font-size: 10px;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    line-height: 28px;
}

.canvas-wrapper {
    position: relative;
    width: 460px;
    height: 670px;
    background: #000;
    border: 3px solid #000;
    box-shadow: inset 2px 2px 0 #3b5c32, inset -2px -2px 0 #070d06;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.click-hint {
    position: absolute;
    bottom: 34px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--osrs-font-pixel);
    font-size: 8px;
    color: rgba(200, 245, 180, 0.75);
    pointer-events: none;
    text-shadow: 1px 1px 1px #000;
}

.prestige-btn {
    width: 100%;
    max-width: 460px;
    font-family: var(--osrs-font-pixel);
    font-size: 10px;
    padding: 10px;
    background: linear-gradient(180deg, #ffb833 0%, #cc7a00 100%);
    color: #120902;
    border: 2px solid #000;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 14px rgba(255, 184, 51, 0.5);
}

.prestige-btn.hidden {
    display: none;
}

/* Sidebar Column */
.osrs-sidebar {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #172614;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #416138, inset -1px -1px 0 #0a1208;
    height: 712px;
}

.tab-buttons {
    display: flex;
    background: #0f1a0d;
    border-bottom: 2px solid #000;
}

.tab-btn {
    flex: 1;
    font-family: var(--osrs-font-pixel);
    font-size: 9px;
    padding: 10px 4px;
    background: #1a2e16;
    color: #a5c79e;
    border: none;
    border-right: 1px solid #000;
    cursor: pointer;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn.active {
    background: #2d4c27;
    color: #ffd700;
    box-shadow: inset 0 2px 0 #76ff03;
}

.tab-pane {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

.pane-header {
    background: #233b1e;
    padding: 8px 12px;
    font-family: var(--osrs-font-pixel);
    font-size: 10px;
    color: #ffd700;
    border-bottom: 1px solid #000;
    text-shadow: 1px 1px 0 #000;
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Custom Scrollbar */
.scroll-content::-webkit-scrollbar {
    width: 8px;
}

.scroll-content::-webkit-scrollbar-track {
    background: #0f1a0d;
}

.scroll-content::-webkit-scrollbar-thumb {
    background: #35572d;
    border: 1px solid #000;
}

/* Upgrade Cards */
.upgrade-card, .gear-card {
    background: #1d301b;
    border: 1px solid #000;
    box-shadow: inset 1px 1px 0 #3e6338;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gear-card.equipped {
    border-color: #ffd700;
    background: #254021;
}

.upgrade-icon, .gear-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.upgrade-info, .gear-info {
    flex: 1;
}

.upgrade-title, .gear-title {
    font-family: var(--osrs-font-pixel);
    font-size: 9px;
    color: #fff;
    margin-bottom: 4px;
}

.tag-eq {
    color: #00ff00;
    font-size: 8px;
}

.upgrade-desc, .gear-desc {
    font-size: 15px;
    color: #c0dec0;
    margin-bottom: 4px;
    line-height: 1.1;
}

.upgrade-cost {
    font-family: var(--osrs-font-pixel);
    font-size: 8px;
}

.gear-req {
    font-size: 14px;
    color: #69f0ae;
}

.req-unmet {
    color: #ff5555;
}

.can-afford {
    color: var(--osrs-green);
}

.cant-afford {
    color: var(--osrs-red);
}

.buy-btn, .equip-btn, .equipped-btn {
    font-size: 8px;
    padding: 6px 8px;
    flex-shrink: 0;
}

.equip-btn {
    background: linear-gradient(180deg, #3366cc 0%, #153366 100%);
}

.equipped-btn {
    background: #142e18;
    color: #66cc66;
    cursor: default;
}

.section-title {
    font-family: var(--osrs-font-pixel);
    font-size: 10px;
    color: #ffd700;
    margin-bottom: 6px;
}

/* Stats / Log Pane */
.stats-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: #111f0e;
    border-bottom: 1px solid #233b1e;
    font-size: 16px;
}

.stat-val {
    font-family: var(--osrs-font-pixel);
    font-size: 9px;
    color: #fff;
}

/* Settings */
.settings-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.setting-item h4 {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 6px;
}

.setting-item p {
    color: #b0cbb0;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 6px;
}

.danger-btn {
    background: linear-gradient(180deg, #cc2929 0%, #661414 100%);
    color: #fff;
    margin-top: 10px;
}

/* Level Up Announcement Modal */
.level-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: #1f331b;
    border: 3px solid #000;
    box-shadow: 
        inset 2px 2px 0 #568c4d,
        inset -2px -2px 0 #0d170b,
        0 10px 40px rgba(0, 0, 0, 0.9);
    padding: 18px 24px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    text-align: center;
    max-width: 400px;
}

.level-modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.level-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.level-modal-header h3 {
    font-family: var(--osrs-font-pixel);
    font-size: 14px;
    color: var(--osrs-yellow);
}

.level-modal-body {
    font-size: 18px;
    color: #fff;
    line-height: 1.3;
}
