/* Old School RuneScape Karamja Harpoon Pachinko Styles */

:root {
    --osrs-bg: #09131c;
    --osrs-stone: #1f2a36;
    --osrs-stone-light: #2c3e50;
    --osrs-stone-dark: #101822;
    --osrs-border-light: #3d556e;
    --osrs-border-dark: #0b121a;
    --osrs-yellow: #ffff00;
    --osrs-gold: #ffb833;
    --osrs-ocean-cyan: #4de1ff;
    --osrs-green: #00ff00;
}

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

body {
    background-color: var(--osrs-bg);
    color: #e6dfd3;
    font-family: 'Press Start 2P', monospace, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(#122c42 15%, transparent 16%), radial-gradient(#091724 15%, transparent 16%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    overflow-x: hidden;
    padding: 10px;
}

/* App Outer Frame */
.osrs-app-wrapper {
    width: 100%;
    max-width: 980px;
    background-color: var(--osrs-stone);
    border: 4px solid;
    border-color: var(--osrs-border-light) var(--osrs-border-dark) var(--osrs-border-dark) var(--osrs-border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-badge {
    display: flex;
    align-items: center;
    background-color: var(--osrs-stone-dark);
    border: 2px solid;
    border-color: var(--osrs-border-dark) var(--osrs-border-light) var(--osrs-border-light) var(--osrs-border-dark);
    padding: 4px 8px;
    gap: 6px;
}

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

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

.skill-title {
    font-size: 8px;
    color: #9cb9d6;
}

.skill-lvl {
    font-size: 13px;
    color: var(--osrs-ocean-cyan);
    font-weight: bold;
}

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

.xp-bar-bg {
    width: 100%;
    height: 10px;
    background-color: #0c151f;
    border: 1px solid var(--osrs-border-light);
    position: relative;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2394b8, #4de1ff);
    transition: width 0.2s ease-out;
}

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

/* GP Coins Display */
.header-center {
    display: flex;
    align-items: center;
}

.coins-pouch {
    background-color: #101924;
    border: 2px solid;
    border-color: var(--osrs-border-dark) var(--osrs-border-light) var(--osrs-border-light) var(--osrs-border-dark);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.coins-pouch .val {
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px #000;
}

.gp-yellow { color: #ffff00; }
.gp-white  { color: #ffffff; }
.gp-green  { color: #00ff00; }

/* Right Controls */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-controls {
    display: flex;
    background-color: var(--osrs-stone-dark);
    border: 1px solid var(--osrs-border-dark);
}

.speed-btn {
    font-family: inherit;
    font-size: 9px;
    background: none;
    border: none;
    color: #9cb9d6;
    padding: 6px 9px;
    cursor: pointer;
}

.speed-btn.active {
    background-color: #3b5c7a;
    color: var(--osrs-ocean-cyan);
    font-weight: bold;
}

/* OSRS Retro Buttons */
.osrs-btn {
    font-family: inherit;
    font-size: 9px;
    background-color: #2b3e52;
    color: #f5eedf;
    text-decoration: none;
    border: 2px solid;
    border-color: #496887 #121c26 #121c26 #496887;
    padding: 6px 10px;
    cursor: pointer;
    text-shadow: 1px 1px #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background-color 0.1s;
}

.back-hub-btn {
    font-size: 8px;
    padding: 4px 7px;
}

.osrs-btn:hover {
    background-color: #37506b;
}

.osrs-btn:active {
    border-color: #121c26 #496887 #496887 #121c26;
    transform: translateY(1px);
}

/* Main Split Content */
.main-content {
    display: flex;
    flex-direction: row;
    height: 740px;
    background-color: #111e29;
}

/* Board Column */
.game-board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 8px;
    border-right: 3px solid var(--osrs-border-dark);
}

/* Spec Bar */
.spec-bar-wrapper {
    width: 100%;
    max-width: 460px;
    margin-bottom: 6px;
}

.spec-btn {
    font-family: inherit;
    width: 100%;
    height: 26px;
    background-color: #0e2938;
    border: 2px solid;
    border-color: #1f648a #06161f #06161f #1f648a;
    position: relative;
    overflow: hidden;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #4de1ff 0%, #15739c 100%);
    transition: width 0.15s ease-out;
    opacity: 0.6;
}

.spec-text {
    position: relative;
    z-index: 2;
    font-size: 9px;
    color: #d1f4ff;
    text-shadow: 1px 1px #000;
}

.spec-btn.ready {
    cursor: pointer;
    animation: specPulse 1.2s infinite;
}

.spec-btn.ready .spec-bar-fill {
    opacity: 0.95;
}

.spec-btn.ready .spec-text {
    color: #ffffff;
    font-weight: bold;
}

.spec-btn.active {
    background-color: #175e52;
    border-color: #00ffd5 #082924 #082924 #00ffd5;
    animation: superAqua 0.4s infinite alternate;
}

.spec-btn.active .spec-bar-fill {
    background: linear-gradient(180deg, #00ffd5 0%, #0d967e 100%);
}

@keyframes specPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

@keyframes superAqua {
    0% { box-shadow: 0 0 6px #00ffd5; }
    100% { box-shadow: 0 0 16px #4de1ff; }
}

/* Canvas Area */
.canvas-wrapper {
    position: relative;
    width: 460px;
    height: 670px;
    background-color: #06121c;
    border: 3px solid;
    border-color: var(--osrs-border-dark) var(--osrs-border-light) var(--osrs-border-light) var(--osrs-border-dark);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

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

.click-hint {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 38, 0.85);
    border: 1px solid var(--osrs-border-light);
    color: #e0f0ff;
    font-size: 8px;
    padding: 4px 8px;
    pointer-events: none;
    border-radius: 2px;
}

/* 99 Fishing Prestige Skillcape Bar */
.prestige-btn {
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    width: 100%;
    max-width: 460px;
    margin-top: 6px;
    background: linear-gradient(180deg, #1c7ba6 0%, #0d4661 100%);
    color: #ffffff;
    border: 2px solid #5ae2ff;
    padding: 8px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    animation: prestigeGlow 1.5s infinite;
}

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

@keyframes prestigeGlow {
    0% { box-shadow: 0 0 6px #1c7ba6; }
    50% { box-shadow: 0 0 18px #5ae2ff; }
    100% { box-shadow: 0 0 6px #1c7ba6; }
}

/* Sidebar & Tabs */
.osrs-sidebar {
    width: 420px;
    background-color: var(--osrs-stone);
    display: flex;
    flex-direction: column;
}

.tab-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: #101824;
    border-bottom: 2px solid var(--osrs-border-dark);
}

.tab-btn {
    font-family: inherit;
    font-size: 8px;
    background-color: #1e2c3b;
    color: #8da4bd;
    border: 1px solid var(--osrs-border-dark);
    padding: 10px 4px;
    cursor: pointer;
    text-shadow: 1px 1px #000;
}

.tab-btn.active {
    background-color: var(--osrs-stone);
    color: var(--osrs-ocean-cyan);
    border-bottom: 2px solid var(--osrs-stone);
    font-weight: bold;
}

.tab-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 10px;
}

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

.pane-header {
    font-size: 11px;
    color: var(--osrs-gold);
    border-bottom: 2px solid var(--osrs-border-light);
    padding-bottom: 8px;
    margin-bottom: 10px;
    text-shadow: 1px 1px #000;
}

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

/* Upgrade Card */
.upgrade-row {
    background-color: #182330;
    border: 2px solid;
    border-color: var(--osrs-border-light) var(--osrs-border-dark) var(--osrs-border-dark) var(--osrs-border-light);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.upgrade-title {
    font-size: 9px;
    color: #c9e6ff;
}

.upgrade-lvl {
    font-size: 8px;
    color: var(--osrs-ocean-cyan);
}

.upgrade-desc {
    font-size: 7.5px;
    color: #8fa6bd;
    line-height: 1.3;
}

.buy-btn.affordable {
    color: var(--osrs-yellow);
    border-color: #8c733e #292010 #292010 #8c733e;
}

.buy-btn.unaffordable {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Tool Cards */
.tool-card {
    background-color: #182330;
    border: 2px solid;
    border-color: var(--osrs-border-light) var(--osrs-border-dark) var(--osrs-border-dark) var(--osrs-border-light);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-card.active-tool {
    border-color: #4de1ff;
    background-color: #21354a;
}

.tool-card.locked-tool {
    opacity: 0.6;
}

.tool-preview {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.tool-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.t-name {
    font-size: 9px;
    font-weight: bold;
    color: #ffffff;
}

.t-stats {
    font-size: 7.5px;
    color: #8fa6bd;
}

.equipped-btn {
    background-color: #1a421a;
    border-color: #2e752e #0b1f0b #0b1f0b #2e752e;
    color: #a8ffa8;
    cursor: default;
}

/* Stats / Log Container */
.stat-group {
    background-color: #182330;
    border: 1px solid var(--osrs-border-light);
    padding: 10px;
    margin-bottom: 8px;
    font-size: 8px;
    line-height: 1.6;
}

.stat-group h3 {
    font-size: 9.5px;
    color: var(--osrs-gold);
    margin-bottom: 6px;
    border-bottom: 1px solid #293b4f;
    padding-bottom: 4px;
}

/* Settings Box */
.settings-box {
    font-size: 8px;
    line-height: 1.6;
    color: #b5c7d9;
}

.setting-item {
    background-color: #182330;
    border: 1px solid var(--osrs-border-light);
    padding: 10px;
    margin-bottom: 8px;
}

.setting-item h4 {
    color: var(--osrs-ocean-cyan);
    margin-bottom: 6px;
    font-size: 9px;
}

.setting-item p {
    margin-bottom: 6px;
}

.danger-btn {
    background-color: #5c1818;
    border-color: #8f3030 #2e0808 #2e0808 #8f3030;
    color: #ffcccc;
}

/* Level Up Announcement */
.level-modal {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 1000;
}

.level-modal.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.level-modal-content {
    background: linear-gradient(180deg, #18425e 0%, #0d2333 100%);
    border: 3px solid;
    border-color: #3b8bbd #06131c #06131c #3b8bbd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
    padding: 14px 22px;
    text-align: center;
    max-width: 360px;
}

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

.level-modal-header h3 {
    color: var(--osrs-ocean-cyan);
    font-size: 14px;
    text-shadow: 2px 2px #000;
}

.level-modal-body {
    font-size: 8.5px;
    line-height: 1.5;
    color: #e0f0ff;
    text-shadow: 1px 1px #000;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }

    .game-board-container {
        border-right: none;
        border-bottom: 3px solid var(--osrs-border-dark);
    }

    .canvas-wrapper {
        width: 100%;
        max-width: 460px;
        height: 600px;
    }

    .osrs-sidebar {
        width: 100%;
        height: 480px;
    }
}
