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

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #1e1e1e;
    color: white;
    font-family: Arial, sans-serif;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1vh;
    gap: 8px;
}

.main-row {
    display: flex;
    flex-direction: row;
    flex: 1 1 0;
    min-height: 0;
}

.game-title {
    padding: 1vh;
    flex: 0 0 auto;
}

.game-title h1 {
    color: #ff6b00;
    font-size: clamp(18px, 2.5vh, 24px);
}

.info-text {
    color: #888;
    font-size: clamp(12px, 1.5vh, 14px);
}

.grid-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding: 1vh;
}

#grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    grid-template-rows: repeat(24, 1fr);
    gap: 2px;
    background-color: #2d2d2d;
    padding: 2px;
    position: relative;
    width: min(80vh, calc(100vw - 4vh));
    aspect-ratio: 1;
    margin: 0 auto;
    height: 100%;
    max-height: 100%;
}

.grid-section {
    position: relative;
    background-color: #1e1e1e;
    border: 1px solid #333;
    width: 100%;
    height: 100%;
}

.section-label {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: clamp(14px, 2vh, 20px);
    font-weight: bold;
    pointer-events: none;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 1px;
    width: 100%;
    height: 100%;
    background-color: #2d2d2d;
}

.bedroom-section {
    grid-column: 1 / 13;
    grid-row: 1 / 13;
    background-color: #e6f3ff;  /* Light blue tint */
}

.kitchen-section {
    grid-column: 1 / 13;
    grid-row: 13 / 25;
    background-color: #f5f5f5;  /* Light gray */
}

.living-room-section {
    grid-column: 13 / 25;
    grid-row: 13 / 25;
    background-color: #fff0e6;  /* Light peach */
}

.outside-section {
    grid-column: 13 / 25;
    grid-row: 1 / 13;
    background-color: #2d2d2d;
    border: none;
}

.warehouse-section, .barn-section {
    background-color: #eaeaea;
    width: 100%;
    height: 100%;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.grid-cell {
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    border: 1px solid #333;
    transition: background-color 0.2s;
    position: relative;
}

.grid-cell:hover {
    background-color: #2a2a2a;
}

.item-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.item {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
}

.hover-preview {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    opacity: 0.5;
}

.covered-cell {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hotbar {
    background-color: #2d2d2d;
    padding: 1vh;
    margin-top: auto;
    flex: 0 0 auto;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    z-index: 2;
}

.hotbar-slots {
    display: flex;
    gap: 4px;
    max-width: min(70vh, calc(100vw - 4vh));
    margin: 0 auto;
}

.hotbar-slot {
    flex: 1;
    aspect-ratio: 1;
    background-color: #3d3d3d;
    border: 2px solid #4d4d4d;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: min(7vh, calc((100vw - 4vh) / 10));
}

.hotbar-slot .item {
    width: 80%;
    height: 80%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.hotbar-slot:hover {
    border-color: #666;
}

.hotbar-slot.selected {
    border-color: #ff6b00;
}

.hotbar-slot.empty-slot:hover {
    border-color: #ff6b00;
}

.draggable {
    cursor: move;
}

.grid-cell .item {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    grid-column: var(--item-span, 1);
}

/* Inventory Menu Styles */
.inventory-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2d2d2d;
    border: 2px solid #4d4d4d;
    padding: 2vh;
    z-index: 1000;
    width: min(80vw, 800px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
    padding-bottom: 1vh;
    border-bottom: 1px solid #4d4d4d;
}

.inventory-header h2 {
    color: #ff6b00;
    font-size: clamp(16px, 2vh, 20px);
}

.close-inventory {
    background: none;
    border: none;
    color: #888;
    font-size: clamp(20px, 2.5vh, 24px);
    cursor: pointer;
    padding: 0 8px;
}

.close-inventory:hover {
    color: #fff;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
    max-height: 60vh;
    justify-items: center;
}

.inventory-item {
    width: 60px;
    height: 60px;
    background-color: #3d3d3d;
    border: 2px solid #4d4d4d;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 5px;
}

.inventory-item .item {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.inventory-item:hover {
    border-color: #666;
}

.empty-slot {
    background-color: #2a2a2a;
    border: 2px dashed #4d4d4d;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5vh 1vh;
    border-radius: 4px;
    font-size: clamp(12px, 1.5vh, 14px);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1100;
    transform: translate(-50%, -50%);
}

/* Media query for smaller screens */
@media (max-width: 1040px) {
    .grid-container {
        padding: 10px;
    }

    #grid {
        width: 100%;
        max-width: 90vmin; /* Use viewport units for responsive sizing */
    }

    .hotbar-slots {
        max-width: 90vmin; /* Match grid width */
    }
} 

#contactMe {
    padding: 10px;
    width: 100%;
    margin-top: auto;
    text-align: center; 
    bottom: 0;
  }
  
  #contactMe a {
    color: #a7a5a5;
  }

.clear-grid-button {
    background-color: rgba(200, 50, 50, 0.3);
    transition: background-color 0.3s ease;
    cursor: pointer;
    max-width: min(7vh, calc((100vw - 4vh) / 10));
}

.clear-grid-button:hover {
    background-color: rgba(200, 50, 50, 0.5);
}

.clear-icon {
    font-size: 3vh;
    opacity: 0.8;
}

.blocked-cell {
    background-color: rgba(255, 0, 0, 0.2) !important;
    pointer-events: none;
}

.blocked-cell:hover {
    background-color: rgba(255, 0, 0, 0.3) !important;
}

.item-container .item {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

#grid-size-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: #232323;
    padding: 24px 8px;
    margin-right: 18px;
    border-radius: 8px;
    min-width: 120px;
    height: 80vh;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

.grid-size-btn {
    background: #333;
    color: #fff;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 16px 8px;
    margin-bottom: 18px;
    font-size: 1.1em;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, border 0.2s, color 0.2s;
}
.grid-size-btn:hover, .grid-size-btn:focus {
    background: #ff6b00;
    color: #fff;
    border-color: #ff6b00;
    outline: none;
}
.grid-size-btn.selected {
    background: #ff6b00;
    color: #fff;
    border-color: #ff6b00;
}

.cta-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}
.cta-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.08em;
    font-weight: bold;
    border-radius: 8px;
    padding: 12px 28px;
    border: 2px solid #ff6b00;
    background: #fff7e6;
    color: #ff6b00;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.cta-link:hover, .cta-link:focus {
    background: #ff6b00;
    color: #fff;
    border-color: #ff6b00;
    text-decoration: none;
}
.cta-link-discord, .cta-link-discord {
    background: #404eed;
    color: #fff;
    border-color: #404eed;
}