/* 颜色与形状配对游戏特定样式 */

.game-main-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* 覆盖通用样式，确保内容垂直排列 */
#gameContent {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.game-main-container > .game-area {
    flex: 1;
    min-width: 0; /* 防止flex item溢出 */
}

.color-shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.color-shape-item {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
    min-width: 120px;
    min-height: 120px;
    position: relative;
}

.color-shape-item.display-item {
    cursor: default;
    width: 200px;
    height: 200px;
    margin: 0;
    font-size: 8rem; /* 增大图案尺寸，占约50%边长 (200px * 0.5 ≈ 100px) */
    line-height: 1;
}

/* 显示多个图形的容器 */
.items-display-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.color-shape-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-shape-item.display-item:hover {
    transform: none;
    box-shadow: none;
}

.color-shape-item.selected {
    border-color: #1976d2;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.2);
}

.color-shape-item.correct {
    border-color: #4caf50;
}

.color-shape-item.incorrect {
    border-color: #f44336;
}

.match-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 0;
    margin-bottom: 0;
    max-width: 100%;
    width: 100%;
}

.match-option {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: visible;
}

.match-option:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.match-option.selected {
    border-color: #1976d2;
    background: #1976d2;
    color: white;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.3);
    transform: scale(1.05);
}

.order-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none;
}

.submit-button-container {
    min-height: 60px;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.submit-button-container .game-button {
    width: 100%;
}

.submit-button-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.selected-answers-hint {
    text-align: center;
    font-size: 1.1rem;
    color: #1976d2;
    margin-top: 1.5rem;
    margin-bottom: 0;
    padding: 0.75rem;
    background: #e3f2fd;
    border-radius: 8px;
    font-weight: 500;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 历史记录侧边栏样式 */
.history-sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.history-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.history-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    color: #333;
}

.history-subtitle {
    font-size: 0.85rem;
    color: #666;
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.history-item.correct {
    background: #e8f5e9;
}

.history-item.incorrect {
    background: #ffebee;
}

.history-icon {
    font-size: 1.2rem;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item.correct .history-icon {
    color: #4caf50;
}

.history-item.incorrect .history-icon {
    color: #f44336;
}

.history-level {
    font-size: 0.9rem;
    color: #666;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .game-main-container {
        flex-direction: column;
    }

    .history-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .game-main-container {
        gap: 1rem;
    }

    .history-sidebar {
        padding: 1rem;
    }
}

