/* Old School RuneScape Barrows Crypt Roulette Styling */

:root {
    --osrs-bg: #0c0907;
    --osrs-stone-dark: #1c1510;
    --osrs-stone-med: #2a2018;
    --osrs-stone-light: #423226;
    --osrs-border-outer: #060403;
    --osrs-border-light: #6b513d;
    --osrs-border-dark: #120d09;
    --osrs-gold: #ffb833;
    --osrs-yellow: #ffff00;
    --osrs-green: #76ff03;
    --osrs-red: #ff3333;
    --osrs-purple: #c2185b;
    --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: #ebdcd0;
    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(183, 28, 28, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(118, 255, 3, 0.08) 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, #3d2a1e 0%, #1e140d 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, #593e2b 0%, #2e1d13 100%);
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0px #856044, inset -1px -1px 0px #170c06;
    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 #856044, inset 1px 1px 0px #170c06;
    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: #17110c;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543f2f, inset -1px -1px 0 #080503;
    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: #d7ccc8;
}

.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: #100b08;
    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, #d32f2f 0%, #b71c1c 100%);
    transition: width 0.2s ease;
}

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

/* GP Pouch */
.coins-pouch {
    background: #17110c;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543f2f;
    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: #2b1f17;
    color: #bfa897;
    border: 1px solid #000;
    padding: 5px 8px;
    cursor: pointer;
}

.speed-btn.active {
    background: #8d4f29;
    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: #17110c;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543f2f, inset -1px -1px 0 #080503;
    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 #543f2f, inset -2px -2px 0 #080503;
}

#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(235, 220, 208, 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: #1c1510;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #543f2f, inset -1px -1px 0 #0a0705;
    height: 712px;
}

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

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

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

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

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

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

.pane-header {
    background: #302117;
    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: #120c08;
}

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

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

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

.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: #ff80ab;
}

.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;
}

/* Collection Log Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.collection-item {
    background: #17110c;
    border: 1px solid #3d2a1e;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

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

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

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

.col-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

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

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

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: #17110c;
    border-bottom: 1px solid #2d1e16;
    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: #bfa897;
    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: #2a1c14;
    border: 3px solid #000;
    box-shadow: 
        inset 2px 2px 0 #734c32,
        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;
}
