@font-face {
    font-family: 'MinecraftRegular'; 
    src: url('./fonts/MinecraftRegular.otf') format('opentype'); 
    font-weight: normal;
    font-style: normal;
    font-display: swap; 
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'MinecraftRegular', Arial, sans-serif; 
    margin: 0;
    background-color: #1a1a1a; 
    color: #e0e0e0; 
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    flex-grow: 1;
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    background-color: #2a2a2a; 
    box-shadow: 0 0 20px rgba(0,0,0,0.4); 
    border-radius: 8px;
    
    display: flex;
    flex-direction: column;
}

.error-message, .no-data {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #ff9999; 
    background-color: #4a2d2d; 
    border: 1px solid #773333; 
    border-radius: 5px;
    margin-top: 20px;
    font-family: 'MinecraftRegular', Arial, sans-serif;
}
.no-data {
    color: #bbbbbb; 
    background-color: #3a3a3a; 
    border-color: #555; 
}

.rank-section {
    background-color: #2a2a2a; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    margin-bottom: 30px; 
    padding: 20px;
    
    padding-bottom: 40px; 
    border: 1px solid #333; 
    overflow: hidden; 
}

.rank-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a3a3a; 
    position: relative; 
}

.rank-logo {
    width: 64px;
    height: 64px;
    margin-right: 15px;
    border: none;
    border-radius: 0;
    object-fit: contain;
}

.rank-header h2 {
    margin: 0;
    font-size: 2.2em;
    color: #4CAF50; 
    letter-spacing: 1px;
    font-family: 'MinecraftRegular', Arial, sans-serif;
    flex-grow: 1;
    text-align: left;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    justify-content: center;

    
    max-height: 20000px; 
    opacity: 1;
    transition: max-height 0.15s ease-in-out, opacity 0.15s ease-in-out; 
    padding-top: 0;
    padding-bottom: 0;
}

.member-card {
    background-color: #3a3a3a; 
    border-style: solid; 
    border-width: 2px; 
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: border-width 0.1s ease, border-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
    display: flex;
    flex-direction: column; 
    align-items: stretch;
    color: #e0e0e0; 
    position: relative; 
    min-height: 200px; 
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background-color: #4a4a4a; 
}

.member-card.house-blue {
    border-color: #2196F3; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 8px rgba(33, 150, 243, 0.5); 
}
.member-card.house-blue:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 12px rgba(33, 150, 243, 0.7); 
}

.member-card.house-yellow {
    border-color: #FFEB3B; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 8px rgba(255, 235, 59, 0.5); 
}
.member-card.house-yellow:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 12px rgba(255, 235, 59, 0.7); 
}

.member-card.house-red {
    border-color: #F44336; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 0 8px rgba(244, 67, 54, 0.5); 
}
.member-card.house-red:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 12px rgba(244, 67, 54, 0.7); 
}

.card-header {
    text-align: center;
    margin-bottom: 10px;
    padding: 0 5px;
    padding-bottom: 5px;
}

.card-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.5em;
    color: #FFFFFF;
    font-family: 'MinecraftRegular', Arial, sans-serif;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}

.name-delimiter {
    width: 80%;
    height: 2px;
    background-color: #FFFFFF;
    margin: 0 auto;
    border-radius: 1px;
    margin-bottom: 5px;
}

.house-rank-title {
    font-size: 0.85em;
    color: #bbbbbb;
    text-align: center;
    margin-top: 0;
    margin-bottom: 5px;
    font-style: italic;
}

.card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    padding: 0 5px;
}

.member-head-new-layout {
    width: 64px;
    height: 64px;
    border-radius: 0;
    border: none;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    cursor: help;
}

.member-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    min-width: 0;
}

.join-info, .language-info, .game-info {
    font-family: 'MinecraftRegular', Arial, sans-serif;
    color: #bbbbbb;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: baseline;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 1;
    min-width: 0;
    margin-bottom: 0;
}

.join-info {
    margin-bottom: 5px;
}

.game-info {
    margin-top: 5px;
}

.join-info p, .language-info p, .game-info p {
    margin: 0;
    display: flex;
    align-items: baseline;
    width: 100%;
}

