/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background-color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
}

/* --- LAYOUT WRAPPERS --- */
.sburb-app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
    padding: 0; 
    position: relative;
}

.app-body {
    display: flex;
    width: 100%;
    gap: 20px;
    align-items: flex-start;
    flex-grow: 1;
    padding: 20px;
}

/* --- HEADER --- */
.site-header {
    width: 100%;
    height: 60px;
    background-color: #dcdcdc; 
    border-bottom: 2px solid #aaa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* General Header Button (for right side) */
.header-btn {
    background: white;
    border: 2px solid #ccc;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: bold;
    color: #555;
}

/* Home Button (Icon Only - UPDATED) */
.home-btn {
    width: 45px;
    height: 45px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.home-btn img {
    width: 40px; /* Increased size */
    height: 40px;
    object-fit: contain;
}

.home-btn:hover {
    background: transparent;
    border: none;
    transform: scale(1.1);
}

/* Text Buttons (Right side buttons) */
.text-btn {
    height: 40px;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 900;
}

.text-btn:hover {
    transform: scale(1.05);
    border-color: red;
    color: black;
}

/* --- LEFT SIDEBAR --- */
.left-sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0; 
    position: sticky;
    top: 80px; 
    height: calc(100vh - 100px);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 20px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    border: 2px solid rgba(255,255,255,0.6);
    overflow: hidden; 
}

.char-column {
    width: 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.column-header {
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 900;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8);
}

.char-btn {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.char-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.char-btn:hover {
    border-color: #666;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 5; 
}

.char-btn.active-char {
    border: 4px solid #ff0000;
    transform: scale(1.08);   
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4); 
    z-index: 10; 
}

/* --- RIGHT MAIN CONTENT --- */
.main-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; 
}

/* --- VIEWPORT BLOCK --- */
.viewport-block {
    background-color: transparent;
    min-height: 400px; 
    height: 400px;
    display: flex;
    gap: 20px;
}

/* --- 1. PROFILE INFO CARD --- */
.profile-info-col {
    flex: 0.9;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
    border: 4px solid #31513a;
}

.profile-title {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: bold;
    background-color: #2b8d49; 
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    border: none;
    text-align: center; 
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-row {
    line-height: 1.4;
}

.profile-row .label {
    color: #2b8d49;
    font-weight: bold;
    display: block; 
    margin-bottom: 4px;
    font-size: 16px;
}

.profile-row .value {
    font-weight: bold;
    color: #000;
    font-size: 18px;
}

/* --- 2. CHARACTER SPRITE CARD --- */
.character-img-col {
    flex: 0.7;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center; 
    position: relative;
    overflow: hidden;
}

.character-img-col img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- 3. ECHELADDER CARD --- */
.echeladder-col {
    flex: 1.6;
    background-color: #2b8d49; 
    border-radius: 20px;       
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1); 
    padding: 10px;
    display: flex;
    flex-direction: column;
    border: 4px solid #31513a;
}

.echeladder-header {
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 25px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #003366;
}

.echeladder-inner {
    background-color: white;
    flex-grow: 1;
    border-radius: 12px; 
    display: flex;
    overflow: hidden; 
}

.ladder-stats {
    width: 40%;
    padding: 15px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 15px;
    border-right: 2px solid #ddd;
}

.badge-group {
    width: 100%;
    margin-bottom: 5px;
}

.badge-label {
    font-size: 14px; 
    font-weight: bold;
    color: #31513a;
    margin-bottom: 4px;
    text-align: left;
}

.ladder-badge {
    width: 100%;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
}

