/* Old School RuneScape The Abyss Altar Siphon Styling */

:root {
    --osrs-bg: #09030e;
    --osrs-stone-dark: #1b1024;
    --osrs-stone-med: #2a1a38;
    --osrs-stone-light: #3e2752;
    --osrs-border-outer: #050208;
    --osrs-border-light: #643b87;
    --osrs-border-dark: #160a21;
    --osrs-gold: #ffb833;
    --osrs-yellow: #ffff00;
    --osrs-green: #00ff00;
    --osrs-cyan: #00ffff;
    --osrs-red: #ff3333;
    --osrs-orange: #ff981a;
    --osrs-purple: #bf55ec;
    --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: #e6daf2;
    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(138, 43, 226, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(75, 0, 130, 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, #371f4f 0%, #1e0e2d 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, #5c3577 0%, #2f1742 100%);
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0px #8f5cb5, inset -1px -1px 0px #1a0826;
    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 #8f5cb5, inset 1px 1px 0px #1a0826;
    transform: translateY(1px);
}

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

.back-hub-btn {
    background: linear-gradient(180deg, #44324f 0%, #1f1426 100%);
    border-color: #0b0512;
}

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

.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: #11071c;
    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, #d279ff 0%, #7b1fa2 100%);
    transition: width 0.2s ease;
}

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

/* GP Pouch */
.coins-pouch {
    background: #160a24;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #56336e;
    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: #241433;
    color: #a48bbd;
    border: 1px solid #000;
    padding: 5px 8px;
    cursor: pointer;
}

.speed-btn.active {
    background: #6e2da8;
    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: #190a29;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #5f2c82, inset -1px -1px 0 #0c0314;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

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

.spec-btn.active .spec-bar-fill {
    background: linear-gradient(180deg, #ff99ff 0%, #ff00cc 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 #56336e, inset -2px -2px 0 #11051b;
}

#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(220, 180, 255, 0.7);
    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: #1e112a;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #593774, inset -1px -1px 0 #0d0514;
    height: 712px;
}

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

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

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

.tab-btn.active {
    background: #3e2259;
    color: #ffd700;
    box-shadow: inset 0 2px 0 #bf55ec;
}

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

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

.pane-header {
    background: #2d1840;
    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: #140b1c;
}

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

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

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

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

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

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

.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: #1a2e1a;
    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: #170b24;
    border-bottom: 1px solid #2b163f;
    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: #baa3d0;
    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: #2a163d;
    border: 3px solid #000;
    box-shadow: 
        inset 2px 2px 0 #7b3ba8,
        inset -2px -2px 0 #12061c,
        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;
}
