/* 基本レイアウト */
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.main-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

/* 入力セクション */
.layout-settings {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
}

.layout-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.layout-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layout-input-group label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.layout-input-group input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
}

.layout-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.layout-separator {
    font-size: 1.5rem;
    color: #64748b;
    font-weight: 700;
    padding-top: 1.5rem;
}

.names-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.names-input label {
    font-weight: 600;
    color: #475569;
}

.names-input textarea {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-height: 200px;
    resize: vertical;
    font-family: inherit;
}

.names-input textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.input-hint {
    font-size: 0.85rem;
    color: #64748b;
}

.shuffle-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.shuffle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* 結果セクション */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.action-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

.board-label {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.seating-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.seating-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 auto;
    width: fit-content;
    min-width: min-content;
}

.seat-row {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

.seat {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #60a5fa;
    border-radius: 8px;
    padding: 0.875rem 0.75rem;
    min-width: 90px;
    max-width: 120px;
    text-align: center;
    font-weight: 600;
    color: #1e40af;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seat:not(.empty):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
}

.seat.empty {
    background: #f8fafc;
    border-style: dashed;
    color: #cbd5e1;
}

/* 使い方 */
.usage-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.usage-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.step-text p {
    color: #64748b;
    line-height: 1.6;
}

.tips-section {
    background: #eff6ff;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    padding: 1.5rem;
}

.tips-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 1rem;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tips-list li {
    color: #1e40af;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.tips-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: 700;
}

/* 記録セクション */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.record-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.record-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.record-date {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.record-actions {
    display: flex;
    gap: 0.5rem;
}

.record-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.record-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.record-btn.delete:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fee;
}

.record-info {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.record-seats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.record-seat {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: #1e40af;
}

.clear-btn {
    width: 100%;
    padding: 0.75rem;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #475569;
}

/* 印刷用スタイル */
@media print {
    body * {
        visibility: hidden;
    }

    #resultSection,
    #resultSection * {
        visibility: visible;
    }

    #resultSection {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .result-actions {
        display: none;
    }
}

/* 関連ツール */
#relatedToolsContainer {
    margin-top: 3rem;
}

/* 広告セクション */
.ad-section {
    margin-top: 3rem;
    text-align: center;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .layout-row {
        flex-direction: column;
        align-items: stretch;
    }

    .layout-separator {
        padding-top: 0;
        text-align: center;
    }

    .seat {
        min-width: 70px;
        max-width: 90px;
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .seat-row {
        gap: 0.5rem;
    }

    .seating-chart {
        gap: 0.5rem;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .result-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 100px;
    }

    .card {
        padding: 1.5rem;
    }
}