.ladder-badge.yellow { background-color: #ffff00; }
.ladder-badge.pink { background-color: #ff0066; }

.badge-val {
    font-weight: bold;
    font-size: 14px; 
}

.ladder-badge.pink .badge-val { color: white; text-shadow: 1px 1px 0 black; }
.ladder-badge.yellow .badge-val { color: #ff6600; text-shadow: 1px 1px 0 black; }

.gel-stats { width: 100%; }

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    justify-content: flex-start;
}

.icon-box {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.icon-box img { width: 30px; }

.stat-text {
    font-size: 14px; 
    font-weight: bold;
    line-height: 1.2;
    text-align: left;
}
.green-text { color: #31513a; }
.stat-text span { background: #ffff00; padding: 0 2px; color: red; }
.stat-text span.dark { background: #ff0066; color: white; }

.boondollars {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    font-size: 20px; 
    font-weight: bold;
    color: #31513a; 
    margin-top: auto; 
}

.ladder-list-wrapper {
    width: 60%;
    background-color: black;
    border-left: 4px solid #ccc;
    position: relative;
    overflow: hidden;
}

.ladder-list {
    height: 100%;
    overflow-y: scroll;
    padding: 5px 0;
}

.rung {
    padding: 12px 15px;
    margin-bottom: 2px;
    font-size: 16px; 
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
}

.rung.locked {
    background-color: #000;
    color: white; 
    border-bottom: 1px solid #333;
}

.rung.active { border: 2px solid white; }
.rung.active:nth-child(10n+1) { background-color: #ff067c; color: #ffff00; }
.rung.active:nth-child(10n+2) { background-color: #72eb34; color: #306800; }
.rung.active:nth-child(10n+3) { background-color: #e49700; color: #00d5f2; }
.rung.active:nth-child(10n+4) { background-color: #a10000; color: #ffffff; }
.rung.active:nth-child(10n+5) { background-color: #005682; color: #ffe094; }
.rung.active:nth-child(10n+6) { background-color: #06b6ff; color: #ff0000; }
.rung.active:nth-child(10n+7) { background-color: #6a006a; color: #96ff00; }
.rung.active:nth-child(10n+8) { background-color: #ff6000; color: #77003c; }
.rung.active:nth-child(10n+9) { background-color: #2d5817; color: #ff01fe; }
.rung.active:nth-child(10n+10) { background-color: #ff9caa; color: #6a006a; }

.ladder-list::-webkit-scrollbar { width: 12px; }
.ladder-list::-webkit-scrollbar-track { background: #ccc; border-left: 1px solid #999; }
.ladder-list::-webkit-scrollbar-thumb { background: #fff; border: 1px solid #999; box-shadow: inset 1px 1px 0 #fff; }
.ladder-list::-webkit-scrollbar-button { background: #ccc; height: 10px; display: block; }


/* --- GRIST CACHE --- */
.grist-cache-container { width: 100%; position: relative; }
.tab-navigation { display: flex; align-items: flex-end; height: 60px; padding-left: 20px; position: relative; z-index: 2; }
.nav-item { width: 60px; height: 50px; display: flex; justify-content: center; align-items: center; margin-right: 5px; position: relative; cursor: pointer; transition: all 0.2s ease; }
.nav-item img { width: 45px; height: 45px; display: block; object-fit: contain; }
.nav-item.active-tab { background-color: white; height: 60px; border-top-left-radius: 15px; border-top-right-radius: 15px; margin-bottom: 0; box-shadow: 0px -2px 5px rgba(0,0,0,0.05); z-index: 10; }
.nav-item.active-tab img { width: 54px; height: 54px; object-fit: contain; }
.nav-item.active-tab::before { content: ""; position: absolute; bottom: 0; left: -15px; width: 15px; height: 15px; background: radial-gradient(circle at top left, transparent 15px, white 15px); }
.nav-item.active-tab::after { content: ""; position: absolute; bottom: 0; right: -15px; width: 15px; height: 15px; background: radial-gradient(circle at top right, transparent 15px, white 15px); }

.grist-cache-body { background-color: white; width: 100%; border-radius: 15px; padding: 15px; box-shadow: 0px 4px 10px rgba(0,0,0,0.1); position: relative; z-index: 1; margin-top: -1px; }
.cache-label { color: #666; font-size: 20px; font-weight: bold; margin-bottom: 5px; margin-left: 5px; }
.grist-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grist-cell { background: linear-gradient(to bottom, #eaeaea 0%, #dcdcdc 100%); border-radius: 8px; height: 55px; display: flex; align-items: center; padding: 0 8px; border: 1px solid #ccc; min-width: 0; }
.grist-cell.empty { justify-content: flex-start; padding-left: 15px; color: #999; font-weight: bold; font-size: 25px; box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1); }
.grist-icon { width: 36px; height: 36px; margin-right: 10px; flex-shrink: 0; object-fit: contain; }
.grist-bar { flex-grow: 1; height: 14px; border: 2px solid #888; border-radius: 10px; background-color: #e0e0e0; margin-right: 5px; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2); }