.tool-fullwidth {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Tool shell */
.game-tool {
    max-width: 100%;
    margin: 0 auto;
}

.game-tool.editor-section,
.editor-section.game-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-tool .card {
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    border-radius: var(--radius, 12px);
    background: var(--color-surface, #fff);
}

.game-tool .card-body {
    padding: 1.25rem 1.35rem;
}

.game-tool .card-title {
    color: var(--color-text, #1f2937);
    font-weight: 700;
    font-size: 1.05rem;
}

.game-tool .form-control,
.game-tool .form-select,
.game-tool .select-input,
.game-tool textarea {
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
}

.game-tool .form-control:focus,
.game-tool .form-select:focus,
.game-tool textarea:focus {
    border-color: var(--color-primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.game-tool .btn-primary {
    background: var(--color-primary, #0d9488);
    border-color: var(--color-primary, #0d9488);
}

.game-tool .btn-primary:hover {
    background: var(--color-primary-hover, #0f766e);
    border-color: var(--color-primary-hover, #0f766e);
}

.game-tool .alert {
    border-radius: 10px;
}

[data-theme="dark"] .game-tool .card {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

[data-theme="dark"] .game-tool .card-title,
[data-theme="dark"] .game-tool .form-label,
[data-theme="dark"] .game-tool {
    color: var(--color-text, #f9fafb);
}

[data-theme="dark"] .game-tool .text-muted,
[data-theme="dark"] .game-tool .form-text {
    color: var(--color-text-secondary, #9ca3af) !important;
}

[data-theme="dark"] .game-tool .form-control,
[data-theme="dark"] .game-tool .form-select,
[data-theme="dark"] .game-tool textarea {
    background: #111827;
    color: var(--color-text, #f9fafb);
    border-color: var(--color-border, #374151);
}

/* --- tool: schulte-square --- */
.schulte-square-tool {
    padding: 2rem 0;
}

.control-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.generate-hint {
    transition: all 0.3s ease;
}

.generate-hint .alert {
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.info-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.info-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.schulte-grid {
    display: inline-grid;
    gap: 4px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.schulte-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.schulte-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.schulte-grid.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.schulte-grid.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.schulte-grid.grid-7 {
    grid-template-columns: repeat(7, 1fr);
}

.grid-cell {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.grid-cell:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.05);
}

.grid-cell.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
    animation: correctPulse 0.5s ease;
}

.grid-cell.wrong {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: wrongShake 0.5s ease;
}

.grid-cell.completed {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.action-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.result-stats {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.schulte-info .alert {
    border-radius: 10px;
    border: none;
}

.schulte-info .alert-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #0c5460;
}

.schulte-info .alert-warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #856404;
}

/* 生成按钮动画 */
#generateBtn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#generateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#generateBtn:active {
    transform: translateY(0);
}

#generateBtn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#generateBtn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .grid-cell {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .info-value {
        font-size: 1.5rem;
    }
    
    .schulte-grid {
        gap: 2px;
        padding: 0.5rem;
    }
}
