:root {
    --blb-royal-blue: #1e3a8a;
    --blb-blue-dark: #152a66;
    --blb-blue-light: #3b5cb8;
    --blb-gold: #d4a537;
    --blb-gold-light: #f0c75e;
    --blb-gold-dark: #b8922f;
    --white: #ffffff;
    --cream: #faf8f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, #e8e4df 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--blb-royal-blue);
    margin-bottom: 0.25rem;
}

.header h1 span {
    color: var(--blb-gold-dark);
}

.header .subtitle {
    color: var(--blb-blue-light);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Floor Toggle */
.floor-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.floor-btn {
    padding: 0.75rem 2rem;
    border:0px solid var(--blb-royal-blue);   
    background: var(--white);
    color: var(--blb-royal-blue);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.floor-btn:hover {
    background: var(--blb-blue-light);
    color: var(--white);
}

.floor-btn.active {
    background: var(--blb-royal-blue);
    color: var(--white);
}

/* Blueprint Container */
.blueprint-container {
    background: var(--white);
    border: 0px solid var(--blb-royal-blue); 
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.15);
    padding: 2rem;
    margin-bottom: 2rem;
}

.floor-label {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--blb-royal-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--blb-gold);
}

.floor-label span {
    color: var(--blb-gold-dark);
}

/* B-Shape Grid */
.b-shape-wrapper {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border: 0px solid var(--blb-royal-blue); 
}

.b-shape {
    display: grid;
    gap: 4px;
    background: var(--blb-royal-blue);
    padding: 4px;
    border: 0px solid var(--blb-royal-blue); 
}

/* Girls layout: rectangular building with courtyard */
.girls-layout {
    grid-template-columns: 100px 100px 100px 100px 100px 100px 100px 100px 100px 100px;
    grid-template-rows: 100px 100px 100px 100px 100px;
}

/* Boys layout similar structure */
.boys-layout {
    grid-template-columns: 100px 100px 100px 100px 100px 100px 100px 100px 100px 100px;
    grid-template-rows: 100px 100px 100px 100px 100px;
}

.room {
    background: var(--cream);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.room:hover {
    background: var(--blb-gold-light);
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(212, 165, 55, 0.4);
}

.room.active {
    background: var(--blb-gold);
    box-shadow: 0 4px 20px rgba(212, 165, 55, 0.5);
}

.room.empty {
    background: #e2e8f0;
    opacity: 0.6;
}

.room.empty:hover {
    background: #cbd5e1;
    transform: scale(1.02);
}

.room-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blb-royal-blue);
}

.room-caregiver {
    font-size: 0.65rem;
    color: var(--blb-blue-light);
    font-weight: 600;
    margin-top: 2px;
}

.room-count {
    font-size: 0.6rem;
    color: var(--blb-gold-dark);
    margin-top: 2px;
}

/* Courtyard */
.courtyard {
    background: linear-gradient(135deg, #e8f4ea 0%, #d4e8d7 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #4a7c59;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.courtyard-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Hidden/structural cells */
.void {
    background: transparent;
    border: 0px solid var(--blb-royal-blue); 
}

/* Simple white top section for building outline */
.void-white-top {
    background: linear-gradient(to bottom, 
        var(--white) 0%, 
        var(--white) 50px,
        var(--blb-royal-blue) 30px,
        var(--blb-royal-blue) 100%
    );
}

.void-white-left {
    background: linear-gradient(to right, 
        var(--white) 0%, 
        var(--white) 30px,
        var(--blb-royal-blue) 30px,
        var(--blb-royal-blue) 100%
    );
}

.void-white-right {
    background: linear-gradient(to left, 
        var(--white) 0%, 
        var(--white) 30px,
        var(--blb-royal-blue) 30px,
        var(--blb-royal-blue) 100%
    );
}

.void-white-bottom {
    background: linear-gradient(to top, 
        var(--white) 0%, 
        var(--white) 30px,
        var(--blb-royal-blue) 30px,
        var(--blb-royal-blue) 100%
    );
}

/* Void with blue background and white diagonal corners for B-shape outline */
/* Top-left corner: white triangle (75px left, 50px top) */
.void-corner-tl {
    background: linear-gradient(to bottom right, 
        var(--white) 0%, 
        var(--white) calc(75px + 50px - 100px),
        var(--blb-royal-blue) calc(75px + 50px - 100px + 1px),
        var(--blb-royal-blue) 100%
    );
}

/* Top-right corner: white triangle (75px right, 50px top) */
.void-corner-tr {
    background: linear-gradient(to bottom left, 
        var(--white) 0%, 
        var(--white) calc(75px + 50px - 100px),
        var(--blb-royal-blue) calc(75px + 50px - 100px + 1px),
        var(--blb-royal-blue) 100%
    );
}

/* Bottom-left corner: white triangle (75px left, 50px bottom) */
.void-corner-bl {
    background: linear-gradient(to top right, 
        var(--white) 0%, 
        var(--white) calc(75px + 50px - 100px),
        var(--blb-royal-blue) calc(75px + 50px - 100px + 1px),
        var(--blb-royal-blue) 100%
    );
}

/* Bottom-right corner: white triangle (75px right, 50px bottom) */
.void-corner-br {
    background: linear-gradient(to top left, 
        var(--white) 0%, 
        var(--white) calc(75px + 50px - 100px),
        var(--blb-royal-blue) calc(75px + 50px - 100px + 1px),
        var(--blb-royal-blue) 100%
    );
}

/* More precise diagonal using clip-path */
.void-diag-tl {
    background: var(--blb-royal-blue);
    position: relative;
}

.void-diag-tl::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    clip-path: polygon(0 0, 75px 0, 0 50px);
}

.void-diag-tr {
    background: var(--blb-royal-blue);
    position: relative;
}

.void-diag-tr::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    clip-path: polygon(100% 0, calc(100% - 75px) 0, 100% 50px);
}

