/* Old School RuneScape Blast Furnace Bar Melter Styling */

:root {
    --osrs-bg: #0f0a06;
    --osrs-stone-dark: #1f140e;
    --osrs-stone-med: #301f15;
    --osrs-stone-light: #482e20;
    --osrs-border-outer: #080402;
    --osrs-border-light: #704732;
    --osrs-border-dark: #120b07;
    --osrs-gold: #ffb833;
    --osrs-yellow: #ffff00;
    --osrs-green: #76ff03;
    --osrs-orange: #ff9800;
    --osrs-red: #ff3d00;
    --osrs-cyan: #00e5ff;
    --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: #f0e2d8;
    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(255, 87, 34, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255, 152, 0, 0.1) 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, #422618 0%, #21120a 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, #5c3420 0%, #2e170c 100%);
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0px #874f32, inset -1px -1px 0px #170a04;
    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 #874f32, inset 1px 1px 0px #170a04;
    transform: translateY(1px);
}

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

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

/* Skill Badge */
.skill-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #170e08;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543422, inset -1px -1px 0 #080402;
    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: #ffb74d;
}

.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: #120b06;
    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, #ff9800 0%, #e65100 100%);
    transition: width 0.2s ease;
}

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

/* GP Pouch */
.coins-pouch {
    background: #170e08;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543422;
    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: #2b1a11;
    color: #c7a491;
    border: 1px solid #000;
    padding: 5px 8px;
    cursor: pointer;
}

.speed-btn.active {
    background: #b25825;
    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: #170e08;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543422, inset -1px -1px 0 #080402;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

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

.spec-btn.active .spec-bar-fill {
    background: linear-gradient(180deg, #ffff00 0%, #ff9100 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 #543422, inset -2px -2px 0 #080402;
}

#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(255, 204, 128, 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: #1c140e;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543422, inset -1px -1px 0 #0a0604;
    height: 712px;
}

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

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

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

.tab-btn.active {
    background: #422819;
    color: #ffd700;
    box-shadow: inset 0 2px 0 #ff9800;
}

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

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

.pane-header {
    background: #331e13;
    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: #120a06;
}

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

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

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

.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: #d7ccc8;
    margin-bottom: 4px;
    line-height: 1.1;
}

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

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

.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: #2e1a14;
    color: #ffab91;
    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: #170e08;
    border-bottom: 1px solid #2d1a10;
    font-size: 16px;
}

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

/* Forged Ingot Vault Showcase */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.collection-item {
    background: #170e08;
    border: 1px solid #2d1a10;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.collection-item.collected {
    border-color: #ffd700;
    background: #2b160b;
}

.collection-item.uncollected {
    opacity: 0.45;
    filter: grayscale(1.0);
}

.col-icon {
    font-size: 16px;
}

.col-details {
    flex: 1;
    overflow: hidden;
}

.col-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffe8d6;
    font-weight: bold;
    font-size: 14px;
}

.col-sub {
    font-family: var(--osrs-font-pixel);
    font-size: 8px;
    color: #cca483;
}

.col-count {
    font-family: var(--osrs-font-pixel);
    font-size: 8px;
    color: #ffd700;
}

/* 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: #c7a491;
    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: #2b1a11;
    border: 3px solid #000;
    box-shadow: 
        inset 2px 2px 0 #73452c,
        inset -2px -2px 0 #100a06,
        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;
}