.member-details .label {
    min-width: 90px;
    text-align: left;
    flex-shrink: 0;
    padding-right: 5px;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.member-details .value {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.join-info .plus-icon {
    font-size: 1.2em;
    color: #69F0AE;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 0;
}

.card-info-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px 0 5px;
    border-top: 1px dashed #555;
    margin-top: auto;
}

.logos-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.house-logo-container {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.house-logo-member-card {
    max-width: 64px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.division-logo-container {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.division-logo-member-card {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.decoration-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.decoration-section h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #aaaaaa;
    font-family: 'MinecraftRegular', Arial, sans-serif;
}
.decoration-section p {
    margin: 0;
    font-size: 0.8em;
    color: #888888;
}

.decorations-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 0;
}

.decoration-tooltip-wrapper {
    display: inline-block;
    cursor: help;
}

.decoration-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.decoration-icon:hover {
    transform: scale(1.1);
}

.custom-mouse-tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.1s ease-in-out;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    max-width: 250px;
    white-space: normal;
    word-wrap: break-word;
}

.rank-toggle-checkbox {
    
}

.toggle-members-button {
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: #FFFFFF;
    transition: transform 0.15s ease-in-out;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    z-index: 10;
    user-select: none;
}

.toggle-members-button::before {
    content: "▼";
}

.rank-toggle-checkbox:not(:checked) ~ .rank-header .toggle-members-button {
    transform: translateY(-50%) rotate(-90deg);
}

.rank-toggle-checkbox:not(:checked) ~ .members-grid {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
}

---

### Key Changes to `rank-explanation` Section:

```css

.rank-explanation {
    background-color: #2b2b2b;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #f0f0f0;
    text-align: left; 
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
}

.rank-explanation h2 {
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center; 
    width: 100%; 
}

.rank-explanation p {
    margin-bottom: 20px;
}

.rank-groups-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    width: 100%; 
    max-width: 400px; 
    margin: 0 auto; 
    padding-left: 20px; 
    box-sizing: border-box; 
}

.rank-group-heading {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 15px; 
    margin-bottom: 5px; 
    color: #e0e0e0; 
}

.rank-group-heading.yellow-text {
    color: #FFD700; 
}

.rank-explanation ul {
    list-style: none; 
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%; 
}

.rank-explanation li {
    padding: 2px 0;
    font-size: 1.1em;
    position: relative;
    text-align: left;
    margin-bottom: 0; 
    display: flex; 
    align-items: baseline; 
}

.rank-explanation li::before {
    content: "| "; 
    color: #666; 
    margin-right: 5px; 
    font-weight: normal; 
    flex-shrink: 0; 
}

.rank-explanation .rank-name {
    flex-grow: 1; 
    color: #f0f0f0; 
}

.rank-explanation .rank-name.yellow {
    color: #FFD700; 
}

.rank-explanation .rank-name.white {
    color: #f0f0f0; 
}

.high-officers-group::before,
.officer-group::before,
.personnel-group::before,
.high-officers-group::after,
.officer-group::after,
.personnel-group::after {
    content: none !important; 
}

@media (max-width: 768px) {
    
    .rank-groups-container {
        padding-left: 10px;
    }
}

@media (max-width: 480px) {
    
    .rank-groups-container {
        padding-left: 5px;
    }
}

/* --- Input and Control Bar styling --- */
.ui-controls-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px !important;
}

#clientSideSearch {
    flex-grow: 1;
    background-color: #1a1a1a;
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 10px 15px;
    font-family: 'MinecraftRegular', Arial, sans-serif;
    font-size: 0.95rem;
    outline: none;
}
#clientSideSearch:focus {
    border-color: #4CAF50;
}

.ui-view-button {
    background-color: #3a3a3a;
    border: 2px solid #444;
    border-radius: 4px;
    color: #4CAF50;
    padding: 10px 20px;
    font-family: 'MinecraftRegular', Arial, sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.1s ease, border-color 0.1s ease;
}
.ui-view-button:hover {
    background-color: #4a4a4a;
    border-color: #4CAF50;
}

/* --- Layout Toggle Visibility Engine --- */
#displayModeContainer .table-rows-layout {
    display: none; /* Hide tabular views by default configuration */
}

#displayModeContainer.tab-view-active .standard-cards-layout {
    display: none !important; /* Kill cards view architecture when tabs active */
}

#displayModeContainer.tab-view-active .table-rows-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
}

/* --- Tab View Presentation Structure --- */
.tab-view-header-row {
    display: flex;
    padding: 10px 15px;
    border-bottom: 2px solid #444;
    font-weight: bold;
    color: #4CAF50;
    font-size: 0.9rem;
}

.tab-member-row {
    display: flex;
    align-items: center;
    background-color: #333;
    border: 1px solid #444;
    border-left: 4px solid #555; /* Default fallback rank/house highlight line */
    border-radius: 4px;
    padding: 8px 15px;
    transition: background-color 0.1s ease;
}
.tab-member-row:hover {
    background-color: #3d3d3d;
}

/* Specific House Left Edge Accent Border Line */
.tab-member-row.tab-blue { border-left-color: #2196F3; }
.tab-member-row.tab-yellow { border-left-color: #FFEB3B; }
.tab-member-row.tab-red { border-left-color: #F44336; }

/* Grid columns proportions definition */
.col-username { flex: 2; display: flex; align-items: center; gap: 12px; }
.col-title { flex: 1.5; }
.col-joined { flex: 1.2; }
.col-speaks { flex: 1.8; }
.col-game { flex: 1.5; }
.col-badges { flex: 2.5; display: flex; justify-content: flex-start; }

.tab-avatar-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    cursor: help;
}

.tab-name-span {
    font-size: 1.05rem;
    color: #fff;
}

.text-highlight-gold {
    color: #FFD700;
}

.opacity-sub {
    opacity: 0.65;
}

.tab-medals-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tab-inline-icon {
    height: 22px;
    width: auto;
    object-fit: contain;
    cursor: help;
}