.void-diag-bl {
    background: var(--blb-royal-blue);
    position: relative;
}

.void-diag-bl::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    clip-path: polygon(0 100%, 75px 100%, 0 calc(100% - 50px));
}

.void-diag-br {
    background: var(--blb-royal-blue);
    position: relative;
}

.void-diag-br::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    clip-path: polygon(100% 100%, calc(100% - 75px) 100%, 100% calc(100% - 50px));
}

/* Building structure (non-room blue areas) */
.building {
    background: var(--blb-blue-light);
    border: 0px solid var(--blb-royal-blue); 
}

/* Compass */
.compass {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border: 2px solid var(--blb-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.compass::before {
    content: "N";
    position: absolute;
    top: -18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--blb-gold-dark);
}

.compass-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 20px solid var(--blb-gold);
}

/* Room Detail Panel */
.detail-panel {
    background: var(--blb-royal-blue);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    min-height: 150px;
    color: var(--white);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--blb-gold);
}

.detail-room-number {
    width: 60px;
    height: 60px;
    background: var(--blb-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--blb-blue-dark);
}

.detail-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.detail-info p {
    font-size: 0.85rem;
    color: var(--blb-gold-light);
}

.detail-children {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.child-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.child-age {
    background: var(--blb-gold);
    color: var(--blb-blue-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.child-bday {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 2rem;
}

.select-prompt {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem;
}

.select-prompt .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Room Breakdown Section */
.breakdown-section {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.15);
    padding: 2rem;
}

.breakdown-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--blb-royal-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.breakdown-card {
    border: 2px solid var(--blb-royal-blue);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.breakdown-card:hover {
    border-color: var(--blb-gold);
    box-shadow: 0 4px 16px rgba(212, 165, 55, 0.3);
}

.breakdown-card.empty {
    opacity: 0.5;
    border-style: dashed;
}

.breakdown-header {
    background: var(--blb-royal-blue);
    color: var(--white);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breakdown-room {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breakdown-badge {
    width: 32px;
    height: 32px;
    background: var(--blb-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--blb-blue-dark);
}

.breakdown-caregiver {
    font-size: 0.8rem;
    color: var(--blb-gold-light);
}

.breakdown-body {
    padding: 0.75rem 1rem;
    background: var(--cream);
}

.breakdown-child {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(30, 58, 138, 0.1);
    font-size: 0.85rem;
}

.breakdown-child:last-child {
    border-bottom: none;
}

.breakdown-child-name {
    color: var(--blb-blue-dark);
    font-weight: 500;
}

.breakdown-child-age {
    color: var(--blb-gold-dark);
    font-weight: 600;
}

/* Stats */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--blb-gold);
    border-radius: 8px;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blb-blue-dark);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--blb-blue-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .girls-layout, .boys-layout {
        transform: scale(0.7);
        transform-origin: center;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
}