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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #232F3E; /* AWS dark blue */
}

.settings {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-bottom: 30px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.setting-group {
    margin: 10px;
    min-width: 150px;
}

/* 難易度選択のスタイル */
#difficulty {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 16px;
    width: 100%;
}

/* 難易度に応じた色 */
#difficulty option[value="easy"] {
    background-color: #c8e6c9; /* 薄い緑 */
}

#difficulty option[value="medium"] {
    background-color: #fff9c4; /* 薄い黄色 */
}

#difficulty option[value="hard"] {
    background-color: #ffccbc; /* 薄いオレンジ */
}

#difficulty option[value="extreme"] {
    background-color: #ffcdd2; /* 薄い赤 */
}

/* 無効化された設定のスタイル */
select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 16px;
}

.game-area {
    background-color: #fff;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

#icon-display {
    height: 250px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#progress-bar {
    width: 100%;
    height: 10px;
    background-color: #eee;
    position: absolute;
    bottom: 0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

#progress {
    height: 100%;
    width: 0;
    background-color: #FF9900; /* AWS orange */
    transition: width 0.3s;
}

.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

button {
    padding: 10px 20px;
    background-color: #FF9900; /* AWS orange */
    color: #232F3E; /* AWS dark blue */
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

button:hover {
    background-color: #EC7211; /* Darker AWS orange */
}

#start-btn {
    width: 200px;
    font-size: 18px;
}

.answer-area {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.answer-area h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #232F3E;
}

.icon-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.icon-option {
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f9f9f9;
    padding: 10px;
}

.icon-option:hover {
    border-color: #FF9900;
    transform: scale(1.05);
}

.selected-icons {
    text-align: center;
}

.selected-icons h4 {
    margin-bottom: 15px;
    color: #232F3E;
}

#selected-icons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 60px;
}

.selected-icon {
    width: 60px;
    height: 60px;
    border: 2px solid #FF9900;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    position: relative;
    padding: 5px;
}

.selected-icon .remove-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.result {
    text-align: center;
    margin: 20px 0;
    font-size: 18px;
    min-height: 50px;
}

.correct {
    color: #27ae60;
    font-weight: bold;
}

.incorrect {
    color: #e74c3c;
    font-weight: bold;
}

.instructions {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.instructions h2 {
    margin-bottom: 15px;
    color: #232F3E;
}

#reset-btn {
    margin-left: 10px;
    background-color: #e74c3c;
    color: white;
}

#reset-btn:hover {
    background-color: #c0392b;
}

@media (max-width: 600px) {
    .settings {
        flex-direction: column;
    }
    
    .setting-group {
        width: 100%;
        margin: 5px 0;
    }
    
    .icon-option {
        width: 60px;
        height: 60px;
    }
}
/* AWS アイコンのスタイル */
.aws-icon {
    max-width: 120px;
    max-height: 120px;
    margin-bottom: 15px;
}

.aws-icon-small {
    max-width: 60px;
    max-height: 60px;
    margin-bottom: 5px;
}

.aws-icon-tiny {
    max-width: 40px;
    max-height: 40px;
}

.service-name {
    font-size: 18px;
    margin-top: 10px;
    text-align: center;
}

.service-name-small {
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
}

.icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.game-info {
    display: flex;
    justify-content: space-between;
    background-color: #232F3E;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#game-progress, #score, #timer {
    font-size: 18px;
}

#timer {
    font-family: monospace;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

.game-clear {
    font-size: 24px;
    font-weight: bold;
    color: #FF9900;
    margin: 20px 0;
    text-align: center;
    padding: 10px;
    background-color: #232F3E;
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* ユーザー名フォーム */
.username-form {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.username-form label {
    margin-right: 10px;
    font-weight: bold;
}

.username-form input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    flex-grow: 1;
    max-width: 200px;
}

.username-form button {
    padding: 8px 15px;
    background-color: #FF9900;
    color: #232F3E;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.username-form button:hover {
    background-color: #EC7211;
}

#current-user {
    margin-left: 15px;
    font-weight: bold;
    color: #232F3E;
}

/* ランキング */
.ranking-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ranking-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #232F3E;
}

.ranking-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.ranking-tab {
    padding: 10px 20px;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.3s;
}

.ranking-tab:hover {
    color: #FF9900;
}

.ranking-tab.active {
    color: #FF9900;
    border-bottom-color: #FF9900;
}

.ranking-list {
    width: 100%;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.ranking-item:nth-child(even) {
    background-color: #f9f9f9;
}

.ranking-item:first-child {
    background-color: #FFF9E6;
    font-weight: bold;
}

.ranking-item:first-child .rank {
    color: #FF9900;
}

.ranking-item .rank {
    width: 30px;
    font-weight: bold;
}

.ranking-item .username {
    flex-grow: 1;
    margin: 0 15px;
}

.ranking-item .score {
    font-weight: bold;
    color: #232F3E;
}

.no-records {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}
/* ギブアップボタンのスタイル */
.give-up-btn {
    background-color: #6c757d;
    color: white;
    margin-left: 10px;
}

.give-up-btn:hover {
    background-color: #5a6268;
}
/* もう一度表示ボタンのスタイル */
.show-again-btn {
    background-color: #17a2b8;
    color: white;
    margin-left: 10px;
}

.show-again-btn:hover {
    background-color: #138496;
}

/* ボタングループのスタイル */
.answer-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .answer-buttons {
        flex-direction: column;
    }
    
    .answer-buttons button {
        margin: 5px 0;
    }
}
/* ペナルティ表示のスタイル */
.penalty {
    font-size: 24px;
    font-weight: bold;
    color: #dc3545;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
