h1 {
    text-align: center;
    color: #0056b3;
    margin: 0;
}

.settings {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    font-weight: bold;
    color: #333;
}

select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Player Sections Container */
.player-sections-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Player Section */
.player-section {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-section h3 {
    text-align: center;
    color: #007bff;
    margin-top: 0;
    margin-bottom: 10px;
}

.player-section h3 input[type="text"] {
    width: 100%;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    background: transparent;
}

.input-group,
.result-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label,
.result-group label {
    font-weight: bold;
    color: #555;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.rank-point,
.total-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #0056b3;
    padding: 8px;
    background-color: #f0f8ff;
    border: 1px solid #b0e0e6;
    border-radius: 4px;
    text-align: center;
}

/* Score Input with Buttons */
.score-input-controls {
    display: flex;
    flex-direction: row; /* ボタンを横に並べる */
    justify-content: center;
    gap: 10px; /* ボタン列間のスペース */
    margin-top: 10px; /* テキストエリアとのスペース */
}

.score-buttons-left,
.score-buttons-right {
    display: flex;
    flex-direction: column; /* ボタンを縦に並べる */
    gap: 5px;
}

.score-btn {
    padding: 5px 8px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    min-width: 70px;
}

.score-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.current-score {
    width: 100%; /* テキストエリアの幅を100%に */
    text-align: center;
    -moz-appearance: textfield;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.current-score::-webkit-outer-spin-button,
.current-score::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Styles for Total Scores Summary */
.total-scores-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #e9f7ff;
    border: 1px solid #a7d9f8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.summary-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.total-scores-summary h2 {
    color: #0056b3;
    margin: 0;
}

.share-button {
    background-color: black;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    padding: 0;
}

.share-button img {
    width: 18px;
    height: 18px;
}


.summary-players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.summary-player {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    display: flex; /* Flexbox for internal alignment */
    flex-direction: column; /* Stack elements vertically */
    align-items: center; /* Center content horizontally */
    border: 1px solid #eee; /* Add a subtle border for each player summary */
    border-radius: 8px;
    padding: 10px;
    background-color: #fdfdfd;
    flex: 1;
    min-width: 120px;
}

.summary-player-name {
    color: #007bff;
}

.summary-total-score {
    /* デフォルトの色に戻す */
}

.first-place-score {
    color: #00BCD4; /* シアン系 */
}

/* Warning highlight for total current score */
.warning-highlight {
    background-color: #ffc107; /* オレンジ色 */
    color: #333; /* 文字色を濃いめに */
    font-weight: bold;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: #f0f0f0;
    color: #555;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

footer p {
    margin: 0;
}



/* Overall Condition Toggle Button */
.overall-condition-toggle-button {
    background-color: #28a745; /* Green */
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.overall-condition-toggle-button:hover {
    background-color: #218838;
}

/* All Condition Details Container */
.all-condition-details-container {
    border: 1px solid #a7d9f8;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    background-color: #e9f7ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: none; /* Initially hidden */
    text-align: left; /* Align text to left within the container */
}

.all-condition-details-container.open {
    display: block;
}

.condition-details-players-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.condition-details-player {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 calc(50% - 20px); /* 2列表示 (gap考慮) */
    max-width: calc(50% - 20px);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .condition-details-player {
        flex: 1 1 100%; /* モバイルでは1列 */
        max-width: 100%;
    }
}

/* Condition Input Group (for riichi sticks and honba) */
.condition-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.condition-input-group label {
    font-weight: normal;
    color: #333;
    margin-right: 5px;
}

.condition-label-text {
    font-weight: bold;
    color: #007bff;
}

.count-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.count-btn:hover {
    background-color: #0056b3;
}

.riichi-sticks-count,
.honba-count {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.oya-selection-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.oya-selection-group label {
    font-weight: normal;
    color: #333;
}

.oya-buttons {
    display: flex;
    gap: 5px;
}

.oya-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
}

.oya-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.condition-type-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.condition-type-group label {
    font-weight: normal;
    color: #333;
}

.condition-type-buttons {
    display: flex;
    gap: 5px;
}

.condition-type-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
}

.condition-type-btn.selected {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.tie-breaking-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.tie-breaking-group label {
    font-weight: normal;
    color: #333;
}

.tie-breaking-buttons {
    display: flex;
    gap: 5px;
}

.tie-breaking-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
}

.tie-breaking-btn.selected {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .settings {
        flex-direction: column;
        gap: 15px;
    }

    .player-sections-container {
        grid-template-columns: 1fr;
    }

    .score-input-controls {
        flex-direction: row; /* モバイルでも横並びを維持 */
        justify-content: center;
        gap: 10px;
    }

    .score-buttons-left,
    .score-buttons-right {
        flex-direction: column; /* モバイルでも縦並びを維持 */
        gap: 5px;
    }

    .score-btn {
        min-width: 60px;
        padding: 5px 3px;
        font-size: 0.9em;
        box-sizing: border-box;
    }

    .current-score {
        width: 100%;
    }

    .summary-players {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .summary-player {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

.clear-button {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.clear-button:hover {
    background-color: #c82333;
}



.condition-details-player ul {
    list-style-type: none; /* Remove default bullet points */
    padding: 0;
    margin: 0;
}

.condition-details-player ul li {
    margin-bottom: 5px;
    padding-left: 10px;
    position: relative;
}

.condition-details-player ul li::before {
    content: "•"; /* Add custom bullet point */
    color: #007bff;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.copy-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

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