body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    /* ここを800pxから1000pxに広げます */
    max-width: 1000px; /* PCで6列表示するために最大幅を広げる */
    position: relative;
    margin: auto;
}

h1, h2 {
    color: #333;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

.input-group input[type="number"],
.initial-input {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 5px;
}

#initials-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none !important;
}

/* ローディングアニメーション */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-section p {
    font-size: 1.2em;
    color: #555;
}

/* グループ表示セクション全体の調整 */
#results-section {
    padding-top: 20px;
}

#groups-display {
    display: grid;
    /* ここは前回の変更で問題ありません */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.group {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.group h3 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    border-bottom: 1px solid #cce5ff;
    padding-bottom: 5px;
}

.group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group ul li {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 1.0em;
    word-break: break-all;
}

/* シャッフルされるイニシャルのコンテナ */
#shuffling-initials-container {
    position: relative;
    width: 100%;
    height: 150px;
    margin-top: 20px;
    border: 1px dashed #ccc;
    box-sizing: border-box;
    overflow: hidden;
}

/* シャッフルされる個々のイニシャル */
.shuffling-initial {
    background-color: #ffeb3b;
    color: #333;
    padding: 8px 12px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2em;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: absolute;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

/* イニシャルのふわふわ浮遊アニメーション */
@keyframes float {
    0% { transform: translate(-50%, -50%) translateY(0px) rotate(0deg); }
    25% { transform: translate(-50%, -50%) translateY(-5px) rotate(5deg); }
    50% { transform: translate(-50%, -50%) translateY(0px) rotate(0deg); }
    75% { transform: translate(-50%, -50%) translateY(5px) rotate(-5deg); }
    100% { transform: translate(-50%, -50%) translateY(0px) rotate(0deg); }
}