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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.main-content {
    flex: 1;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.sidebar {
    width: 280px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.bookshelf-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.bookshelf-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookshelf-item:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.bookshelf-item.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

/* Add special items */
.special-items {
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.special-items h4 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 1rem;
}

.special-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.special-item:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.special-item.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.bookshelf-preview {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    position: relative;
}

.bookshelf-preview::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: repeating-linear-gradient(
        to right,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.3) 3px,
        rgba(255, 255, 255, 0.3) 4px
    );
    border-radius: 2px;
}

.bookshelf-preview.fiction {
    background: linear-gradient(45deg, #8e24aa, #ab47bc);
}

.bookshelf-preview.business {
    background: linear-gradient(45deg, #1976d2, #42a5f5);
}

.bookshelf-preview.manga {
    background: linear-gradient(45deg, #f57c00, #ffb74d);
}

.bookshelf-preview.children {
    background: linear-gradient(45deg, #388e3c, #66bb6a);
}

.bookshelf-preview.magazine {
    background: linear-gradient(45deg, #d32f2f, #ef5350);
}

.bookshelf-preview.erase {
    background: #757575;
    border: 2px dashed #bdbdbd;
}

.special-preview {
    width: 32px;
    height: 24px;
    border-radius: 4px;
}

.special-preview.entrance {
    background: #4caf50;
}

.special-preview.cashier {
    background: #ff9800;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.tips {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.tips h4 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 0.9rem;
}

.tips ul {
    list-style: none;
}

.tips li {
    padding: 0.2rem 0;
    font-size: 0.8rem;
    color: #666;
    position: relative;
    padding-left: 1rem;
}

.tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #2196f3;
}

.store-layout {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    height: 600px;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
}

.grid-cell {
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    overflow: hidden;
}

.grid-cell:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.grid-cell.entrance {
    background: #4caf50;
    color: white;
}

.grid-cell.entrance::after {
    content: '入口';
    font-size: 0.6rem;
}

.grid-cell.cashier {
    background: #ff9800;
    color: white;
}

.grid-cell.cashier::after {
    content: 'レジ';
    font-size: 0.6rem;
}

.grid-cell.bookshelf {
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.grid-cell.bookshelf.fiction {
    background: linear-gradient(135deg, #8e24aa, #ab47bc);
}

.grid-cell.bookshelf.business {
    background: linear-gradient(135deg, #1976d2, #42a5f5);
}

.grid-cell.bookshelf.manga {
    background: linear-gradient(135deg, #f57c00, #ffb74d);
}

.grid-cell.bookshelf.children {
    background: linear-gradient(135deg, #388e3c, #66bb6a);
}

.grid-cell.bookshelf.magazine {
    background: linear-gradient(135deg, #d32f2f, #ef5350);
}

.customers-layer {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    pointer-events: none;
}

.customer {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2196f3;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.6);
    transition: all 0.3s ease;
    z-index: 10;
}

.customer.interested {
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.customer.leaving {
    background: #ff5722;
    box-shadow: 0 0 6px rgba(255, 87, 34, 0.6);
}

.simulation-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.simulation-results h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.result-item {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

.result-item.positive {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.result-item.negative {
    background: #ffeee8;
    border-left: 4px solid #ff5722;
}

.result-score {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .bookshelf-types {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .layout-grid {
        height: 500px;
        min-height: 400px;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
    
    .stats {
        gap: 1rem;
    }
}